/* No build step: one stylesheet, system fonts, and the viewer's colour scheme.
   The React rebuild brings a real design system; this exists so the internal
   tool looks deliberate in the meantime. */

:root {
  color-scheme: light dark;
  --bg: #fbfbfd;
  --panel: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e4e5ea;
  --accent: #3b5bdb;
  --danger: #c92a2a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111318;
    --panel: #191c22;
    --ink: #e9eaee;
    --muted: #9aa1ad;
    --line: #2a2e37;
    --accent: #748ffc;
    --danger: #ff8787;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

main { max-width: 900px; margin: 0 auto; padding: 32px 20px 96px; }

h1 { font-size: 24px; letter-spacing: -0.01em; margin: 0 0 20px; }
h2 { font-size: 17px; margin: 36px 0 12px; }
h3 { font-size: 15px; margin: 10px 0 2px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

/* Top bar ------------------------------------------------------------------ */

.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px; height: 52px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 600; color: var(--ink); }
.topbar nav { display: flex; gap: 16px; }
.topbar .signout { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar .who { color: var(--muted); font-size: 13px; }

/* Controls ----------------------------------------------------------------- */

.button {
  display: inline-block; padding: 9px 16px; border: 0; border-radius: 8px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 500;
  cursor: pointer;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }
.button.danger { background: var(--danger); }
.button.slack { width: 100%; text-align: center; background: #4a154b; }

.link {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer;
}
.link.danger { color: var(--danger); }

input[type="text"], input:not([type]), input[type="email"], input[type="password"], select {
  width: 100%; padding: 9px 11px; margin: 4px 0 14px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
label { font-size: 13px; font-weight: 500; color: var(--muted); }

/* Cards and messages -------------------------------------------------------- */

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 24px;
}
.card.narrow { max-width: 380px; margin: 40px auto; }
.card h1 { margin-bottom: 16px; }
.card h2 { margin-top: 0; }

.messages { list-style: none; max-width: 900px; margin: 16px auto 0; padding: 0 20px; }
.messages li {
  padding: 10px 14px; border-radius: 8px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--line);
}
.messages .error { border-color: var(--danger); color: var(--danger); }

.muted, .meta { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; }
.notes { white-space: pre-wrap; }

.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 30px; letter-spacing: 0.12em; text-align: center;
  padding: 16px; margin: 18px 0 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}

/* Lists --------------------------------------------------------------------- */

.recordings, .devices { list-style: none; padding: 0; margin: 0; }
.recordings li, .devices li {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.recordings a { flex: 1; color: var(--ink); }
.recordings a:hover { text-decoration: none; }
.devices li > div { flex: 1; }
.devices li.revoked { opacity: 0.55; }
.title { display: block; font-weight: 500; }
.meta { display: block; }

/* Detail -------------------------------------------------------------------- */

video {
  width: 100%; border-radius: 12px; background: #000;
  border: 1px solid var(--line);
}

.panels { list-style: none; padding: 0; margin: 0; }
.panels li { margin-bottom: 28px; }
.panels .seek {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer;
}
.panels img {
  width: 100%; display: block; border-radius: 10px; border: 1px solid var(--line);
}
.panels blockquote {
  margin: 8px 0 0; padding-left: 12px;
  border-left: 3px solid var(--line); color: var(--muted);
}

.transcript { list-style: none; padding: 0; margin: 0; }
.transcript li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid var(--line);
}
.transcript .time {
  flex: 0 0 52px; text-align: right; font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--muted);
}
.transcript .source {
  flex: 0 0 56px; font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.transcript .text { flex: 1; }
.transcript .bleed .text { color: var(--muted); }

/* Session context: clipboard and focus rows, interleaved with the speech.
   Set apart rather than styled loudly — they're the same timeline, and the
   transcript should still read as one column of text. */
.transcript .row-focus,
.transcript .row-clipboard,
.transcript .row-concealed { background: color-mix(in srgb, var(--panel) 70%, transparent); }
.transcript .row-focus .text { color: var(--muted); }
.transcript .row-focus .source,
.transcript .row-clipboard .source,
.transcript .row-concealed .source { color: var(--accent); }

.transcript .copied {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; word-break: break-word;
  padding: 1px 6px; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--line);
}
.transcript .row-concealed .text { color: var(--muted); font-style: italic; }

.transcript .copy {
  flex: 0 0 auto; padding: 2px 8px; font-size: 11px;
  color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.transcript .copy:hover { color: var(--ink); border-color: var(--muted); }

/* A screenshot fills the same slot the player would. */
.shot {
  width: 100%; display: block; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
}

/* Actions on a recording ---------------------------------------------------
   Gemini drafting GitHub issues is the first of these. Styled as a block that
   sits between the storyboard and the transcript, because that's the order you
   work in: watch it, check what you marked, then turn it into work. */

.actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.actions form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions .hint { font-size: 12px; color: var(--muted); max-width: 46ch; }

/* htmx sets .htmx-request on the indicator for the life of the POST. Drafting
   takes the better part of a minute, so this is the only thing telling anyone
   the page hasn't hung. */
.drafting { display: none; font-size: 13px; color: var(--accent); }
.drafting.htmx-request { display: block; }
.actions button[disabled] { opacity: 0.5; cursor: progress; }

.action-error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.draft-head .summary { font-size: 15px; margin: 0 0 4px; }
.draft-head .meta { font-size: 12px; color: var(--muted); margin: 0 0 16px; }

.ticket {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 16px; background: var(--panel);
}
.ticket header { display: flex; align-items: baseline; gap: 12px; }
.ticket header h3 { flex: 1; margin: 0 0 8px; font-size: 16px; }
.ticket .copy-md { flex: 0 0 auto; padding: 3px 10px; font-size: 11px; }
.ticket > p { margin: 0 0 12px; }

/* Screenshots sit side by side when they fit: a storyboard and the still it
   relates to are usually read together. */
.ticket .shots {
  display: grid; gap: 12px; margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.ticket .shots figure { margin: 0; }
.ticket .shots img {
  width: 100%; display: block; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg);
}
.ticket .shots figcaption {
  font-size: 12px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}

.ticket .notes-block h4 {
  margin: 0 0 4px; font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.ticket .notes-block p { margin: 0 0 12px; font-size: 14px; }

.ticket .md summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.ticket .md pre {
  margin: 8px 0 0; padding: 12px; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}

.draft-foot {
  display: flex; align-items: center; gap: 16px;
  font-size: 12px; margin-bottom: 24px;
}
.draft-foot .link.danger { color: var(--danger); background: none; border: none; cursor: pointer; }

/* Notes are bullets now, not a paragraph: the same content reads as a list and
   gets skimmed, where a block of prose in a ticket gets skipped. */
.ticket .notes-block ul { margin: 0 0 12px; padding-left: 18px; }
.ticket .notes-block li { font-size: 14px; margin-bottom: 3px; }
.ticket .notes-block .link-note { color: var(--muted); word-break: break-all; }
