:root {
  color-scheme: light;
  --ink: #182433;
  --muted: #6c7b8b;
  --line: #e2e8ed;
  --paper: #f5f7fa;
  --blue: #2563eb;
  --green: #087f70;
  --orange: #b65f10;
  --radius: 12px;
  font:
    14px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans SC",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button,
a,
input,
select {
  outline-offset: 3px;
}
button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 7px 12px;
  border-radius: 8px;
}
button:hover {
  background: #eef3fa;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: white;
  color: var(--ink);
  min-width: 0;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
[hidden] {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-weight: 700;
  margin-right: 10px;
}
.overview {
  display: flex;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
}
.overview strong {
  color: var(--ink);
  margin-left: 5px;
}
.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}
.sidebar {
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: white;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
}
.field input,
.field select {
  width: 100%;
  color: var(--ink);
}
.filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.list-heading {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 4px 0;
}
#case-list {
  overflow: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.case-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  text-align: left;
  padding: 10px;
  border-color: transparent;
  border-radius: 8px;
}
.case-item.selected {
  background: #ecf2ff;
  border-color: #baceff;
}
.case-name {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.case-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.list-score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  align-self: center;
  color: var(--blue);
}
main {
  padding: 26px 32px;
  min-width: 0;
  max-width: 1800px;
}
.case-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
h1 {
  font-size: 22px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  margin: 5px 0 8px;
}
h2 {
  font-size: 17px;
  margin: 0;
}
.navigation {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-size: 12px;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #eef2f7;
  color: #5b6c80;
}
.badge.scored {
  background: #def3ed;
  color: var(--green);
}
.badge.gate_failed,
.badge.insufficient_evidence {
  background: #fff0dc;
  color: var(--orange);
}
.badge.error {
  background: #fee9e7;
  color: #be3730;
}
.context {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  padding: 18px 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.label {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.context p {
  margin: 5px 0;
  overflow-wrap: anywhere;
}
.score-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.score-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
}
.score-card:first-child {
  background: #17283f;
  color: white;
  border-color: #17283f;
}
.score-label {
  font-size: 11px;
  color: var(--muted);
}
.score-card:first-child .score-label {
  color: #becbdc;
}
.score-value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.score-scale {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}
.score-card:first-child .score-scale {
  color: #becbdc;
}
.bar {
  height: 3px;
  background: #eaf0f6;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--blue);
}
.score-card:first-child .bar {
  background: #344a67;
}
.score-card:first-child .bar-fill {
  background: #79d9c5;
}
.visual-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 20px 0 28px;
}
.visual-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.tabs {
  display: flex;
  gap: 4px;
}
.tabs button {
  border-color: transparent;
  color: var(--muted);
}
.tabs button[aria-selected="true"] {
  color: var(--blue);
  background: #edf3ff;
  font-weight: 600;
}
figure {
  margin: 0;
  min-width: 0;
}
figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0;
}
.reference {
  color: var(--green);
  font-weight: 700;
}
.generated {
  color: var(--blue);
  font-weight: 700;
}
#view-sheets img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #171b24;
}
#view-sheets figure + figure {
  margin-top: 14px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.pair canvas,
