/* Colour, type, space, radius and motion come from tokens.css (loaded
   first). The block below only maps the names this stylesheet grew up
   with onto the token set, so nothing here had to change on day one.
   Migrate usages to the token names, then delete the alias. */
:root {
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --raise: var(--surface-3);
  --ink-dim: var(--ink-muted);
  --ink-faint: var(--ink-subtle);
  --line-soft: var(--line);
  --accent-soft: var(--accent-hover);
  --btn-ink: var(--ink-on-accent);
  --banner: var(--surface-2);
  --banner-ink: var(--warn);
  --error: var(--danger-quiet);
  --error-line: var(--danger-line);
  --error-ink: var(--danger);
  --selection: var(--accent-quiet);
  --focus-ring: var(--accent-ring);
  --font-serif: var(--font-sans);
  --radius: var(--r-md);
  --topbar-height: var(--topbar-h);
  /* Legacy spacing steps: the old scale had 20/24/32 here, the token
     scale has 24/32/64. Shadowed until usages move to the new steps. */
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
}

/* Headings sit one step brighter than body copy. Rules later in the
   file that set a heading colour explicitly still win. */
h1, h2, h3, h4, h5, h6 {
  color: var(--ink-strong);
  font-weight: 500;
}

* {
  box-sizing: border-box;
}

/* A translucent wash keeps selected text legible; the default accent fill
   rendered ink-on-orange and was unreadable. */
::selection {
  background: var(--selection);
  color: var(--ink);
}

.result ::selection,
.context-panel ::selection {
  background: var(--selection);
  color: var(--ink);
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.app {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
}

.rail {
  grid-column: 1;
  grid-row: 2;
}

.work {
  grid-column: 2;
  grid-row: 2;
}

/* ---------- shared ---------- */

button,
input,
textarea {
  font: inherit;
}

button {
  appearance: none;
  border: 0;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--btn-ink);
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  min-height: 38px;
  cursor: pointer;
  /* Rows and tabs are click targets, so a stray double-click should not
     select their label text. Transcript and analysis text stays selectable. */
  user-select: none;
}

button:hover:not(:disabled):not(.ghost):not(.tab):not(.item):not(.nav-item):not(.angle-card):not(.source-open):not(.menu-item):not(.danger-solid):not(.accent-solid) {
  background: var(--accent-soft);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  font-weight: 500;
}

button.ghost:hover:not(:disabled):not([aria-pressed="true"]) {
  background: var(--raise);
  color: var(--ink);
  border-color: var(--line);
}

button.ghost.danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: var(--danger);
}

button.danger-solid {
  background: var(--danger);
  color: var(--btn-ink);
}

button.danger-solid:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 78%, var(--bg));
}

button.accent-solid {
  background: var(--accent);
  color: var(--btn-ink);
}

button.accent-solid:hover:not(:disabled) {
  background: var(--accent-soft);
}

input[type="search"],
textarea {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[readonly],
textarea[readonly] {
  cursor: default;
}

.eyebrow,
.kicker,
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.label {
  color: var(--ink-faint);
}

.hint,
.count {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.banner,
.step,
.error {
  border-radius: 6px;
  padding: var(--space-3);
  font-size: 0.8125rem;
  border: 1px solid var(--line);
}

.banner {
  background: var(--banner);
  color: var(--banner-ink);
}

.step {
  background: var(--panel-2);
  color: var(--ink-dim);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.error {
  background: var(--error);
  border-color: var(--error-line);
  color: var(--error-ink);
}

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

.rail {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-height: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--topbar-height);
  padding: 0.55rem 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  z-index: 6;
}

.topbar .brand {
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.topbar-actions #theme-btn {
  min-width: 32px;
  width: 32px;
  padding: 0.3rem;
}

.topbar-actions #context-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-muted);
  border-color: var(--line);
  background: transparent;
}

.topbar-actions #context-btn:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.btn-icon,
.icon-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  display: block;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button.small {
  min-height: 32px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.topbar .eyebrow {
  margin: 0 0 1px;
}

.composer label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 0.75rem;
  color: var(--ink-dim);
}

.composer-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.library {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-height: 0;
  flex: 1;
}

.library-head {
  display: block;
}

.library-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
}

.library-summary {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--ink-dim);
}

