/* Every colour this stylesheet uses is defined here and nowhere else.
   It used to be eleven variables and a hundred and thirty loose literals, most
   of them the same few hues at a different alpha - so a hue could only be
   changed by finding all of its spellings, and the sheet could not be read to
   find out what its palette was.

   From V4 the interface itself has no hue. Ground, panels, type and controls
   are greys and near-black, and the primary action is a black button rather
   than a coloured one: shape already says "this is a button", so spending a
   hue to say it again leaves nothing to say the thing that matters. Green,
   amber and red are left to mean accepted, waiting and rejected. A colour on
   screen is then always a verdict, and nothing about it has to be learned -
   the one green thing on a page is the thing that passed.

   The mark in the corner is the single exception. It is identity, not state:
   it sits outside the work area and never changes colour for any reason, so it
   cannot be misread as a judgement. */
:root {
  color-scheme: light;

  /* The hues as channels, so every tint of one really is a tint of the same
     colour. The two veils are what a theme actually inverts: an overlay that
     darkens a light ground has to become one that lightens a dark one, and
     that is one line here rather than ninety edits. */
  --ink-rgb: 23, 26, 32;
  --accent-rgb: 23, 26, 32;
  --brand-rgb: 178, 107, 0;
  --brand-shade-rgb: 90, 52, 8;
  --teal-rgb: 15, 123, 82;
  --danger-rgb: 192, 35, 24;
  --pending-rgb: 138, 90, 0;
  --veil-rgb: 23, 26, 32;
  --shadow-rgb: 100, 105, 112;

  --ink: rgb(var(--ink-rgb));
  --muted: #5c6169;
  /* The accent is the ink. A filled control is black, not coloured, which is
     what leaves the three signal hues free to mean only what they mean. */
  --accent: rgb(var(--accent-rgb));
  --accent-strong: #000000;
  --brand: rgb(var(--brand-rgb));
  --teal: rgb(var(--teal-rgb));
  --danger: rgb(var(--danger-rgb));
  --pending: rgb(var(--pending-rgb));
  --selected-ok: #7ee2b8;
  --selected-wait: #f0c374;
  --selected-no: #ffb3ab;
  --offline: #9aa0a8;
  --line: rgba(var(--ink-rgb), 0.12);

  /* Text sitting on a filled colour rather than on the ground, which is the one
     place a theme must not simply follow --ink. */
  --on-accent: #ffffff;
  --on-brand: #fff8ee;
  --on-teal: #0d5c3d;
  --on-danger: #8f1a12;

  /* The ladder, from the page itself up to what floats above it. */
  --ground: #fafafa;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --surface-raised: #ffffff;
  --card: #ffffff;
  --field: #ffffff;
  --dialog: #ffffff;
  --dialog-dim: #f4f5f6;
  --gate-card: #ffffff;
  --gate-scrim: rgba(250, 250, 250, 0.97);
  --toast: #eceef0;
  --toast-error: #fceceb;
  /* Behind a picture or a video, so it is what shows through whatever has not
     loaded yet or does not fill its box. */
  --media-well: #eceef0;
  --media-well-soft: #f2f3f5;

  /* Off-palette, and the only two left: both predate the rest and neither is a
     tint of any hue above. A theme will want them replaced, not converted. */
  --panel-line: rgba(23, 26, 32, 0.18);
  --override-wash: rgba(138, 90, 0, 0.12);

  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", system-ui, "PingFang SC", "Noto Sans SC", sans-serif;
}

/* The dark palette, twice, because CSS cannot name a block and reuse it: once
   for a machine that asked for dark, once for a person who did. Light is the
   default now. Dark used to be, on the argument that the console is looked at
   in a dim room beside a render - true of a grading suite, and not true of this
   page, which is mostly text being read for minutes at a time. It was rejected
   in use as tiring, so it is a choice rather than the ground state.

   The two blocks have to stay identical, and the stylesheet test checks that
   rather than trusting it. Only the values that are written out need repeating:
   --ink, --accent, --line and the rest are defined in terms of the channels
   above, so they follow on their own.

   Everything derived from --veil-rgb and --shadow-rgb is a translucent overlay
   whose alpha was chosen once and is fixed at its use site. The veil inverts -
   ink darkening a light panel becomes white lifting a dark one - and the shadow
   goes from a soft grey, which reads as depth on paper, to black. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --ink-rgb: 242, 243, 245;
    --accent-rgb: 242, 243, 245;
    --brand-rgb: 240, 169, 74;
    --brand-shade-rgb: 120, 74, 8;
    --teal-rgb: 63, 201, 141;
    --danger-rgb: 242, 105, 92;
    --pending-rgb: 224, 169, 74;
    --veil-rgb: 255, 255, 255;
    --shadow-rgb: 0, 0, 0;

    --muted: #a4a9b2;
    --accent-strong: #ffffff;
    --offline: #767b84;

    --on-accent: #15171b;
    --on-brand: #2b1a05;
    --on-teal: #9ce9c6;
    --on-danger: #ffb3ab;
    --selected-ok: #0d5c3d;
    --selected-wait: #8a5a00;
    --selected-no: #8f1a12;

    --ground: #15171b;
    --surface: rgba(29, 32, 38, 0.82);
    --surface-strong: #1d2026;
    --surface-raised: #1a1d22;
    --card: #1a1d22;
    --field: #1a1d22;
    --dialog: #1d2026;
    --dialog-dim: #17191e;
    --gate-card: #1d2026;
    --gate-scrim: rgba(21, 23, 27, 0.97);
    --toast: #24272e;
    --toast-error: #3a1c19;
    --media-well: #07090b;
    --media-well-soft: #0d0f12;

    --panel-line: rgba(242, 243, 245, 0.22);
    --override-wash: rgba(224, 169, 74, 0.15);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;

  --ink-rgb: 242, 243, 245;
  --accent-rgb: 242, 243, 245;
  --brand-rgb: 240, 169, 74;
  --brand-shade-rgb: 120, 74, 8;
  --teal-rgb: 63, 201, 141;
  --danger-rgb: 242, 105, 92;
  --pending-rgb: 224, 169, 74;
  --veil-rgb: 255, 255, 255;
  --shadow-rgb: 0, 0, 0;

  --muted: #a4a9b2;
  --accent-strong: #ffffff;
  --offline: #767b84;

  --on-accent: #15171b;
  --on-brand: #2b1a05;
  --on-teal: #9ce9c6;
  --on-danger: #ffb3ab;
  --selected-ok: #0d5c3d;
  --selected-wait: #8a5a00;
  --selected-no: #8f1a12;

  --ground: #15171b;
  --surface: rgba(29, 32, 38, 0.82);
  --surface-strong: #1d2026;
  --surface-raised: #1a1d22;
  --card: #1a1d22;
  --field: #1a1d22;
  --dialog: #1d2026;
  --dialog-dim: #17191e;
  --gate-card: #1d2026;
  --gate-scrim: rgba(21, 23, 27, 0.97);
  --toast: #24272e;
  --toast-error: #3a1c19;
  --media-well: #07090b;
  --media-well-soft: #0d0f12;

  --panel-line: rgba(242, 243, 245, 0.22);
  --override-wash: rgba(224, 169, 74, 0.15);
}

* { box-sizing: border-box; }

/* `hidden` means the element is not there, and nothing in this sheet gets to
   disagree. The browser's own `[hidden] { display: none }` is weaker than any
   class selector that sets `display`, so every panel with a layout - a grid, a
   flex row - silently outranked it, and `el.hidden = true` became a no-op.

   That was patched one class at a time, twenty-one times, and four were missed:
   the two prompt boxes for a mode the shot was not in showed up anyway (and the
   text typed into them was discarded on save), 设置 appeared for accounts that
   cannot open it, and the model picker appeared with one model to pick. Each
   miss was invisible until someone hit it, because the JS looked correct - it
   set `.hidden`, and the assignment worked.

   One rule that cannot be outranked ends the whole category. `!important` is
   the right instrument here for once: there is no design in which an element
   marked hidden should still be laid out. */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: -0.003em;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.brand strong, .brand small { display: block; }
.brand strong { font-weight: 600; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 18px;
  font-weight: 700;
}
.brand-mark.large { width: 58px; height: 58px; font-size: 32px; margin-bottom: 14px; }

/* Which pipeline step the server is running. The auto right margin keeps the
   badge beside the logo instead of letting space-between centre it. */
.version-badge {
  margin: 0 auto 0 14px;
  padding: 1px 7px;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--offline); }
.connection[data-state="online"] .connection-dot { background: var(--teal); box-shadow: 0 0 0 5px rgba(var(--teal-rgb), 0.12); }
.connection[data-state="error"] .connection-dot { background: var(--danger); }
/* No local ComfyUI where none was ever meant to be: a state, not a fault, so
   it keeps the neutral dot rather than borrowing the red one. */
.connection[data-state="idle"] .connection-dot { background: var(--offline); }

/* Three columns: what to work on, the work, and the agent watching it. The page
   used to be one scroll containing every capability at the same level. */
/* The window is the frame, and each column scrolls inside it.
 *
 * An earlier attempt at this was taken back out: pinning the columns produced
 * three scrollbars - the page, the rail, and inside the dock both the status
 * block and the conversation - each one making something shorter than it had
 * been. The difference now is where the scrolling goes. The shell is exactly
 * the window's height, so the page never scrolls at all, and each column has
 * one scroller and not two: the dock's status block and its conversation move
 * together inside a single one.
 *
 * That is what lets the middle column keep a head that stays put. Where you
 * are, how far the open shot has got and what the card is doing right now are
 * all needed *while* reading the thing below them.
 *
 * `min-height: 0` on the children is not decoration: a grid item's default
 * minimum is its content, so without it a column simply grows and the overflow
 * never engages - the failure looks like a stylesheet that was never written. */
.app-shell {
  --rail-w: 212px;
  --dock-w: 310px;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--dock-w);
  height: 100vh;
}
.app-shell > * { min-height: 0; min-width: 0; }
.app-shell[data-rail="off"] { --rail-w: 56px; }
.app-shell[data-dock="off"] { --dock-w: 0px; }
.app-shell[data-dock="off"] .dock { display: none; }
/* Collapsed, the rail keeps the one thing it is for: which workspace is which.
   Everything that only makes sense with a label goes. */
.app-shell[data-rail="off"] .rail { padding: 24px 8px; }
.app-shell[data-rail="off"] .rail-text { display: none; }
.app-shell[data-rail="off"] .rail-identity,
.app-shell[data-rail="off"] .brand,
.app-shell[data-rail="off"] .version-badge,
.app-shell[data-rail="off"] .rail-theme,
.app-shell[data-rail="off"] .project-picker,
.app-shell[data-rail="off"] .rail-project-facts,
.app-shell[data-rail="off"] .rail-new-project,
.app-shell[data-rail="off"] .rail-label,
.app-shell[data-rail="off"] .system-card,
.app-shell[data-rail="off"] .connection { display: none; }
.app-shell[data-rail="off"] .rail-nav,
.app-shell[data-rail="off"] .rail-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
.rail { grid-column: 1; grid-row: 1; position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px 10px; background: var(--dialog-dim); overflow-y: auto; overflow-x: hidden; }
.rail-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 5px; }
.rail .version-badge { margin: 0; }
.rail .project-picker-toggle { min-width: 0; width: 100%; }
.rail-group { display: flex; flex-direction: column; gap: 3px; }
.rail-label { margin: 0 0 6px 10px; color: var(--muted); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.rail-nav { display: flex; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13.5px; text-align: left; }
.rail-nav:hover { background: rgba(var(--veil-rgb), 0.04); color: var(--ink); }
.rail-nav[aria-current="true"] { background: rgba(var(--accent-rgb), 0.12); color: var(--accent-strong); font-weight: 650; }
.rail-count { margin-left: auto; color: var(--muted); font-size: 11px; }
/* Three states rather than two: following the machine is a choice, and without
   a way back to it a choice made once can never be taken back. */
/* Under the version badge rather than at the foot of the rail: it belongs with
   what this console *is*, not with what it is doing. */
.rail-theme { width: 100%; padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 11.5px; }
.rail-theme:hover { border-color: rgba(var(--accent-rgb), 0.45); color: var(--ink); }
/* One action per line. Both are text-buttons, which are inline, and the result
   line that used to separate them is hidden until one of them has been used. */
.memory-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
/* Packed under the navigation, not pushed to the floor.
 *
 * `margin-top: auto` put it at the bottom of the rail, which was fine when the
 * rail was a page long and nobody looked. Now the rail is a window tall, and
 * the gap it opens is a window of nothing between 成片 and the gauges - the
 * useful part chased to the bottom edge by empty space. Reading them should not
 * cost a scroll. */
.rail .system-card { padding: 14px; border-radius: 15px; }
.rail .system-grid { grid-template-columns: 1fr; gap: 6px; }
.rail .system-grid div { padding: 9px 11px; }
.rail .connection { justify-content: center; }

.workarea { grid-column: 2; grid-row: 1; min-width: 0; display: flex; flex-direction: column; }
/* The shot list: one line each, showing how far it has got. */
.shot-entry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 11px; }
.shot-entry-tools { flex: none; display: flex; align-items: center; gap: 6px; }
.shot-move, .shot-remove { padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 12px; }
.shot-move { width: 32px; }
.shot-move:disabled { opacity: 0.3; }
.shot-move:not(:disabled):hover, .shot-remove:hover { border-color: rgba(var(--accent-rgb), 0.45); color: var(--ink); }
.shot-row { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; padding: 15px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-raised); color: inherit; text-align: left; }
.shot-row:hover { border-color: rgba(var(--accent-rgb), 0.45); }
.shot-row-body { flex: 1; min-width: 0; }
.shot-row-body strong { display: block; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-row-body small { display: block; margin-top: 5px; color: var(--muted); font-size: 11.5px; }
.shot-row-steps { flex: none; display: flex; gap: 4px; }
.shot-row-step { width: 26px; height: 5px; border-radius: 99px; background: rgba(var(--veil-rgb), 0.12); }
.shot-row-step.is-accepted { background: var(--teal); }
.shot-row-step.is-pending { background: var(--pending); }
.shot-row-step.is-rejected { background: var(--danger); }
.shot-row-state { flex: none; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11.5px; }
.shot-row-state[data-status="accepted"] { border-color: rgba(var(--teal-rgb), 0.4); color: var(--teal); }
.shot-row-state[data-status="rejected"] { border-color: rgba(var(--danger-rgb), 0.45); color: var(--danger); }
.shot-row-state[data-status="pending"] { border-color: rgba(var(--pending-rgb), 0.45); color: var(--pending); }

/* Video model, duration and size belong together above the prompt. */
.video-settings-panel .asset-field { margin-bottom: 0; }
.video-settings-panel .asset-warning { margin: 10px 0 0; }
.video-cost { margin: 9px 0 0; color: var(--muted); font-size: 11.5px; }
.video-cost[data-fits="false"] { color: var(--danger); }

/* What a shot is made of, before how far it has got. A shot names its pictures
   by role, so without this the card could show every prompt and not one of the
   pictures those prompts are written against. */
.shot-assets { margin: 0; min-width: 0; }
.shot-assets-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 11px; color: var(--muted); font-size: 11.5px; }
.shot-assets-list { display: flex; gap: 10px; flex-wrap: wrap; }
.shot-assets-empty { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.shot-asset { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--dialog-dim); }
.shot-asset > div { min-width: 0; overflow-wrap: anywhere; }
.shot-asset img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: var(--media-well); cursor: zoom-in; }
.shot-asset strong { display: block; font-size: 12.5px; }
.shot-asset small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.shot-asset-slot { padding: 2px 7px; border-radius: 6px; background: rgba(var(--veil-rgb), 0.07); color: var(--muted); font-size: 10px; }
.shot-asset[data-missing="true"] { border-color: rgba(var(--danger-rgb), 0.45); background: rgba(var(--danger-rgb), 0.07); }
.shot-asset[data-missing="true"] small { color: var(--danger); }

