* { box-sizing: border-box; margin: 0; }

:root {
  --ink: #1b1f24;
  --muted: #5b6470;
  --line: #d9dce1;
  --accent: #2455d4;
  --accent-soft: #e8eefc;
  --pass: #1c8a3c;
  --fail: #c2352b;
  --warn: #a05a00;
}

body {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #f7f8fa;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.masthead-left { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.logo { font-weight: 800; color: var(--accent); letter-spacing: 0.02em; }
.masthead h1 { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.runtime-slot { display: flex; align-items: center; gap: 10px; }

.runtime-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-soft);
  border: 1px solid #c3d2f4;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
}

.runtime-banner button {
  font: inherit;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
}

.runtime-banner button.secondary { background: transparent; color: var(--accent); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

.player-shell { position: relative; }

#player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: 12px;
  display: block;
}

.fallback-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 64px;
  background: rgba(20, 24, 30, 0.92);
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fallback-banner button {
  font: inherit;
  background: #ffffff;
  color: var(--ink);
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 600;
}

.chapters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.chapters button {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  cursor: pointer;
  color: var(--muted);
}

.chapters button.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.session-panel {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
}

.sidebar { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }

.steps { list-style: none; display: flex; flex-direction: column; gap: 4px; }

.steps li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.steps li:hover { background: #f0f2f5; }
.steps li.active { background: var(--accent-soft); }

.step-index {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
  min-width: 18px;
}

.step-title { flex: 1; }
.step-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.step-state { font-size: 12px; font-weight: 700; }
.step-state.pass { color: var(--pass); }
.step-state.fail { color: var(--fail); }
.step-state.undetermined { color: var(--warn); }

#transcript-search {
  width: 100%;
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 10px;
}

.transcript { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }

.transcript p {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  cursor: pointer;
}

.transcript p:hover { background: #f0f2f5; }
.transcript p.active { background: var(--accent-soft); }
.transcript p.hidden { display: none; }
.transcript .t { color: var(--muted); font-size: 12px; margin-right: 8px; font-variant-numeric: tabular-nums; }
.transcript mark { background: #ffe89a; border-radius: 3px; }

.foot { padding: 10px 24px 28px; color: var(--muted); font-size: 12px; max-width: 1400px; margin: 0 auto; }