.library-bulk {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.library-row {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
}

.item-select {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.item-select input {
  width: 0.9rem;
  height: 0.9rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.library-list {
  list-style: none;
  margin: 0;
  padding: 0 var(--space-1) var(--space-4) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

.library-list .empty {
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.library-list button.item {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-soft);
  font-weight: 400;
  padding: var(--space-2);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  min-height: 0;
}

.library-list button.item {
  transition: border-color 0.12s ease, background 0.12s ease;
}

.library-list button.item:hover {
  background: var(--panel-2);
  border-color: var(--ink-faint);
}

.library-list button.item[aria-current="true"] {
  background: var(--panel-2);
  border-color: var(--accent);
}

.item-thumb {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  display: block;
}

.item-copy {
  min-width: 0;
}

.item-title {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-meta {
  display: block;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-faint);
}

.item-meta.active {
  color: var(--accent);
}

/* ---------- film header ---------- */

.film {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: var(--space-4);
  align-items: start;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-2);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.film .poster {
  display: block;
  width: 3.4rem;
  height: 4.4rem;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}

.film .poster:not(.portrait) {
  width: 5.5rem;
  height: 3.4rem;
}

.film .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.film-main {
  min-width: 0;
}

.film-main h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.film-meta {
  margin: 0.2rem 0 0;
  color: var(--ink-dim);
  font-size: 0.8125rem;
}

.film-meta:empty {
  display: none;
}

.film .step,
.film .error {
  margin-top: var(--space-2);
}

.film-stats {
  display: flex;
  gap: var(--space-5);
  margin: 0;
  padding: 0.1rem 0 0;
}

.stat {
  margin: 0;
}

.stat dt {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.stat dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.film-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: 0.1rem;
}

.menu {
  position: relative;
}

.menu-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 8;
  min-width: 12.5rem;
  padding: var(--space-1);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.8125rem;
  min-height: 36px;
  padding: 0.4rem 0.7rem;
}

.menu-item:hover:not(:disabled) {
  background: var(--raise);
}

#stats-note {
  margin: var(--space-2) 0 0;
  font-size: 0.75rem;
}

.chip {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  user-select: none;
}

.chip:empty {
  display: none;
}

/* ---------- work surface ---------- */

.work {
  padding: var(--space-5);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.script-drawer-scrim {
  position: fixed;
  top: var(--topbar-height);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 19;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.36s ease, visibility 0.36s ease;
}

.script-drawer-scrim.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.script-drawer {
  --sheet-inset: var(--space-5);
  position: fixed;
  top: calc(var(--topbar-height) + var(--sheet-inset));
  right: var(--sheet-inset);
  bottom: var(--sheet-inset);
  z-index: 20;
  width: min(64rem, calc(100vw - var(--sheet-inset) * 2));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transform: translateX(calc(100% + var(--sheet-inset) + 16px));
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.42s;
}

.script-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.transcript-drawer {
  width: min(42rem, calc(100vw - var(--sheet-inset) * 2));
}

.transcript-drawer .segments {
  max-width: none;
}

.transcript-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: var(--space-2);
}

.transcript-copy {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  .script-drawer,
  .script-drawer-scrim {
    transition: none;
  }
}

.script-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.script-drawer-head h2 {
  margin: var(--space-1) 0 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.25;
}

.script-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-5);
}

.script-drawer .script-stack {
  margin: 0;
  padding: 0;
  border: 0;
}

.empty-stage {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 8px 0 40px;
  overflow-x: hidden;
  overflow-y: auto;
}

.empty-inner {
  width: 100%;
  max-width: 46rem;
}

.empty-stage h2 {
  margin: 0 0 var(--space-8);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  border-top: 1px solid var(--line);
  padding-top: var(--space-6);
}

.steps li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.step-n {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
}

.steps h3 {
  margin: 0 0 var(--space-1);
  font-size: 0.9375rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  color: var(--ink-dim);
  max-width: 52ch;
}

.empty-foot {
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  align-items: baseline;
}

.empty-foot p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-dim);
}

.empty-foot .label {
  margin-right: var(--space-2);
}

.muted {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink);
  background: var(--raise);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.surface {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  position: relative;
  z-index: 3;
  background: var(--bg);
}

.tab {
  background: transparent;
  color: var(--ink-faint);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.85rem;
  min-height: 40px;
}

.tab {
  transition: color 0.12s ease, border-color 0.12s ease;
}

.tab:hover:not(:disabled) {
  background: transparent;
  color: var(--ink);
  border-bottom-color: var(--line);
}

.tab[aria-selected="true"]:hover {
  border-bottom-color: var(--accent);
}

.tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.work-status {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: var(--space-3) 0;
  color: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line-soft);
}

.work-status .loader {
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.step.is-busy {
  color: var(--accent-soft);
  border-color: var(--accent);
}

.panels {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  grid-template-areas: "study transcript";
}

.panel-study {
  grid-area: study;
}

.panel-transcript {
  grid-area: transcript;
  border-left: 1px solid var(--line-soft);
}

.panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--space-4) var(--space-8);
}

.col-label {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 calc(-1 * var(--space-4));
  padding: var(--space-4) var(--space-4) var(--space-4);
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

#breakdown-body,
#angles-body,
#page-transcript {
  padding-top: var(--space-4);
}

/* transcript */

.visual-body {
  max-width: none;
  margin: 0;
}

.visual-body .pull {
  font-size: 1.05rem;
  padding-left: var(--space-3);
}

.visual-body.hidden {
  display: none;
}

.page-transcript {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.page-transcript.hidden {
  display: none;
}

#work-surface.is-youtube #transcript-btn {
  display: none;
}