.shot-assets-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.shot-assets-picker .reference-group { grid-column: 1 / -1; }
.shot-asset-option { position: relative; display: grid; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(var(--shadow-rgb), 0.18); color: inherit; text-align: left; }
.shot-asset-option img { width: 100%; aspect-ratio: 1; border-radius: 9px; object-fit: cover; background: var(--media-well); }
.shot-asset-option span { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-asset-option[data-chosen="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.shot-asset-order { position: absolute; top: 12px; left: 12px; display: grid; place-items: center; min-width: 21px; height: 21px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 11px; font-style: normal; font-weight: 700; }
.shot-asset-option[data-chosen="false"] .shot-asset-order { display: none; }
.shot-assets-actions { display: flex; justify-content: flex-end; gap: 10px; }
/* The prototype's .mats / .mat: 76px tiles in one wrapping row, the chosen ones
   outlined in ink, and 上传 as a dashed tile at the end of the same row. */
.shot-inline-picker { display: flex; flex-wrap: wrap; gap: 6px; max-height: 24rem; padding: 0; }
/* One tile holds two controls: the whole picture chooses, the corner looks. */
.shot-asset-tile { position: relative; display: grid; }
.shot-inline-picker .shot-asset-tile { width: 76px; }
.shot-asset-tile .shot-asset-option { width: 100%; }
.asset-zoom-button { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: var(--ink); color: var(--ground); font-size: 11px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity 120ms ease; }
.shot-asset-tile:hover .asset-zoom-button,
.asset-zoom-button:focus-visible { opacity: 1; }
/* Touch has no hover, so the corner is simply there. */
@media (hover: none) { .asset-zoom-button { opacity: 1; } }
/* Files may be dropped onto the whole picker, not only onto 上传. */
.shot-reference-controls[data-dropping="true"] { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 10px; }
/* 产物: what the shots made, filed under the shot rather than by what it is. */
.product-list { display: grid; gap: 10px; }
.product-shot { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.product-shot > summary { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.product-shot > summary span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-unit { margin-top: 10px; }
.product-unit-head { margin: 0 0 6px; color: var(--muted); font-size: 11.5px; }
.product-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.product-tile { display: grid; gap: 2px; width: 104px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--media-well-soft); color: inherit; cursor: pointer; overflow: hidden; }
.product-tile:hover { border-color: var(--ink); }
.product-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--media-well); color: var(--muted); font-size: 11px; }
.product-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product-play { position: absolute; right: 4px; bottom: 4px; padding: 0 5px; border-radius: 4px; background: var(--ink); color: var(--ground); font-size: 9px; font-style: normal; }
.product-tile small { padding: 0 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-tile .product-state:not(:empty) { padding-bottom: 4px; color: var(--teal); }

.library-picker-list { display: flex; flex-wrap: wrap; gap: 10px; max-height: 60vh; overflow-y: auto; margin: 10px 0; }
.library-picker-list .reference-group { flex-basis: 100%; }
.library-picker-list .shot-asset-tile { width: 96px; }
.library-dialog .form-dialog-body { max-width: 620px; }
.asset-zoom-dialog .form-dialog-body { max-width: min(90vw, 900px); }
.asset-zoom-dialog .form-dialog-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.asset-zoom-dialog .asset-zoom-button { position: static; width: 28px; height: 28px; font-size: 14px; opacity: 1; }
.asset-zoom-frame { display: grid; place-items: center; max-height: 70vh; overflow: auto; border-radius: 10px; background: var(--media-well); }
.asset-zoom-frame img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.shot-library-tile { grid-template-rows: 72px auto; font: inherit; }
.shot-inline-picker .reference-group,
.shot-inline-picker .shot-assets-empty { flex-basis: 100%; }
.shot-inline-picker .shot-asset-option { width: 76px; align-content: start; gap: 0; padding: 0; border: 2px solid transparent; border-radius: 6px; background: var(--media-well-soft); overflow: hidden; }
.shot-inline-picker .shot-asset-option[data-chosen="true"] { border-color: var(--ink); background: var(--media-well-soft); }
.shot-inline-picker .shot-asset-option[data-missing="true"] { width: auto; padding: 4px 8px; border-color: var(--danger); }
.shot-inline-picker .shot-asset-option img { border-radius: 0; }
.shot-inline-picker .shot-asset-option span { padding: 4px 2px; font-size: 10px; text-align: center; color: var(--muted); }
.shot-inline-picker .shot-asset-option[data-chosen="true"] span { color: var(--ink); font-weight: 600; }
.shot-inline-picker .shot-asset-order { top: 3px; left: 3px; min-width: 18px; height: 18px; font-size: 10px; }
.shot-upload-tile { position: relative; display: grid; grid-template-rows: 72px auto; width: 76px; border: 2px dashed var(--line); border-radius: 6px; color: var(--muted); text-align: center; cursor: pointer; }
.shot-upload-tile > span { display: grid; place-items: center; font-size: 20px; line-height: 1; }
.shot-upload-tile small { padding: 4px 2px; font-size: 10px; }
.shot-upload-tile:hover { border-color: var(--ink); color: var(--ink); }
.shot-upload-tile:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.shot-upload-tile input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.shot-asset-option[data-missing="true"] { color: var(--danger); border-color: var(--danger); overflow-wrap: anywhere; }
.shot-material-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.shot-upload-button { position: relative; display: inline-flex; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 6px; cursor: pointer; font-size: 12px; color: var(--muted); }
.shot-upload-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.shot-upload-button:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.shot-assets-error:empty, .shot-media-error:empty { display: none; }
.shot-media-picker { min-width: 0; }

/* The stepper: a shot is a pipeline, not a pile of buttons. */
.shot-back-button { margin-left: auto; }
.stepper { display: flex; margin: 18px 0; border: 1px solid var(--line); border-radius: 16px; background: rgba(var(--veil-rgb), 0.02); overflow: hidden; }
.step { flex: 1; min-width: 0; padding: 13px 16px; border: 0; border-right: 1px solid var(--line); background: transparent; color: inherit; text-align: left; position: relative; }
.step:last-child { border-right: 0; }
.step:hover { background: rgba(var(--veil-rgb), 0.03); }
.step[aria-current="true"] { background: rgba(var(--accent-rgb), 0.1); }
.step[aria-current="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--accent); }
.step-index { display: block; color: var(--muted); font-size: 10.5px; }
.step strong { display: block; margin-top: 5px; font-size: 14px; }
.step-state { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.step[data-status="accepted"] .step-state { color: var(--teal); }
.step[data-status="pending"] .step-state { color: var(--pending); }
.step[data-status="rejected"] .step-state { color: var(--danger); }
.step-intro { margin: 0 0 16px; max-width: 66ch; color: var(--muted); font-size: 12.5px; line-height: 1.75; }
.step-intro b { color: var(--ink); font-weight: 600; }

/* Every step reports itself the same way: what is happening, and if it went
   wrong, which way to go about it. Stays until the next run replaces it. */
.step-run { margin: 16px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(var(--veil-rgb), 0.02); }
.step-run-head { display: flex; align-items: center; gap: 11px; }
.step-run-head strong { font-size: 13px; }
.step-run-head small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.step-run-cancel { flex: none; padding: 3px 10px; font-size: 11.5px; }
.step-run[data-status="running"], .step-run[data-status="queued"] { border-color: rgba(var(--accent-rgb), 0.3); }
.step-run[data-status="completed"] .step-run-head strong { color: var(--teal); }
.step-run[data-status="failed"] { border-color: rgba(var(--danger-rgb), 0.4); background: rgba(var(--danger-rgb), 0.06); }
.step-run[data-status="failed"] .step-run-head strong { color: var(--danger); }
.step-run[data-status="interrupted"] .step-run-head strong { color: var(--pending); }

/* ComfyUI's own bar, read from the file its stdout goes to. A MiniMax clip
   takes sixteen minutes, which is far too long for a spinner to be an answer. */
.step-progress { margin-top: 12px; }
.step-progress-track { height: 6px; border-radius: 99px; background: rgba(var(--veil-rgb), 0.09); overflow: hidden; }
.step-progress-track i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 400ms ease; }
.step-progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 7px; }
.step-progress-label span { font-size: 12px; }
.step-progress-label small { color: var(--muted); font-size: 11px; }

.step-run-failure { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.failure-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; letter-spacing: 0.04em; }
.failure-chip[data-category="content"] { background: rgba(var(--pending-rgb), 0.16); color: var(--pending); }
.failure-chip[data-category="environment"] { background: rgba(var(--danger-rgb), 0.16); color: var(--danger); }
.failure-chip[data-category="unknown"] { background: rgba(var(--veil-rgb), 0.07); color: var(--muted); }
.failure-reason { margin: 9px 0 0; font-size: 13px; line-height: 1.7; }
.failure-next { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.failure-raw { margin-top: 10px; }
.failure-raw summary { color: var(--muted); font-size: 11.5px; cursor: pointer; }
.failure-raw pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(var(--shadow-rgb), 0.28); color: var(--muted); font-size: 11.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.shot-meta { display: flex; align-items: end; gap: 14px; margin-bottom: 18px; }
.shot-meta .automation-state { flex: 1; margin: 0; }
.shot-meta .seed-field { flex: none; }

.final-placeholder { padding: 22px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* 成片顺序：一段一行 —— 位置、首帧、哪一段、时长、视频状态、挪动。 */
.final-cut { display: grid; gap: 12px; }
.final-cut-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.final-cut-summary { margin: 0; color: var(--ink); font-size: 13px; }
.final-film-files { display: grid; gap: 7px; }
.final-film-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--media-well-soft); }
.final-film-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.final-film-row span { color: var(--muted); font-size: 12px; }
@media (max-width: 640px) { .final-film-row { grid-template-columns: minmax(0, 1fr) auto; } .final-film-row span { grid-column: 1; } }
.final-cut-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.final-cut-row { display: grid; grid-template-columns: 32px 96px minmax(0, 1fr) 64px 130px 64px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--media-well-soft); }
@media (max-width: 760px) {
  .final-cut-row { grid-template-columns: 28px 72px minmax(0, 1fr); }
  .final-cut-duration, .final-cut-status, .final-cut-moves { grid-column: 3; }
}
.final-cut-position { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.final-cut-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--media-well); }
.final-cut-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.final-cut-body { display: grid; gap: 2px; min-width: 0; }
.final-cut-body small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.final-cut-duration { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.final-cut-status { justify-self: start; padding: 1px 8px; border-radius: 99px; background: var(--ink); color: var(--ground); font-size: 11px; }
.final-cut-row[data-status="accepted"] .final-cut-status { background: var(--teal); color: var(--on-accent); }
.final-cut-row[data-status="pending"] .final-cut-status { background: var(--pending); color: var(--on-accent); }
.final-cut-row[data-status="rejected"] .final-cut-status, .final-cut-row[data-status="missing"] .final-cut-status { background: var(--danger); color: var(--on-accent); }
.final-cut-moves { display: flex; justify-content: flex-end; gap: 2px; }

.dock { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; gap: 13px; padding: 24px 18px; border-left: 1px solid var(--line); overflow-y: auto; }
/* The reference half of the panel, given a share of the window rather than all
   the room it wants.
 *
 * Pinning the dock to the window fixed the page growing without end and left a
 * worse problem behind: the five status fields, the picker and the hint are
 * about 530 pixels of fixed content, so on a shorter window they took
 * everything and the conversation was squeezed to its floor - a scroll box too
 * short to hold one message, inside a second scrollbar for the dock itself.
 *
 * Capped and scrollable, it yields first. Reference is worth reading once; a
 * reply is worth reading now. */
/* Grouped, and nothing more: the cap and the scrollbar that were here made a
   second scroll region inside a panel that already had one. */
.dock-brief { display: flex; flex-direction: column; gap: 13px; }
.dock-head h2 { margin: 0 0 8px; font-size: 15px; }
.dock-shot-picker { display: grid; gap: 6px; color: var(--muted); font-size: 11.5px; }
.dock-shot-picker select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); }

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.system-card, .jobs-section {
  border: 1px solid var(--line);
  background: var(--surface-raised);
}
.system-card { padding: 24px; border-radius: var(--radius); }
.system-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.system-card-head > span { font-weight: 750; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--accent); }
.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.system-grid div { padding: 14px; background: rgba(var(--veil-rgb), 0.035); border-radius: 14px; }
.system-grid dt { color: var(--muted); font-size: 12px; }
.system-grid dd { margin: 7px 0 0; font-size: 15px; font-weight: 750; overflow-wrap: anywhere; }

.jobs-section { padding: 32px; border-radius: 28px; margin-bottom: 28px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 34px; font-weight: 500; }
.section-note { margin: 0; max-width: 320px; color: var(--muted); text-align: right; font-size: 13px; }
.project-picker { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.project-picker-field { position: relative; }
.project-picker-toggle, .seed-field input, .review-panel input, .token-card input {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}
.project-picker-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 230px; padding: 11px 13px; font: inherit; text-align: left; cursor: pointer;
}
.project-picker-toggle:disabled { cursor: default; opacity: 0.6; }
.project-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-picker-arrow { flex: none; opacity: 0.7; font-size: 11px; }
input:focus, select:focus, .project-picker-toggle:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.7); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}
/* The list this button opens: our own colours throughout, the same in every browser - unlike a
   native <select>'s popup, which Chrome and Firefox each colour their own way regardless of this
   stylesheet. Plain background is the page's own neutral surface, not stark white; the highlighted
   row matches the app's own accent (used for every other "selected" state), not a browser blue. */
