Skip to content

AI media harness for planning, generating, and editing locally

TypeScript
30.3 KB
Raw Blame
/* ============================================================================
   generator.css — the Generator screen: a command bar, a board of scene groups
   with their shot tiles, a status bar, and the inspector pane that edits
   whatever is open on the board.

   Legibility contract: body copy is --text-base, the smallest text anywhere is
   --text-xs (12px), standard controls are --control-md (32px) and compact
   ones --control-sm (24px). No raw px type, no hand-written greys.
   ========================================================================== */

/* The board, the splitter and the inspector. The inspector's width is the
   user's (usePaneSize → --pane-generator-inspector), so there are no width
   breakpoints any more: a narrow window narrows the board, and the splitter
   is how the inspector gets out of the way. */
.generator-view {
  --pane-generator-inspector: var(--pane-side-default); /* usePaneSize sets the real width inline */
  height: 100%;
  min-height: 0;
  display: grid;
  /* Floors on both sides: with the agent pane open in a 900px window the view
     is ~540px wide, and a fixed inspector squeezed the scene list to nothing. */
  grid-template-columns: minmax(280px, 1fr) auto minmax(280px, var(--pane-generator-inspector));
  grid-template-rows: minmax(0, 1fr);
  background: var(--surface-pane);
}

/* Nothing to inspect until there is a scene, so the board takes the width. */
.generator-view--empty {
  grid-template-columns: minmax(0, 1fr);
}

/* --- The board column: command bar, board, status bar ---------------------- */

.generator-main {
  min-width: 0;
  min-height: 0;
  container: generator-main / inline-size;
  display: flex;
  flex-direction: column;
}

/* Align the command bar with the inspector's selected-item header. */
.generator-command {
  flex: 0 0 auto;
  height: var(--item-header);
  border-bottom: 1px solid var(--stroke-divider);
  background: var(--surface-chrome);
}

.generator-command .generator-runtime { flex: 0 1 auto; }
.generator-command .generator-template { min-width: 0; }

/* "Generate all" is the screen's one accent button, as in the mock: an accent
   fill on the command bar's otherwise subtle row. */
.generator-command .generator-command__generate:not(:disabled) {
  color: var(--on-accent);
  background: var(--button-primary-bg);
}

.generator-command .generator-command__generate:hover:not(:disabled) {
  background: var(--button-primary-hover);
}

.generator-command .generator-command__generate:active:not(:disabled) {
  color: var(--on-accent-dim);
  background: var(--button-primary-active);
}

.generator-command .generator-command__cancel {
  color: var(--danger);
}

/* The board is where the shots are laid out, so it sits in the well; the
   scene headers across it are chrome, edge to edge. */
.generator-board-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
}

.generator-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--surface-well);
}

.generator-status__runtime {
  color: var(--warning);
}

/* --- The generator picker ---------------------------------------------------
   A neutral ComboBox; the engine's readiness is the 8px glyph in front of it,
   coloured by state. The name ellipsises (with the full name in the tooltip)
   rather than scrolling sideways, and the box grows to 240px before it does.
   ========================================================================== */

.generator-runtime {
  flex: none;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding-left: var(--space-2);
}

.generator-runtime > i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-faint);
}

.generator-runtime--ready > i { background: var(--success); }
.generator-runtime--demo > i { background: var(--warning); }

.generator-runtime--runtimeMissing > i,
.generator-runtime--modelsMissing > i,
.generator-runtime--incompatible > i,
.generator-runtime--unavailable > i {
  background: var(--danger);
}

.generator-runtime__label {
  color: var(--text-secondary);
  font-size: var(--text-base);
  white-space: nowrap;
}

/* Lower than a form field so the command bar's buttons stay the tallest
   thing on the row. */
.generator-template {
  height: var(--control-sm);
  min-width: 140px;
  max-width: 240px;
}

.generator-template .ui-combo__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- The board ---------------------------------------------------------------

   Every scene in the project as a section header — the same 28px chrome strip
   as the inspector's sections: a chevron, the name at 12px semibold, and the
   shot count at the trailing edge — with its shots as tiles in an
   auto-filling grid below it.
   ========================================================================== */