.block-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.block-head h3 {
  margin: 0;
}

.visual-body .block p {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: normal;
}

.overlay-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.overlay-lines li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.2rem var(--space-3);
  align-items: baseline;
}

.overlay-lines li:has(> .stamp) {
  grid-template-columns: 2.5rem minmax(0, 1fr);
}

.overlay-lines .stamp {
  font-size: 0.6875rem;
}

.overlay-lines .seg-text {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: pre-line;
}

.overlay-lines .beat-detail {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  color: var(--ink-dim);
}

.visual-body .block {
  max-width: none;
}

.segments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: none;
}

.segments li {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  gap: var(--space-4);
  align-items: baseline;
}

.stamp {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  user-select: none;
}

.seg-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* breakdown + angles */

.block {
  max-width: 78ch;
  margin-bottom: var(--space-6);
}

.block h3 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 600;
}

.block .label {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  font-weight: 600;
}

.block .block-head h3 {
  margin: 0;
}

.pull {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  line-height: 1.4;
  border-left: 2px solid var(--accent);
  padding-left: var(--space-4);
}

.beats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.beats li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.beat-quote {
  margin: 0 0 var(--space-2);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: var(--space-3);
}

.beat-label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.beat-detail {
  margin: 0;
  color: var(--ink);
}

.bullets {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--ink);
}

.take-skip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  max-width: none;
}

.take-skip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.take-skip li {
  font-size: 0.9375rem;
  line-height: 1.35;
}

.take-col-skip li {
  color: var(--ink-dim);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-dim);
  background: var(--raise);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}

.angle-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  max-width: 78ch;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font-weight: 400;
  min-height: 0;
  display: block;
}

button.angle-card:hover:not(:disabled) {
  background: var(--panel);
  border-color: var(--ink-faint);
}

.angle-card.is-selected {
  border-color: var(--accent);
}

.angle-card.is-busy {
  border-color: var(--accent-soft);
}

.angle-card h4 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
}

.angle-card .angle-why {
  margin: 0 0 var(--space-4);
  color: var(--ink-dim);
}

.angle-hint {
  margin: 0 0 var(--space-4);
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.spoken-beats {
  margin: 0 0 var(--space-4);
  padding-left: 1.1rem;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.script-stack {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.script-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.script-card {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: var(--space-4);
}

.script-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.script-card h5 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
}

.script-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.55;
}

.script-caption {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
  color: var(--ink-dim);
  font-size: 0.875rem;
  white-space: pre-wrap;
}

.angle-open {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  border-left: 2px solid var(--line);
  padding-left: var(--space-4);
  color: var(--ink);
}

.angle-format {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin: 0 0 var(--space-3);
}

.angle-ground {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.placeholder {
  color: var(--ink-faint);
  max-width: 60ch;
}

/* ---------- context editor ---------- */

.context-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.context-head h2 {
  margin: var(--space-2) 0 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
}

.context-panel {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.ctx-block {
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--line-soft);
}

.ctx-block:last-child {
  border-bottom: 0;
}

.ctx-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.ctx-block h3 {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

.ctx-hint {
  margin: 0 0 var(--space-4);
  color: var(--ink-dim);
  font-size: 0.875rem;
}

.source-list {
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.source-list .empty {
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.source-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: var(--space-2) var(--space-3);
}

.source-item {
  transition: border-color 0.12s ease, background 0.12s ease;
}

.source-item:hover {
  background: var(--panel);
  border-color: var(--ink-faint);
}

.source-item:has(.source-open:focus-visible) {
  border-color: var(--accent);
}

.toggle {
  display: inline-flex;
  cursor: pointer;
}

.toggle input {
  appearance: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--raise);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  margin: 0;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-faint);
  transition: transform 0.15s ease, background 0.15s ease;
}

.toggle input:checked {
  border-color: var(--accent);
}

.toggle input:checked::after {
  transform: translateX(14px);
  background: var(--accent);
}

.source-open {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  color: var(--ink);
  font-weight: 400;
  min-height: 0;
  cursor: pointer;
}

button.source-open:hover:not(:disabled),
button.source-open:focus {
  background: transparent;
  color: var(--ink);
}

button.source-open:hover:not(:disabled) .source-name {
  color: var(--accent-soft);
}

.source-name {
  display: block;
  font-size: 0.9375rem;
}

.source-meta {
  display: block;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-faint);
}

.ctx-add {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ctx-add-row {
  display: flex;
  gap: var(--space-2);
}

.ctx-add-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.context-panel textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink);
  border-radius: 6px;
  padding: var(--space-3);
  width: 100%;
  resize: vertical;
}

.context-panel textarea[readonly] {
  color: var(--ink-dim);
}

.ctx-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.ctx-settings {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.ctx-settings label {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--ink-dim);
}

.ctx-settings input {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  width: 16rem;
}

.ctx-settings input[type="number"] {
  width: 6rem;
}