.project-picker-menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 60vh; overflow-y: auto; margin: 0; padding: 6px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--dialog-dim); box-shadow: 0 14px 40px rgba(var(--shadow-rgb), 0.22);
}
.project-picker-option {
  display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.project-picker-option:hover, .project-picker-option:focus-visible {
  background: var(--accent); color: var(--on-accent); outline: none;
}
.project-picker-option[aria-selected="true"] { font-weight: 650; }
.project-picker-row { position: relative; display: flex; align-items: center; gap: 4px; }
/* The whole name is shown, wrapped over as many lines as it needs: the rail is narrow and the names are long. */
.project-picker-row .project-picker-option { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.project-picker-row[data-archived="true"] .project-picker-option { color: var(--muted); }
/* The button lies over the end of the row, and only while the row is pointed at, so it never takes room from the
   name. Where there is no pointer (a phone) it sits in the row, always there, as there is nothing to hover. */
.project-picker-archive {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--dialog-dim);
  color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; opacity: 0; pointer-events: none;
}
.project-picker-row:hover .project-picker-archive, .project-picker-row:focus-within .project-picker-archive {
  opacity: 1; pointer-events: auto;
}
.project-picker-archive:hover, .project-picker-archive:focus-visible { background: var(--line); color: var(--ink); outline: none; }
@media (hover: none) {
  .project-picker-archive { position: static; transform: none; flex: none; opacity: 0.8; pointer-events: auto; border: 0; background: transparent; }
}
.project-picker-archived-toggle {
  display: block; width: 100%; margin-top: 6px; padding: 9px 10px; border: 0; border-top: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-size: 12px; text-align: left; cursor: pointer;
}
.project-picker-archived-toggle:hover, .project-picker-archived-toggle:focus-visible { color: var(--ink); outline: none; }

.project-summary { display: flex; align-items: center; gap: 12px; padding: 20px 0 26px; border-top: 1px solid var(--line); }
.project-summary > div:first-child { margin-right: auto; }
.summary-label { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.project-summary h3 { margin: 0; font-size: 19px; }
.summary-chip, .duration-chip { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.automation-summary[data-state="completed"] { color: var(--teal); }
.automation-summary[data-state="needs_human"] { color: var(--danger); }
.capability-summary[data-ready="true"] { color: var(--teal); }
.capability-summary[data-ready="false"] { color: var(--pending); }

.reference-panel { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 18px; align-items: center; margin: 0 0 22px; padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(var(--veil-rgb), 0.025); }
/* An uploaded asset has to be able to say what it is, or the whole library is
   characters and the filter has one button. */
.reference-upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-weight: 750; cursor: pointer; }
.reference-upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* Three-up regardless of width was the bug: this list sits in the middle
   column, between the sidebar and the agent dock, so it is far narrower than
   the viewport a media query can see. At 1280px the cards came out 195px wide
   and the text column inside each one was left with 18px - every name showed
   as a single letter. auto-fill asks the container instead, so the count drops
   to whatever still leaves a card worth reading. */
.reference-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.reference-group { grid-column: 1 / -1; margin-top: 6px; color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.reference-group:first-child { margin-top: 0; }

/* Asset studio: the same anatomy every generating step uses. */
.asset-studio { margin: 0 0 22px; }
.asset-studio-panel { border: 1px solid var(--line); border-radius: 17px; background: rgba(var(--veil-rgb), 0.025); }
.asset-studio-panel > summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; }
.asset-studio-panel > summary h3 { margin: 0; font-size: 17px; }
.candidate-count { margin-left: auto; padding: 4px 10px; border: 1px solid rgba(var(--accent-rgb), 0.4); border-radius: 999px; color: var(--accent); font-size: 11px; }
.asset-form, .candidate-area { padding: 0 18px 18px; }
.asset-block { padding: 16px 0; border-top: 1px solid var(--line); }
.asset-block-label { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; color: var(--muted); font-size: 11px; letter-spacing: 0.1em; }
.asset-block-label .idx { display: grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: rgba(var(--veil-rgb), 0.07); font-size: 10px; letter-spacing: 0; }
.asset-row { display: flex; gap: 14px; flex-wrap: wrap; }
.asset-row .asset-field { flex: 1; min-width: 170px; }
.asset-field { display: grid; gap: 7px; margin-bottom: 13px; }
.asset-field > span { color: var(--muted); font-size: 12px; }
.asset-field textarea, .asset-field input, .asset-field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--field); color: var(--ink); }
.asset-field textarea { resize: vertical; line-height: 1.6; }
.asset-hint { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.asset-run { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.asset-form .step-run { margin: 0 0 10px; }
.asset-spinner { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid rgba(var(--accent-rgb), 0.25); border-top-color: var(--accent); animation: asset-spin 0.8s linear infinite; }
@keyframes asset-spin { to { transform: rotate(360deg); } }
.candidate-area { border-top: 1px solid var(--line); padding-top: 16px; }
.asset-warning { margin: 0 0 13px; padding: 9px 11px; border-left: 3px solid var(--pending); border-radius: 9px; background: rgba(var(--pending-rgb), 0.1); color: var(--pending); font-size: 11.5px; line-height: 1.6; }
.candidate-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.candidate { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 11px; padding: 11px; border: 1px solid var(--line); border-radius: 13px; background: rgba(var(--veil-rgb), 0.03); }
.candidate img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--media-well-soft); }
.candidate strong { display: block; font-size: 12.5px; }
.candidate small { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.candidate-prompt { margin: 7px 0; color: var(--muted); font-size: 11px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.candidate-role { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); font-size: 11.5px; }
.candidate-actions { display: flex; gap: 7px; margin-top: 8px; }
.candidate-actions button { flex: 1; padding: 7px 9px; font-size: 11.5px; border-radius: 9px; }
.refreshed-at {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* How full the card and the machine are. The weights alone take about two
   thirds of the card, so this is usually the answer to why a run failed. */
.memory-gauges { display: grid; gap: 9px; margin-top: 12px; }
.memory-gauge > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.memory-gauge span { color: var(--muted); font-size: 11px; }
.memory-gauge small { font-size: 11px; }
.memory-gauge-track { height: 5px; border-radius: 99px; background: rgba(var(--veil-rgb), 0.09); overflow: hidden; }
.memory-gauge-track i { display: block; height: 100%; border-radius: 99px; background: var(--teal); transition: width 500ms ease; }
.memory-gauge[data-low="true"] .memory-gauge-track i { background: var(--pending); }
.memory-gauge[data-low="true"] small { color: var(--pending); }

.comfy-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.85;
}

.system-card-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.project-id {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  opacity: 0.7;
}

.edit-chip {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid currentColor;
  opacity: 0.8;
}

.reference-role {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.reference-role select {
  font: inherit;
  padding: 0.1rem 0.3rem;
}

/* Typed, because a list of names that already exist cannot produce the first
   one. It takes the rest of its row: 11ch was a guess made when this shared a
   text column with the file name, and in a 195px card it rendered as a box too
   small to read one's own name back out of. */
.reference-role-input {
  font: inherit;
  min-width: 6ch;
  flex: 1 1 auto;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-size: 11px;
}
.reference-role-input:focus { border-color: var(--accent); outline: none; }
.reference-role-input:disabled { opacity: 0.5; }

.reference-role-warning {
  flex-basis: 100%;
  color: var(--pending);
  opacity: 0.9;
}

.prompt-panel {
  margin: 0.75rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
}

.prompt-panel summary {
  cursor: pointer;
  font-size: 0.9rem;
}

.prompt-field {
  position: relative;
  display: block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

/* Prompt fields grow with their contents, including adopted drafts and changes
   in column width. Very long text scrolls instead of filling the whole page. */
.prompt-field textarea {
  display: block;
  width: 100%;
  min-height: calc(3.2em + 22px);
  max-height: 24rem;
  field-sizing: content;
  overflow-y: auto;
  margin-top: 0.2rem;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  resize: vertical;
}

.prompt-override-notice,
.prompt-override-preview {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  background: var(--override-wash);
  font-size: 0.8rem;
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.prompt-hint {
  opacity: 0.7;
}

.reference-empty { grid-column: 1 / -1; padding: 14px; border-radius: 12px; background: rgba(var(--shadow-rgb), 0.12); color: var(--muted); font-size: 12px; text-align: center; }
/* Filtering and picking several at once, for a library that holds sixty. */
.reference-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.reference-filter { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 11.5px; }
.reference-filter:hover { color: var(--ink); }
.reference-filter[aria-pressed="true"] { border-color: rgba(var(--accent-rgb), 0.5); background: rgba(var(--accent-rgb), 0.12); color: var(--accent-strong); }
.reference-selection { display: flex; align-items: center; gap: 11px; margin-left: auto; font-size: 11.5px; }
.reference-selection > span { color: var(--accent); }
.reference-selection .reference-remove[data-armed="true"] { border-color: var(--danger); background: rgba(var(--danger-rgb), 0.16); }
.reference-panel .asset-warning { grid-column: 1 / -1; }

.reference-tick { width: 16px; height: 16px; accent-color: var(--accent); }
.reference-item { display: grid; grid-template-columns: auto 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px; border-radius: 13px; background: rgba(var(--shadow-rgb), 0.16); }
/* The role field gets the whole width of the card, on its own row. It used to
   share the one text column with the file name and the size line, which is a
   field you type into competing for room with two labels you only read. */
.reference-item > .reference-role { grid-column: 1 / -1; }
.reference-item[data-follow="true"] { box-shadow: inset 0 0 0 2px rgba(var(--teal-rgb), 0.7); }
.reference-item[data-selected="true"] { background: rgba(var(--accent-rgb), 0.12); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35); }
.reference-item img { cursor: zoom-in; }
.reference-item img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--media-well); }
.reference-item strong, .reference-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-item strong { font-size: 12px; }
.reference-item small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.reference-remove { padding: 7px 9px; border: 1px solid rgba(var(--danger-rgb), 0.28); border-radius: 9px; background: transparent; color: var(--danger); font-size: 11px; }

/* The cast: which media sits in which numbered slot. Every slot is drawn,
   filled or not, because the tag on an empty one is the number a picture would
   be given, and that is exactly what someone is about to decide. */
.media-cast { display: grid; gap: 10px; }
.media-cast-strip { display: grid; gap: 8px; }
.media-cast-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.media-cast-row[data-ready="false"] { opacity: 0.45; pointer-events: none; }
.media-cast-slot {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 6px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(var(--shadow-rgb), 0.16);
  color: var(--muted);
  font: inherit;
  text-align: center;
}
.media-cast-slot[data-filled="true"] {
  border-style: solid;
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--ink);
  cursor: pointer;
}
.media-cast-slot[data-missing="true"] {
  border-color: var(--danger);
  background: rgba(var(--danger-rgb), 0.12);
}
.media-cast-slot img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--media-well);
}
.media-cast-tag {
  color: var(--accent-strong);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.media-cast-name {
  overflow: hidden;
  max-width: 100%;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-cast-sources {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.shot-media-picker .media-cast-row { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); align-items: start; gap: 6px; }
.shot-media-picker .media-cast-slot { padding: 5px; border-radius: 6px; }
.shot-media-picker .media-cast-tag { font-size: 10px; letter-spacing: 0; }
.shot-media-picker .media-cast-sources { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; max-height: 24rem; overflow-y: auto; }
.shot-media-picker .media-cast-source { width: 76px; min-width: 0; gap: 4px; padding: 4px; border-radius: 6px; }
.shot-media-picker .media-cast-source span { font-size: 10px; }
.media-cast-source:disabled { opacity: 0.4; cursor: default; }
/* A shot that has been started and not finished. Marked rather than hidden:
   it holds its number and its place, and the point is that coming back to it
   later is the normal way to work. */
.draft-chip {
  padding: 4px 10px;
  border: 1px dashed var(--pending);
  border-radius: 999px;
  color: var(--pending);
  font-size: 11.5px;
}
.shot-row[data-draft="true"] .shot-thumb { color: var(--pending); }
.shot-row-state[data-status="draft"] {
  border-color: rgba(var(--pending-rgb), 0.4);
  background: rgba(var(--pending-rgb), 0.12);
  color: var(--pending);
}
.shot-describe-panel .prompt-actions { margin-top: 12px; }
.shot-describe-missing { margin: 12px 0 0; }
.new-shot-rest {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(var(--veil-rgb), 0.02);
}
.new-shot-rest > summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 12.5px;
}
.new-shot-rest[open] > summary { margin-bottom: 10px; }
.new-shot-rest .asset-block { margin-bottom: 0; }

.shot-media { margin: 0 0 18px; }
.shot-media-warning { margin: 10px 0 0; }

.shot-list { display: grid; gap: 16px; }
.shot-card { min-width: 0; }
.artifacts-panel { margin-bottom: 18px; padding: 20px 22px; border-radius: 8px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.artifacts-refresh { margin-left: auto; }
.artifacts-filters, .artifacts-pages { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.artifact-filter { padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); background: var(--card); font-size: 12px; }
.artifact-filter[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); }
.artifacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: 10px; margin-top: 14px; }
.artifact-tile { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 0 0 10px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; text-align: left; background: var(--card); }
.artifact-tile-image { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--dialog-dim); color: var(--muted); font-size: 11px; }
.artifact-tile-image img { width: 100%; height: 100%; object-fit: contain; }
.artifact-tile strong, .artifact-tile small { padding: 0 10px; max-width: 100%; overflow-wrap: anywhere; }
.artifact-tile strong { font-size: 12px; }
.artifact-tile small { color: var(--muted); font-size: 11px; }
.artifact-tile .artifact-record-status { margin: 0 8px; padding: 2px 7px; border-radius: 6px; font-size: 10.5px; }
.artifact-tile[data-status="accepted"] .artifact-record-status { color: var(--teal); background: rgba(var(--teal-rgb), 0.08); }
.artifact-tile[data-status="pending"] .artifact-record-status { color: var(--pending); background: rgba(var(--pending-rgb), 0.08); }
.artifact-tile[data-status="rejected"] .artifact-record-status { color: var(--danger); background: rgba(var(--danger-rgb), 0.08); }
.artifact-tile:hover, .artifact-tile:focus-visible { border-color: var(--accent); }
.artifacts-empty { grid-column: 1 / -1; margin: 8px 0; color: var(--muted); font-size: 12px; }
.current-artifact { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.current-artifact > div { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-content: start; align-items: start; gap: 8px 16px; }
.current-artifact strong, .current-artifact small, .current-artifact button { grid-column: 2; overflow-wrap: anywhere; }
.current-artifact strong { color: var(--ink); }
.current-artifact button { justify-self: start; font-size: 12px; }
.current-artifact-media { grid-column: 1; grid-row: 1 / 4; cursor: pointer; }
.current-artifact-media img, .current-artifact-media video { display: block; max-width: 100%; max-height: 240px; margin: auto; object-fit: contain; border-radius: 6px; }
.artifact-dialog { width: min(920px, 94vw); max-width: 94vw; max-height: 92dvh; overflow-y: auto; padding: 20px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--card); }
.artifact-dialog::backdrop { background: rgba(var(--ink-rgb), 0.45); }
.artifact-dialog-head { display: flex; align-items: baseline; gap: 12px; position: sticky; top: -20px; z-index: 1; padding: 8px 0; background: var(--card); }
.artifact-title { flex: 1; margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.artifact-media img, .artifact-media video { display: block; width: min(100%, 640px); max-height: 50vh; object-fit: contain; margin: auto; }
.artifact-meta { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.artifact-tools, .artifact-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.artifact-tools, .artifact-report, .artifact-provenance, .artifact-identity-panel { font-size: 12px; }
.artifact-error { font-size: 12px; color: var(--pending); overflow-wrap: anywhere; }
.artifact-notes-row { display: grid; gap: 6px; font-size: 12px; }
.artifact-notes, .artifact-kind { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); }
.artifact-provenance pre, .artifact-identity { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 16rem; overflow: auto; font-size: 11px; }
@container workspace (max-width: 644px) {
  .current-artifact > div { grid-template-columns: minmax(0, 1fr); }
  .current-artifact strong, .current-artifact small, .current-artifact button { grid-column: 1; }
  .current-artifact-media { grid-row: auto; }
}
.shot-editor-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.shot-save-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; padding: 6px 0; margin-bottom: 12px; background: var(--ground); font-size: 12px; }
.shot-save-status { color: var(--muted); overflow-wrap: anywhere; }
.shot-save-status[data-state="error"] { color: var(--danger); }
.shot-save-status[data-state="saving"], .shot-save-status[data-state="dirty"] { color: var(--pending); }
.shot-upload-failures { flex-basis: 100%; }
.shot-upload-failures:empty { display: none; }
.shot-upload-failures > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 4px; color: var(--danger); }
.shot-upload-failures span { overflow-wrap: anywhere; }
.shot-identity { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.shot-number { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: rgba(var(--accent-rgb), 0.12); color: var(--accent); font-weight: 850; }
.shot-type { margin: 0 0 5px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.shot-goal { margin: 0; font-size: 17px; line-height: 1.45; }
.shot-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0; }
.asset-status { min-height: 72px; padding: 14px; border-radius: 14px; background: rgba(var(--veil-rgb), 0.035); }
.asset-status strong, .asset-status span { display: block; }
.asset-status strong { margin-bottom: 7px; font-size: 13px; }
.asset-status span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.status-accepted strong { color: var(--teal); }
.status-rejected strong { color: var(--danger); }
.status-pending strong { color: var(--pending); }

.automation-state { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.automation-state > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(var(--accent-rgb), 0.035); }
.automation-state span, .automation-state strong { display: block; }
.automation-state span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.automation-state strong { font-size: 12px; overflow-wrap: anywhere; }

.shot-actions { display: flex; align-items: end; gap: 10px; }
.seed-field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.seed-field input { width: 105px; padding: 11px 12px; }
.primary-button, .secondary-button, .automation-button, .accept-button, .reject-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 750;
}
.primary-button { background: var(--accent); color: var(--on-accent); }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { border-color: var(--line); background: transparent; color: var(--ink); }
.automation-button { border-color: rgba(var(--teal-rgb), 0.34); background: rgba(var(--teal-rgb), 0.12); color: var(--on-teal); }
.automation-button:hover { background: rgba(var(--teal-rgb), 0.2); }
.accept-button { background: rgba(var(--teal-rgb), 0.15); color: var(--on-teal); }
.reject-button { background: rgba(var(--danger-rgb), 0.14); color: var(--on-danger); }
.review-panel { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.review-panel label { display: grid; flex: 1; gap: 6px; color: var(--muted); font-size: 11px; }
.review-panel input { width: 100%; padding: 11px 12px; }
.review-panel > div { display: flex; gap: 8px; }
.video-preview { width: min(100%, 440px); max-height: 560px; margin: 18px auto 0; display: block; border-radius: 14px; background: var(--media-well); }
.keyframe-preview-frame { margin: 18px 0 0; }
.keyframe-preview-label { width: min(100%, 440px); margin: 0 auto 7px; color: var(--accent); font-size: 12px; text-align: center; }
.keyframe-preview { width: min(100%, 440px); max-height: 560px; object-fit: contain; margin: 0 auto; display: block; border-radius: 14px; background: var(--media-well); }

.auto-review-report { margin-top: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: rgba(var(--veil-rgb), 0.025); }
.auto-review-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auto-review-head span, .auto-review-head strong { display: block; }
.auto-review-head span { margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.auto-review-score { color: var(--accent); font-size: 20px; }
.auto-review-report[data-decision="accepted"] .auto-review-decision { color: var(--teal); }
.auto-review-report[data-decision="rejected"] .auto-review-decision { color: var(--danger); }
.auto-review-report[data-decision="uncertain"] .auto-review-decision { color: var(--pending); }
.auto-review-summary { color: var(--muted); line-height: 1.6; }
.auto-review-reference-summary { margin: -5px 0 12px; color: var(--teal); font-size: 12px; }
.auto-review-arbitration { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--pending); background: rgba(var(--pending-rgb), 0.1); color: var(--pending); font-size: 12px; line-height: 1.6; }
.review-evidence { margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(var(--shadow-rgb), 0.13); }
.review-evidence h4 { margin: 0 0 9px; font-size: 13px; }
.review-evidence > p { margin: -3px 0 10px; color: var(--muted); font-size: 11px; }
.provenance { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.provenance > summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.provenance-entry { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.provenance-entry:first-child { margin-top: 8px; padding-top: 0; border-top: 0; }
.provenance-entry h4 { margin: 0 0 8px; font-size: 12px; }
.provenance-facts { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: 11px; }
.provenance-facts dt { color: var(--muted); }
.provenance-facts dd { margin: 0; word-break: break-word; }
.provenance-prompt { margin: 0 0 9px; padding: 8px 10px; border-radius: 9px; background: rgba(var(--veil-rgb), 0.035); color: var(--muted); font-size: 11px; line-height: 1.6; white-space: pre-wrap; }
.review-evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; }
.review-evidence-item { min-width: 0; margin: 0; padding: 7px; border-radius: 11px; background: rgba(var(--veil-rgb), 0.035); }
.review-evidence-item img, .review-evidence-loading { display: grid; width: 100%; aspect-ratio: 1; place-items: center; border-radius: 8px; background: var(--media-well-soft); object-fit: cover; color: var(--muted); font-size: 10px; cursor: zoom-in; }
.video-evidence-grid .review-evidence-item img { aspect-ratio: 4 / 3; }
.review-evidence-item figcaption { margin-top: 7px; }
.review-evidence-item strong, .review-evidence-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-evidence-item strong { font-size: 11px; }
.review-evidence-item small { margin-top: 3px; color: var(--muted); font-size: 9px; }
/* Starting a project: the one thing the console could never do for itself. */
.rail-new-project { width: 100%; padding: 9px 11px; border: 1px dashed var(--line); border-radius: 11px; background: transparent; color: var(--accent); font-size: 13px; }
.rail-new-project:hover { border-color: var(--accent); border-style: solid; background: rgba(var(--accent-rgb), 0.08); }

.view-head-with-action { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.view-head-with-action > div { min-width: 0; }
.shot-placeholder { padding: 26px 22px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.asset-field-inline { grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.asset-field-inline input { width: auto; }
.asset-field-inline > span { color: var(--muted); font-size: 12px; }
.form-dialog-wide { width: min(680px, calc(100% - 32px)); }
/* The dialog's fields have their own margin stripped, so a block that groups
   several of them has to space them itself. */
.form-dialog .asset-block { display: grid; gap: 12px; padding: 15px 0 0; }
.form-dialog .asset-block-label { margin-bottom: 0; }
.form-dialog .asset-field > span b { color: var(--pending); font-weight: 600; }

.form-dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--dialog); color: var(--ink); }
.form-dialog::backdrop { background: rgba(var(--shadow-rgb), 0.78); }
.form-dialog-body { display: grid; gap: 15px; padding: 24px; max-height: 86vh; overflow-y: auto; }
.form-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.form-dialog-head h3 { margin: 4px 0 0; font-size: 19px; }
.form-dialog-note { margin: 0; padding: 11px 13px; border-radius: 12px; background: rgba(var(--veil-rgb), 0.035); color: var(--muted); font-size: 12px; line-height: 1.7; }
.form-dialog-note b { color: var(--ink); }
.form-dialog-note code { color: var(--accent); font-size: 11.5px; }
/* The dialog is already a gap-spaced grid; the fields must not add their own. */
.form-dialog .asset-field { margin-bottom: 0; gap: 6px; }
.form-dialog .asset-field > small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.form-dialog .asset-field > small b { color: var(--pending); font-weight: 600; }
.form-dialog .form-error { margin: 0; }

.evidence-dialog { width: min(920px, calc(100% - 32px)); padding: 46px 18px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--dialog-dim); color: var(--ink); }
.evidence-dialog::backdrop { background: rgba(var(--shadow-rgb), 0.78); }
.evidence-dialog img { display: block; max-width: 100%; max-height: 78vh; margin: auto; object-fit: contain; }
.evidence-dialog p { margin: 12px 0 0; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.evidence-dialog-close { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 20px; }
.auto-review-scores { display: flex; flex-wrap: wrap; gap: 7px; }
.auto-review-scores span { padding: 5px 8px; border-radius: 999px; background: rgba(var(--veil-rgb), 0.05); color: var(--muted); font-size: 11px; }
.auto-review-issues { margin: 13px 0; padding-left: 20px; color: var(--muted); line-height: 1.55; }
.auto-review-issues li[data-severity="high"], .auto-review-issues li[data-severity="critical"] { color: var(--danger); }
.auto-review-suggestions { color: var(--muted); font-size: 12px; }
.auto-review-suggestions summary { cursor: pointer; color: var(--accent); }
.auto-review-report > small { display: block; margin-top: 13px; color: var(--muted); }

.job-list { display: grid; gap: 10px; }
.job-item { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; background: rgba(var(--veil-rgb), 0.035); }
.job-item strong { display: block; margin-bottom: 5px; }
.job-item small, .job-placeholder { color: var(--muted); }
.job-state { padding: 6px 10px; border-radius: 999px; font-size: 12px; background: rgba(var(--veil-rgb), 0.06); }
.job-state.completed { color: var(--teal); }
.job-state.failed, .job-state.interrupted { color: var(--danger); }
.job-state.running, .job-state.queued { color: var(--accent); }

.empty-state { padding: 48px 20px; text-align: center; border-top: 1px solid var(--line); }
.empty-state p { color: var(--muted); }
.loading-state { padding: 48px 20px; text-align: center; border-top: 1px solid var(--line); }
.loading-state p { color: var(--muted); }
.loading-state strong::after { content: ""; display: inline-block; width: 1em; margin-left: 4px; animation: loading-dots 1.2s steps(4, end) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes loading-dots { from { width: 0; } to { width: 1em; } }
#projectContent.is-loading { opacity: 0.45; transition: opacity 0.15s; }
@media (prefers-reduced-motion: reduce) { .loading-state strong::after { animation: none; width: 1em; } }

.jobs-section {
  content-visibility: auto;
  contain-intrinsic-size: auto 560px;
}

.simulation-badge { display: inline-block; padding: 4px 9px; border: 1px solid rgba(var(--pending-rgb), 0.34); border-radius: 999px; background: rgba(var(--pending-rgb), 0.1); color: var(--pending); font-size: 10.5px; }
/* Grows with the conversation. No overflow of its own - a box that scrolls
   inside a page that scrolls is two scrollbars for one list. */
.agent-messages { display: grid; align-content: start; gap: 10px; min-height: 150px; padding-right: 5px; }
.agent-message { max-width: 88%; padding: 13px 15px; border-radius: 15px; background: rgba(var(--veil-rgb), 0.045); }
.agent-message.user { justify-self: end; background: rgba(var(--pending-rgb), 0.14); }
.agent-message span { color: var(--accent); font-size: 11px; }
.agent-message.user span { color: var(--pending); }
/* Wrapped anywhere, because not every answer is prose. An endpoint's error
   comes back as one unbroken JSON blob with no spaces to break at, and a
   paragraph that only breaks at spaces runs it off the side of a 330-pixel
   column - which is how a 400 arrived on screen as "LLM HTTP 400: {"err". */
.agent-message p { margin: 6px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
/* Which endpoint answered and how long it took. Quiet, because it is evidence
   rather than content - but present on every reply, because a comparison made
   from memory is made from the last answer rather than from the average. */
.agent-message-meta { display: block; margin-top: 7px; color: var(--muted); font-size: 10.5px; }
/* The model's working: dimmed, smaller, and folded away once the answer
   starts. Visible while it is the only thing happening, so a minute of
   reasoning looks like a minute of reasoning rather than a minute of nothing. */
.agent-reasoning { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.agent-reasoning summary { cursor: pointer; color: var(--muted); font-size: 10.5px; }
.agent-reasoning p { margin: 5px 0 0; line-height: 1.55; overflow-wrap: anywhere; }
.agent-composer { display: grid; gap: 8px; padding-top: 13px; border-top: 1px solid var(--line); }
.agent-composer > label { color: var(--muted); font-size: 11px; }
.agent-composer textarea { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--field); color: var(--ink); resize: vertical; }
.simulation-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.agent-status-list { display: grid; gap: 8px; margin: 0; }
.agent-status-list > div { padding: 11px 13px; border-radius: 12px; background: rgba(var(--veil-rgb), 0.035); }
.agent-status-list dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.agent-status-list dd { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
.agent-state-hint { margin: 12px 0 0; color: var(--teal); font-size: 11px; line-height: 1.55; }

.token-screen { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--gate-scrim); }
.token-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 26px; background: var(--gate-card); box-shadow: 0 30px 100px rgba(var(--shadow-rgb), 0.42); }
.token-card h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 30px; }
.token-card > p:not(.eyebrow):not(.form-error) { color: var(--muted); line-height: 1.65; }
.token-card label { display: grid; gap: 7px; margin: 24px 0 14px; color: var(--muted); font-size: 12px; }
.token-card input { padding: 13px; }
.token-card .primary-button { width: 100%; }
.login-brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.login-brand-row .brand-mark.large { margin-bottom: 0; }
.login-version { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; }
.form-error { min-height: 20px; color: var(--danger); font-size: 12px; }

.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 420px; padding: 13px 16px; border-radius: 13px; background: var(--toast); color: var(--ink); box-shadow: 0 16px 50px rgba(var(--shadow-rgb), 0.35); opacity: 0; transform: translateY(10px); pointer-events: none; transition: 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--toast-error); }

@media (max-width: 850px) {
  .section-heading, .project-summary { align-items: flex-start; flex-direction: column; }
  .project-summary > div:first-child { margin-right: 0; }
  .project-picker, .project-picker-toggle { width: 100%; }
  .shot-status-grid { grid-template-columns: 1fr; }
  .automation-state { grid-template-columns: 1fr; }
  .reference-panel { grid-template-columns: 1fr; }
  /* auto-fill already drops to one column here; only the placement is needed. */
  .reference-list { grid-column: 1; }
  .shot-actions { flex-wrap: wrap; }
  .review-panel { align-items: stretch; flex-direction: column; }
}

@media (max-width: 560px) {
  .connection { padding: 8px; }
  #connectionText { display: none; }
  .jobs-section { padding: 20px; border-radius: 20px; }
  .agent-composer > div { grid-template-columns: 1fr; }
  .agent-composer .primary-button { width: 100%; }
  .shot-identity { grid-template-columns: auto 1fr; }
  .duration-chip { grid-column: 2; justify-self: start; }
  .system-grid { grid-template-columns: 1fr; }
  .section-note { text-align: left; }
}

/* "帮我整理" and what it writes.
 *
 * The button was bare accent-coloured text pulled up by a negative margin,
 * which put it on top of the textarea's resize handle and made it look like a
 * mistake rather than an action. It is a button now: an outlined pill, sitting
 * clear of the field, on its own row.
 *
 * What it writes never goes into the field above. That box holds what the
 * person wrote, and comparing two versions needs both of them on screen. */
.prompt-helper { margin-top: 8px; }
.prompt-helper-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prompt-write-button {
  padding: 5px 13px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-size: 12px;
  line-height: 1.5;
}
.prompt-write-button:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.75);
  background: rgba(var(--accent-rgb), 0.14);
}
.prompt-helper-note { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

/* The written version, as its own card so it reads as a proposal rather than
   as something that has already happened. */
.prompt-result {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.05);
}
.prompt-result-head { color: var(--accent); font-size: 11px; font-weight: 650; letter-spacing: 0.02em; }
.prompt-result-text { margin: 9px 0 0; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompt-result-text:empty { display: none; }
/* The model thinking out loud while it works, so a slow answer looks like work
   rather than like nothing. Folded away once the prompt itself starts. */
.prompt-thinking { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
.prompt-thinking summary { cursor: pointer; color: var(--muted); }
/* The working is the one thing here that is allowed its own scrollbar: it runs
   to pages on a reasoning model, it is not the answer, and letting it push the
   answer off the screen would defeat the point of showing it. */
.prompt-thinking p { margin: 6px 0 0; max-height: 9em; overflow-y: auto; line-height: 1.55; overflow-wrap: anywhere; }
.prompt-result-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.prompt-result-actions .secondary-button { padding: 6px 15px; border-radius: 999px; font-size: 12.5px; }

/* The settings page. Grouped the way the work is grouped, because the question
   people arrive with is "change the model", not "find AGENT_LLM_MODEL". */
.settings-form { display: grid; gap: 18px; }
.settings-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.settings-tab { padding: 8px 16px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
.settings-tab:hover { color: var(--ink); background: rgba(var(--veil-rgb), 0.04); }
.settings-tab[aria-selected="true"] { color: var(--accent-strong); font-weight: 650; box-shadow: inset 0 -2px 0 var(--accent); }
.settings-group { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(var(--veil-rgb), 0.03); }
.settings-group legend { padding: 0 8px; color: var(--accent); font-size: 12px; font-weight: 650; }
.settings-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 6px 14px; align-items: center; margin-bottom: 10px; }
.settings-label { color: var(--muted); font-size: 12.5px; }
.settings-row input { width: 100%; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); }
.settings-row input[type="checkbox"] { appearance: none; width: 44px; height: 24px; padding: 0; border-radius: 999px; cursor: pointer; background: radial-gradient(circle at 12px 50%, var(--ink) 0 7px, transparent 8px), var(--field); transition: background 120ms ease, border-color 120ms ease; }
.settings-row input[type="checkbox"]:checked { border-color: var(--accent); background: radial-gradient(circle at 31px 50%, white 0 7px, transparent 8px), var(--accent); }
/* The key itself under the box: every instruction ever written about this
   project names the key, not the label. */
.settings-help { grid-column: 2; color: var(--muted); font-size: 10.5px; overflow-wrap: anywhere; }
.settings-actions { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.settings-status { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--muted); font-size: 13px; line-height: 1.5; }
.settings-status[data-state="failed"] { border-color: rgba(var(--danger-rgb), 0.5); color: var(--danger); }
.settings-status span { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.member-summary { margin-top: 8px; padding: 7px 10px; border: 0; border-radius: 10px; background: rgba(var(--accent-rgb), 0.1); color: var(--accent-strong); font-size: 11px; text-align: center; cursor: pointer; }
.membership-admin { margin-top: 24px; padding: 20px 22px; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.membership-admin .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.membership-admin .section-heading h3 { margin: 2px 0 0; }
.member-create { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)) auto; gap: 10px; align-items: end; margin: 18px 0; }
.member-create label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.member-create input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); }
.member-list { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.member-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 11px 13px; background: rgba(var(--veil-rgb), 0.03); }
.member-row + .member-row { border-top: 1px solid var(--line); }
.member-row strong, .member-row small { display: block; }
.member-row small { margin-top: 3px; color: var(--muted); }
.member-row > span { color: var(--teal); font-size: 11px; }
.member-row[data-status="suspended"] { opacity: 0.65; }
.member-row[data-status="suspended"] > span { color: var(--danger); }
.member-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: end; }
.member-group-line { margin-top: 3px; }
.member-group-line select { margin-left: 4px; }
@media (max-width: 980px) { .member-create { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .member-create { grid-template-columns: 1fr; } }
/* On a phone the row's three columns left the words a strip 23px wide, one character to a line, and
   the card 520px tall: the member was on the page and could not be read. The words and the status
   share the first line; the actions take the whole second one. */
@media (max-width: 720px) {
  .membership-admin { padding: 16px 14px; }
  .member-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .member-row .member-actions { grid-column: 1 / -1; justify-content: start; gap: 6px 14px; }
}
.recharge-dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--card); color: var(--ink); box-shadow: 0 24px 80px rgba(var(--shadow-rgb), .3); }
.recharge-dialog::backdrop { background: rgba(var(--veil-rgb), .58); backdrop-filter: blur(3px); }
.recharge-card { display: grid; gap: 16px; padding: 24px; }
.recharge-card label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.recharge-card input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); }
.recharge-qr { width: 240px; height: 240px; justify-self: center; border-radius: 12px; background: var(--surface-strong); padding: 10px; }
.subscription-offer { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; background: rgba(var(--accent-rgb), .1); }
.subscription-offer small { display: block; margin-top: 4px; color: var(--muted); }
.recharge-card hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.settings-note { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 1240px) { .settings-row { grid-template-columns: 1fr; } .settings-help { grid-column: 1; } }