.scene-board {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-4);
}

.scene-section {
  position: relative;
  display: flex;
  flex-direction: column;
}

.scene-section--dragging {
  opacity: 0.45;
}

/* A 2px accent bar where a dragged scene would land. */
.scene-section--drop-before::before,
.scene-section--drop-after::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 1;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  pointer-events: none;
}

.scene-section--drop-before::before { top: -1px; }
.scene-section--drop-after::after { bottom: -1px; }

/* --- The scene header ------------------------------------------------------- */

.scene-rule {
  min-width: 0;
  height: var(--section-row);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 var(--space-1);
  /* Keep controls clear of overlay scrollbars inside the full-width fill. */
  padding-inline-end: calc(var(--space-1) + var(--space-4));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-chrome);
}

/* One line between two headers, not two, and none under the command bar's
   divider — the PropSection rule. */
.scene-section:first-child > .scene-rule,
.scene-section--collapsed + .scene-section > .scene-rule {
  border-top-color: transparent;
}

.scene-rule__toggle,
.scene-rule__action {
  width: var(--control-sm);
  height: var(--control-sm);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  transition: var(--transition-control);
}

.scene-rule__toggle:hover,
.scene-rule__action:hover:not(:disabled) {
  background: var(--fill-subtle-hover);
}

.scene-rule__toggle:active,
.scene-rule__action:active:not(:disabled) {
  background: var(--fill-subtle-pressed);
}

.scene-rule__action:disabled {
  color: var(--text-disabled);
}

.scene-rule__action > span {
  display: grid;
  place-items: center;
}

.scene-rule__cancel {
  color: var(--danger);
}

.scene-rule__drag {
  width: var(--space-5);
  height: var(--control-sm);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: grab;
}

.scene-rule__drag:hover {
  color: var(--text-primary);
  background: var(--fill-subtle-hover);
}

.scene-rule__drag:active {
  cursor: grabbing;
}

.scene-rule__summary {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  min-height: var(--control-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-1);
  border: 0;
  border-radius: var(--radius-sm);
  color: inherit;
  background: none;
  text-align: left;
}

.scene-rule__summary:hover {
  background: var(--fill-subtle-hover);
}

.scene-section--current .scene-rule__title {
  color: var(--accent-bright);
}

.scene-rule__status {
  width: var(--space-4);
  height: var(--space-4);
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: var(--accent-bright);
}

.scene-rule__status--generating svg,
.scene-rule__status--ready svg {
  animation: spin 1.4s linear infinite;
}

.scene-rule__status--completed { color: var(--success); }
.scene-rule__status--changed { color: var(--warning); }

.scene-rule__status--failed,
.scene-rule__status--cancelled {
  color: var(--danger);
}

.scene-rule__status--draft {
  color: var(--text-muted);
}

.scene-rule__title {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-rule__caption,
.scene-rule__badge {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.scene-rule__caption {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.scene-rule__badge {
  padding: 0 var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  line-height: 16px;
}

.scene-rule__length {
  flex: 0 1 120px;
  min-width: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-2);
}

.scene-rule__length input[type="range"] {
  width: 100%;
}

/* --- One shot, as a tile ------------------------------------------------------

   The tile is a SUMMARY and a target: a frame, the name and times, one line
   of the shot's words. 4px corners and a hairline edge like any Fluent grid
   item; rest, hover and the open shot are the shared selectable-card rule
   (.ui-selectable--card: an accent fill and ring). The grid auto-fills
   fixed 300px columns: resizing the inspector wraps tiles onto more rows
   rather than growing or shrinking them.
   ========================================================================== */

.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(0, var(--shot-tile-width)));
  --shot-tile-width: 300px;
  gap: var(--space-2);
  margin: 0;
  padding: var(--space-2) var(--space-3) var(--space-3);
  padding-inline-end: calc(var(--space-3) + var(--space-4));
  list-style: none;
}

