body {
  font-family: sans-serif;
  margin: 2rem;
  line-height: 1.5;
  color: var(--text-color, #1f2328);
  background: var(--background-color, #ffffff);
}

.page-header {
  margin-bottom: 2rem;
}

.export-layout {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr);
  gap: 2rem;
}

.sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
  display: grid;
  gap: 0.5rem;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  background: var(--panel-background, #fff);
}

.sidebar h2 {
  margin-top: 0;
}

.sidebar a {
  color: #0969da;
  text-decoration: none;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.transcript-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.transcript-controls input,
.transcript-controls select {
  margin-left: 0.35rem;
}

.message {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
  background: var(--message-background, #fff);
}

.message.hidden {
  display: none;
}

.message.user {
  background: #f6f8fa;
}

.message.assistant {
  background: #eef6ff;
}

.message.tool-result {
  background: #f6fff1;
}

.message.branch-summary {
  background: #fff8dc;
}

.message.compaction-summary {
  background: #f7f0ff;
}

.tree-summary ul {
  list-style: none;
  padding-left: 0;
}

.tree-entry {
  padding: 0.25rem 0;
}

.tree-entry.active {
  font-weight: 700;
}

.entry-label {
  color: #57606a;
}

.tool-status {
  color: #cf222e;
  font-weight: 700;
}

pre {
  white-space: pre-wrap;
  margin: 0;
}

.markdown-content {
  display: grid;
  gap: 0.75rem;
}

.markdown-content p {
  margin: 0;
}

.markdown-content code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

.markdown-content p code {
  background: var(--inline-code-background, #f6f8fa);
  border: 1px solid var(--inline-code-border, #d0d7de);
  border-radius: 4px;
  padding: 0.1rem 0.25rem;
}

.markdown-content pre,
.ansi-rendered {
  background: var(--code-background, #f6f8fa);
  border: 1px solid var(--code-border, #d0d7de);
  border-radius: 6px;
  overflow-x: auto;
  padding: 0.75rem;
}

.highlight .k,
.highlight .kn,
.highlight .kd,
.highlight .kr,
.highlight .ow {
  color: var(--syntax-key-color, #0550ae);
  font-weight: 600;
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sa,
.highlight .sb,
.highlight .sc,
.highlight .sd,
.highlight .se,
.highlight .sh,
.highlight .si,
.highlight .sx {
  color: var(--syntax-string-color, #0a3069);
}

.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mo {
  color: var(--syntax-number-color, #953800);
}

.highlight .c,
.highlight .c1,
.highlight .cm,
.highlight .cp,
.highlight .cs {
  color: var(--syntax-comment-color, #6e7781);
  font-style: italic;
}

.highlight .nf,
.highlight .fm,
.highlight .nd {
  color: var(--syntax-function-color, #8250df);
}

.highlight .nc,
.highlight .nn,
.highlight .nt {
  color: var(--syntax-type-color, #116329);
}

.syntax-key {
  color: var(--syntax-key-color, #0550ae);
}

.syntax-string {
  color: var(--syntax-string-color, #0a3069);
}

.syntax-number {
  color: var(--syntax-number-color, #953800);
}

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

  .sidebar {
    position: static;
  }
}