/* ============================================================
   The head of the middle column, and the body under it
   ============================================================ */

.workhead { flex: none; padding: 6px 26px 0; border-bottom: 1px solid var(--line); }
.workbody { container: workspace / inline-size; flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 80px; }
.workhead-top { display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }

/* The way back out of a shot. It used to be a text button inside the shot card,
   which put it wherever that card had scrolled to - and 分镜 in the rail read as
   dead, because with a shot open the view was already "shots". */
.crumbs { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.crumbs button { padding: 0; border: 0; background: none; color: var(--accent-strong); font-size: 13px; font-weight: 600; }
.crumbs button:hover { text-decoration: underline; }
.crumbs .crumb-sep { color: var(--muted); opacity: 0.6; }
.crumbs b { color: var(--ink); font-weight: 600; }
.crumbs .crumb-note { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dock-toggle { margin-left: auto; flex: none; padding: 5px 13px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); font-size: 12px; }
.dock-toggle:hover { border-color: var(--accent); color: var(--ink); }

.rail-icon { flex: none; width: 18px; font-style: normal; font-size: 14px; text-align: center; }
.rail-nav .rail-text { margin-left: 10px; }
.rail-toggle { display: flex; align-items: center; width: 100%; margin-top: 4px; padding: 9px 11px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 12px; text-align: left; }
.rail-toggle:hover { background: rgba(var(--veil-rgb), 0.05); color: var(--ink); }
.rail-toggle-glyph { display: none; }
.app-shell[data-rail="off"] .rail-toggle-glyph { display: inline; }

/* Where the open shot stands. Pinned because the answer is what the page below
   is being read against; scrolled away, every panel reads as free-standing. */
.progress-strip { display: flex; align-items: stretch; gap: 14px; padding-bottom: 12px; flex-wrap: wrap; }
.progress-steps { display: flex; flex-wrap: wrap; gap: 2px; min-width: 0; }
.pstep { min-width: 116px; padding: 8px 17px 9px; border: 0; border-top: 3px solid transparent; border-radius: 8px 8px 0 0; background: var(--surface-strong); color: var(--muted); text-align: left; }
.pstep:hover { background: var(--dialog-dim); }
.pstep .pstep-index { display: block; font-size: 10.5px; letter-spacing: 0.1em; opacity: 0.75; }
.pstep .pstep-name { display: block; margin-top: 2px; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.pstep .pstep-state { display: block; margin-top: 2px; font-size: 11.5px; }
.pstep[data-status="accepted"] .pstep-state { color: var(--teal); }
.pstep[data-status="pending"] .pstep-state { color: var(--pending); }
.pstep[data-status="busy"] .pstep-state { color: var(--pending); }
.pstep[data-status="rejected"] .pstep-state { color: var(--danger); }
/* Selected is a filled block, not a tint. A tint was tried and could not be
   seen: with four of these in a row, "which one am I on" went unanswered. */
.pstep[aria-current="true"] { background: var(--accent); border-top-color: var(--accent-strong); }
.pstep[aria-current="true"] .pstep-index, .pstep[aria-current="true"] .pstep-name { color: var(--on-accent); opacity: 1; }
.pstep[aria-current="true"] .pstep-state { color: var(--on-accent); opacity: 0.85; }
.pstep[aria-current="true"][data-status="accepted"] .pstep-state { color: var(--selected-ok); }
.pstep[aria-current="true"][data-status="pending"] .pstep-state { color: var(--selected-wait); }
.pstep[aria-current="true"][data-status="rejected"] .pstep-state { color: var(--selected-no); }

.progress-facts { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.progress-fact { min-width: 102px; padding: 8px 15px 9px; border-radius: 8px; background: var(--surface-strong); }
.progress-fact dt { color: var(--muted); font-size: 10.5px; letter-spacing: 0.1em; }
.progress-fact dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; }

/* One line for the job that is running; the rest of them are its drawer. They
   were a panel at the foot of the shot list, which is not where anyone looks
   when the question is whether the card is free. */
.timeline-strip { display: flex; align-items: center; gap: 12px; padding: 8px 0 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.timeline-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--pending); animation: timeline-pulse 1.3s infinite; }
@keyframes timeline-pulse { 50% { opacity: 0.25; } }
.timeline-what { min-width: 0; }
.timeline-what b { color: var(--ink); font-weight: 600; }
.timeline-bar { flex: 1; min-width: 70px; max-width: 220px; height: 6px; border-radius: 99px; background: rgba(var(--veil-rgb), 0.1); overflow: hidden; }
.timeline-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width 240ms ease; }
.timeline-more { margin-left: auto; flex: none; }
.task-drawer { max-height: 240px; overflow-y: auto; padding: 2px 0 12px; border-top: 1px solid var(--line); }
.task-drawer .section-note { margin: 6px 0 8px; }