/* List density: one 28px row per shot, no frames. */
.scene-board--list .shot-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
}

.shot-slot {
  position: relative;
  min-width: 0;
  display: flex;
}

/* The 2px accent insertion bar, between tiles (or rows in the list). */
.shot-slot--drop-before::before,
.shot-slot--drop-after::after {
  content: "";
  position: absolute;
  z-index: 1;
  border-radius: 1px;
  background: var(--accent);
  pointer-events: none;
}

.shot-slot--drop-before::before { top: -2px; bottom: -2px; left: -5px; width: 2px; }
.shot-slot--drop-after::after { top: -2px; bottom: -2px; right: -5px; width: 2px; }

.scene-board--list .shot-slot--drop-before::before { inset: -2px 0 auto; width: auto; height: 2px; }
.scene-board--list .shot-slot--drop-after::after { inset: auto 0 -2px; width: auto; height: 2px; }

.shot-card {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: 6px;
  border: 1px solid var(--stroke-card);
  border-radius: var(--radius-sm);
  color: inherit;
  text-align: left;
}

.shot-card--dragging {
  opacity: 0.45;
}

.scene-board--list .shot-card {
  min-height: 28px;
  padding: 2px var(--space-2);
  justify-content: center;
}

/* The frame and the text are separate controls: clicking the frame plays
   this shot; clicking the text opens its settings. */
.shot-card__open-control {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  color: inherit;
  background: none;
  text-align: left;
}

.scene-board--list .shot-card__open-control {
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
}

.shot-card__head {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: 16px;
}

.scene-board--list .shot-card__head {
  flex: 0 0 auto;
  min-width: 180px;
}

.shot-card__head > b {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-card__head > em {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Up to three lines of the shot's own words, clamped; the full text is in
   the tooltip and in the inspector. The tile keeps room for all three so
   the grid's rows line up. The list keeps it to one ellipsised line. */
.shot-card__line {
  min-width: 0;
  min-height: 48px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  line-height: 16px;
  overflow-wrap: anywhere;
}

.scene-board--list .shot-card__line {
  min-height: 0;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-card__line--empty {
  color: var(--text-faint);
}

/* A cited reference reads as the thing it points at, not as the token that
   stores it — the same promise the field makes with "[Reference N]". */
.shot-card__ref {
  color: var(--accent-bright);
  font-style: normal;
  font-weight: var(--weight-semibold);
}

.shot-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  overflow: hidden;
  max-height: var(--control-sm);
}

/* Chips everywhere in the Generator: 24px, 4px corners, 12px text. */
.shot-card__tag {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--fill-control);
  font-size: var(--text-xs);
  font-style: normal;
  line-height: 16px;
}

/* --- The frame a tile shows ---------------------------------------------------

   A real frame of the shot once the scene has been rendered, in that frame's
   own shape (ShotThumbnail sets aspect-ratio from the poster; the Video's
   configured dimensions until then), and nothing
   invented before that: the placeholder says which state the scene is in
   instead. Same rule as the media thumb and the reference card.
   ========================================================================== */

.shot-thumb {
  position: relative;
  aspect-ratio: var(--shot-frame-aspect, 16 / 9);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  overflow: hidden;
  border-radius: 2px;
  color: var(--text-muted);
  background-color: var(--panel-3);
}

.shot-thumb-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--shot-frame-aspect, 16 / 9);
}

.shot-thumb-frame > .shot-thumb { height: 100%; }

.shot-thumb__popout {
  position: absolute;
  top: 50%;
  left: calc(50% + var(--space-1) / 2);
  transform: translateY(-50%);
  width: var(--icon-button);
  height: var(--icon-button);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  opacity: 0;
  transition: opacity var(--motion-fast) linear;
}

.shot-card:hover .shot-thumb__popout,
.shot-card:hover .shot-thumb__play,
.shot-thumb-frame:hover .shot-thumb__popout,
.shot-thumb-frame:hover .shot-thumb__play,
.shot-thumb-frame:has(:focus-visible) .shot-thumb__popout,
.shot-thumb-frame:has(:focus-visible) .shot-thumb__play { opacity: 1; }