.ping {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.ping-log {
  list-style: none;
  margin: 0 0 var(--space-3);
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ping-log:empty::after {
  content: "Try “hello” against grok-4.6, then against claude-opus-5.";
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.ping-msg {
  margin: 0;
  font-size: 0.8125rem;
  max-width: 56ch;
}

.ping-msg.is-user {
  color: var(--ink-dim);
}

.ping-msg.is-ok .ping-meta {
  color: var(--accent);
}

.ping-msg.is-err {
  color: var(--danger);
}

.ping-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.03em;
  display: block;
  margin-bottom: 2px;
}

.ping-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.ping-row select,
.ping-row input {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.ping-row select {
  width: 11rem;
}

.ping-row input {
  flex: 1;
  min-width: 10rem;
}

button.ghost[aria-pressed="true"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 22%, var(--panel));
}

button.ghost[aria-pressed="true"]:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 22%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--panel));
}

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
  .app,
  .app.has-selection {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .beats li {
    grid-template-columns: 8rem minmax(0, 1fr);
  }
}

@media (max-width: 1040px) {
  .app,
  .app.has-selection {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .film {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .film-stats,
  .film-actions {
    grid-column: 2;
  }
}

@media (max-width: 900px) {
  .panels {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "study"
      "transcript";
  }

  .panel-transcript {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .panel-study,
  .panel-transcript {
    max-height: min(70vh, 52rem);
  }

  .take-skip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app,
  .app.has-selection {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar,
  .rail,
  .work {
    grid-column: 1;
    grid-row: auto;
  }

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

  .empty-stage {
    padding: var(--space-5) 0;
    align-items: flex-start;
  }

  .film {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .film-stats,
  .film-actions {
    grid-column: 1 / -1;
  }

  .film-actions {
    justify-content: flex-start;
  }

  .segments li,
  .beats li,
  .steps li {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }
}

/* ---------- interaction states ----------
   Last in the file on purpose: the per-section field rules above set their own
   border, and at equal specificity source order would otherwise win. */

.app input:hover:not(:disabled):not([readonly]),
.app textarea:hover:not(:disabled):not([readonly]) {
  border-color: var(--ink-faint);
}

.app input:focus,
.app textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.app textarea[readonly]:focus {
  border-color: var(--line);
  box-shadow: none;
}

.unlock-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
}

.unlock-card {
  width: min(24rem, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-8) var(--space-6);
}

.unlock-card h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 var(--space-2);
}

.unlock-card .lede {
  color: var(--ink-dim);
  margin: 0 0 var(--space-6);
}

.unlock-card label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--ink-dim);
  font-size: 0.875rem;
}

.unlock-card input {
  width: 100%;
  margin-bottom: var(--space-4);
}

.unlock-card button {
  width: 100%;
}

.error-hint {
  color: var(--danger);
  margin: 0 0 var(--space-4);
}


/* =====================================================================
   v3 studio refresh — the token-system look approved on the artboard.
   Additive layer: it overrides the rules above by cascade order so the
   change is reviewable in one place. Fold into the blocks above once
   settled; nothing here introduces a raw colour.
   ===================================================================== */

html,
body {
  font-size: 14px;
}

.app {
  grid-template-columns: 260px minmax(0, 1fr);
}

/* ---- topbar: 50px, quiet brand, ghost actions ---- */

.topbar {
  min-height: 50px;
  padding: 0 var(--space-4);
  gap: var(--space-3);
}

.topbar .eyebrow {
  display: none;
}

.brand h1 {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-strong);
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand h1::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---- controls ---- */

button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

button.ghost {
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost:hover:not(:disabled):not([aria-pressed="true"]) {
  background: var(--chip);
  border-color: var(--line-strong);
}

button.ghost[aria-pressed="true"] {
  background: var(--chip);
  color: var(--ink-strong);
  border-color: var(--line-strong);
}

button.ghost.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger-line);
}

button.ghost.danger:hover:not(:disabled) {
  background: var(--danger-quiet);
  border-color: var(--danger);
  color: var(--danger);
}

button.danger-solid {
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
}

button.danger-solid:hover:not(:disabled) {
  background: color-mix(in srgb, var(--danger) 82%, #000);
  border-color: transparent;
  color: #fff;
}

.topbar-actions #theme-btn {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
}

input[type="text"],
input[type="url"],
input[type="search"],
input[type="number"],
select,
textarea,
.app textarea {
  background: var(--chip);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--ink);
  font-size: 13px;
  padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus,
.app textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---- rail: flush, dense ---- */

.rail {
  padding: 14px 12px;
  gap: 14px;
}

.composer label {
  font-size: 12px;
  color: var(--ink-subtle);
  margin-bottom: 6px;
}

.composer textarea {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
}

.composer-row {
  margin-top: 8px;
}

.hint,
.count,
.muted,
.library-summary {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink-subtle);
  letter-spacing: 0;
}

