:root {
  color-scheme: light;
  --paper: #f4f3ef;
  --surface: #fbfaf7;
  --ink: #171815;
  --muted: #6d7069;
  --line: #d8d7d1;
  --line-dark: #b7b6b0;
  --blue: #1d52f2;
  --lime: #c9ff4f;
  --red: #ec4d37;
  --amber: #f3a33c;
  --green: #16845b;
  --header: 3.5rem;
  font-family: Figtree, Inter, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}
html,
body {
  min-width: 20rem;
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
body {
  overflow: hidden;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
}
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 0.16rem solid var(--blue);
  outline-offset: 0.15rem;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: white;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
}
.eyebrow {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.topbar {
  display: grid;
  grid-template-columns: 12rem minmax(15rem, 1fr) auto auto;
  align-items: center;
  height: var(--header);
  border-bottom: 1px solid var(--line-dark);
  background: var(--surface);
}
.brand {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  height: 100%;
  padding: 0 0.9rem;
  border-right: 1px solid var(--line);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-decoration: none;
}
.brand-mark {
  position: relative;
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
}
.brand-mark i {
  position: absolute;
  width: 1rem;
  height: 0.22rem;
  background: var(--blue);
  transform: rotate(-35deg);
}
.brand-mark i:nth-child(2) {
  background: var(--red);
  transform: rotate(35deg);
}
.brand-mark i:nth-child(3) {
  width: 0.22rem;
  height: 0.22rem;
  border-radius: 50%;
  background: var(--ink);
}
.project-title {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0 1rem;
}
.project-title span,
.model-state {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.56rem;
  text-transform: uppercase;
}
.project-title strong {
  font-size: 0.7rem;
}
.model-state {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0 1rem;
  white-space: nowrap;
}
.model-state > span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0.2rem rgb(22 132 91 / 12%);
}
.model-state small {
  color: var(--green);
}
.primary-button {
  align-self: stretch;
  min-width: 12rem;
  border: 0;
  border-left: 1px solid #0b34ad;
  background: var(--blue);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
}
.primary-button kbd {
  margin-left: 0.65rem;
  padding: 0.15rem 0.3rem;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 0.18rem;
  font-size: 0.5rem;
}