.shot-thumb__popout svg { width: 20px; height: 20px; }

.shot-popout {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  container-type: size;
  background: color-mix(in srgb, var(--surface-chrome) 75%, transparent);
  backdrop-filter: grayscale(1) brightness(.55);
}

.shot-popout__frame {
  position: relative;
  width: min(100cqw, calc(100cqh * var(--shot-aspect)));
  max-width: 100%;
  aspect-ratio: var(--shot-aspect);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--stage-bg);
}

.shot-popout__frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.shot-popout__close, .shot-popout__play {
  position: absolute;
  display: grid;
  place-items: center;
  width: var(--control-md);
  height: var(--control-md);
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
}
.shot-popout__close { top: var(--space-2); right: var(--space-2); }
.shot-popout__play { left: 50%; bottom: var(--space-3); transform: translateX(-50%); }
.shot-popout__message { position: absolute; inset: var(--space-3) var(--space-5) auto; margin: 0; padding: var(--space-2); text-align: center; color: var(--on-stage); background: var(--stage-bg); }

.shot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-thumb--poster {
  background-image: none;
}

.shot-thumb--playable {
  padding: 0;
  border: 0;
}

.shot-thumb__play {
  position: absolute;
  inset: 50% auto auto calc(50% - var(--icon-button) / 2 - var(--space-1) / 2);
  width: var(--icon-button);
  height: var(--icon-button);
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-pill);
  opacity: 0;
  transition: opacity var(--motion-fast) linear;
}

/* Media controls always use stage colors: accent contrast colors can turn
   dark with a light accent, making them disappear over video in dark mode. */
.shot-thumb__play, .shot-thumb__popout, .shot-popout__play, .shot-popout__close {
  color: var(--on-stage);
  background: color-mix(in srgb, var(--stage-bg) 90%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--on-stage) 35%, transparent), 0 2px 8px var(--scrim);
}

.shot-thumb--playable:hover .shot-thumb__play,
.shot-thumb--playable:focus-visible .shot-thumb__play,
.shot-thumb--playable .shot-thumb__play--loading,
.shot-thumb--playable[aria-label^="Playback unavailable"] .shot-thumb__play {
  opacity: 1;
}

.shot-thumb em {
  padding: 0 var(--space-2);
  color: inherit;
  font-size: var(--text-xs);
  font-style: normal;
  text-align: center;
}

.shot-thumb__eta {
  padding: 0 var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-tight);
  text-align: center;
}

.shot-thumb__status {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-2) var(--space-2);
  color: var(--on-stage);
  background: linear-gradient(transparent, color-mix(in srgb, var(--stage-bg) 90%, transparent));
  pointer-events: none;
}

.shot-thumb__status .shot-thumb__eta { color: inherit; }

.shot-thumb--generating,
.shot-thumb--ready {
  color: var(--accent-bright);
}

.shot-thumb--failed,
.shot-thumb--cancelled {
  color: var(--danger);
}

.shot-thumb .spin {
  animation: spin 1.4s linear infinite;
}

.shot-thumb__progress {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  overflow: hidden;
  background: var(--line);
}

.shot-thumb__progress > i {
  height: 100%;
  display: block;
  background: var(--accent-bright);
  transition: width var(--motion-normal) linear;
}

/* --- The inspector pane -------------------------------------------------------

   One shot, or one scene. Which one is showing is decided by what was clicked
   on the board, and the two never appear at once: a pane that edits a shot
   and its scene side by side is a pane where nobody knows which "length"
   they are looking at. Its width is the splitter's.
   ========================================================================== */

.generator-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-pane);
}

/* The open item heads the pane (ItemHeader). A shot's meta line ends with
   its scene as a quiet link back up. */
.generator-panel__up {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: none;
  font: inherit;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 2px;
}

.generator-panel__up:hover {
  color: var(--text-primary);
  text-decoration-color: currentColor;
}

/* The editable name stays the pane's heading, as it was before the item
   header: an h2 around the input, laid out as the input alone would be. */