.library-head #search {
  height: 32px;
  padding: 0 10px;
}

.library-list {
  gap: 2px;
  padding-right: 0;
}

.library-list button.item {
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  min-height: 48px;
}

.library-list button.item:hover {
  background: var(--chip);
  border-color: transparent;
}

.library-list button.item[aria-current="true"] {
  background: var(--chip);
  border-color: transparent;
}

.library-list button.item[aria-current="true"] .item-title {
  color: var(--ink-strong);
  font-weight: 500;
}

.item-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 0;
  background: var(--thumb);
}

.item-title {
  font-size: 13px;
  line-height: 17px;
  color: var(--ink);
}

.item-meta {
  font-size: 11px;
  color: var(--ink-subtle);
}

.library-row {
  grid-template-columns: 1rem minmax(0, 1fr);
}

/* ---- work surface ---- */

.work {
  padding: 24px 28px 0;
}

.film {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "poster main actions"
    "poster stats actions";
  gap: 4px 16px;
  align-items: start;
  padding-bottom: 20px;
  margin-bottom: 0;
  border-bottom: 0;
}

.film .poster,
.film .poster:not(.portrait) {
  grid-area: poster;
  width: 48px;
  height: 64px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.film-main {
  grid-area: main;
}

.film-main h2 {
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.film-meta {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.film-stats {
  grid-area: stats;
  gap: 14px;
  padding: 2px 0 0;
  align-items: baseline;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat dd {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: var(--ink-strong);
}

.stat dt {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
}

.film-actions {
  grid-area: actions;
  gap: 8px;
  padding-top: 2px;
}

.film-actions button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.work-status {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--ink-muted);
  border-bottom: 0;
  padding: 4px 0 12px;
}

/* ---- tabs: underline, monochrome ---- */

.tabs {
  gap: 22px;
}

.tab {
  padding: 0 2px;
  min-height: 36px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-muted);
}

.tab:hover:not(:disabled) {
  color: var(--ink-strong);
  border-bottom-color: transparent;
}

.tab[aria-selected="true"],
.tab[aria-selected="true"]:hover {
  color: var(--ink-strong);
  font-weight: 500;
  border-bottom-color: var(--ink-strong);
}

/* ---- panels: 7/5, no boxes, no divider ---- */

.panels {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  column-gap: 28px;
}

.panel {
  padding: 0 0 48px;
}

.panel-transcript {
  border-left: 0;
}

.col-label {
  margin: 0;
  padding: 18px 0 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-strong);
  border-bottom: 0;
}

#breakdown-body,
#angles-body,
#page-transcript {
  padding-top: 4px;
}

.kicker,
.label,
.block h3,
.block .label,
.block-head h3 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
}

.block {
  max-width: none;
  margin-bottom: 20px;
}

.block h3 {
  margin-bottom: 6px;
}

.pull,
.visual-body .pull {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 27px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  border-left: 0;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.beats {
  gap: 0;
}

.beats li {
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 44px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-bottom: 0;
  border-radius: var(--r-md);
  transition: background var(--t-fast) var(--ease);
}

.beats li:hover {
  background: var(--chip);
}

.beat-label {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 20px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
}

.beat-quote {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  color: var(--ink-strong);
  border-left: 0;
  padding-left: 0;
  margin-bottom: 2px;
}

.beat-detail {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-muted);
}

.take-skip ul,
.tag-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
}

.take-skip li,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: var(--chip);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

.take-col-skip li {
  background: transparent;
  border: 1px dashed var(--line-strong);
  color: var(--ink-muted);
}

code {
  border-radius: 6px;
  background: var(--chip);
}

.angle-card,
.script-card {
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.angle-card.is-selected {
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-1);
}

.empty-stage h2 {
  font-family: var(--font-sans);
  font-size: 28px;
  line-height: 34px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.steps h3 {
  font-weight: 500;
}

.unlock-card {
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}


/* ---- v3 structure: sidebar spans full height, bar sits over the work area ---- */

.app {
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 50px minmax(0, 1fr);
}

.rail {
  grid-column: 1;
  grid-row: 1 / -1;
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  background: var(--bg);
}

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

.crumb {
  font-size: 13px;
  color: var(--ink-muted);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  background: var(--chip);
  border-radius: var(--r-md);
  color: var(--ink-subtle);
}

.topbar-search svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.topbar-search input,
.topbar-search input:focus {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--ink);
  font-size: 13px;
}

.topbar-search kbd {
  font-family: var(--font-sans);
  font-size: 10px;
  line-height: 1;
  color: var(--ink-subtle);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 2px 5px;
}

.topbar-search kbd + kbd {
  margin-left: -4px;
}

.topbar-actions {
  justify-content: flex-end;
}

.rail .brand {
  padding: 2px 4px 6px;
}

.rail .eyebrow {
  display: none;
}

.rail .brand h1::before {
  background: var(--ink-strong);
}

.composer {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 12px;
}

