:root {
  color-scheme: light dark;
  --bg: #f7f7f8;
  --panel: #ffffff;
  --text: #17171c;
  --muted: #6b6b76;
  --line: #e3e3e8;
  --accent: #5865f2;
  --accent-soft: rgba(88, 101, 242, 0.18);
  --wave: #b9bdf7;
  --progress: #5865f2;
  --pause: rgba(120, 120, 130, 0.22);
  --mark: #e5a00d;
  --danger: #d93d3d;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111114;
    --panel: #1b1b20;
    --text: #ececf1;
    --muted: #9a9aa6;
    --line: #2c2c34;
    --accent: #7983ff;
    --accent-soft: rgba(121, 131, 255, 0.22);
    --wave: #464b8f;
    --progress: #8f97ff;
    --pause: rgba(160, 160, 170, 0.18);
    --mark: #ffb224;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 4px;
}

h2 {
  font-size: 1rem;
  margin: 28px 0 8px;
}

.muted {
  color: var(--muted);
}

.head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}

.head p {
  margin: 0;
}

.downloads {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--accent);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  pointer-events: none;
}

.btn.locked {
  color: var(--muted);
  border-style: dashed;
}

.message {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}

.message.error {
  border-color: var(--danger);
}

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

.transport {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
}

.time {
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: 6px 12px;
  align-items: center;
}

.label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.label .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 0.9rem;
}

.label .talk {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.label img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}

.chip {
  font: inherit;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.wave {
  position: relative;
  min-width: 0;
}

.lanes {
  margin-top: 6px;
}

.lane {
  position: relative;
  height: 34px;
  cursor: pointer;
  border-radius: 4px;
  background: color-mix(in srgb, var(--line) 35%, transparent);
  overflow: hidden;
}

.lane canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lane .playhead,
.lane .band {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

.lane .playhead {
  width: 2px;
  background: var(--progress);
}

.lane .band {
  background: var(--accent-soft);
}

.hint {
  font-size: 0.82rem;
  margin: 10px 0 14px;
}

.selection {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 0.75rem;
  color: var(--muted);
}

.field input,
.field select {
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  min-width: 0;
}

.field input {
  width: 110px;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.clips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.prose {
  max-width: 720px;
}

.summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.summary h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.summary h4 {
  margin: 12px 0 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.summary p,
.summary ul {
  margin: 0;
}

.summary ul {
  padding-left: 18px;
}

.summary .small {
  margin-top: 10px;
  font-size: 0.78rem;
}

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

.transcript-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 8px;
}

.transcript-tools input[type='search'] {
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  flex: 1 1 200px;
  min-width: 0;
}

.transcript-tools .follow {
  font-size: 0.85rem;
  color: var(--muted);
}

.lines {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.lines .line {
  display: grid;
  grid-template-columns: auto minmax(60px, 140px) 1fr;
  gap: 4px 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.lines .line[hidden] {
  display: none;
}

.lines .line:hover {
  background: color-mix(in srgb, var(--line) 30%, transparent);
}

.lines .line.current {
  background: var(--accent-soft);
}

.lines .time {
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.lines .who {
  color: var(--c);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lines mark {
  background: color-mix(in srgb, var(--mark) 45%, transparent);
  color: inherit;
  border-radius: 2px;
}

@media (max-width: 640px) {
  .lines .line {
    grid-template-columns: auto 1fr;
  }
  .lines .text {
    grid-column: 1 / -1;
  }
}

.badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  vertical-align: middle;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.camera {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: zoom-in;
}

.camera.big {
  grid-column: 1 / -1;
  cursor: zoom-out;
}

.camera video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.camera .off {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111114;
  color: #9a9aa6;
  font-size: 0.85rem;
}

.camera .off[hidden] {
  display: none;
}

.camera .who {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 16px);
  padding: 2px 8px 2px 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.8rem;
}

.camera .who img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.camera .who span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .label {
    margin-top: 6px;
  }
  .actions {
    margin-left: 0;
  }
}
