/* The product's own tokens, copied rather than imported: this deploys to Cloudflare Pages as a
   standalone site, and a demo that breaks because the app's stylesheet moved is worse than a
   demo that drifts a shade. Keep these in step with web/styles.css :root by hand. */
:root {
  color-scheme: dark;
  --bg: #0a0d16;
  --surface: #12182a;
  --surface-2: #182136;
  --border: #232e47;
  --ink: #eef2fb;
  --muted: #93a0bd;
  --faint: #5b6884;
  --accent: #19aeb2;
  --green: #3ecf8e;
  --red: #ff6b6b;
  --amber: #f5b83d;
  --human: #19aeb2;
  --claude: #e08a63;
  --codex: #58b7d6;
  --banner: 46px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- the standing disclosure ---------- */

.demo-banner {
  height: var(--banner);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: linear-gradient(90deg, #143b3d, #12182a 65%);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.demo-banner strong { color: var(--ink); }
.demo-banner-cta {
  margin-left: auto;
  flex: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #04222a;
  font-weight: 600;
  text-decoration: none;
}
.demo-banner-cta:hover { filter: brightness(1.08); }

#app { display: flex; height: calc(100% - var(--banner)); }

/* ---------- rail ---------- */

.rail {
  width: 288px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.brand { padding: 18px 16px 12px; font-weight: 700; }
.brand .dot { color: var(--accent); }
.rail-list { flex: 1; overflow-y: auto; padding: 4px 8px 16px; }
.rail-section {
  padding: 14px 8px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.rail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.rail-item:hover { background: var(--surface-2); color: var(--ink); }
.rail-item.active { background: var(--surface-2); color: var(--ink); }
.rail-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-item .count {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #04222a;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.rail-item .sub { font-size: 11px; color: var(--faint); }
.rail-foot { padding: 10px 16px; border-top: 1px solid var(--border); }
.rail-who { font-size: 11px; color: var(--faint); }

/* ---------- content ---------- */

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.view-header { padding: 16px 24px 12px; border-bottom: 1px solid var(--border); }
.view-header h1 { margin: 0; font-size: 18px; }
.view-header .meta { margin-top: 3px; font-size: 12px; color: var(--muted); }
.view-body { flex: 1; overflow-y: auto; padding: 20px 24px; }

.panel {
  max-width: 820px;
  margin-bottom: 18px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.panel h2 { margin: 0 0 10px; font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; }

.metrics { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.metric {
  flex: 1 1 170px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.metric strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.metric span { font-size: 12px; color: var(--muted); }

.rows { display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.row .grow { flex: 1; min-width: 0; }
.row .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.pill {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.pill.ok { color: var(--green); border-color: #1d5c42; }
.pill.warn { color: var(--amber); border-color: #6b5320; }
.pill.bad { color: var(--red); border-color: #6b2b2b; }
.pill.claude { color: var(--claude); border-color: #6b452f; }
.pill.codex { color: var(--codex); border-color: #2c5a6b; }

/* ---------- transcript ---------- */

.turn { max-width: 820px; margin-bottom: 14px; }
.turn-who { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.turn.human .turn-who { color: var(--human); }
.turn.agent .turn-who { color: var(--claude); }
.turn-body {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  white-space: pre-wrap;
}
.turn-tool {
  margin-top: 8px;
  padding: 8px 12px;
  background: #0c1120;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  overflow-x: auto;
}
.caret { color: var(--accent); }

table.grid { width: 100%; border-collapse: collapse; max-width: 980px; }
table.grid th, table.grid td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}
table.grid th { color: var(--faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.coverage {
  max-width: 980px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #6b5320;
  background: #221b0d;
  font-size: 13px;
}

/* ---------- the tour ---------- */

.tour {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(420px, calc(100vw - 48px));
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  z-index: 20;
}
.tour-step h3 { margin: 0 0 6px; font-size: 15px; }
.tour-step p { margin: 0; color: var(--muted); }
.tour-controls { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-controls button {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.tour-controls button:hover { border-color: var(--accent); }
.tour-next { background: var(--accent) !important; color: #04222a !important; font-weight: 600; }
.tour-next:disabled, .tour-back:disabled { opacity: 0.4; cursor: default; }
.tour-count { font-size: 12px; color: var(--faint); }
.tour-exit { margin-left: auto; color: var(--muted) !important; }
.tour-restart {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  z-index: 20;
}

/* What the current step is talking about, so the caption and the screen agree. */
.spotlight {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

@media (max-width: 880px) {
  #app { flex-direction: column; height: auto; }
  .rail { width: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .rail-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .rail-item { width: auto; }
  .rail-section { width: 100%; }
  .demo-banner { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  #app { height: auto; }
  .tour { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

.session-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.skip-replay {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.skip-replay:hover { border-color: var(--accent); color: var(--ink); }