@media (max-width: 1040px) {
  .rail { padding: 16px 6px; }
  .workhead { padding-left: 16px; padding-right: 16px; }
  .workbody { padding: 16px 16px 60px; }
}
@media (max-width: 720px) {
  .app-shell { --rail-w: 56px; --dock-w: 0px; }
  .app-shell[data-rail="on"] .rail { position: fixed; z-index: 11; inset: 0 auto 0 0; width: 212px; border-right: 1px solid var(--line); }
  .dock { position: fixed; z-index: 10; top: 60px; bottom: 12px; right: 12px; width: min(310px, calc(100vw - 80px)); background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
  .progress-side { width: 100%; }
}

.progress-side { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.progress-facts { display: flex; gap: 2px; margin: 0; }
.progress-seed { display: block; }
.progress-seed span { display: block; color: var(--muted); font-size: 10.5px; letter-spacing: 0.1em; }
.progress-seed input { width: 88px; margin-top: 2px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); font-size: 13.5px; font-weight: 600; }


/* The picture at the head of a row, and the verdict along the top of it. */
.shot-thumb { position: relative; flex: none; width: 104px; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; border-radius: 8px; border-top: 3px solid transparent; background: var(--media-well); color: var(--muted); font-size: 11px; letter-spacing: 0.04em; }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-thumb[data-verdict="accepted"] { border-top-color: var(--teal); }
.shot-thumb[data-verdict="pending"] { border-top-color: var(--pending); }
.shot-thumb[data-verdict="rejected"] { border-top-color: var(--danger); opacity: 0.6; }


/* ============================================================
   A step: the sequence on the left, the material beside it
   ============================================================ */

/* Each column owns its flow: tall materials must not push the left prompt
   below an empty grid row. No material input means no reserved second column. */
.step-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.step-layout.has-materials { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.step-main { min-width: 0; }
/* One column of settings, as wide as 第 1 步's: the model on its own line and
   时长/分辨率 under it. Laid out along a line rather than in fixed columns
   because a grid hides 时长 - each cell has its own - and a fixed column would
   leave 分辨率 standing in the gap instead of following the model. */
/* End-aligned so 时长's box and 分辨率's sit on one line even though only
   one of the two labels carries a note under it. */
.video-settings-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
/* The unit note sits under its own label rather than pushing the select out of line. */
.video-settings-row .field-note { display: block; margin-top: 3px; }
.video-settings-row > .asset-field { flex: 1 1 160px; margin: 0; min-width: 0; }
.video-settings-row > .field-model { flex: 1 1 100%; }
.video-settings-row > .field-duration { flex: 0 1 110px; }
.video-head { margin-bottom: 16px; }
.video-settings-panel { margin-bottom: 16px; }
.asset-field > span .field-note { color: var(--muted); font-size: 11px; font-weight: 400; }
.negative-prompt-state { margin-left: 8px; font-size: 11px; }

/* Where the frame comes from, or which model runs. Sits above the prompt it
   decides the shape of, in the step it belongs to. */
.step-model { display: flex; flex-direction: column; gap: 10px; }
.step-model .prompt-actions { margin: 0; }
.step-model .asset-field { margin: 0; }

/* Query outside the fieldset: nested size containers intermittently lose
   their children's layout boxes in Chrome. Include the card's 44px padding. */
@container workspace (max-width: 644px) {
  .step-layout.has-materials { grid-template-columns: minmax(0, 1fr); }
  .video-settings-row > .asset-field { flex-basis: 100%; }
  .video-settings-row > .field-duration { flex-basis: 100%; }
}


/* What an asset is, beside what a shot calls it. */
.reference-kind { flex: none; padding: 3px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--muted); font-size: 11px; }
.reference-kind:hover { color: var(--ink); }


/* ============================================================
   The status card, at the width the rail actually gives it
   ============================================================ */

/* Sized for a panel, and it lives in a 236px column: two cells to a row left
   about 65px each, so 无法检测显卡 wrapped to three lines and the header's
   three words broke mid-word. A narrow column wants rows. */
.rail .system-card { padding: 14px; border-radius: 12px; }
.rail .system-card-head { margin-bottom: 11px; flex-wrap: wrap; gap: 6px 10px; }
.rail .system-card-head > span { font-size: 12.5px; font-weight: 650; }
.rail .system-card-actions { gap: 10px; margin-left: auto; }
.rail .system-card .text-button { font-size: 11.5px; }

/* Label left, value right, one line each. */
.rail .system-grid { grid-template-columns: 1fr; gap: 2px; }
.rail .system-grid div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 6px 9px; border-radius: 8px; }
.rail .system-grid dt { font-size: 11.5px; }
.rail .system-grid dd { margin: 0; font-size: 12.5px; font-weight: 650; text-align: right; }

.rail .memory-gauges { margin-top: 10px; }
.rail .comfy-hint { margin-top: 9px; font-size: 11.5px; }
.rail .refreshed-at { font-size: 11px; }
.rail .connection { padding: 6px 11px; font-size: 12px; }


/* Nothing running: the row stays, because 全部任务 is on it. The pulse is what
   means "something is happening", so it stops rather than lying. */
.timeline-strip[data-live="false"] .timeline-dot { background: var(--offline); animation: none; }
.timeline-strip[data-live="false"] .timeline-bar { visibility: hidden; }


/* ============================================================
   The shot list, as the prototype has it
   ============================================================ */

.list-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; color: var(--muted); font-size: 12.5px; }

/* One filled chip per step. Colour is the verdict; the word beside it is which
   step. Two of them say more than one chip about "where it has got to". */
.shot-row-steps { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
/* The prototype's .chip: a step nothing has come out of is an outline, and a
   verdict fills it. */
.shot-chip { padding: 3px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 10.5px; font-weight: 500; white-space: nowrap; background: transparent; color: var(--muted); }
.shot-chip[data-status="busy"] { border-color: transparent; background: var(--pending); color: var(--on-accent); }
.shot-chip[data-status="accepted"] { border-color: transparent; background: var(--teal); color: var(--on-teal); }
.shot-chip[data-status="pending"] { border-color: transparent; background: var(--pending); color: var(--on-accent); }
.shot-chip[data-status="rejected"] { border-color: transparent; background: var(--danger); color: var(--on-accent); }

/* The id sits on the picture, so a row is nameable without a second column. */
.shot-thumb-id { position: absolute; top: 0; left: 0; padding: 1px 7px; background: var(--ink); color: var(--ground); font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; }
.shot-thumb-note { color: var(--muted); font-size: 11px; }
.thumb-preview { position: fixed; z-index: 40; pointer-events: none; border-radius: 12px; overflow: hidden; background: var(--media-well); box-shadow: 0 16px 50px rgba(var(--shadow-rgb), 0.35); }
.thumb-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }

.rail-project-title { margin: 0 6px; font-size: 14px; font-weight: 650; line-height: 1.35; }
.rail-account-facts { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: -8px 10px 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.app-shell[data-rail="off"] .rail-account-facts { display: none; }
@media (max-width: 720px) { .rail-account-facts { display: none; } }
.rail-project-facts { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin: -12px 6px 0; color: var(--muted); font-size: 11.5px; }
.rail-project-facts .project-id { margin: 0; font-size: 10.5px; }
.rail-project-sharing { display: flex; align-items: center; gap: 7px; margin: 2px 6px 0; color: var(--muted); font-size: 11.5px; cursor: pointer; }


/* Read out, not asked for. */
.derived-note { margin: 0 0 8px; }

/* 创建 and 取消 together, where the decision is made. */
.form-dialog-actions { display: flex; align-items: center; gap: 10px; }

/* On a filled chip the text sits on the hue itself, not on a 15% wash of it -
   so it takes the colour that is defined for exactly that, in both themes. */
.shot-chip[data-status="accepted"] { color: var(--on-accent); }


/* ============================================================
   顶栏压扁 —— the rules the prototype had already worked out
   ============================================================ */

/* Three stacked lines came to over two hundred pixels, and on a laptop that is
   most of the work area. Keeping the head fixed is right; the price has to be
   small. 第 1 步 / 分镜参考 / 已接受 reads as well across as down. */
.workhead-top { margin-bottom: 6px; }
.progress-strip { align-items: center; padding-bottom: 7px; }
.pstep { display: flex; align-items: baseline; gap: 8px; min-width: 0; padding: 7px 14px; border-radius: 8px; border-top-width: 0; }
.pstep .pstep-index { display: inline; margin: 0; font-size: 10px; opacity: 0.7; }
.pstep .pstep-name { display: inline; margin: 0; font-size: 13px; }
.pstep .pstep-state { display: inline; margin: 0; font-size: 11px; }

/* The four facts were four cards. One row, hairline between, same words. */
.progress-side { align-items: center; gap: 0; }
.progress-facts { gap: 0; }
.progress-fact { display: flex; align-items: baseline; gap: 6px; min-width: 0; padding: 0 14px; border-radius: 0; background: none; border-left: 1px solid var(--line); }
.progress-facts > .progress-fact:first-child { border-left: 0; }
.progress-fact dt { font-size: 10px; letter-spacing: 0.06em; }
.progress-fact dd { margin: 0; font-size: 12.5px; }
.progress-seed { display: flex; align-items: baseline; gap: 6px; padding: 0 14px; border-left: 1px solid var(--line); }
.progress-seed span { display: inline; font-size: 10px; letter-spacing: 0.06em; }
.progress-seed input { width: 66px; margin-top: 0; padding: 1px 7px; font-size: 12.5px; }
.timeline-strip { padding: 5px 0 7px; font-size: 12px; }
.timeline-bar { height: 5px; max-width: 180px; }

/* A heading and what the thing is for, instead of a paragraph explaining the
   pipeline once per step to somebody with the stepper above them. */
.section-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h3, .section-head h4 { margin: 0; font-size: 15px; font-weight: 650; }
.section-head span { color: var(--muted); font-size: 12.5px; }
.step-head { grid-column: 1 / -1; }
.shot-describe-panel { display: block; }


/* ============================================================
   The task drawer: one line per job
   ============================================================ */

/* Each entry was a card about sixty pixels tall, and the drawer opens inside a
   fixed head - four of them filled it. Four facts fit on one line. */
.job-list { display: flex; flex-direction: column; gap: 4px; }
.job-item { display: flex; align-items: baseline; gap: 12px; padding: 7px 12px; border-radius: 8px; border-left: 3px solid transparent; background: rgba(var(--veil-rgb), 0.035); font-size: 12.5px; }
.job-item strong { margin: 0; flex: none; font-size: 12.5px; font-weight: 650; }
.job-target { flex: none; color: var(--muted); }
.job-note { margin-left: auto; text-align: right; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The shape of the queue, readable before any of it is read. */
.job-item[data-status="running"] { border-left-color: var(--pending); }
.job-item[data-status="completed"] { border-left-color: var(--teal); }
.job-item[data-status="failed"], .job-item[data-status="interrupted"] { border-left-color: var(--danger); }
.job-item-link { cursor: pointer; }
.job-item-link:hover { background: rgba(var(--veil-rgb), 0.07); }
.job-state { flex: none; padding: 2px 9px; font-size: 11px; font-weight: 600; }
.job-state.completed { background: rgba(var(--teal-rgb), 0.14); }
.job-state.failed, .job-state.interrupted { background: rgba(var(--danger-rgb), 0.14); }
.job-state.running { background: rgba(var(--pending-rgb), 0.16); color: var(--pending); }
.job-state.queued { color: var(--muted); }
.task-drawer .section-note { margin: 4px 0 8px; font-size: 11.5px; }


/* Selected is a filled block, here as everywhere else in V4. A 12% wash was
   tried and could not be seen: with several in a column, "which one am I on"
   went unanswered. */
.rail-nav[aria-current="true"] { background: var(--accent); color: var(--on-accent); font-weight: 650; }
.rail-nav[aria-current="true"] .rail-count { color: var(--on-accent); opacity: 0.75; }
.rail .project-picker-toggle { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }

/* ============================================================
   The shot is a column of sections, not a card full of them
   ============================================================ */

/* The wrapper's header said the shot id and its sentence - which the crumb
   trail says, one line above it. A box around a box, and the outer one's only
   content was a duplicate. */
.shot-card { padding: 0; border: 0; border-radius: 0; background: none; }
.shot-identity { display: none; }

/* What was inside becomes the cards: siblings in one column, which is what they
   are - sections of one document, read in order. */
.shot-describe-panel, .step-body { margin: 0 0 18px; padding: 20px 22px; border: 0; border-radius: 8px; background: var(--card); }
.step-body + .step-body { margin-top: 0; }


/* ============================================================
   原型的控件，接到控制台的类名上
   ============================================================ */

/* Every field on the shot page and in the dialogs. From the prototype's `.in`:
   a soft border, the field ground, 6px corners, and a focus ring that is the
   ink at 12% rather than the browser's blue.

   `resize: none` comes with it, but not `overflow: hidden` - in the mock every
   box holds one fixed sentence, and here they hold whatever gets typed. */
.asset-field input,
.asset-field textarea,
.asset-field select,
.prompt-field input,
.prompt-field textarea,
.form-dialog input,
.form-dialog textarea,
.form-dialog select,
.settings-form input,
.settings-form select,
.reference-role-input {
  width: 100%;
  display: block;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  resize: none;
}
.asset-field input:focus,
.asset-field textarea:focus,
.asset-field select:focus,
.prompt-field input:focus,
.prompt-field textarea:focus,
.form-dialog input:focus,
.form-dialog textarea:focus,
.form-dialog select:focus,
.settings-form input:focus,
.reference-role-input:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--ink-rgb), 0.12);
}

/* The label above a field. */
.asset-field > span,
.prompt-field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }
.asset-field > span b, .prompt-field > span b { font-weight: 600; }
.asset-field { position: relative; display: block; margin-top: 14px; }
.asset-field:first-child { margin-top: 0; }
.shot-card textarea { field-sizing: content; min-height: calc(3.2em + 22px); max-height: 24rem; overflow-y: auto; }
.shot-describe-panel .asset-row > * { min-width: min(200px, 100%); }
.asset-row { display: flex; gap: 14px; flex-wrap: wrap; }
.asset-row > * { flex: 1; min-width: 200px; }

/* Buttons are pills. A filled one is the thing to press; everything else is
   outlined, which is what stops a row of four from shouting equally. */
.primary-button, .secondary-button, .accept-button, .reject-button, .automation-button {
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 590;
}
.primary-button:hover, .secondary-button:hover, .automation-button:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.primary-button { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.primary-button:hover { background: var(--accent-strong); box-shadow: none; }
.primary-button:disabled, .secondary-button:disabled, .automation-button:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; }
.accept-button { border-color: rgba(var(--teal-rgb), 0.45); color: var(--on-teal); }
.reject-button { border-color: rgba(var(--danger-rgb), 0.45); color: var(--on-danger); }

/* 帮我整理 and the rest of the inline text buttons: small pills, not links. */
.prompt-helper-bar .text-button,
.prompt-result-actions .text-button { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; }
.prompt-helper-bar .text-button:hover,
.prompt-result-actions .text-button:hover { border-color: var(--accent); color: var(--ink); }