.generator-panel__name {
  flex: 1;
  min-width: 0;
  display: flex;
  margin: 0;
  font: inherit;
}

/* An unnamed shot shows its number as the placeholder; it is the name until
   one is typed, so it reads in the name's ink, not a hint's. */
.generator-panel .ui-item-header__input::placeholder {
  color: var(--text-primary);
  opacity: 1;
}

/* The pane's scrolling middle. It takes what the header and action footer
   leave, and scrolls inside it. Its sections run edge to edge, the first one
   straight under the item header. */
.panel-scroll {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.shot-inspector,
.scene-inspector {
  display: flex;
  flex-direction: column;
}

/* A shot's prompt inside the Pose scene's own section: no headers of its
   own, just the fields one under another. */
.shot-inspector--flat {
  gap: var(--space-3);
}

/* The fields in a section breathe a little more than a stack of rows. */
.shot-inspector .ui-prop-section__content,
.scene-settings .ui-prop-section__content {
  gap: var(--space-1);
}

/* Each scene section is the first child of its region, so the shared rule
   drops its top line; the second one needs it back when the first is open
   (a collapsed header already draws that line underneath). */
.scene-settings:has(> .ui-prop-section--open) + .scene-settings > .ui-prop-section > .ui-prop-section__header {
  border-top-color: var(--line);
}

/* Inspector rows (PropRow) inside the pane, and the caption that explains
   one: 12px secondary, indented to line up with the row's value column —
   the label column plus the row's gap, less the 6px the row hangs out by. */
.prop-caption {
  margin: 0 0 var(--space-1);
  padding-left: calc(var(--prop-label) + var(--space-2) - 6px);
  color: var(--text-muted);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
}

.prop-unit {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prop-row__button.icon-button {
  width: var(--control-sm);
  height: var(--control-sm);
  flex: 0 0 auto;
}

/* The full-width fields: a 12px label over a textarea. */
.shot-card__sublabel,
.scene-settings__field > span {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
}

.scene-settings__field {
  display: block;
  margin-top: var(--space-2);
}

.scene-settings__field textarea {
  width: 100%;
  height: auto;
  min-height: 80px;
  padding: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  resize: vertical;
}

.shot-speech {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.shot-speech > .shot-card__sublabel {
  margin-bottom: 0;
}

/* --- Settings on a shot ------------------------------------------------------
   Its own section in the shot's pane; the header names it and counts what is
   set. */

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

.shot-settings__none {
  color: var(--text-faint);
  font-size: var(--text-xs);
  line-height: var(--control-sm);
}

/* A token: 24px, 4px corners, 12px text, a small square remove button. */
.setting-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: var(--control-sm);
  padding: 0 2px 0 var(--space-2);
  border: 1px solid var(--stroke-control);
  border-radius: var(--radius-sm);
  background: var(--fill-control);
  font-size: var(--text-xs);
}

.setting-tag em {
  color: var(--text-muted);
  font-style: normal;
}

.setting-tag b {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

.setting-tag button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  color: var(--text-secondary);
  background: none;
}

.setting-tag button:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--fill-subtle-hover);
}

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

/* --- Inspector actions and compiled prompt -------------------------------- */

