:root {
  color-scheme: light;
  --ink: #1d2524;
  --muted: #68736f;
  --line: #d5dfda;
  --accent: #2f7d6b;
  --accent-dark: #1f5d50;
  --surface: #ffffff;
  --soft: #edf4f0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #e8eeea;
}

button { border: 0; font: inherit; cursor: pointer; }

.topbar,
main {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 20px;
}

.topbar h1,
.topbar p { margin: 0; }
.topbar h1 { font-size: 30px; letter-spacing: 0; }
.topbar .lede { margin-top: 7px; color: var(--muted); font-size: 14px; }

.eyebrow {
  margin-bottom: 6px !important;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0;
  text-transform: uppercase;
}

nav { display: flex; gap: 8px; }
nav a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--accent-dark);
  background: rgba(255,255,255,.76);
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.summary div { padding: 18px 20px; border-left: 1px solid var(--line); }
.summary div:first-child { border-left: 0; }
.summary strong { display: block; font-size: 25px; }
.summary span { color: var(--muted); font-size: 12px; font-weight: 680; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 12px;
}

.toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.filter-group { display: flex; gap: 7px; }
.filter-group button {
  min-height: 36px;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 740;
}
.filter-group button.active { color: white; background: var(--accent); }
.filter-group span { margin-left: 5px; opacity: .72; }

.action-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 36px;
}

.group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--accent-dark);
  background: var(--soft);
}
.group-heading:first-child { border-top: 0; }
.group-heading h2 { margin: 0; font-size: 14px; letter-spacing: 0; }
.group-heading span { font-size: 11px; font-weight: 720; }

.action-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(320px, 520px);
  gap: 28px;
  align-items: center;
  min-height: 360px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}
.action-row:last-child { border-bottom: 0; }
.action-row[hidden] { display: none; }

.action-index { color: var(--accent); font-size: 12px; font-weight: 780; }
.action-info h3 { margin: 8px 0 3px; font-size: 22px; letter-spacing: 0; }
.action-key { margin: 0 0 18px; color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; }
.meta span {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 8px;
  color: var(--muted);
  background: #f7f9f8;
  font-size: 11px;
  font-weight: 680;
}
.job-id { margin: 18px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }

.video-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 1;
  background: #111;
}
.video-wrap video,
.video-wrap canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.video-error {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  color: #fff;
  background: #303735;
  font-size: 12px;
  text-align: center;
}
.video-wrap.failed .video-error { display: grid; }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .summary div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .summary div:nth-child(4) { border-top: 1px solid var(--line); }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .filter-group { width: 100%; overflow-x: auto; }
  .action-row { grid-template-columns: 1fr; min-height: 0; gap: 16px; padding: 20px; }
}