.composer label {
  text-transform: none;
  font-weight: 500;
  color: var(--ink-subtle);
}

.composer textarea {
  background: var(--bg);
}

.composer-row {
  align-items: flex-start;
}

#submit-btn {
  min-height: 34px;
}

.library-meta {
  padding: 4px 4px 0;
}

.library-list button.item {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
}

.item-thumb {
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.item-copy {
  display: contents;
}

.item-title {
  font-size: 13px;
  line-height: 32px;
}

.item-meta {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  white-space: nowrap;
}

/* ---- v3 sections: label column, numbered beats, cards on the right ---- */

#breakdown-body > .block:not(.take-skip) {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

#breakdown-body > .block:not(.take-skip) > h3 {
  margin: 0;
  line-height: 22px;
  font-size: 13px;
}

#breakdown-body > .block:not(.take-skip) > *:not(h3) {
  grid-column: 2;
}

#breakdown-body > .block:has(+ .breakdown-rule) {
  margin-bottom: 4px;
}

#breakdown-body > .breakdown-rule {
  appearance: none;
  display: block;
  border: 0;
  height: 1px;
  margin: 18px 0 28px;
  padding: 0;
  background: linear-gradient(
    90deg,
    var(--accent) 0,
    var(--accent) 36px,
    var(--line) 36px,
    var(--line) 100%
  );
  opacity: 0.7;
}

.block > p {
  margin: 0;
  line-height: 22px;
}

.beats {
  counter-reset: beat;
}

.beats li {
  grid-template-columns: 26px 96px minmax(0, 1fr);
  align-items: center;
}

.beats li::before {
  counter-increment: beat;
  content: counter(beat, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-subtle);
}

.panel-transcript .col-label {
  padding-left: 18px;
}

.visual-body {
  min-width: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 22px 22px 24px;
}

.visual-body .block:last-child {
  margin-bottom: 0;
}

.visual-body .block {
  min-width: 0;
}

.visual-body .block-head {
  margin-bottom: 14px;
}

.visual-body .block > h3 {
  margin: 0 0 6px;
}

.visual-body .pull {
  box-shadow: none;
  background: var(--chip);
  font-size: 15px;
  line-height: 24px;
  font-weight: 400;
  color: var(--ink);
  padding: 14px 16px;
  margin: 0;
  max-width: 100%;
}

.overlay-lines li {
  padding: 8px 0;
}


/* ---- v3 shell: sidebar nav, tabs strip, right-column cards ---- */

.rail {
  gap: 10px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 6px;
}

.nav-item,
.rail .nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
}

.nav-item svg,
.rail .nav-item .btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-item:hover:not(:disabled) {
  background: var(--chip);
  color: var(--ink-strong);
}

.app.view-library #empty-state,
.app.view-job #empty-state,
.app.view-context #empty-state {
  display: none !important;
}

.app.view-home #nav-home,
.app.view-library #nav-library,
.app.view-job:not(.study-angles):not(.study-scripts) #nav-library,
.app.view-job.study-angles #nav-angles,
.app.view-job.study-scripts #nav-scripts,
.app.view-context #nav-context,
.app.view-context #context-btn {
  background: var(--chip);
  color: var(--ink-strong);
}

.rail-foot {
  margin-top: auto;
  padding-top: 6px;
}

.crumb-sep {
  color: var(--ink-subtle);
}

.crumb-current {
  color: var(--ink-strong);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app:not(.view-job) .crumb-sep,
.app:not(.view-job) .crumb-current {
  display: none;
}

.topbar-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.topbar-link:hover {
  background: var(--chip);
  border-color: var(--line-strong);
  color: var(--ink-strong);
}

.study-tabs {
  margin-bottom: 4px;
}

.panel-study > .col-label {
  display: none;
}

.col-label {
  position: static;
  z-index: auto;
  background: transparent;
}

.tab[aria-pressed="true"],
.tab[aria-pressed="true"]:hover {
  color: var(--ink-strong);
  font-weight: 500;
  border-bottom-color: var(--ink-strong);
}

.film-actions .icon-btn {
  width: 36px;
  padding: 0;
}

.film-actions .icon-btn svg {
  width: 15px;
  height: 15px;
}

#work-surface.is-youtube #transcript-btn {
  display: none;
}

.page-transcript,
#work-surface.is-youtube .page-transcript {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 18px 16px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.panel-transcript {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#work-surface.is-youtube #panel-transcript {
  overflow: hidden;
  padding-bottom: 16px;
}

#work-surface.is-youtube .page-transcript {
  flex: 1;
  min-height: 0;
  margin-top: 4px;
}

.page-transcript.hidden {
  display: none;
}

.page-transcript .card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-strong);
}

#work-surface.is-youtube .page-transcript .card-title {
  display: none;
}

.page-transcript .transcript-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-transcript .transcript-copy button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border: 0;
  background: var(--chip);
}

.page-transcript .segments {
  max-height: 360px;
  overflow-y: auto;
}