.pair video {
  display: block;
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: contain;
  background: #171b24;
  border-radius: 8px;
}
.frame-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 12px;
}
.frame-selector button {
  font-size: 11px;
  min-width: 66px;
}
.frame-selector button.read {
  border-color: #b5d7ce;
}
.frame-selector button.active {
  background: #e6f3ef;
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}
.frame-subtitle {
  font-size: 11px;
  color: var(--muted);
}
.video-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.video-controls input {
  flex: 1;
  width: 100px;
  padding: 0;
}
.video-controls output {
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.section-heading a {
  font-size: 12px;
}
.judge-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  margin-bottom: 12px;
  overflow: hidden;
}
.judge-section > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.judge-section > summary::-webkit-details-marker {
  display: none;
}
.judge-section > summary::before {
  content: "▸";
  color: var(--muted);
}
.judge-section[open] > summary::before {
  content: "▾";
}
.judge-section > summary .section-name {
  flex: 1;
}
.judge-content {
  padding: 0 18px 18px;
}
.metric-row {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
.metric-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.metric-title {
  font-weight: 600;
  font-size: 13px;
}
.metric-value {
  font-variant-numeric: tabular-nums;
  color: var(--blue);
  font-weight: 600;
}
.evidence {
  color: #48596b;
  font-size: 12px;
  border-left: 2px solid #dbe5f0;
  padding-left: 12px;
  margin-top: 10px;
}
.evidence p {
  margin: 4px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.frame-link {
  padding: 2px 6px;
  margin-right: 4px;
  margin-bottom: 3px;
  font-size: 10px;
  border-radius: 5px;
  color: var(--blue);
}
.inventory-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  font-size: 12px;
  padding: 10px 0;
}
.inventory-stats strong {
  margin-left: 5px;
  font-variant-numeric: tabular-nums;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  margin: 10px 0;
}
th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
td.numeric {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.object-description {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.reason {
  padding: 12px;
  background: #fff8ed;
  border-radius: 8px;
  color: #805b27;
  font-size: 12px;
}
#message {
  padding: 40px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  width: 94vw;
  max-width: 3000px;
  height: 90vh;
  max-height: 90vh;
}
dialog::backdrop {
  background: #112034b3;
}
.dialog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.dialog-scroll {
  overflow: auto;
  height: calc(100% - 62px);
  padding: 12px 20px;
}
.dialog-scroll img {
  display: block;
  width: auto;
  max-width: none;
}
.dialog-scroll figure + figure {
  margin-top: 20px;
}
.empty {
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
}
@media (min-width: 1700px) {
  main {
    padding: 30px 42px;
  }
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  main {
    padding: 20px;
  }
  .case-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .score-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .context {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .overview {
    gap: 9px;
  }
  .topbar {
    padding: 12px 16px;
  }
}
@media (max-width: 700px) {
  .topbar {
    position: relative;
    flex-wrap: wrap;
  }
  .layout {
    display: block;
  }
  .sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  #case-list {
    max-height: 220px;
  }
  .score-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .visual-toolbar {
    flex-wrap: wrap;
  }
  .tabs button {
    padding: 7px 9px;
  }
  .video-controls {
    flex-wrap: wrap;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .navigation {
    white-space: normal;
  }
  .overview {
    flex-wrap: wrap;
  }
  .dialog-scroll img {
    width: 1800px;
  }
}

.pair img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #171b24;
}
.frame-overview {
  display: block;
  overflow-x: auto;
}
.frame-overview h2 {
  margin: 0 0 12px;
  font-size: 16px;
}
.frame-overview table {
  min-width: 530px;
}
.score-value {
  overflow-wrap: anywhere;
}
/* Shared evidence workspace. */
:root {
  color-scheme: dark;
  --ink: #d9e5ed;
  --muted: #88a0b0;
  --line: #233544;
  --paper: #09131d;
  --blue: #85ddcf;
  --green: #80dbc7;
}
button,
input,
select,
.topbar,
.sidebar,
.context,
.score-card,
.visual-panel,
.judge-section {
  background: #101e2b;
  color: var(--ink);
}
button:hover,
.case-item.selected,
.tabs button[aria-selected="true"],
.frame-selector button.active {
  background: #1b3c45;
  color: #b9fff0;
}
.case-item {
  border-bottom: 1px solid #ffffff06;
}
.badge {
  background: #1e3444;
}
.badge.scored {
  background: #173b36;
  color: #9de4ce;
}
.badge.gate_failed {
  background: #453120;
  color: #efc28e;
}
.context {
  border: 1px solid var(--line);
  border-radius: 14px;
}
.score-card {
  border: 1px solid var(--line);
  border-radius: 12px;
}
.score-card:first-child {
  background: linear-gradient(130deg, #1c3c45, #152434);
}
.bar {
  background: #273c4b;
}
.bar-fill {
  background: #77ccbd;
}
.tabs button {
  border-radius: 8px;
}
.visual-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.visual-toolbar {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.reference {
  color: #8ddcc8;
}
.generated {
  color: #a7bff3;
}
.frame-selector {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 16px;
  gap: 9px;
}
.frame-selector button {
  flex: 0 0 106px;
  overflow: hidden;
  padding: 5px;
  font-size: 10px;
  border: 1px solid var(--line);
}
.frame-selector img {
  width: 94px;
  height: 59px;
  object-fit: contain;
  display: block;
  margin-bottom: 5px;
  background: #060c13;
  border-radius: 5px;
}
.pair {
  padding: 0 16px 16px;
  gap: 16px;
}
.pair img,
.pair video {
  max-height: 49vh;
  object-fit: contain;
  border-radius: 8px;
}
.pair figcaption {
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 9px 0;
}
.frame-subtitle {
  font-size: 10px;
  color: var(--muted);
}
.judge-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 10px;
}
.judge-section summary {
  padding: 16px;
}
.judge-content {
  border-top: 1px solid var(--line);
}
.metric-row {
  padding: 12px 0;
}
.reason {
  background: #32291e;
  color: #e1c39e;
}
.video-controls {
  padding: 16px;
  background: #0c1925;
}
.video-controls input {
  accent-color: #86d8c6;
}
body.embedded > .topbar,
body.embedded .sidebar,
body.embedded .navigation {
  display: none;
}
body.embedded .layout {
  display: block;
  height: auto;
}
body.embedded #main {
  height: auto;
  max-width: 1350px;
  margin: auto;
  padding: 24px 32px;
}
body.embedded h1 {
  font-size: 22px;
  letter-spacing: -0.02em;
}
body.embedded .context {
  margin-top: 16px;
}
body.embedded .overview {
  display: none;
}
@media (max-width: 700px) {
  body.embedded #main {
    padding: 16px;
  }
  .pair {
    grid-template-columns: 1fr;
  }
  .score-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .case-heading h1 {
    overflow-wrap: anywhere;
  }
}
.technical-details {
  margin: 18px 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.technical-details > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
}
.technical-details .frame-overview {
  margin-top: 14px;
}
.score-cards {
  margin-bottom: 20px;
}
.score-value {
  font-variant-numeric: tabular-nums;
}
.context p {
  margin: 6px 0;
}
.judgments h2 {
  font-size: 17px;
}
.frame-selector button.read {
  background: #10232e;
  color: #9eafb8;
}
.frame-selector button.active {
  background: #21483f;
  border-color: #90dfc9;
  color: #d2fff0;
  box-shadow: 0 0 0 1px #90dfc94d;
}
.frame-selector button:hover {
  border-color: #83b6b0;
}
body.embedded .case-heading {
  margin-bottom: 10px;
}
body.embedded .context {
  padding: 14px 18px;
  margin-bottom: 16px;
}
body.embedded .score-card {
  padding: 12px 16px;
}
body.embedded .visual-panel {
  padding: 12px;
}
.pair img,
.pair video {
  max-height: 40vh;
}
.language-selector {
  font-size: 11px;
  min-width: 65px;
  padding: 7px 9px;
  border-radius: 8px;
}
#view-prefix {
  padding: 0 16px 16px;
}
.prefix-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}
#prefix-video {
  display: block;
  width: 100%;
  max-height: 57vh;
  background: #060c13;
  object-fit: contain;
  border-radius: 10px;
}
.tabs {
  flex-wrap: wrap;
}

.automated-results {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--border, #243944);
  border-radius: 16px;
}
.automated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.automated-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: #ffffff05;
  border-radius: 10px;
}
.automated-card strong {
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.automated-results pre {
  max-height: 280px;
  overflow: auto;
}