/* The panels inside a step stop being boxed twice: the step is the card. */
.step-body .prompt-panel { margin: 14px 0 0; padding: 0; border: 0; border-radius: 0; }
.step-main > .prompt-panel:first-child { margin-top: 0; }
.step-body .prompt-panel summary { margin-bottom: 4px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.step-body .prompt-field { margin-top: 6px; }
.visually-hidden { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.asset-field > .visually-hidden, .prompt-field > .visually-hidden { margin: -1px; }
.prompt-actions { display: flex; align-items: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.shot-actions { margin-top: 16px; }


/* ============================================================
   原型剩下的类，一次走完
   ============================================================ */

/* .why - 一段解释的字。 */
.asset-hint, .step-intro, .prompt-hint, .section-note { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.section-head .asset-hint { margin: 0; }

/* .card - 是卡片的那些面板，之前没有被当成卡片画。 */
.reference-panel, .asset-studio-panel, .jobs-section, .settings-form, .final-placeholder,
.auto-review-report, .review-panel, .provenance {
  padding: 20px 22px; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--line); border: 0;
}
.step-body, .shot-describe-panel { box-shadow: 0 0 0 1px var(--line); border: 0; }

/* .libhead / .rolebar - a library card's head: title and hint, then the kind
   filters and 上传 on the same line. */
.reference-panel { grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.library-head { display: flex; align-items: baseline; gap: 6px 11px; flex-wrap: wrap; }
.library-head h2 { margin: 0; font-size: 17px; font-weight: 650; }
.library-hint { color: var(--muted); font-size: 12.5px; }
.library-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.library-bar .reference-upload-button { position: relative; min-height: 0; margin-left: 6px; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.reference-panel > .asset-hint { margin: 0; }

/* 设置 - one card per group, fields in two columns, labelled by their .env key. */
.settings-form { padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
.settings-group { padding: 20px 22px; border: 0; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.settings-group legend { float: left; width: 100%; margin: 0 0 2px; padding: 0; color: var(--ink); font-size: 17px; font-weight: 650; }
.settings-fields { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 14px; }
.settings-row { display: block; margin: 14px 0 0; }
.settings-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.settings-when { margin-left: 4px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.settings-when.live { color: var(--teal); border-color: currentColor; }
.settings-help { display: block; margin-top: 5px; }

/* 九宫格 - the prototype's small grid: a glance at where each shot stands. The
   decisions are made in the big picture a cell opens, where they can be seen.
   Cells are 16:9 because B16 renders at 16:9 whatever the project's frame. */
.storyboard-panel { display: grid; gap: 12px; margin-top: 14px; }
.storyboard-panel > .asset-hint { margin: 0; }
.storyboard-shared textarea { width: 100%; }
.storyboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 820px; }
@media (max-width: 720px) { .storyboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.storyboard-cell { display: grid; align-content: start; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--media-well-soft); color: var(--muted); }
.storyboard-cell-picture { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 0; border-radius: 5px; background: var(--media-well); color: var(--muted); font-size: 10px; cursor: pointer; }
.storyboard-cell-picture:disabled { cursor: default; }
.storyboard-cell-picture img { width: 100%; height: 100%; object-fit: cover; }
.storyboard-cell-prompt { width: 100%; min-height: 4.5em; resize: vertical; font-size: 12px; }
.storyboard-cell-foot { display: flex; align-items: center; gap: 2px; min-height: 22px; font-size: 11px; }
.storyboard-cell-foot .text-button { padding: 0 5px; font-size: 11.5px; }
.storyboard-cell-changed { color: var(--pending); }
.storyboard-remove[data-armed="true"] { color: var(--danger); font-weight: 600; }
.storyboard-add { display: grid; place-items: center; min-height: 120px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.storyboard-add:disabled { cursor: default; opacity: 0.5; }
.storyboard-cell-tag, .storyboard-cell-shot { position: absolute; padding: 1px 6px; background: var(--ink); color: var(--ground); font-size: 9.5px; }
.storyboard-cell-tag { top: 0; right: 0; }
.storyboard-cell-shot { bottom: 0; left: 0; }
.storyboard-cell[data-keep="yes"] { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.storyboard-cell[data-keep="yes"] .storyboard-cell-tag { background: var(--teal); color: var(--on-accent); }
.storyboard-cell[data-keep="redo"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.storyboard-cell[data-keep="redo"] .storyboard-cell-tag { background: var(--danger); color: var(--on-accent); }
.storyboard-cell[data-keep="wait"] .storyboard-cell-tag { background: var(--pending); color: var(--on-accent); }
.storyboard-tally { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.storyboard-count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.storyboard-count b { margin-right: 4px; color: var(--ink); font-size: 15px; font-weight: 700; }
.storyboard-count[data-kind="yes"] b { color: var(--teal); }
.storyboard-count[data-kind="redo"] b { color: var(--danger); }
.storyboard-grow { flex: 1; }
.storyboard-cell[data-keep="busy"] .storyboard-cell-tag { background: var(--pending); color: var(--on-accent); }
/* The version view: one picture as large as the window allows, then every
   version as a thumbnail. Both have fixed heights, so nothing in the dialog can
   squeeze them when the text below makes it scroll. */
.form-dialog.storyboard-dialog { width: min(1120px, calc(100% - 32px)); }
.storyboard-preview { position: relative; display: grid; place-items: center; height: min(60vh, calc((min(1120px, 100vw - 32px) - 48px) * 9 / 16)); border-radius: 10px; background: var(--media-well); color: var(--muted); font-size: 12px; }
.storyboard-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.storyboard-versions { display: flex; gap: 8px; min-height: 124px; overflow-x: auto; padding-bottom: 4px; }
.storyboard-version { flex: none; display: grid; align-content: start; gap: 4px; width: 168px; padding: 3px; border: 2px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; cursor: pointer; }
.storyboard-version[aria-pressed="true"] { border-color: var(--teal); color: var(--ink); }
.storyboard-version-picture { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--media-well); font-size: 11px; }
.storyboard-version-picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.storyboard-version-label { font-size: 11.5px; line-height: 1.4; }
.storyboard-lightbox-prompt textarea { width: 100%; }
.storyboard-preview video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--media-well); border-radius: 10px; }

/* 子分镜视频：一段一行 —— 首帧、这一段的设置、这一段视频的状态。 */
.subshot-video-panel { display: grid; gap: 12px; margin-top: 14px; }
.subshot-video-panel > .asset-hint { margin: 0; }
.subshot-video-grid { max-width: 980px; }
.subshot-video-frame-note, .subshot-video-changed { color: var(--muted); font-size: 11px; }
.subshot-video-changed { color: var(--pending); }
/* 尾帧: the cell's own last frame, shown small beside the offer to change it. */
.subshot-tail { display: flex; gap: 6px; align-items: center; min-height: 22px; }
.subshot-tail .text-button { padding: 0; font-size: 11px; text-align: left; }
.subshot-tail[data-ready="true"] .text-button { color: var(--teal); }
.subshot-tail-thumb { flex: none; width: 32px; height: 24px; border-radius: 4px; background: var(--media-well); object-fit: cover; }
.tail-frame-library { display: flex; flex-wrap: wrap; gap: 10px; max-height: 320px; overflow-y: auto; margin: 10px 0; }
.tail-frame-dialog .form-dialog-body { max-width: 560px; }

.subshot-video-summary { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.subshot-video-settings { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 6px; }
.subshot-video-field { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }
.subshot-video-field input, .subshot-video-field textarea { width: 100%; font-size: 12px; }
.subshot-video-field textarea { min-height: 4.5em; resize: vertical; }
.subshot-video-mismatch { margin: 0; color: var(--pending); font-size: 11px; line-height: 1.5; }

/* 第 2 步右侧：这个分镜用的素材，和第 1 步同一批，只看不改。 */
.video-assets { min-width: 0; }
.video-assets-list { display: flex; flex-wrap: wrap; gap: 10px; }
.video-asset-tile { display: grid; gap: 4px; width: 76px; }
.video-asset-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 8px; background: var(--media-well); color: var(--muted); font-size: 11px; }
.video-asset-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-asset-tile small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.video-asset-tile[data-missing="true"] .video-asset-thumb { border: 1px dashed var(--danger); color: var(--danger); }
.video-assets-hint { margin: 10px 0 0; }

/* .rail-cap - 左栏的分组标题。 */
.rail-label { margin: 0 0 5px 9px; padding: 0; color: var(--muted); font-size: 11px; letter-spacing: 0.1em; text-transform: none; }

/* .helper / .helper-bar / .helper-note - 帮我整理那一组。 */
.prompt-helper { margin-top: 9px; }
.prompt-helper-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prompt-helper-note { color: var(--muted); font-size: 11.5px; }
.prompt-result { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(var(--veil-rgb), 0.05); }
.prompt-result-head { color: var(--muted); font-size: 11.5px; }
.prompt-result-actions { display: flex; gap: 9px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* .thumb - 资产库里的一张。 */
.reference-item { border-radius: 8px; border: 1px solid var(--line); overflow: hidden; background: var(--surface-strong); }
.reference-item img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--media-well); }

/* .entry / .tools - 一行，和行尾那三个按钮。 */
.shot-entry { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.shot-entry .shot-row { flex: 1; min-width: 0; margin: 0; }
.shot-entry-tools { display: flex; gap: 2px; flex: none; }
.shot-move, .shot-remove { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: var(--surface-strong); color: var(--muted); font-size: 13px; }
.shot-move:hover { background: var(--accent); color: var(--on-accent); }
/* The first sheet's `.shot-move:not(:disabled):hover` sets the text to ink and is the more
   specific, so on this accent background it would be ink on ink: say it again at its weight. */
.shot-move:not(:disabled):hover { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.shot-remove:hover { background: var(--danger); color: var(--on-accent); }
.shot-move:disabled { opacity: 0.3; cursor: not-allowed; background: var(--dialog-dim); color: var(--muted); }
.shot-move:disabled:hover { background: var(--dialog-dim); color: var(--muted); }

@container workspace (max-width: 600px) {
  .shot-entry { flex-direction: column; align-items: stretch; }
  .shot-entry .shot-row { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px; padding: 12px; width: 100%; }
  .shot-row .shot-thumb { width: 80px; }
  .shot-row-steps, .shot-row-state { grid-column: 1 / -1; justify-content: flex-start; }
  .shot-entry-tools { align-self: flex-end; flex-wrap: wrap; }
}

/* .chip - 小圆牌。 */
.summary-chip { padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); font-size: 10.5px; font-weight: 500; }
.job-state { border-radius: 99px; }

/* .note - 顶上那条提示，黑底白字。 */
.prompt-override-notice { padding: 12px 16px; border-radius: 12px; border-left: 3px solid var(--accent); background: var(--accent); color: var(--on-accent); }
.prompt-override-notice .text-button { color: var(--on-accent); text-decoration: underline; }

/* details.tuck - 收起来的那一段。 */
.derived-edit, .new-shot-rest { margin-top: 15px; padding: 11px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: none; }
.derived-edit summary, .new-shot-rest summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }


/* Only the end state fills the remaining width; shot size and motion are facts,
   not three equally weighted dashboard cards. */
.derived-facts { display: flex; gap: 9px; flex-wrap: wrap; margin: 12px 0 10px; }
.derived-facts div { min-width: min(150px, 100%); max-width: 100%; padding: 9px 14px; border-radius: 6px; background: var(--dialog-dim); overflow-wrap: anywhere; }
.derived-facts [data-field="end_state"] { flex: 1; }
.derived-facts span { display: block; color: var(--muted); font-size: 10.5px; }
.derived-facts b { font-size: 14px; font-weight: 600; line-height: 1.6; }

/* 画风: this film's, not this shot's. */
.film-style { margin-top: 12px; padding: 10px 13px; border-radius: 6px; background: var(--dialog-dim); }
.film-style > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11.5px; }
.film-style p { margin: 0; font-size: 12.5px; line-height: 1.65; }
.film-style b { font-weight: 600; }


/* One button per step; the loop is a fold away. */
.shot-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.shot-actions-note { color: var(--muted); font-size: 12px; }
.more-actions { margin-top: 14px; }
.more-actions summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.more-actions .shot-actions { margin-top: 10px; }

/* The shot workbench (web/workbench.js). One page per shot: sections for 分镜图,
   尾帧 and 视频, each with what you fill in the middle and the card that makes
   it on the right. Greys throughout; the three signal hues keep their meaning. */
.wb { display: grid; gap: 14px; max-width: 1240px; }
.wb-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wb-title { margin: 0; font: 500 26px/1.25 Georgia, "Noto Serif SC", serif; flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.wb-title-id { white-space: nowrap; }
.wb-title-input { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 0 6px; }
.wb-title-input:hover { border-color: var(--line); }
.wb-title-input:focus { border-color: var(--ink); background: var(--field); outline: none; }
.wb-classic, .wb-switch { font-size: 13px; color: var(--muted); }
.wb-copy { padding: 5px 12px; font-size: 13px; }
.shot-copy { width: auto; padding: 0 8px; font-size: 12px; }
.wb-switch { font-weight: 600; color: var(--ink); }
.wb-chip { display: inline-flex; align-items: center; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--media-well); color: var(--muted); white-space: nowrap; }
.wb-chip[data-tone="ok"] { background: rgba(var(--teal-rgb), 0.12); color: var(--teal); }
.wb-chip[data-tone="wait"] { background: rgba(var(--pending-rgb), 0.14); color: var(--pending); }
.wb-chip[data-tone="no"] { background: rgba(var(--danger-rgb), 0.12); color: var(--danger); }
.wb-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 640px; }
.wb-mode { text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 8px 12px; }
.wb-mode b { display: block; font-size: 14px; }
.wb-mode span { color: var(--muted); font-size: 12px; }
.wb-mode[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.wb-mode:disabled { opacity: 0.55; cursor: not-allowed; }
.wb-mode-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.wb-mode-needs { margin: -4px 0 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }
.wb-bar-label { font-size: 12.5px; color: var(--muted); }
.wb-mode-seg .wb-mode { padding: 5px 12px; }
.wb-mode-seg .wb-mode:disabled { opacity: 0.55; cursor: not-allowed; }
.wb-jump { display: inline-flex; align-items: center; gap: 7px; border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 0 8px; margin-bottom: -1px; color: var(--muted); }
.wb-jump:hover, .wb-jump[aria-current="true"] { color: var(--ink); }
.wb-jump[aria-current="true"] { border-bottom-color: var(--ink); }
.wb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: inline-block; }
.wb-dot[data-tone="ok"] { background: var(--teal); }
.wb-dot[data-tone="wait"] { background: var(--pending); }
.wb-grid-note { border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; justify-items: start; color: var(--muted); }
.wb-grid-note p { margin: 0; }
.wb-stage { scroll-margin-top: calc(var(--wb-parts-h, 0px) + 12px); display: grid; gap: 10px; }
.wb-stage-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wb-stage-head h3 { margin: 0; font: 500 20px/1.3 Georgia, "Noto Serif SC", serif; }
.wb-hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.wb-bench { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.wb-col { display: grid; gap: 12px; min-width: 0; }
.wb-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.wb-panel h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; }
.wb-frame { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: start; }
.wb-slot-wrap { display: grid; gap: 6px; }
.wb-slot { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: 10px; border: 1.5px dashed var(--line); background: var(--media-well-soft); display: grid; place-items: center; overflow: hidden; cursor: pointer; }
.wb-slot:hover, .wb-slot.dropping { border-color: var(--ink); }
.wb-slot.dropping { border-style: solid; }
.wb-slot.filled { border-style: solid; }
.wb-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wb-empty { color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.4; padding: 6px; }
.wb-empty b { display: block; font-size: 22px; font-weight: 300; }
.wb-slot-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 22px; font-size: 12px; }
.wb-src { color: var(--muted); }
.wb-fields { display: grid; gap: 12px; min-width: 0; }
.wb-field { display: grid; gap: 5px; }
.wb-field-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.wb-field textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); padding: 8px 10px; font: inherit; line-height: 1.5; }
.wb-save { font-size: 12px; color: var(--muted); }
.wb-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wb-count[data-state="near"] { color: var(--pending); }
.wb-count[data-state="full"] { color: var(--danger); font-weight: 600; }
.wb-save[data-state="error"] { color: var(--danger); }
.wb-row { display: flex; gap: 12px 24px; flex-wrap: wrap; align-items: flex-start; }
.wb-tier { min-width: 180px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); padding: 5px 8px; font: inherit; }
.wb-duration input { width: 96px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); padding: 5px 8px; }
.wb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-tag { font-size: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.wb-versions { display: grid; gap: 8px; }
/* 视频版本宫格：一格一版一张卡，卡与卡之间留白清楚，缩略图一出片就加载。 */
.wb-versions.wb-ver-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 18px 16px; }
.wb-take-tile { display: grid; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--media-well-soft); }
.wb-take-tile.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wb-take-th { position: relative; width: 100%; aspect-ratio: 9 / 16; border: none; border-radius: 10px; background: var(--media-well); overflow: hidden; padding: 0; cursor: pointer; display: grid; place-items: center; color: var(--muted); }
.wb-take-th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wb-take-cap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.wb-take-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding-top: 2px; border-top: 1px solid var(--line); }
.wb-take-foot .wb-use { padding: 3px 10px; font-size: 12px; }
/* 详情窗口：一列到底——画面在上、动作、参数、提示词。 */
.wb-take-win { width: min(460px, calc(100vw - 32px)); }
.wb-take-player { position: relative; height: min(46vh, 440px); aspect-ratio: 9 / 16; margin: 0 auto; padding: 0; border: none; border-radius: 12px; background: rgba(var(--shadow-rgb), 0.9); overflow: hidden; display: grid; place-items: center; color: var(--on-accent); cursor: pointer; }
.wb-take-player img, .wb-take-player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.wb-take-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.wb-take-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 12.5px; align-items: baseline; }
.wb-take-facts dt { color: var(--muted); white-space: nowrap; }
.wb-take-facts dd { margin: 0; word-break: break-all; }
.wb-take-facts .wb-task-id { display: flex; align-items: baseline; gap: 10px; }
.wb-task-id code { user-select: all; font-size: 12px; }
/* 视频预览条：播放器下方一行小截图，用来逐帧看一眼。
   Explicit min-height so the row is always visible even before frames come
   back or if the fetch fails; the parent grid was quietly squeezing it to zero
   on some browsers. min-width: 100% keeps it stretched inside its grid track. */
