:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111312;
  background: #f7f6f1;
  --paper: #f7f6f1;
  --white: #fff;
  --ink: #111312;
  --muted: #666762;
  --line: #d9d7cf;
  --line-dark: #aaa79f;
  --accent: #287f70;
  --accent-soft: #dff0e9;
  --violet: #6f5ee8;
  --fail: #a33b32;
  --fail-soft: #f7e7e3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--paper); }
[hidden] { display: none !important; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 4vw;
  background: rgba(247, 246, 241, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--violet);
  border-radius: 6px;
  font-weight: 900;
}

.site-header nav { display: flex; gap: 34px; }
.site-header nav a {
  color: #464742;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.site-header nav a:hover { color: var(--ink); }

.header-status {
  justify-self: end;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #4c4e49;
  font-size: 12px;
  font-weight: 700;
}
.header-status span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 74px 4vw 42px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 1100px;
  margin: 0;
  font-size: clamp(72px, 10vw, 148px);
  line-height: 0.84;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 760px;
  margin: 38px auto 0;
  color: #555651;
  font-size: 19px;
  line-height: 1.65;
}

.hero-actions { display: flex; gap: 10px; margin-top: 32px; }
.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}
.button-dark { color: #fff; background: var(--ink); border-color: var(--ink); }
.button:disabled { cursor: default; opacity: 0.45; }

.metric-strip {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 70px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric-strip div {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--line);
}
.metric-strip div:last-child { border-right: 1px solid var(--line); }
.metric-strip strong { font-size: 40px; line-height: 1; }
.metric-strip span { margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }

.section { padding: 110px 4vw; border-bottom: 1px solid var(--line); }
.section-heading { max-width: 900px; margin: 0 auto 64px; text-align: center; }
.section-heading.compact { max-width: 760px; margin-bottom: 46px; }
.section-heading h2 { margin: 0; font-size: clamp(40px, 5vw, 72px); line-height: 1.02; }
.section-heading p:last-child {
  max-width: 680px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.capability-grid {
  max-width: 1240px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}
.capability-grid article {
  min-height: 330px;
  padding: 30px;
  border-left: 1px solid var(--line);
}
.capability-grid article:last-child { border-right: 1px solid var(--line); }
.capability-index {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  font-weight: 900;
}
.capability-grid h3 { margin: 72px 0 8px; font-size: 22px; }
.capability-grid strong { color: var(--accent); font-size: 36px; }
.capability-grid p { margin: 20px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.section-trajectories { background: var(--white); }
.scope-tabs {
  max-width: 1240px;
  display: flex;
  margin: 0 auto;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-dark);
}
.scope-tabs button {
  min-height: 48px;
  flex: 0 0 auto;
  padding: 0 22px;
  color: #62635e;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  font-size: 13px;
  font-weight: 800;
}
.scope-tabs button.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.explorer {
  max-width: 1240px;
  height: 780px;
  min-height: 660px;
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  margin: 28px auto 0;
  border: 1px solid var(--line);
  background: var(--paper);
}
.task-browser {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.search-field { padding: 16px; border-bottom: 1px solid var(--line); }
.search-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-dark);
  border-radius: 4px;
}
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filter-row label, .ledger-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.filter-row select, .ledger-controls select {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.browser-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.browser-status button, .compare-bar button:not(.button) {
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-weight: 800;
}
.task-list { min-height: 0; overflow-y: auto; }
.task-option {
  width: 100%;
  min-height: 70px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px 16px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.task-option:hover, .task-option.is-active { background: #e9f3ef; }
.task-option strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.task-option span span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.task-option em { align-self: start; color: var(--accent); font-size: 10px; font-style: normal; font-weight: 900; text-transform: uppercase; }

.task-stage { min-width: 0; min-height: 0; height: 100%; padding: 30px; overflow-y: auto; }
.stage-empty { min-height: 650px; display: grid; align-content: center; text-align: center; }
.stage-empty h3 { margin: 0; font-size: 36px; }
.stage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.stage-header h3 { max-width: 800px; margin: 0; overflow-wrap: anywhere; font-size: clamp(24px, 3vw, 42px); line-height: 1.05; }
.stage-actions { display: flex; gap: 8px; }
.stage-actions a { min-height: 36px; padding: 0 10px; font-size: 11px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #4e504b;
  background: var(--white);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.tag-pass { color: #155b4d; background: var(--accent-soft); border-color: #acd4c7; }
.tag-fail { color: var(--fail); background: var(--fail-soft); border-color: #e5bcb5; }

.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.media-panel { min-width: 0; background: #151715; border: 1px solid #151715; }
.media-heading {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: #fff;
  border-bottom: 1px solid #393b38;
}
.media-heading strong { font-size: 12px; }
.media-heading span { color: #aeb1aa; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.media-frame {
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(#222522 1px, transparent 1px),
    linear-gradient(90deg, #222522 1px, transparent 1px),
    #151715;
  background-size: 32px 32px;
}
.media-frame video { width: 100%; height: 100%; object-fit: contain; background: #0d0f0e; }
.media-unavailable { max-width: 310px; padding: 20px; color: #d7dad3; text-align: center; }
.media-unavailable strong { display: block; color: #fff; font-size: 16px; }
.media-unavailable p { margin: 10px 0 0; color: #aeb1aa; font-size: 11px; line-height: 1.55; }
.media-meta { min-height: 54px; padding: 10px 14px; color: #aeb1aa; border-top: 1px solid #393b38; font-size: 9px; line-height: 1.5; }
.media-scope-note {
  margin: 0;
  padding: 10px 14px 13px;
  color: #d1d4ce;
  border-top: 1px solid #393b38;
  font-size: 10px;
  line-height: 1.55;
}

.media-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0 1rem 1rem;
}

.media-links a {
  color: #dff0e9;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18rem;
}

.agent-activity {
  margin-top: 24px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line-dark);
}
.agent-activity-unavailable { background: #fbf1ef; border-color: #e0b8b1; }
.activity-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}
.activity-header .section-kicker { margin-bottom: 7px; }
.activity-header h4 { margin: 0; font-size: 20px; }
.activity-coverage {
  padding: 6px 8px;
  color: #155b4d;
  background: var(--accent-soft);
  border-radius: 3px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.agent-activity-unavailable .activity-coverage { color: var(--fail); background: var(--fail-soft); }
.agent-activity-unavailable > p {
  max-width: 760px;
  margin: 14px 0 0;
  color: #62504d;
  font-size: 12px;
  line-height: 1.65;
}
.activity-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 18px;
  background: var(--line);
  border: 1px solid var(--line);
}
.activity-summary span {
  min-height: 68px;
  display: grid;
  align-content: center;
  padding: 10px;
  background: var(--paper);
  color: var(--muted);
  font-size: 10px;
}
.activity-summary strong { color: var(--ink); font-size: 22px; }
.activity-provenance { margin: 12px 0 0; color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.agent-activity .media-links a { color: var(--accent); }
.activity-artifact-status { display: grid; gap: 10px; margin: 14px 0; font-size: 11px; line-height: 1.5; }
.activity-artifact-status > div { padding-left: 10px; border-left: 2px solid var(--line); }
.activity-artifact-status dt { font-weight: 800; }
.activity-artifact-status dd { margin: 3px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.activity-artifact-status [data-status="unavailable"],
.activity-artifact-status [data-status="partial"] { border-left-color: #b88b19; }
.activity-image-note { color: var(--muted); font-size: 10px; line-height: 1.5; }
.activity-relation-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: #62501c;
  background: #fff4c9;
  border-left: 3px solid #b88b19;
  font-size: 10px;
  line-height: 1.55;
}
.activity-timeline-wrap { margin-top: 18px; border-top: 1px solid var(--line); }
.activity-timeline-wrap > summary {
  padding: 14px 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.activity-timeline { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.activity-event {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.activity-sequence {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
}
.activity-computer_use .activity-sequence { background: var(--violet); }
.activity-edit .activity-sequence { background: var(--accent); }
.activity-event-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.activity-event-heading strong { min-width: 0; overflow-wrap: anywhere; font: 600 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.activity-event-heading span { flex: 0 0 auto; color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; }
.activity-detail { margin-top: 8px; }
.activity-detail summary { color: var(--accent); font-size: 9px; font-weight: 800; cursor: pointer; }
.activity-images { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.activity-images img { display: block; width: auto; max-width: 100%; height: 200px; object-fit: contain; border: 1px solid var(--line); }
.activity-detail pre {
  max-height: 280px;
  margin: 8px 0 0;
  padding: 12px;
  overflow: auto;
  color: #dce1da;
  background: #151715;
  font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.instruction-block {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.instruction-block h4, .evidence-grid h4 { margin: 0; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.instruction-block p { margin: 0; font-size: 14px; line-height: 1.65; }
.evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 24px; }
.evidence-grid ul { margin: 12px 0 0; padding-left: 18px; color: #4f514c; font-size: 12px; line-height: 1.6; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 7px 12px; margin: 12px 0 0; font-size: 11px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }

.section-ledger { background: var(--paper); }
.ledger-controls {
  max-width: 1240px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 auto 14px;
}
.ledger-controls label { width: 180px; }
.ledger-controls > span { color: var(--muted); font-size: 11px; }
.table-scroll { max-width: 1240px; margin: 0 auto; overflow-x: auto; border-top: 1px solid var(--line-dark); }
table { width: 100%; min-width: 1000px; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
th, td { height: 58px; padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { height: 42px; color: #5e605a; font-size: 9px; text-transform: uppercase; }
th:nth-child(1) { width: 58px; }
th:nth-child(2) { width: 28%; }
th:nth-child(3), th:nth-child(4) { width: 82px; }
th:nth-child(5) { width: 100px; }
th:nth-child(6), th:nth-child(7), th:nth-child(9) { width: 78px; }
th:nth-child(8) { width: 18%; }
tbody tr { cursor: pointer; }
tbody tr:hover td, tbody tr.is-selected td { background: #eaf2ef; }
.task-cell strong, .task-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-cell span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.compare-column, .compare-cell { text-align: center; }
.compare-cell input { width: 16px; height: 16px; accent-color: var(--accent); }
.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.badge-primary, .badge-pass, .badge-easy { color: #155b4d; background: var(--accent-soft); }
.badge-frontier { color: var(--fail); background: var(--fail-soft); }
.badge-web { color: #245b88; background: #dfeefa; }
.badge-game { color: #553f9e; background: #e8e3ff; }
.badge-game-cua { color: #553f9e; background: #e8e3ff; }
.badge-mobile { color: #8a4c16; background: #fff0d9; }
.badge-devops { color: #17605f; background: #dff3f1; }
.badge-calibration { color: #6a4d10; background: #f6e9c9; }
.badge-diagnostic, .badge-unknown { color: #50545b; background: #e9eaed; }
.badge-remove, .badge-fail { color: var(--fail); background: var(--fail-soft); }
.media-count { font-weight: 900; }
.media-count-ready { color: var(--accent); }
.media-count-missing { color: var(--fail); }

.game-evidence {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.game-evidence article {
  min-height: 150px;
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
}
.game-evidence span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.game-evidence strong {
  display: block;
  margin-top: 14px;
  font-size: 34px;
  line-height: 1;
}
.game-evidence p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.compare-bar {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 16px;
  color: #fff;
  background: var(--ink);
  border: 1px solid #373936;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}
.compare-bar button:not(.button) { color: #a9d8cc; }
.compare-bar .button { min-height: 36px; color: var(--ink); background: #fff; }

dialog {
  width: min(1180px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line-dark);
}
dialog::backdrop { background: rgba(17, 19, 18, 0.68); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; padding: 24px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; }
.close-button { width: 36px; height: 36px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; font-size: 22px; }
.compare-grid { display: grid; grid-template-columns: repeat(3, 1fr); overflow: auto; }
.compare-item { min-width: 0; padding: 24px; border-right: 1px solid var(--line); }
.compare-item:last-child { border-right: 0; }
.compare-item h3 { overflow-wrap: anywhere; }

input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .site-header { grid-template-columns: 1fr auto; padding: 0 18px; }
  .site-header nav { display: none; }
  .hero { min-height: auto; padding: 70px 18px 32px; }
  .hero h1 { font-size: clamp(54px, 16vw, 92px); }
  .metric-strip { grid-template-columns: 1fr 1fr; margin-top: 48px; }
  .metric-strip div { border-bottom: 1px solid var(--line); }
  .metric-strip div:nth-child(even) { border-right: 1px solid var(--line); }
  .metric-strip div:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .section { padding: 78px 18px; }
  .capability-grid { grid-template-columns: 1fr; }
  .capability-grid article { min-height: 250px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .capability-grid article:last-child { border-bottom: 0; }
  .capability-grid h3 { margin-top: 48px; }
  .explorer { height: auto; grid-template-columns: 1fr; min-height: auto; }
  .task-browser { height: auto; max-height: 430px; border-right: 0; border-bottom: 1px solid var(--line); }
  .task-stage { height: auto; }
  .task-list { min-height: 220px; }
  .task-stage { padding: 22px; }
  .stage-empty { min-height: 360px; }
  .media-grid, .evidence-grid, .game-evidence, .activity-summary { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-item { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .site-header { height: 62px; }
  .brand { font-size: 14px; }
  .header-status { font-size: 10px; }
  .hero h1 { font-size: 52px; }
  .hero-copy { font-size: 16px; }
  .hero-actions { width: 100%; flex-direction: column; }
  .metric-strip strong { font-size: 32px; }
  .section-heading h2 { font-size: 40px; }
  .scope-tabs { margin-right: -18px; margin-left: -18px; padding-left: 18px; }
  .stage-header { grid-template-columns: 1fr; }
  .instruction-block { grid-template-columns: 1fr; gap: 10px; }
  .filter-row { grid-template-columns: 1fr; }
  .activity-header { flex-direction: column; align-items: start; }
  .activity-event-heading { flex-direction: column; gap: 6px; }
  .compare-bar { right: 12px; bottom: 12px; left: 12px; justify-content: space-between; }
}