.app-shell {
  display: grid;
  grid-template-columns: 13.5rem minmax(28rem, 1fr) 23rem;
  height: calc(100vh - var(--header));
}
.runs-panel,
.evaluation-panel {
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
}
.runs-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-dark);
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 4.25rem;
  padding: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.panel-heading h1 {
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
}
.panel-heading button,
.stage-actions button,
.source-card button,
.brief-panel button,
.findings-section header button {
  border: 0;
  background: none;
  cursor: pointer;
}
.panel-heading button {
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.candidate-list {
  padding: 0.55rem;
}
.candidate-card {
  display: grid;
  grid-template-columns: 4.4rem 1fr;
  gap: 0.65rem;
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.45rem;
  border: 1px solid transparent;
  background: none;
  text-align: left;
  cursor: pointer;
}
.candidate-card:hover {
  background: var(--paper);
}
.candidate-card.is-active {
  border-color: var(--ink);
  background: white;
  box-shadow: 2px 2px 0 var(--ink);
}
.candidate-card video {
  width: 4.4rem;
  height: 3.6rem;
  object-fit: cover;
  background: #111;
}
.candidate-copy {
  min-width: 0;
}
.candidate-copy small,
.candidate-copy strong,
.candidate-copy > span {
  display: block;
}
.candidate-copy small {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.48rem;
  text-transform: uppercase;
}
.candidate-copy strong {
  margin-top: 0.25rem;
  overflow: hidden;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.candidate-copy > span {
  margin-top: 0.4rem;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.5rem;
}
.candidate-copy b {
  color: var(--ink);
  font-size: 0.72rem;
}
.source-card {
  margin: auto 0.55rem 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: var(--paper);
}
.source-card label {
  display: block;
  margin: 0.5rem 0;
  font-size: 0.57rem;
  line-height: 1.35;
}
.source-card div {
  display: flex;
  border: 1px solid var(--line-dark);
  background: white;
}
.source-card input {
  min-width: 0;
  flex: 1;
  padding: 0.48rem;
  border: 0;
  background: transparent;
  font-family: "DM Mono", monospace;
  font-size: 0.48rem;
}
.source-card button {
  padding: 0 0.5rem;
  border-left: 1px solid var(--line);
  color: var(--blue);
  font-size: 0.5rem;
  text-transform: uppercase;
}
.run-meta {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.44rem;
  text-transform: uppercase;
}

.review-stage {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0 1rem 1.2rem;
}
.stage-toolbar {
  position: sticky;
  z-index: 8;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.25rem;
  background: rgb(244 243 239 / 94%);
  backdrop-filter: blur(0.6rem);
}
.breadcrumb {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-size: 0.65rem;
}
.breadcrumb span,
.breadcrumb i {
  color: var(--muted);
}
.breadcrumb i {
  font-style: normal;
}
.stage-actions {
  display: flex;
  border: 1px solid var(--line);
  background: var(--surface);
}
.stage-actions button {
  padding: 0.5rem 0.65rem;
  border-right: 1px solid var(--line);
  font-size: 0.55rem;
}
.stage-actions button:last-child {
  border: 0;
}
.video-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #090a0b;
}
.video-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.safe-area {
  position: absolute;
  inset: 8% 34%;
  border: 1px dashed rgb(255 255 255 / 42%);
  pointer-events: none;
}
.safe-area span {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  padding: 0.18rem 0.28rem;
  background: rgb(0 0 0 / 62%);
  color: rgb(255 255 255 / 70%);
  font-family: "DM Mono", monospace;
  font-size: 0.42rem;
  text-transform: uppercase;
}
.play-button {
  position: absolute;
  bottom: 0.8rem;
  left: 0.8rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  background: rgb(0 0 0 / 55%);
  color: white;
  cursor: pointer;
}
.play-button span {
  width: 0.45rem;
  height: 0.65rem;
  border-right: 0.12rem solid currentColor;
  border-left: 0.12rem solid currentColor;
}
.play-button.is-paused span {
  width: 0;
  height: 0;
  border: 0;
  border-top: 0.35rem solid transparent;
  border-bottom: 0.35rem solid transparent;
  border-left: 0.55rem solid currentColor;
  transform: translateX(0.08rem);
}
.timestamp {
  position: absolute;
  right: 0.7rem;
  bottom: 0.8rem;
  padding: 0.28rem 0.4rem;
  background: rgb(0 0 0 / 60%);
  color: white;
  font-family: "DM Mono", monospace;
  font-size: 0.5rem;
}
.model-pin {
  position: absolute;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.32rem 0.4rem 0.32rem 0.25rem;
  border: 1px solid rgb(255 255 255 / 40%);
  background: rgb(23 24 21 / 82%);
  color: white;
  font-size: 0.5rem;
  cursor: pointer;
  backdrop-filter: blur(0.5rem);
}
.model-pin span {
  display: grid;
  width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  background: var(--red);
  font-family: "DM Mono", monospace;
  font-size: 0.44rem;
}
.pin-one {
  top: 37%;
  left: 54%;
}
.pin-two {
  right: 13%;
  bottom: 23%;
}
.pin-two span {
  background: var(--amber);
  color: var(--ink);
}
.timeline {
  padding-top: 0.7rem;
}
.track {
  position: relative;
  height: 0.3rem;
  overflow: visible;
  background: var(--line-dark);
  cursor: pointer;
}
.played {
  display: block;
  width: 27%;
  height: 100%;
  background: var(--blue);
}
.marker {
  position: absolute;
  top: -0.18rem;
  width: 0.18rem;
  height: 0.65rem;
  background: var(--red);
}
.marker-one {
  left: 27%;
}
.marker-two {
  left: 56%;
  background: var(--amber);
}
.scene-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  height: 2.7rem;
  margin-top: 0.3rem;
  overflow: hidden;
}
.scene-strip span {
  background: var(--frame) center / cover;
  filter: saturate(0.75);
}
.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.44rem;
}
.brief-panel {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.brief-panel header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 0;
}
.brief-panel h2 {
  max-width: 35rem;
  margin: 0.35rem 0 0;
  font-size: clamp(0.95rem, 1.6vw, 1.25rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.025em;
}
.brief-panel button {
  color: var(--blue);
  font-size: 0.55rem;
  text-transform: uppercase;
}
.brief-criteria {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  padding: 0 0 1rem;
}
.brief-criteria span {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.58rem;
}
.brief-criteria i {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 1px #83a62f;
}

.evaluation-panel {
  position: relative;
  padding-bottom: 5.2rem;
  border-left: 1px solid var(--line-dark);
}
.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 6.4rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.score-header strong {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.06em;
}
.score-header small {
  color: var(--muted);
  font-size: 0.6rem;
}
.decision-badge {
  padding: 0.35rem 0.48rem;
  border: 1px solid #cc922f;
  background: #fff1d7;
  color: #9a5e08;
  font-family: "DM Mono", monospace;
  font-size: 0.5rem;
  text-transform: uppercase;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid var(--line);
}
.metric-grid button {
  position: relative;
  min-height: 4.6rem;
  padding: 0.7rem;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}
.metric-grid button:nth-child(even) {
  border-right: 0;
}
.metric-grid button:nth-child(n + 3) {
  border-bottom: 0;
}
.metric-grid button:hover {
  background: var(--paper);
}
.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.55rem;
}
.metric-grid strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 500;
}
.metric-grid i {
  position: absolute;
  right: 0.7rem;
  bottom: 0.8rem;
  left: 0.7rem;
  height: 2px;
  background: linear-gradient(90deg, var(--blue) var(--score), var(--line) var(--score));
}
.findings-section header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 1rem;
}
.findings-section h2 {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}
.findings-section header button {
  color: var(--blue);
  font-size: 0.5rem;
  text-transform: uppercase;
}
.finding {
  margin: 0 0.65rem 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: white;
  cursor: pointer;
}
.finding-high {
  border-left: 0.2rem solid var(--red);
}
.finding-positive {
  border-left: 0.2rem solid var(--green);
}
.finding-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: center;
}
.finding-top span,
.finding-top small {
  font-family: "DM Mono", monospace;
  font-size: 0.47rem;
}
.finding-top span {
  color: var(--blue);
}
.finding-top strong {
  font-size: 0.62rem;
}
.finding-top small {
  color: var(--red);
  text-transform: uppercase;
}
.finding:not(.finding-high):not(.finding-positive) .finding-top small {
  color: #9a5e08;
}
.finding-positive .finding-top small {
  color: var(--green);
}
.finding p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.57rem;
  line-height: 1.45;
}
.evidence {
  margin-top: 0.65rem;
  padding: 0.55rem;
  background: var(--paper);
}
.evidence > span,
.human-actions > span {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.45rem;
  text-transform: uppercase;
}
.evidence blockquote {
  margin: 0.3rem 0 0;
  font-size: 0.54rem;
  line-height: 1.4;
}
.human-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.65rem;
}
.human-actions > span {
  margin-right: auto;
}
.human-actions button {
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line);
  background: white;
  font-size: 0.48rem;
  cursor: pointer;
}
.human-actions button.is-selected {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.review-footer {
  position: sticky;
  z-index: 6;
  bottom: 0;
  padding: 0.75rem;
  border-top: 1px solid var(--line-dark);
  background: rgb(251 250 247 / 94%);
  backdrop-filter: blur(0.6rem);
}
.review-footer div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.47rem;
  text-transform: uppercase;
}
.review-footer div i {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--amber);
}
.review-footer button {
  width: 100%;
  padding: 0.75rem;
  border: 0;
  background: var(--ink);
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

dialog {
  width: min(31rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0.5rem 0.5rem 0 rgb(23 24 21 / 25%);
}
dialog::backdrop {
  background: rgb(23 24 21 / 55%);
  backdrop-filter: blur(0.25rem);
}
dialog form {
  padding: 1.2rem;
}
dialog header {
  display: flex;
  justify-content: space-between;
}
dialog h2 {
  margin: 0.35rem 0 0;
  font-size: 1.25rem;
}
dialog header button {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.pipeline {
  margin-top: 1.4rem;
  border: 1px solid var(--line);
}
.pipeline-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.pipeline-step:last-child {
  border: 0;
}
.pipeline-step > i {
  width: 0.7rem;
  height: 0.7rem;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
}
.pipeline-step.is-running > i {
  border: 0.18rem solid var(--blue);
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
.pipeline-step.is-done > i {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 0.16rem white;
}
.pipeline-step strong,
.pipeline-step small {
  display: block;
}
.pipeline-step strong {
  font-size: 0.63rem;
}
.pipeline-step small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.5rem;
}
.pipeline-step b {
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.46rem;
  font-weight: 500;
  text-transform: uppercase;
}
.pipeline-step.is-running b {
  color: var(--blue);
}
.pipeline-step.is-done b {
  color: var(--green);
}
dialog form > p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.56rem;
  line-height: 1.5;
}
.toast {
  position: fixed;
  z-index: 80;
  right: 1rem;
  bottom: 1rem;
  max-width: 20rem;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: white;
  font-size: 0.6rem;
  transform: translateY(7rem);
  transition: transform 0.22s ease-out;
}
.toast.is-visible {
  transform: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 70rem) {
  .app-shell {
    grid-template-columns: 11rem minmax(26rem, 1fr) 20rem;
  }
  .candidate-card {
    grid-template-columns: 1fr;
  }
  .candidate-card video {
    width: 100%;
    height: 3.6rem;
  }
  .model-state {
    display: none;
  }
  .topbar {
    grid-template-columns: 11rem 1fr auto;
  }
}
@media (max-width: 54rem) {
  body {
    overflow: auto;
  }
  .topbar {
    grid-template-columns: 1fr auto;
  }
  .project-title {
    display: none;
  }
  .primary-button {
    min-width: 10rem;
  }
  .app-shell {
    display: block;
    height: auto;
  }
  .runs-panel {
    border-right: 0;
  }
  .candidate-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
  .candidate-card {
    margin: 0;
  }
  .source-card,
  .run-meta {
    display: none;
  }
  .review-stage {
    overflow: visible;
  }
  .evaluation-panel {
    overflow: visible;
    border-top: 1px solid var(--line-dark);
    border-left: 0;
  }
  .review-footer {
    position: static;
  }
}
@media (max-width: 36rem) {
  .brand {
    border-right: 0;
  }
  .primary-button {
    min-width: 9rem;
  }
  .candidate-copy > span {
    display: none;
  }
  .stage-actions button:first-child {
    display: none;
  }
  .safe-area {
    right: 30%;
    left: 30%;
  }
  .model-pin strong {
    display: none;
  }
  .brief-criteria {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