.debug-prompt,
.inspector-actions {
  flex: 0 0 auto;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

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

.debug-prompt-dialog__scene {
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

/* Coloured by authorship, because the one thing it must never do is let
   Slopus's own scaffolding read as the user's writing. */
.compiled-prompt__text {
  user-select: text;
  max-height: min(60vh, 560px);
  margin: 0;
  overflow: auto;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--layer-alt);
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prompt-part--brief {
  color: var(--success);
  font-weight: var(--weight-medium);
}

.prompt-part--tag {
  color: var(--accent-bright);
  font-weight: var(--weight-medium);
}

/* --- A narrow board ---------------------------------------------------------
   The agent pane open in a small window leaves the board ~280px. The command
   bar drops its labels (the tooltips still name the commands), the template
   picker narrows, and the scene rows keep the title by dropping the caption
   and the status chip — the status glyph beside the title still carries it. */
@container generator-main (max-width: 440px) {
  .generator-command .generator-runtime__label { display: none; }
  /* Visually hidden, not display:none — the label is the button's
     accessible name. */
  .generator-command .ui-cmd--labelled .ui-cmd__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .generator-command .ui-cmd--labelled { padding-inline: var(--space-2); }
  .generator-template { min-width: 96px; }
  .scene-rule__caption,
  .scene-rule__badge { display: none; }
}


/* Takes sit beside tiles, or in a wrapping row below the shot list. */
.scene-section__content { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: start; gap: var(--space-2); }
.scene-section__content > .shot-grid { min-width: 0; grid-template-columns: repeat(auto-fill, minmax(0, min(var(--shot-tile-width), 100%))); }
.scene-board--list .scene-section__content { grid-template-columns: minmax(0, 1fr); gap: 0; }
.scene-board--list .scene-section__content > .shot-grid { grid-template-columns: minmax(0, 1fr); }
.scene-history { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-2) var(--space-3) 0; }
.scene-board--list .scene-history { flex-direction: row; flex-wrap: wrap; padding: 0 var(--space-3) var(--space-3); }
.scene-board--list .scene-history__take { flex: 0 0 80px; }
.scene-history__take { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-1); min-width: 0; padding: 3px; border: 1px solid var(--stroke-divider); border-radius: var(--radius-sm); color: var(--text-secondary); background: var(--surface-pane); font-size: var(--text-xs); }
.scene-history__take:hover:not(:disabled) { background: var(--fill-subtle-hover); }
.scene-history__take[aria-pressed="true"] { border-color: var(--accent); color: var(--text-primary); background: var(--accent-soft); }
.scene-history__picture { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; background: var(--stage-bg); border-radius: var(--radius-sm); overflow: hidden; }
.scene-history__picture img { width: 100%; height: 100%; object-fit: contain; }
.scene-history__draft .scene-history__picture { background: var(--fill-subtle-hover); }

.scene-generation-controls { display: flex; min-width: 0; }
.scene-generation-controls > .scene-generate-button { flex: 1; }
.scene-generation-controls--split { border: 1px solid var(--button-primary-stroke); border-bottom-color: var(--button-primary-stroke-bottom); border-radius: var(--radius-sm); background: var(--button-primary-bg); }
.scene-generation-controls--split:has(> .scene-generate-button:disabled) { border-color: transparent; background: var(--button-primary-off-bg); }
.scene-generation-controls--split > .primary-button { min-height: calc(var(--control-md) - 2px); border: 0; background: transparent; }
.scene-generation-controls--split > .scene-generate-button { border-radius: calc(var(--radius-sm) - 1px) 0 0 calc(var(--radius-sm) - 1px); }
.scene-generation-controls--split > .scene-generation-options { position: relative; flex: 0 0 var(--control-md); padding: 0; border-radius: 0 calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0; }
.scene-generation-options::before { content: ""; position: absolute; left: 0; top: 25%; bottom: 25%; width: 1px; background: currentColor; opacity: .22; }
.scene-generation-controls--split > .primary-button:hover:not(:disabled), .scene-generation-controls--split > .primary-button[aria-expanded="true"] { background: var(--button-primary-hover); }
.scene-generation-controls--split > .primary-button:active:not(:disabled) { background: var(--button-primary-active); }
/* The arrow shares Generate's neutral state; its separate upscale actions may
   still be available, so retain a neutral hover/pressed affordance. */
.scene-generation-controls--split:has(> .scene-generate-button:disabled) > .scene-generation-options { color: var(--button-primary-off-ink); background: var(--button-primary-off-bg); }
.scene-generation-controls--split:has(> .scene-generate-button:disabled) > .scene-generation-options:is(:hover, [aria-expanded="true"]) { background: var(--fill-subtle-hover); }
.scene-generation-controls--split:has(> .scene-generate-button:disabled) > .scene-generation-options:active { background: var(--fill-subtle-pressed); }
.scene-generation-actions { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3); }