#work-surface.is-youtube .page-transcript .segments {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.page-transcript .segments li {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border: 0;
}

.page-transcript .stamp {
  width: 36px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 21px;
  color: var(--ink-subtle);
}

.page-transcript .seg-text {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
}


/* ---- v3 pages: library grid, new-pull dialog, home actions ---- */

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 4px 0 20px;
}

.page-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
}

.page-head .library-summary {
  margin: 4px 0 0;
}

.page-head .library-bulk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.page-head .library-bulk.hidden {
  display: none;
}

.page-head .library-bulk.hidden + .open-new-pull,
.page-head .library-bulk + .open-new-pull {
  margin-left: 0;
}

.page-head .library-bulk.hidden ~ .open-new-pull {
  margin-left: auto;
}

.open-new-pull {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#library-view {
  overflow-y: auto;
  padding-bottom: 48px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  overflow: visible;
  flex: none;
}

.library-grid .empty {
  grid-column: 1 / -1;
}

.library-grid .library-row {
  display: block;
  position: relative;
}

.library-grid .item-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.library-grid button.item,
.library-grid button.item:hover,
.library-grid button.item[aria-current="true"] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-height: 0;
  padding: 0;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}

.library-grid button.item:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.library-grid button.item[aria-current="true"] {
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-1);
}

.library-grid .item-thumb {
  width: 100%;
  height: 140px;
  border-radius: 0;
  object-fit: cover;
  background: var(--thumb);
}

.library-grid .item-copy {
  display: block;
  padding: 12px 14px 14px;
}

.library-grid .item-title {
  display: block;
  white-space: normal;
  font-size: 14px;
  line-height: 19px;
  font-weight: 500;
  color: var(--ink-strong);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.library-grid .item-meta {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  white-space: normal;
  color: var(--ink-muted);
}

.library-grid .item-meta.active {
  color: var(--warn);
}

.empty-actions {
  display: flex;
  gap: 8px;
  margin: -24px 0 40px;
}

.empty-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-composer {
  width: 100%;
  max-width: 52rem;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 228px;
  padding: 14px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-1);
}

.home-composer-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.home-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-full);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
}

.home-tool.is-on {
  background: var(--chip);
  color: var(--ink-strong);
}

.home-tool svg {
  width: 15px;
  height: 15px;
}

.home-composer textarea,
.app .home-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 112px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  resize: none;
  padding: 10px 4px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: 400 16px/24px var(--font-sans);
  color: var(--ink-strong);
}

.home-composer textarea::placeholder {
  color: var(--ink-subtle);
}

.home-composer textarea:focus,
.app .home-composer textarea:focus {
  outline: none;
  border: 0;
  box-shadow: none;
}

.home-composer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
  min-width: 0;
}

.home-composer-foot .accent-solid {
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}

.home-composer-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.home-composer-hints span {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-full);
  background: var(--chip);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
}

dialog.new-pull {
  width: min(560px, calc(100vw - 32px));
  margin: auto;
  padding: 22px 24px 24px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-2);
}

dialog.new-pull::backdrop {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}

dialog.new-pull h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 24px;
}

dialog.new-pull .muted {
  margin: 0 0 16px;
}

dialog.new-pull .composer {
  padding: 0;
  background: transparent;
  box-shadow: none;
}

dialog.new-pull .composer textarea {
  background: var(--chip);
  min-height: 96px;
}

dialog.new-pull .composer-row {
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

dialog.new-pull #queue-note {
  margin-right: auto;
}

dialog.new-pull #submit-btn {
  min-height: 36px;
}


/* ---- v3 polish: focus rings, nav hover, angle cards ---- */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

.tab:focus-visible,
.nav-item:focus-visible,
.library-grid button.item:focus-visible {
  outline-offset: -2px;
}

.tab:focus-visible {
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}

.nav-item:hover:not(:disabled),
.rail .nav-item:hover:not(:disabled) {
  background: var(--chip);
  color: var(--ink-strong);
  border-color: transparent;
}

.angle-card,
button.angle-card:hover:not(:disabled) {
  max-width: none;
  padding: 18px 20px;
  margin-bottom: 12px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--t-fast) var(--ease);
}

.angle-card:hover {
  box-shadow: var(--shadow-2);
}

.angle-card.is-selected,
.angle-card.is-selected:hover {
  border: 0;
  box-shadow: 0 0 0 2px var(--accent), var(--shadow-1);
}

.angle-card.is-busy {
  border: 0;
  box-shadow: 0 0 0 2px var(--warn), var(--shadow-1);
}

.angle-card h4 {
  margin: 0 0 4px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  color: var(--ink-strong);
}

.angle-format {
  margin: 0 0 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-muted);
}

.angle-card .angle-why {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 22px;
  color: var(--ink);
}

.angle-open {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 0;
  border-radius: var(--r-md);
  background: var(--chip);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 23px;
  font-weight: 500;
  color: var(--ink-strong);
}

