:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #66758a;
  --line: #d8e0e8;
  --panel: #f4f7fa;
  --paper: #fbfcfd;
  --white: #ffffff;
  --accent: #0f8f95;
  --accent-soft: #e5f5f5;
  --prompt-line: #e3e8ef;
  --prompt-mark: #edf7f7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3f7;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
pre {
  font: inherit;
}

.topbar {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: 18px 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 3px;
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 15px;
}

.repo-link,
.copy-button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.repo-link {
  padding: 9px 12px;
}

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  min-height: calc(100vh - 88px);
}

.gallery-panel,
.detail-panel {
  min-width: 0;
  padding: 20px;
}

.gallery-panel {
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.run-grid {
  display: grid;
  gap: 12px;
}

.run-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.run-card:hover,
.run-card.selected {
  border-color: var(--accent);
}

.run-thumb {
  width: 132px;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  background: var(--panel);
  object-fit: cover;
}

.run-card-body {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
}

.run-title {
  overflow: hidden;
  color: var(--ink);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-meta {
  color: var(--muted);
  font-size: 12px;
}

.run-tags,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
}

.detail-panel {
  overflow: auto;
}

.detail-layout {
  display: grid;
  gap: 18px;
}

.hero-video {
  width: 100%;
  max-height: 58vh;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #000;
}

.detail-header,
.prompt-card,
.shot-card,
.reference-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
}

.detail-header {
  display: grid;
  gap: 10px;
}

.detail-title-row,
.prompt-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reference-card {
  display: grid;
  grid-template-columns: minmax(160px, 260px) minmax(0, 1fr);
  gap: 16px;
}

.reference-card img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.field-grid {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.prompt-list,
.shot-list {
  display: grid;
  gap: 12px;
}

.copy-button {
  cursor: pointer;
  padding: 7px 10px;
  white-space: nowrap;
}

.copy-button:hover {
  background: var(--panel);
}

.prompt-actions {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
}

.prompt-badge {
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 7px 9px;
  white-space: nowrap;
}

.prompt-code {
  position: relative;
  max-height: none;
  overflow: auto;
  border-radius: 6px;
  border: 1px solid var(--prompt-line);
  border-left: 4px solid var(--accent);
  background:
    linear-gradient(90deg, var(--prompt-mark), transparent 34px),
    var(--paper);
  color: #26313d;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.7;
  padding: 16px 18px 16px 22px;
  white-space: pre-wrap;
}

.prompt-code.compact {
  max-height: 220px;
  overflow: hidden;
}

.prompt-code.compact:not(.expanded)::after {
  position: sticky;
  right: 0;
  bottom: 0;
  left: 0;
  display: block;
  height: 48px;
  margin: 0 -18px -16px -22px;
  background: linear-gradient(rgba(251, 252, 253, 0), var(--paper));
  content: "";
}

.prompt-code.expanded {
  max-height: 70vh;
  overflow: auto;
}

.shot-card {
  display: grid;
  gap: 10px;
}

.shot-meta {
  color: var(--muted);
  font-size: 12px;
}

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

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

  .gallery-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reference-card {
    grid-template-columns: 1fr;
  }

  .prompt-title-row {
    flex-direction: column;
  }

  .prompt-actions {
    flex-wrap: wrap;
  }
}