.wb-take-strip { display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; min-height: 108px; min-width: 100%; box-sizing: content-box; }
.wb-take-strip-cell { flex: 0 0 auto; width: 56px; height: 100px; border-radius: 4px; background: var(--media-well); overflow: hidden; }
.wb-take-strip-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 角色的声音：一行，挑一个音色库里的声音。 */
.reference-voice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 6px; }
.reference-voice > span { color: var(--muted); font-size: 12px; }
.reference-voice-select { flex: 1 1 140px; min-width: 0; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font-size: 12.5px; }
/* 角色的台词：每个会说话的角色一节，台词列表 + 念一句。 */
/* 音色库窗口 */
.voice-pool-win { width: min(560px, calc(100vw - 32px)); }
.voice-pool-list { display: grid; gap: 8px; }
.voice-pool-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.voice-pool-item small { display: block; color: var(--muted); font-size: 11.5px; word-break: break-all; }
.voice-pool-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.voice-pool-form input { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font: inherit; font-size: 12.5px; min-width: 0; }
.voice-pool-form button { grid-column: 1 / -1; justify-self: start; }
.wb-take-body .wb-eyebrow { margin: 4px 0 0; }
/* 提示词框：矮一点，右下角可拖拉；标题右侧放动作，与「用到的素材」一致。 */
.wb-take-body .wb-ver-words { max-height: 260px; resize: vertical; overflow: auto; min-height: 120px; }
.wb-take-body::after { content: ""; display: block; height: 12px; }
.wb-take-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wb-take-prompt-head .wb-eyebrow { margin: 0; }
.wb-take-prompt-tools { display: flex; gap: 10px; }
/* 用到的素材：宫格摆放，缩略图在上，标签+名字在下，比一行一条省地方。 */
.wb-take-cast { display: grid; gap: 8px; }
.wb-take-cast-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wb-take-cast-head .wb-eyebrow { margin: 0; }
.wb-take-cast-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.wb-take-cast-item { display: grid; gap: 4px; min-width: 0; }
.wb-take-cast-item .wb-cast-thumb { width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; background: var(--media-well); overflow: hidden; display: grid; place-items: center; color: var(--muted); font-size: 22px; }
.wb-take-cast-item .wb-cast-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wb-take-cast-meta { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; }
.wb-take-cast-meta .wb-cast-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-tag-static { flex: 0 0 auto; padding: 1px 6px; border-radius: 99px; background: var(--media-well); color: var(--muted); font-size: 11px; }
.wb-ver { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.wb-ver.current { background: var(--media-well-soft); }
.wb-ver-th { position: relative; width: 56px; aspect-ratio: 9 / 16; border-radius: 6px; background: var(--media-well); overflow: hidden; display: grid; place-items: center; color: var(--muted); }
.wb-ver-play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--on-accent); text-shadow: 0 1px 4px rgba(var(--shadow-rgb), 0.9); pointer-events: none; }
.wb-ver-detail { display: none; grid-column: 1 / -1; gap: 8px; padding: 10px 2px 2px; border-top: 1px dashed var(--line); }
.wb-ver[data-open="on"] .wb-ver-detail { display: grid; }
.wb-ver-facts { margin: 0; font-size: 12px; color: var(--muted); word-break: break-all; }
.wb-ver-words { margin: 0; max-height: 240px; overflow: auto; padding: 10px; border-radius: 8px; background: var(--media-well-soft); font: inherit; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; user-select: text; }
.wb-ver-tools { display: flex; gap: 10px; justify-content: flex-end; }
.wb-ver-th img { width: 100%; height: 100%; object-fit: cover; }
.wb-ver-meta { font-size: 12.5px; min-width: 0; }
.wb-ver-meta div { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-ver-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.wb-ver-act .wb-use { padding: 4px 10px; font-size: 12.5px; }
.wb-none { margin: 0; color: var(--muted); font-size: 12.5px; }
.wb-player video { width: 100%; max-height: 420px; border-radius: 10px; background: var(--media-well); margin-bottom: 10px; }
.wb-card { position: sticky; top: calc(var(--wb-parts-h, 0px) - 8px); display: grid; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.wb-eyebrow { margin: 0; font-size: 11.5px; letter-spacing: 0.08em; color: var(--muted); }
p.wb-use { margin: 0; font-size: 15px; font-weight: 600; }
.wb-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.wb-provider { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); padding: 7px 8px; font: inherit; }
.wb-provider-menus { display: grid; gap: 8px; }
.wb-provider-menus .wb-provider:not(:disabled):has(option:checked:not([value=""])) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wb-pinned { margin: 0; font-size: 12.5px; color: var(--muted); }
.wb-notes, .wb-missing { display: grid; gap: 4px; margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--muted); }
.wb-notes li.change { color: var(--ink); }
.wb-missing { color: var(--pending); }
.wb-refused { margin: 0; font-size: 13px; color: var(--danger); }
.wb-price { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.wb-price b { font-size: 28px; font-weight: 600; }
.wb-price span { color: var(--muted); font-size: 13px; }
.wb-rate { margin: -4px 0 0; font-size: 14px; font-weight: 600; }
.wb-stage.wb-flash { outline: 2px solid rgba(var(--teal-rgb), 0.7); outline-offset: 6px; border-radius: var(--radius); }
.wb-seed { display: grid; gap: 5px; }
.wb-seed-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wb-seg { display: inline-flex; background: var(--media-well); border-radius: 9px; padding: 3px; gap: 2px; }
.wb-seg button { border: 0; background: transparent; color: var(--muted); padding: 4px 12px; border-radius: 7px; }
.wb-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; }
.wb-seed-value { width: 130px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); padding: 5px 8px; }
.wb-generate { width: 100%; }
@container workspace (max-width: 900px) {
  .wb-bench { grid-template-columns: minmax(0, 1fr); }
  .wb-card { position: static; }
}
@container workspace (max-width: 560px) {
  .wb-frame { grid-template-columns: minmax(0, 1fr); }
  .wb-modes { grid-template-columns: minmax(0, 1fr); }
}
.wb-from-library { font-size: 12.5px; justify-self: start; }
.wb-picker { width: min(760px, calc(100vw - 32px)); max-height: min(78vh, 720px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--dialog); color: var(--ink); box-shadow: 0 24px 60px rgba(var(--shadow-rgb), 0.4); overflow: hidden; }
.wb-picker::backdrop { background: rgba(var(--veil-rgb), 0.45); }
.wb-picker-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--dialog); }
.wb-picker-head h3 { margin: 0; font-size: 15px; }
.wb-picker-close { font-size: 20px; line-height: 1; padding: 0 6px; }
.wb-picker-body { display: grid; gap: 12px; padding: 16px 18px 20px; max-height: calc(min(78vh, 720px) - 56px); overflow-y: auto; }
.wb-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.wb-pick { display: grid; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); text-align: left; font-size: 11.5px; }
.wb-pick img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 5px; background: var(--media-well); }
.wb-pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-pick:hover:not(:disabled) { border-color: var(--ink); }
.wb-pick:disabled { opacity: 0.45; cursor: not-allowed; }
.wb-pick-glyph { display: grid; place-items: center; aspect-ratio: 3 / 4; font-size: 26px; color: var(--muted); background: var(--media-well); border-radius: 5px; }
.wb-upload { justify-self: start; cursor: pointer; }
.wb-cast { display: grid; gap: 18px; }
.wb-cast-group { display: grid; gap: 8px; }
.wb-cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.wb-cast-list { display: grid; gap: 8px; }
.wb-cast-tile, .wb-cast-row { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: grab; }
.wb-cast-tile { display: grid; gap: 6px; padding: 6px; }
.wb-cast-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; padding: 6px 8px; }
.wb-cast-tile.dragging, .wb-cast-row.dragging { opacity: 0.4; }
.wb-cast-tile.drop-before { box-shadow: inset 3px 0 0 var(--ink); }
.wb-cast-tile.drop-after { box-shadow: inset -3px 0 0 var(--ink); }
.wb-cast-row.drop-before { box-shadow: inset 0 3px 0 var(--ink); }
.wb-cast-row.drop-after { box-shadow: inset 0 -3px 0 var(--ink); }
.wb-cast-thumb { display: grid; place-items: center; border-radius: 7px; background: var(--media-well); color: var(--muted); overflow: hidden; }
.wb-cast-tile .wb-cast-thumb { aspect-ratio: 3 / 4; }
.wb-cast-row .wb-cast-thumb { width: 44px; height: 44px; }
.wb-cast-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wb-cast-meta { display: flex; align-items: center; gap: 2px 8px; flex-wrap: wrap; min-width: 0; font-size: 12.5px; }
.wb-cast-label { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-cast-meta .wb-tag { background: transparent; color: var(--ink); cursor: pointer; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.wb-cast-add-tile { min-height: 120px; border: 1.5px dashed var(--line); border-radius: 10px; background: transparent; color: var(--muted); }
.wb-cast-add-tile:hover { border-color: var(--ink); color: var(--ink); }
.wb-cast-list .wb-cast-add { justify-self: start; }
.wb-cast-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wb-cast-name { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.wb-drop { cursor: pointer; font-size: 20px; }
.wb-drop:hover, .wb-drop.dropping { outline: 1.5px dashed var(--ink); outline-offset: 1px; }

.wb-playable { cursor: pointer; }
.wb-zoomable { cursor: zoom-in; }
.wb-picker-made { margin: 10px 0; display: grid; gap: 6px; }
.wb-picker-made-list { display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.wb-pick-made { justify-content: start; text-align: left; }
.wb-picture-frame img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wb-drop.wb-zoomable { cursor: zoom-in; }
.wb-playable.playing { color: var(--teal); }
.wb-take-prompt { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.audio-asset-list { display: grid; gap: 6px; }
.audio-asset { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.audio-asset-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wb-dub-knob { flex: 1 1 96px; }
.wb-dub-vector { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin-top: 8px; }
.wb-dub-feel { display: grid; grid-template-columns: 3.2em 1fr 2.4em; align-items: center; gap: 8px; font-size: 12.5px; }
.wb-dub-feel output { text-align: right; color: var(--muted); }
.wb-dub-emo-audio { margin-top: 8px; }
.wb-dub-pick { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.wb-dub-pick select { flex: 1 1 auto; min-width: 0; }
.wb-dub-pick .wb-upload { flex: none; white-space: nowrap; }
.wb-dub-pick .wb-dub-listen { flex: none; white-space: nowrap; }
.wb-dub-vector[data-idle="true"] { opacity: 0.55; }
.wb-dub-random { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.wb-field input:not([type="checkbox"]), .wb-field select { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); padding: 7px 10px; font: inherit; }
.wb-dub-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.wb-dub-face { aspect-ratio: 1 / 1; font-size: 28px; }
.wb-dub-face[data-playing="true"] { color: var(--accent); }
.wb-dub-words { margin: 0; font-size: 12.5px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.wb-dub-voice { margin: 0; font-weight: 600; }
.wb-dub-agree { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.5; }

/* 工具 */
.tools-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card { display: grid; gap: 6px; text-align: left; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.tool-card:hover { border-color: var(--accent); }
.tool-card strong { font-size: 14.5px; }
.tool-card span { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.tool-card small { color: var(--pending); font-size: 11.5px; }
.tool-page { display: grid; gap: 14px; max-width: 760px; }
.tool-back { justify-self: start; }
.tool-panel { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.tool-panel h3 { margin: 0; font-size: 14px; }
.tool-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tool-field { display: grid; gap: 5px; min-width: 0; }
.tool-field > span { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12.5px; }
.tool-field input, .tool-field select, .tool-field textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); color: var(--ink); font: inherit; line-height: 1.5; }
.tool-field textarea { resize: vertical; }
.tool-count { font-variant-numeric: tabular-nums; }
.tool-agree { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 1.5; }
.tool-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.tool-error { margin: 0; color: var(--danger); font-size: 12.5px; }
.tool-result { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--media-well-soft); }
.tool-result code { word-break: break-all; font-size: 12px; }
.tool-result-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.voice-pool-actions { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .tool-row { grid-template-columns: 1fr; } }
/* end 工具 */

/* Parts */
/* How tall the Part bar is; workbench.js sets the real figure on the page once it is drawn. What sticks under the bar leaves this much room. */
.wb {
  --wb-parts-h: 0px;
}
/* Stays on screen under the 全部任务 line while the page scrolls. top is minus the
   scroller's 20px of padding, because a sticky box sticks to the inside of it: at 0 it would
   stop 20px short and let the page show through the gap. The page's own
   colour behind it, so what scrolls under it is covered rather than shown through. */
.wb-parts { position: sticky; top: -20px; z-index: 3; margin: 2px 0 0; padding: 6px 0; background: var(--ground); border-bottom: 1px solid var(--line); }
.wb-part-mobile { display: none; }
/* One line to a tab, and wrapping onto a second line when there are more Parts than fit. */
.wb-part-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; max-height: 7.5em; overflow-y: auto; }
.wb-part-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 22em; padding: 3px 12px 3px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.5; cursor: pointer; }
.wb-part-tab b { font-size: 13px; white-space: nowrap; }
.wb-part-sub { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
button.wb-part-sub { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; cursor: text; }
.wb-part-sub-empty { font-style: italic; opacity: 0.7; }
.wb-part-sub-input { width: 9em; box-sizing: border-box; padding: 1px 6px; border: 1px solid var(--accent); border-radius: 6px; background: var(--field); color: var(--ink); font: inherit; font-size: 12px; }
/* Where the Part stands, in the tab's corner: red a draft, amber a clip not confirmed, green one that is. */
.wb-part-dot { position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; box-sizing: content-box; border: 2px solid var(--ground); border-radius: 50%; background: var(--pending); }
.wb-part-dot[data-kind="draft"] { background: var(--danger); }
.wb-part-dot[data-kind="accepted"] { background: var(--teal); }
.wb-part-tab[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--media-well-soft); cursor: default; }
.wb-part-add { align-self: center; }
.wb-part-add:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-part-copy { align-self: center; }
.wb-part-copy:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-part-remove { align-self: center; color: var(--danger); }
.wb-part-remove:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-part-note { margin: 0; color: var(--pending); font-size: 12.5px; line-height: 1.55; }
.shot-entry-part { margin-left: 28px; padding-left: 10px; border-left: 2px solid var(--line); }
.shot-fold { width: auto; padding: 0 10px; white-space: nowrap; }
.crumb-part { color: var(--accent-strong); }
/* end Parts */

/* Parts in the cut */
.final-cut-row[data-part] { border-left: 4px solid var(--accent); }
.final-cut-apart { color: var(--pending); font-size: 11.5px; font-style: normal; }
.final-cut-size { color: var(--muted); font-size: 11.5px; font-style: normal; font-variant-numeric: tabular-nums; }
.final-cut-size[data-odd="true"] { color: var(--danger); }
/* end Parts in the cut */

/* Instance */
.wb-instance { color: var(--pending); }
/* end Instance */

/* Bubbles */
.bubbles { position: fixed; z-index: 31; right: 24px; bottom: 92px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.bubble { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 13px; background: var(--card); color: var(--ink); box-shadow: 0 16px 50px rgba(var(--shadow-rgb), 0.35); animation: bubble-in 180ms ease; }
.bubble[data-kind="warn"] { border-left-color: var(--pending); }
.bubble[data-kind="error"] { border-left-color: var(--danger); }
.bubble-text { display: grid; gap: 3px; min-width: 0; }
.bubble-text strong { font-size: 14px; }
.bubble-text small { color: var(--muted); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.bubble-close { font-size: 18px; line-height: 1; padding: 2px 8px; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .bubble { animation: none; } }

/* Mobile shell: the workbench already becomes a single column through its
   container queries. The outer frame needs its own mode so a 56px desktop icon
   rail does not steal the width from a phone. Project switching stays at the
   top; workspace navigation becomes a labelled bottom bar. */
@media (max-width: 720px) {
  html, body { min-height: 100dvh; }
  body { overflow-x: hidden; }
  .app-shell {
    --rail-w: 0px;
    --dock-w: 0px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100dvh;
    min-height: 100dvh;
  }
  .workarea { grid-column: 1; grid-row: 1; min-height: 0; }
  .rail,
  .app-shell[data-rail="off"] .rail,
  .app-shell[data-rail="on"] .rail {
    position: fixed;
    z-index: 9;
    inset: auto 0 0;
    width: auto;
    height: calc(62px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    display: block;
    padding: 0 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: var(--card);
    overflow: hidden;
  }
  .rail-identity, .rail-theme, .rail-project-facts, .rail-new-project,
  .system-card, .connection, .rail-toggle { display: none !important; }
  .app-shell[data-rail="off"] .project-picker,
  .project-picker {
    position: fixed;
    z-index: 8;
    inset: 8px 12px auto;
    display: grid;
    width: auto;
    margin: 0;
  }
  .project-picker > span { display: none; }
  .project-picker-toggle { width: 100%; min-width: 0; min-height: 42px; }
  .app-shell:has(.progress-strip:not([hidden])) .project-picker { display: none; }
  .rail-group {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    height: 100%;
    gap: 2px;
  }
  .rail-label { display: none; }
  .app-shell[data-rail="off"] .rail-nav,
  .rail-nav {
    position: relative;
    z-index: 11;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    min-width: 0;
    flex: 1 1 0;
    padding: 5px 2px;
    border-radius: 10px;
    text-align: center;
    font-size: 10.5px;
    pointer-events: auto;
    touch-action: manipulation;
  }
  .app-shell[data-rail="off"] .rail-nav .rail-text { display: block; }
  .rail-nav .rail-count { display: none; }
  .rail-nav .rail-text { margin-left: 0; line-height: 1.2; }
  .rail-icon { width: auto; font-size: 17px; line-height: 1.1; }
  .workhead { padding: 56px 12px 0; }
  .workarea:has(.progress-strip:not([hidden])) .workhead { padding-top: 0; }
  .workhead-top { min-height: 40px; gap: 8px; margin-bottom: 0; padding-right: 92px; }
  .crumbs { gap: 5px; font-size: 12px; }
  .crumbs button { font-size: 12px; }
  .crumbs .crumb-note { display: none; }
  .dock-toggle {
    position: fixed;
    z-index: 12;
    top: 62px;
    right: 16px;
    min-height: 38px;
    padding: 6px 10px;
    border-color: var(--line);
    background: var(--card);
    box-shadow: 0 6px 20px rgba(var(--shadow-rgb), 0.16);
    font-size: 11px;
  }
  .dock-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--ink); }
  .workarea:has(.progress-strip:not([hidden])) .dock-toggle { top: 5px; }
  .progress-strip {
    position: fixed;
    z-index: 7;
    top: 46px;
    right: 0;
    bottom: calc(70px + env(safe-area-inset-bottom));
    display: block;
    width: 44px;
    box-sizing: border-box;
    padding: 5px 3px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background: var(--card);
    box-shadow: -6px 0 20px rgba(var(--shadow-rgb), 0.1);
    overflow-y: auto;
  }
  .progress-steps {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    gap: 5px;
    overflow: visible;
    scrollbar-width: none;
  }
  .progress-steps::-webkit-scrollbar { display: none; }
  .pstep {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    min-height: 52px;
    box-sizing: border-box;
    padding: 6px 2px;
    border-top-width: 0;
    border-left: 3px solid transparent;
    border-radius: 8px;
    text-align: center;
  }
  .pstep .pstep-index { font-size: 9px; }
  .pstep .pstep-name { margin-top: 3px; font-size: 10px; line-height: 1.15; white-space: normal; }
  .pstep .pstep-state { display: none; }
  .pstep[aria-current="true"] { border-left-color: var(--accent-strong); border-top-color: transparent; }
  .progress-side { display: none; }
  .workbody { padding: 12px 12px calc(88px + env(safe-area-inset-bottom)); }
  .workarea:has(.progress-strip:not([hidden])) .workbody { padding-right: 50px; }
  .dock {
    top: 58px;
    right: 12px;
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 24px));
    max-height: none;
    padding: 52px 16px 16px;
  }
  .wb-parts { position: static; top: auto; z-index: auto; padding: 3px 0 5px; }
  .wb-part-mobile { display: grid; gap: 8px; padding: 3px 0 7px; }
  .wb-part-mobile-switch { display: grid; gap: 5px; color: var(--muted); font-size: 11.5px; }
  .wb-part-select {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 9px 38px 9px 12px;
    border: 1px solid var(--accent);
    border-radius: 11px;
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-weight: 650;
  }
  .wb-part-mobile-subtitle { min-width: 0; }
  .wb-part-mobile-note {
    width: 100%;
    min-height: 40px;
    padding: 7px 10px;
    border: 1px dashed var(--line);
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .wb-part-mobile-subtitle .wb-part-sub-input { width: 100%; min-height: 42px; font-size: 14px; }
  .wb-part-mobile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wb-part-mobile-actions > :only-child { grid-column: 1 / -1; }
  .wb-part-mobile-actions button { min-height: 44px; }
  .wb-part-mobile-remove { color: var(--danger); }
  .wb-part-row {
    display: none;
  }
  .wb-part-row::-webkit-scrollbar { display: none; }
  .wb-part-tab { flex: 0 0 auto; min-width: 112px; min-height: 44px; max-width: 70vw; padding: 7px 12px; scroll-snap-align: start; }
  .wb-part-add, .wb-part-copy, .wb-part-remove { flex: 0 0 auto; min-width: 44px; min-height: 44px; }
  .wb-part-sub { max-width: 42vw; }
  .wb-stage { gap: 8px; scroll-margin-top: 8px; }
  .wb, .wb-stage, .wb-bench, .wb-col, .wb-panel { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
  .wb { overflow-x: clip; }
  .wb-stage-head { display: block; }
  .wb-stage-head h3 { font-size: 18px; }
  .wb-hint { display: block; margin-top: 4px; line-height: 1.45; }
  .wb-panel { padding: 12px; border-radius: 12px; }
  .wb-panel h4 { margin-bottom: 9px; }
  .wb-bench { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wb-frame { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .wb-slot-wrap { justify-items: center; }
  .wb-slot { max-width: 220px; }
  .wb-fields { gap: 14px; }
  .wb-field textarea { min-height: 112px; font-size: 14px; }
  .wb-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .wb-tier, .wb-duration input, .wb-provider, .wb-seed-value { width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; }
  .wb-mode-group { display: grid; gap: 6px; margin-left: 0; }
  .wb-mode-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .wb-mode-seg .wb-mode { min-height: 44px; padding: 7px 5px; text-align: center; }
  .wb-seed-row { align-items: stretch; }
  .wb-seg button { min-height: 38px; }
  .wb-cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .wb-cast-tools, .wb-take-actions, .wb-take-foot, .wb-ver-act { gap: 8px; }
  .wb-cast-tools > button, .wb-take-actions > button, .wb-take-foot button, .wb-ver-act button,
  .wb-from-library, .wb-upload, .wb-generate { min-height: 44px; }
  .wb-generate { font-size: 15px; }
  .wb-prompt-tools { flex-wrap: wrap; }
  .wb-prompt-tools button, .wb-take-prompt-tools button { min-height: 40px; }
  .wb-take-win { width: calc(100vw - 24px); max-width: none; }
  .toast { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
  .bubbles { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
}
/* end Bubbles */

/* Import from another project */
.asset-import-body { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; margin: 10px 0; }
.asset-import-source { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.asset-import-source small, .asset-import-item small { color: var(--muted); }
.asset-import-source:disabled { opacity: 0.5; cursor: not-allowed; }
.asset-import-title { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.asset-import-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.asset-import-item small { margin-left: auto; }
.asset-import-skipped { margin: 0; font-size: 13px; color: var(--muted); }
.asset-import-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; }
.asset-import-tools .reference-filters { flex: 1 1 auto; }
.asset-import-tools .text-button:disabled { opacity: 0.45; cursor: not-allowed; }
/* end Import */

/* Vouchers */
.voucher-redeem { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 4px; }
.voucher-redeem label span { font-weight: 600; font-size: 13px; }
.voucher-redeem input { width: 20em; max-width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font: inherit; letter-spacing: 0.04em; }
.voucher-make { align-items: end; }
.voucher-make .settings-note { grid-column: 1 / -1; }
.voucher-kind-pick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; padding: 0; border: 0; }
.voucher-kind-pick legend { color: var(--muted); font-size: 11px; padding: 0; }
.voucher-kind-pick label { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
.voucher-fresh { display: grid; gap: 8px; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--pending); border-radius: 10px; background: var(--card); }
.voucher-warning { margin: 0; color: var(--pending); font-size: 13px; line-height: 1.55; }
.voucher-codes { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); font: 13px/1.6 ui-monospace, Consolas, monospace; resize: vertical; user-select: all; }
.voucher-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.voucher-list { display: grid; gap: 6px; margin: 12px 0; }
.voucher-row { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.voucher-row[data-status="redeemed"], .voucher-row[data-status="void"], .voucher-row[data-status="expired"] { opacity: 0.7; }
.voucher-what { display: grid; gap: 2px; min-width: 9em; }
.voucher-what small, .voucher-state small { color: var(--muted); font-size: 12px; }
.voucher-state { display: grid; gap: 2px; margin-right: auto; }
.voucher-chip { display: inline-block; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.voucher-row[data-status="unused"] .voucher-chip { border-color: var(--teal); color: var(--teal); }
.voucher-row[data-fresh="true"] { opacity: 1; border-color: var(--accent); background: rgba(var(--accent-rgb), 0.1); }
.voucher-head-side { display: grid; justify-items: end; gap: 2px; }
.voucher-live { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.voucher-left { font-variant-numeric: tabular-nums; }
.voucher-left[data-spent="true"] { color: var(--pending); }
.voucher-history { display: grid; gap: 4px; margin: 6px 0 14px; }
.voucher-history-title { margin: 0 0 2px; color: var(--muted); font-size: 12px; }
.voucher-history-row { display: flex; align-items: baseline; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.voucher-history-row span { color: var(--muted); }
.voucher-history-row small { margin-left: auto; color: var(--muted); font-size: 12px; }
/* end Vouchers */

/* 资产库 shelves: 素材 / 生成物 / 音色, and the dubs by character then shot. */
.asset-tabs { display: flex; gap: 6px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.asset-tab { padding: 9px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; }
.asset-tab:hover { color: var(--ink); }
.asset-tab[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.asset-tab-count { margin-left: 4px; color: var(--muted); font-size: 11.5px; }
.library-bar .reference-filters + .reference-filters { padding-left: 10px; border-left: 1px solid var(--line); }
.dub-list { display: grid; gap: 8px; }
.dub-group, .dub-shot { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.dub-group > summary, .dub-shot > summary { cursor: pointer; padding: 8px 0; color: var(--ink); font-size: 13px; }
.dub-shot { margin: 4px 0 8px 14px; border-radius: 9px; }
.dub-shot > summary { color: var(--muted); font-size: 12.5px; }
.dub-shot > .audio-asset { margin: 0 0 6px; }
/* end 资产库 shelves */
.wb-ver-th, .wb-picture-frame { position: relative; }
.wb-shape-mismatch { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: 999px; background: rgba(var(--ink-rgb), 0.78); color: var(--on-accent); font-size: 10.5px; line-height: 1.5; pointer-events: auto; }

/* The box Wan 3.0 is asked through: words, with pictures, clips and sounds put straight into it. It takes the place
   of the 怎么动 fields (prompt, size, shape, length) while that provider is chosen; the elements are the same ones. */
.wb-composed > .wb-fields { display: none; }
.wb-composer { position: relative; display: grid; gap: 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 22px; background: var(--card); transition: border-color 0.15s, box-shadow 0.15s; }
.wb-composer:focus-within { border-color: rgba(var(--ink-rgb), 0.4); }
.wb-composer.dropping { border-color: var(--ink); border-style: dashed; box-shadow: 0 0 0 4px rgba(var(--ink-rgb), 0.08); }
.wb-composer.dropping::after { content: "松开，放进这个框"; position: absolute; inset: 0; display: grid; place-items: center; border-radius: 20px; background: rgba(var(--veil-rgb), 0.06); color: var(--ink); font-weight: 600; pointer-events: none; }
.wb-composer-media { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.wb-composer-add { display: grid; justify-items: center; align-content: center; gap: 2px; width: 76px; height: 76px; border: 0; border-radius: 14px; background: var(--media-well-soft); color: var(--muted); font-size: 12px; cursor: pointer; }
.wb-composer-add b { font-size: 20px; font-weight: 300; line-height: 1; }
.wb-composer-add:hover { background: var(--media-well); color: var(--ink); }
.wb-composer-kinds { display: flex; gap: 6px; align-items: center; }
.wb-composer-cast { display: contents; }
.wb-composer-cast .wb-cast { display: contents; }
.wb-composer-cast .wb-cast-group { display: contents; }
.wb-composer-cast .wb-field-label, .wb-composer-cast .wb-cast-add, .wb-composer-cast .wb-cast-add-tile { display: none; }
.wb-composer-cast .wb-cast-grid, .wb-composer-cast .wb-cast-list { display: contents; }
.wb-composer-cast .wb-cast-tile, .wb-composer-cast .wb-cast-row { display: block; width: 76px; height: 76px; padding: 0; border: 0; overflow: hidden; border-radius: 14px; background: var(--media-well); }
.wb-composer-cast .wb-cast-thumb { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; font-size: 22px; }
.wb-composer-cast .wb-cast-thumb img { object-fit: cover; }
.wb-composer-cast .wb-cast-meta { display: contents; }
.wb-composer-cast .wb-cast-label, .wb-composer-cast .wb-cast-meta .text-button:not(:last-child) { display: none; }
.wb-composer-cast .wb-cast-meta .wb-tag { position: absolute; left: 4px; bottom: 4px; white-space: nowrap; padding: 1px 6px; border: 0; border-radius: 99px; background: rgba(var(--ink-rgb), 0.66); color: var(--on-accent); font-size: 10px; line-height: 1.5; }
.wb-composer-cast .wb-cast-meta .text-button:last-child { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: rgba(var(--ink-rgb), 0.66); color: var(--on-accent); font-size: 0; cursor: pointer; }
.wb-composer-cast .wb-cast-meta .text-button:last-child::before { content: "✕"; font-size: 11px; line-height: 20px; }
.wb-composer-prompt { position: relative; }
.wb-composer-prompt .wb-field { gap: 0; }
.wb-composer-prompt .wb-field-label { display: none; }
.wb-words { position: relative; }
.wb-words textarea { display: block; }
.wb-mirror { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; white-space: pre-wrap; overflow-wrap: break-word; color: var(--ink); box-sizing: border-box; padding-right: 2px; }
.wb-words textarea.wb-ghosted { color: transparent; caret-color: var(--ink); }
.wb-framed { position: relative; }
.wb-framed img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wb-nametag { position: relative; color: transparent; border-radius: 6px; background: rgba(var(--teal-rgb), 0.14); }
/* A name that falls across a line end is two boxes: what is drawn on it is placed from the first one's top, never its middle. */
.wb-nametag-thumb { position: absolute; left: 3px; top: 0.12em; width: 1.25em; height: 1.25em; border-radius: 4px; background-position: center; background-size: cover; background-repeat: no-repeat; }
.wb-nametag::after { content: attr(data-label); white-space: nowrap; position: absolute; left: 6px; top: 0; font-size: 0.92em; font-weight: 600; color: var(--on-teal); }
.wb-nametag[data-thumb]::after { left: calc(1.25em + 8px); }
.wb-composer-prompt textarea { min-height: 96px; border: 0; background: transparent; padding: 4px 2px; font-size: 15.5px; resize: none; box-shadow: none; outline: none; }
.wb-composer-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wb-composer-spacer { flex: 1; }
.wb-composer-pill { display: inline-flex; align-items: center; gap: 0; border: 0; border-radius: 999px; background: var(--media-well-soft); color: var(--ink); padding: 8px 14px; font-size: 14px; cursor: pointer; }
.wb-composer-pill:hover { background: var(--media-well); }
.wb-composer-pill:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-composer-settings { padding: 0; overflow: hidden; }
.wb-composer-cell { padding: 8px 12px; border-right: 1px solid var(--line); white-space: nowrap; }
.wb-composer-cell:last-child { border-right: 0; }
.wb-composer-sound[aria-pressed="true"] { background: rgba(var(--teal-rgb), 0.14); color: var(--on-teal); }
.wb-composer-price { padding: 7px 14px; border: 1.5px solid rgba(var(--teal-rgb), 0.4); border-radius: 999px; color: var(--on-teal); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.wb-composer-send { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 20px; line-height: 1; cursor: pointer; }
.wb-composer-send:disabled { opacity: 0.35; cursor: not-allowed; }
.wb-composer-note { margin: 0; font-size: 12.5px; color: var(--muted); }
.wb-composer-note:empty { display: none; }
.wb-composer-note[data-state="wait"] { color: var(--pending); }
.wb-composer-pop { position: absolute; left: 12px; bottom: 64px; z-index: 5; display: grid; gap: 8px; width: min(380px, calc(100% - 24px)); padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 12px 36px rgba(var(--shadow-rgb), 0.28); }
.wb-composer-label { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.wb-composer-label:first-child { margin-top: 0; }
.wb-composer-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-composer-ratios { flex-wrap: nowrap; }
.wb-composer-ratios .wb-composer-choice { min-width: 0; padding-left: 4px; padding-right: 4px; }
.wb-composer-choice { flex: 1 1 auto; min-width: 58px; padding: 8px 10px; border: 0; border-radius: 12px; background: var(--media-well-soft); color: var(--muted); font-size: 14px; cursor: pointer; }
.wb-composer-choice[aria-pressed="true"] { background: var(--media-well); color: var(--ink); font-weight: 650; }
.wb-composer-choice:disabled { opacity: 0.5; cursor: not-allowed; }
.wb-composer-length { display: flex; align-items: center; gap: 12px; }
.wb-composer-length input { flex: 1; }
.wb-composer-length b { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.wb-mention { position: absolute; left: 0; top: 100%; z-index: 6; display: grid; gap: 2px; min-width: 240px; max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 10px 30px rgba(var(--shadow-rgb), 0.26); }
.wb-mention-head { margin: 2px 6px 4px; font-size: 12.5px; color: var(--muted); }
.wb-mention-none { margin: 4px 6px; font-size: 12.5px; color: var(--muted); }
.wb-mention-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.wb-mention-item:hover { background: var(--media-well-soft); }
.wb-mention-thumb { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--media-well); overflow: hidden; color: var(--muted); }
.wb-mention-thumb img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) { .wb-composer { transition: none; } }