.spoken-beats {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  gap: 6px;
  counter-reset: spoken;
}

.spoken-beats li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  font-size: 14px;
  line-height: 21px;
}

.spoken-beats li::before {
  counter-increment: spoken;
  content: counter(spoken, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 21px;
  color: var(--ink-subtle);
}

.angle-ground {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-subtle);
}

.angle-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-subtle);
}

.script-stack {
  border-top: 1px solid var(--line);
}


/* ---- v3 clip fix: scrolling panels must not cut card rings and shadows ---- */

.panel {
  margin: 0 -8px;
  padding: 4px 8px 48px;
}

#angles-body {
  padding: 10px 14px 28px;
}

.panels {
  column-gap: 12px;
}

.angle-card,
.pull,
.visual-body,
.page-transcript {
  margin-left: 0;
  margin-right: 0;
}

.beats li {
  margin: 0 -8px;
  padding: 6px 8px;
}

.col-label {
  padding-left: 0;
}

.panel-transcript .col-label {
  padding-left: 0;
}


/* ---- v3 type: ElevenLabs register — Inter, 400/500, 24px titles at 400 ---- */

html,
body {
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.film-main h2,
.page-head h2,
.context-head h2,
.empty-stage h2,
.unlock-card h1 {
  font: var(--text-display);
  letter-spacing: var(--tracking-tight);
  color: var(--ink-strong);
}

.empty-stage h2 {
  font-size: 28px;
  line-height: 34px;
}

.col-label,
.page-transcript .card-title,
.angle-card h4,
.script-card h5,
.ctx-block h3,
.steps h3 {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.angle-card h4 {
  font-size: 15px;
  line-height: 21px;
}

.brand h1 {
  font-size: 14px;
  font-weight: 500;
}

.nav-item,
.tab,
button,
.topbar-link {
  font-size: 14px;
}

button.small,
.topbar-search input,
.crumb,
.film-meta,
.item-title {
  font-size: 13px;
}

.stat dd,
.stat dt {
  font-size: 13px;
}

.take-skip li,
.tag,
.angle-format,
.beat-detail,
.item-meta,
.hint,
.muted,
.library-summary,
.angle-ground,
.angle-hint,
.kicker,
.label,
.block h3,
.block .label {
  font-size: 12px;
  line-height: 18px;
}

.block > p,
.beat-quote,
.spoken-beats li,
.page-transcript .seg-text,
.angle-card .angle-why {
  font-size: 14px;
  line-height: 22px;
}

.pull {
  font-size: 17px;
  line-height: 26px;
  font-weight: 500;
}

.visual-body .pull {
  font-size: 15px;
  line-height: 24px;
  font-weight: 400;
}


/* ---- v3 sidebar match: ElevenLabs measurements ---- */

.app {
  grid-template-columns: 224px minmax(0, 1fr);
}

.rail {
  padding: 12px;
  gap: 2px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.rail .brand {
  padding: 6px 8px 14px;
}

.brand h1 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  gap: 10px;
}

.brand h1::before {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.side-nav {
  gap: 2px;
  padding-bottom: 0;
}

.nav-item,
.rail .nav-item {
  min-height: 36px;
  padding: 0 12px;
  gap: 12px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 400;
  color: var(--ink-strong);
}

.nav-item svg,
.rail .nav-item .btn-icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}

.rail .banner {
  margin: 10px 0 0;
}

.rail-foot {
  padding-top: 8px;
}

.topbar {
  background: var(--bg);
}

.work {
  background: var(--bg);
}


/* ---- v3 icons: Lucide glyphs inline ---- */

.brand h1::before {
  display: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink-strong);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

.nav-item svg,
.rail .nav-item .btn-icon {
  stroke-width: 1.75;
}

.topbar-search svg {
  width: 15px;
  height: 15px;
}


/* ---- v3 scripts tab ---- */

.angle-pick .muted {
  margin: 0 0 12px;
}

.angle-pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.angle-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  color: var(--ink);
  font-weight: 400;
  text-align: left;
}

.angle-pick-row:hover:not(:disabled) {
  background: var(--chip);
  color: var(--ink-strong);
}

.angle-pick-title {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-strong);
}

.angle-pick-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-subtle);
}

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

.scripts-head h4 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  color: var(--ink-strong);
}

.script-stack {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  gap: 12px;
}

.script-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.script-card {
  padding: 18px 20px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.script-card header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.script-card h5 {
  margin: 0;
  font-size: 15px;
  line-height: 21px;
  font-weight: 500;
  color: var(--ink-strong);
}

.script-card .angle-format {
  margin: 0;
  flex-shrink: 0;
}

.script-body {
  margin: 0 0 12px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 22px;
  color: var(--ink);
}

.script-caption {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--chip);
  font-size: 13px;
  line-height: 19px;
  color: var(--ink-muted);
}

.script-card .script-toolbar {
  margin-top: 4px;
}
