/* Generated by scripts/build.js. Edit src/client/styles/ source files. */

/* src/client/styles/00-tokens.css */
:root {
  color-scheme: dark;
  --bg: #050607;
  --bg-2: #090a0c;
  --panel: #0d0f12;
  --panel-2: #111419;
  --panel-3: #151922;
  --line: #242832;
  --line-soft: #191d24;
  --text: #f4f6f1;
  --muted: #9ba2ad;
  --dim: #68707c;
  --lime: #cdfa46;
  --lime-2: #a9d934;
  --lime-soft: rgba(205, 250, 70, 0.075);
  --danger: #ff6978;
  --warn: #e8b85b;
  --blue: #78a6ff;
  --ok: #82d99d;
  --shadow: none;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #070809 0%, var(--bg) 48%, #030404 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

/* src/client/styles/01-shell.css */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  height: 100vh;
  width: 100vw;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line-soft);
  background: #070809;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #111419;
  color: var(--text);
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 14px;
  font-weight: 800;
}

.brand span {
  margin-top: 1px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}

.nav-section {
  margin-bottom: 22px;
}

.nav-section p {
  margin: 0 0 8px 10px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-item,
.admin-section {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  margin-bottom: 5px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.nav-item svg,
.admin-section svg,
.top-actions svg,
.panel-header svg,
.source-card svg {
  width: 17px;
  height: 17px;
}

.nav-item:hover,
.admin-section:hover {
  background: #101319;
  color: var(--text);
}

.nav-item.is-active,
.admin-section.is-active {
  border-color: rgba(205, 250, 70, 0.28);
  background: var(--lime-soft);
  color: var(--lime);
}

.account-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 17px;
  background: #0b0d10;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #171b21;
  color: var(--lime);
  font-size: 11px;
  font-weight: 900;
}

.account-card strong,
.account-card span {
  display: block;
}

.account-card strong {
  font-size: 12px;
}

.account-card span {
  margin-top: 2px;
  color: var(--dim);
  font-size: 11px;
}

.workspace {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-shrink: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.top-actions,
.composer-actions,
.console-actions,
.action-stack,
.control-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.tiny-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #111419;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.primary-button {
  padding: 0 16px;
  border-color: transparent;
  background: var(--lime);
  color: #090b0d;
}

.ghost-button,
.danger-button {
  padding: 0 14px;
}

.danger-button {
  color: var(--danger);
}

.icon-button {
  width: 38px;
  padding: 0;
}

.tiny-button {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 11px;
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover,
.tiny-button:hover {
  transform: translateY(-1px);
  border-color: rgba(205, 250, 70, 0.22);
}

.primary-button:hover {
  background: #d9ff62;
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled,
.icon-button:disabled,
.tiny-button:disabled,
.primary-button.is-disabled,
.ghost-button.is-disabled,
.danger-button.is-disabled,
.icon-button.is-disabled,
.tiny-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.46;
  pointer-events: none;
  transform: none;
}

.primary-button:disabled,
.primary-button.is-disabled {
  border-color: rgba(148, 163, 184, 0.18);
  background: #20251d;
  color: #87907d;
}

.primary-button:disabled:hover,
.primary-button.is-disabled:hover {
  background: #20251d;
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin: 18px 0 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.status-pill,
.status-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #0b0d10;
  white-space: nowrap;
}

.status-pill strong,
.status-progress strong {
  font-size: 12px;
}

.status-pill span,
.status-progress span {
  color: var(--dim);
  font-size: 11px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(130, 217, 157, 0.08);
}

.status-progress {
  flex: 1;
  min-width: 240px;
}

.status-progress div {
  position: relative;
  flex: 1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #1a1d23;
}

.status-progress em {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #69717f;
  transition: width 300ms ease;
}

.views {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.view {
  display: none;
  height: 100%;
  min-height: 0;
  animation: fadeUp 240ms ease both;
}

.view.is-active {
  display: block;
}

.command-layout,
.two-column,
.images-workspace,
.carousel-layout,
.videos-layout,
.library-layout,
.caption-layout,
.admin-layout {
  display: grid;
  height: 100%;
  min-height: 0;
  gap: 14px;
}

.command-layout {
  grid-template-columns: minmax(520px, 1fr) 300px 390px;
}

.two-column {
  grid-template-columns: minmax(0, 1fr) 340px;
}

.images-workspace {
  grid-template-columns: minmax(720px, 1fr) 370px;
}

.carousel-layout {
  grid-template-columns: minmax(720px, 1fr) 370px;
}

.videos-layout {
  grid-template-columns: minmax(720px, 1fr) 370px;
}

.library-layout {
  grid-template-columns: 300px minmax(0, 1fr);
}

.caption-layout {
  grid-template-columns: 360px minmax(330px, 1fr) 320px;
}

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

.panel,
.log-panel,
.video-preview,
.caption-preview {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-large {
  overflow-y: auto;
}

.panel-header,
.composer-head,
.log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge-running {
  background: rgba(120, 166, 255, 0.1);
  color: var(--blue);
}

/* src/client/styles/02-command.css */
.stage-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.stage-step {
  min-width: 0;
  min-height: 108px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #0a0c0f;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.stage-step span,
.node-card span,
.provider-card span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

.stage-step strong,
.stage-step em {
  display: block;
}

.stage-step strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 13px;
}

.stage-step em {
  color: var(--dim);
  font-size: 11px;
  font-style: normal;
}

.stage-step.is-done {
  border-color: rgba(130, 217, 157, 0.18);
}

.stage-step.is-active {
  border-color: rgba(205, 250, 70, 0.34);
  background: rgba(205, 250, 70, 0.07);
}

.run-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 16px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.run-detail p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.metric-stack {
  display: grid;
  gap: 8px;
}

.metric-stack div {
  padding: 10px 12px;
  border-radius: 13px;
  background: #111419;
}

.metric-stack span,
.detail-list dt {
  display: block;
  margin-bottom: 4px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-stack strong,
.detail-list dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
}

.asset-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.asset-strip article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #0a0c0f;
}

.asset-strip strong,
.asset-strip span {
  grid-column: 2;
}

.asset-strip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.asset-strip span {
  color: var(--dim);
  font-size: 11px;
}

.mini-thumb {
  grid-row: 1 / span 2;
  width: 46px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(135deg, #242832, #111419);
}

.thumb-a { background: linear-gradient(135deg, #252b32, #141817); }
.thumb-b { background: linear-gradient(135deg, #263028, #111419); }
.thumb-c { background: linear-gradient(135deg, #232837, #111419); }

.detail-list {
  display: grid;
  gap: 13px;
  margin: 0;
}

.detail-list div {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line-soft);
}

.divider {
  height: 1px;
  margin: 17px 0;
  background: var(--line-soft);
}

.action-stack {
  align-items: stretch;
  flex-direction: column;
}

.log-panel {
  display: flex;
  flex-direction: column;
  background: #080910;
}

.log-head {
  flex-shrink: 0;
  align-items: center;
  margin: 0;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.log-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-toggle {
  width: 30px;
  min-height: 30px;
  border-radius: 10px;
}

.log-toggle svg {
  width: 15px;
  height: 15px;
}

.log-head strong,
.log-head span {
  display: block;
}

.log-head span {
  margin-top: 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

.log-filters {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.log-filters button,
.connection-tabs button,
.segmented button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.log-filters button {
  padding: 0 9px;
}

.log-filters button.is-active,
.connection-tabs button.is-active,
.segmented button.is-active {
  border-color: rgba(205, 250, 70, 0.3);
  background: var(--lime-soft);
  color: var(--lime);
}

.logs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  font-family: var(--mono);
}

.log-line {
  display: grid;
  grid-template-columns: 66px 58px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.log-line .time {
  color: #444c58;
}

.log-line .type {
  color: var(--dim);
  text-transform: uppercase;
}

.log-line[data-type="stage"] .msg { color: var(--blue); }
.log-line[data-type="runpod"] .msg { color: #b8c0cc; }
.log-line[data-type="error"] .msg { color: var(--danger); }
.log-line[data-type="ok"] .msg { color: var(--ok); }

.run-composer {
  display: none;
  flex-shrink: 0;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: #0b0d10;
}

.run-composer.is-open {
  display: block;
  animation: fadeUp 180ms ease both;
}

.composer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #090b0e;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 140px;
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(205, 250, 70, 0.42);
}

.composer-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.workflow-canvas {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  min-height: 420px;
  align-content: center;
}

.workflow-canvas::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.node-card,
.provider-card {
  position: relative;
  z-index: 1;
  min-height: 178px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.node-card.is-hot,
.provider-card.is-selected {
  border-color: rgba(205, 250, 70, 0.36);
  background: rgba(205, 250, 70, 0.06);
}

.node-card strong,
.provider-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.node-card p,
.provider-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.settings-list,
.source-stack,
.slot-list,
.job-list {
  display: grid;
  gap: 10px;
}

.source-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.source-card svg {
  grid-row: 1 / span 2;
  color: var(--dim);
}

.source-card span {
  color: var(--dim);
  font-size: 12px;
}

.source-card.is-selected {
  border-color: rgba(205, 250, 70, 0.35);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-bottom: 14px;
  border: 1px dashed #343945;
  border-radius: var(--radius-md);
  background: #090b0e;
  color: var(--dim);
  text-align: center;
}

.drop-zone svg {
  width: 25px;
  height: 25px;
  margin-bottom: 10px;
}

.drop-zone strong {
  display: block;
  color: var(--text);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.image-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background: linear-gradient(135deg, #20252f, #0e1116);
}

.image-tile span {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-1 { background: linear-gradient(135deg, #323b37, #101216); }
.tile-2 { background: linear-gradient(135deg, #2f313c, #101216); }
.tile-3 { background: linear-gradient(135deg, #3a342d, #101216); }
.tile-4 { background: linear-gradient(135deg, #263440, #101216); }
.tile-5 { background: linear-gradient(135deg, #373440, #101216); }
.tile-6 { background: linear-gradient(135deg, #29372d, #101216); }

.provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* src/client/styles/03-images.css */
.images-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.image-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.45fr) minmax(0, 0.7fr);
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 0.7fr);
  gap: 12px;
  align-items: stretch;
}

.image-studio-grid > * {
  min-width: 0;
}

.model-pick-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.model-select-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.model-select-field > span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-select-field select {
  height: 36px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 700;
}

.model-select-hint {
  margin: 0;
  color: var(--dim);
  font-size: 10px;
}

.model-select-hint code {
  padding: 3px 7px;
  border-radius: 7px;
  background: #0d1015;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.param-stack {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-top: 2px;
  padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}

.param-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.param-label {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.param-stack .choice-row {
  gap: 5px;
}

.param-stack .quality-option,
.param-stack .ratio-option {
  min-height: 28px;
  padding: 0 9px;
  font-size: 10px;
}

.param-inline-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.param-inline {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 0;
  min-width: 0;
}

.count-stepper {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: stretch;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #090b0e;
  overflow: hidden;
}

.count-stepper:focus-within {
  border-color: rgba(205, 250, 70, 0.42);
}

.count-step {
  display: grid;
  place-items: center;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.count-step:hover {
  background: rgba(205, 250, 70, 0.08);
  color: var(--text);
}

.count-step:active {
  background: rgba(205, 250, 70, 0.16);
}

.count-stepper input {
  height: 100%;
  width: 100%;
  border: 0;
  border-left: 1px solid var(--line-soft);
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.count-stepper input:focus {
  border-color: var(--line-soft);
  outline: none;
}

.select-wrap {
  position: relative;
  height: 32px;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  height: 100%;
  padding: 0 28px 0 10px;
  font-size: 12px;
  font-weight: 700;
  background-image: none;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 11px;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-wrap:focus-within::after {
  border-color: var(--text);
}

.studio-block,
.api-note,
.output-inspector {
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.block-head > span {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.model-row,
.reference-chip-grid,
.choice-row,
.bucket-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-choice,
.reference-chip,
.quality-option,
.ratio-option,
.bucket-tab,
.output-card {
  border: 1px solid var(--line);
  background: #0d1015;
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.model-choice:hover,
.reference-chip:hover,
.quality-option:hover,
.ratio-option:hover,
.bucket-tab:hover,
.output-card:hover {
  transform: translateY(-1px);
  border-color: rgba(205, 250, 70, 0.18);
  color: var(--text);
}

.model-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  min-width: 122px;
  min-height: 58px;
  padding: 9px;
  border-radius: 14px;
  text-align: left;
}

.model-choice-empty {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
}

.model-choice strong,
.model-choice em {
  display: block;
}

.model-choice em,
.identity-strip em,
.output-card em {
  color: var(--dim);
  font-style: normal;
  font-size: 11px;
}

.model-avatar,
.ref-thumb {
  display: block;
  border: 1px solid var(--line-soft);
  background: linear-gradient(135deg, #222832, #111419);
}

.model-avatar.has-image,
.ref-thumb.has-image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.model-avatar {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.avatar-naya { background: linear-gradient(135deg, #2b3028, #121512); }
.avatar-mina { background: linear-gradient(135deg, #2d2931, #121316); }
.avatar-nadia { background: linear-gradient(135deg, #29323a, #111419); }

.model-choice.is-selected,
.output-card.is-selected {
  border-color: rgba(205, 250, 70, 0.4);
  background: rgba(205, 250, 70, 0.055);
  color: var(--text);
}

.identity-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.image-mode-block,
.image-template-field {
  margin-top: 12px;
}

.image-mode-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 6px;
}

.image-mode-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1015;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.image-mode-switch button:hover {
  border-color: rgba(205, 250, 70, 0.18);
  color: var(--text);
}

.image-mode-switch button.is-active {
  border-color: rgba(205, 250, 70, 0.4);
  background: rgba(205, 250, 70, 0.08);
  color: var(--text);
}

.image-mode-switch i {
  width: 15px;
  height: 15px;
}

.identity-strip article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 62px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #0d1015;
}

.ref-thumb {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

.face-ref { background: linear-gradient(135deg, #31322d, #151814); }
.body-ref { background: linear-gradient(135deg, #2b3038, #12151b); }

.reference-chip,
.quality-option,
.ratio-option,
.bucket-tab {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
}

.reference-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.reference-chip svg {
  width: 15px;
  height: 15px;
}

.reference-chip.is-selected,
.quality-option.is-active,
.ratio-option.is-active,
.bucket-tab.is-active {
  border-color: rgba(205, 250, 70, 0.4);
  background: var(--lime);
  color: #080a0b;
}

.reference-chip:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.reference-chip:disabled:hover {
  transform: none;
  border-color: var(--line);
  color: var(--muted);
}

.reference-drop {
  display: grid;
  place-items: center;
  min-height: 126px;
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed #343945;
  border-radius: 17px;
  background: #07090c;
  color: var(--dim);
  text-align: center;
}

.reference-drop.is-dragging {
  border-color: rgba(205, 250, 70, 0.4);
  background: rgba(205, 250, 70, 0.045);
}

.reference-drop svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: var(--muted);
}

.reference-drop strong {
  color: var(--text);
}

.reference-drop span {
  max-width: 520px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.reference-zone.is-disabled .reference-drop {
  opacity: 0.52;
}

.reference-zone.is-disabled .reference-drop,
.reference-zone.is-disabled .reference-drop-actions {
  pointer-events: none;
}

.reference-drop-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}

.reference-drop-actions small {
  align-self: center;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
}

.image-url-inline {
  margin-top: 0;
}

.upload-ref-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.upload-ref-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #0d1015;
}

.upload-ref-item.is-inactive {
  opacity: 0.58;
}

.upload-ref-item.is-advanced {
  align-items: start;
}

.upload-ref-thumb {
  width: 48px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  object-fit: cover;
  background: #111419;
}

.upload-ref-item strong,
.upload-ref-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-ref-item strong {
  font-size: 11px;
}

.upload-ref-item span {
  margin-top: 3px;
  color: var(--dim);
  font-size: 10px;
}

.advanced-ref-controls {
  display: grid;
  grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.advanced-ref-controls select,
.advanced-ref-controls input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #080a0d;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.advanced-ref-controls input {
  padding: 0 10px;
}

.advanced-ref-lock {
  margin-top: 6px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
}

.image-prompt {
  margin-top: 0;
}

.image-directive-card,
.image-feedback-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.output-review-layout,
.images-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 12px;
  align-items: start;
}

.images-review-layout {
  grid-template-columns: minmax(0, 1fr);
}

.images-review {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.image-run-row .row-actions {
  align-items: center;
}

.image-run-meta {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.image-run-outputs {
  grid-template-columns: repeat(auto-fill, minmax(140px, 190px));
}

.image-output-slide {
  min-height: 0;
}

.image-output-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* "Sent to carousel" badge — bottom-centered pill on the output thumbnail.
 *
 * Pinned to the bottom-center so it stays out of the way of:
 *   - the Open button (.carousel-slide-zoom @ top-right)
 *   - the running status badge (.carousel-slide-state @ top-left)
 * Uses a dark purple glass blur so the underlying image still reads but
 * the label has its own legible surface. translateX(-50%) keeps it
 * centered at any card width; max-width + overflow:hidden + text-overflow
 * keep the pill from being clipped on narrow cards. */
.image-output-carousel-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(190, 156, 240, 0.32);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(78, 52, 122, 0.88), rgba(48, 30, 78, 0.92));
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  color: #f4ecff;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 3;
}

.image-output-carousel-badge i,
.image-output-carousel-badge svg {
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
}

.image-output-slide.is-sent-to-carousel {
  position: relative;
}

.image-output-slide.is-sent-to-carousel::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(120, 81, 169, 0.7);
  border-radius: inherit;
  pointer-events: none;
}

.action-stack .ghost-button.is-sent-to-carousel {
  opacity: 0.75;
  border-style: dashed;
}

/* Persistent inspector error block — shown after Send-to-carousel fails so
   the user sees the exact HTTP status + error code instead of a brief
   toast that disappears. */
.image-output-carousel-error {
  margin: 10px 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(207, 56, 56, 0.12);
  border: 1px solid rgba(207, 56, 56, 0.45);
  color: #fff;
}

.image-output-carousel-error strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.image-output-carousel-error span {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.85;
}

.image-output-carousel-error p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

.image-output-meta {
  padding: 0 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

.image-output-meta em,
.image-output-meta span,
.image-output-meta small {
  display: block;
  font-style: normal;
}

.image-output-meta span {
  margin-top: 4px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.image-output-meta small {
  margin-top: 4px;
}

.image-selected-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow-y: auto;
}

.image-selected-side .output-inspector {
  padding: 0;
  border: 0;
  background: transparent;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.output-card {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 188px;
  overflow: hidden;
  padding: 12px;
  border-radius: 17px;
  background:
    linear-gradient(180deg, transparent 0 52%, rgba(0, 0, 0, 0.76)),
    linear-gradient(135deg, #242a34, #111419 65%);
  text-align: left;
}

.output-card.has-provider-image {
  background-size: cover;
  background-position: center;
}

.output-card.is-processing {
  background:
    linear-gradient(180deg, transparent 0 52%, rgba(0, 0, 0, 0.76)),
    repeating-linear-gradient(135deg, rgba(205, 250, 70, 0.11) 0 8px, rgba(255, 255, 255, 0.02) 8px 16px),
    linear-gradient(135deg, #242a34, #111419 65%);
}

.output-card.warning {
  border-color: rgba(232, 184, 91, 0.28);
}

.output-card span {
  position: absolute;
  top: 10px;
  left: 10px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
}

.output-card strong {
  color: var(--text);
  font-size: 20px;
}

.output-preview-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #111419;
}

.output-preview-button {
  appearance: none;
  display: block;
  padding: 0;
  cursor: zoom-in;
}

.output-preview-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.output-inspector p {
  margin: 9px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.api-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.api-note {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.api-note strong {
  color: var(--text);
}

.api-preview {
  min-height: 312px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #07080c;
  color: #d7ddd2;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
}

.prompt-console {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.prompt-console label {
  margin-bottom: 8px;
}

.image-prompt textarea {
  min-height: 220px;
}

.console-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.control-row {
  align-items: end;
  margin-top: 12px;
}

.control-row label {
  flex: 1;
}

.videos-workbench {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* src/client/styles/04-videos-and-jobs.css */
.video-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

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

.video-section-head strong,
.video-section-head span {
  display: block;
}

.video-section-head strong {
  color: var(--text);
  font-size: 13px;
}

.video-section-head span,
.video-status-line {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

.video-frame-picker {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.video-character-reference {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.video-character-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 84px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #07090c;
}

.video-character-thumb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0d1117;
  color: var(--lime);
  flex: 0 0 auto;
}

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

.video-character-card strong,
.video-character-card span {
  display: block;
}

.video-character-card strong {
  color: var(--text);
  font-size: 13px;
}

.video-character-card span {
  margin-top: 4px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.45;
}

.video-check-label span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #090b0e;
  color: var(--text);
  font-size: 12px;
}

.video-check-label input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.video-frame-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.video-motion-workspace {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px;
  align-items: start;
}

.video-source-stage,
.video-frame-review,
.video-generated-reference {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #050607;
}

.video-selected-frame,
.video-generated-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.video-source-stage video,
.video-selected-frame img,
.video-generated-image img {
  display: block;
  width: auto;
  max-width: 100%;
  height: clamp(240px, 34vh, 420px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border-radius: 14px;
  background: #000;
  object-fit: cover;
}

.video-source-stage video {
  object-fit: contain;
}

.video-source-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-source-meta strong,
.video-source-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-source-meta strong {
  color: var(--text);
  font-size: 12px;
}

.video-source-meta span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

.video-frame-review {
  grid-template-rows: auto auto;
}

.video-generated-reference {
  grid-template-areas:
    "card"
    "head"
    "actions";
  grid-template-rows: auto auto auto;
}

.video-generated-card .video-empty-state,
.video-selected-frame .video-empty-state {
  min-height: clamp(240px, 34vh, 420px);
}

.video-selected-frame div:not(.video-empty-state),
.video-generated-card > div:not(.video-generated-image):not(.video-empty-state) {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.video-selected-frame span,
.video-generated-card span {
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.video-selected-frame strong,
.video-generated-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-selected-frame em,
.video-generated-card em {
  color: var(--dim);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.video-frame-actions {
  display: grid;
  gap: 8px;
}

.video-frame-actions span {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.4;
}

.video-extra-request {
  display: grid;
  gap: 6px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.video-extra-request textarea {
  min-height: 54px;
  max-height: 96px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #090b0e;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-transform: none;
}

.video-extra-request textarea:focus {
  outline: none;
  border-color: rgba(205, 250, 70, 0.45);
  box-shadow: 0 0 0 3px rgba(205, 250, 70, 0.08);
}

.video-extra-request textarea::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.video-frame-timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(52px, 62px);
  gap: 7px;
  margin-top: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.video-frame-thumb {
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #07090c;
  color: var(--muted);
  cursor: pointer;
}

.video-frame-thumb:hover,
.video-frame-thumb.is-selected {
  border-color: rgba(205, 250, 70, 0.55);
  background: rgba(205, 250, 70, 0.06);
}

.video-frame-thumb.is-auto:not(.is-selected) {
  border-color: rgba(205, 250, 70, 0.25);
}

.video-frame-thumb img {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background: #000;
  object-fit: cover;
}

.video-frame-thumb span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
}

.video-frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 3px;
}

.video-frame-option {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #07090c;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.video-frame-option:hover,
.video-frame-option.is-selected {
  border-color: rgba(205, 250, 70, 0.42);
  background: rgba(205, 250, 70, 0.045);
}

.video-frame-option img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 9px;
  background: #050607;
}

.video-frame-option span {
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.video-frame-option strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-motion-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 0.8fr);
  gap: 12px;
  align-items: center;
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid rgba(205, 250, 70, 0.25);
  border-radius: 14px;
  background: rgba(205, 250, 70, 0.035);
}

.video-motion-card video,
.video-motion-card img {
  width: 100%;
  max-height: 260px;
  border-radius: 11px;
  background: #050607;
  object-fit: contain;
}

.video-motion-card div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.video-motion-card span {
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.video-motion-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-motion-card em {
  color: var(--dim);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.video-cost-card {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.video-panel-head {
  grid-area: head;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.video-panel-head strong,
.video-panel-head span {
  display: block;
}

.video-panel-head strong {
  color: var(--text);
  font-size: 13px;
}

.video-panel-head span {
  margin-top: 4px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.4;
}

.video-generated-card {
  grid-area: card;
  align-content: start;
}

.video-generated-image {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #050607;
}

button.video-generated-image {
  cursor: zoom-in;
}

button.video-generated-image:hover {
  border-color: rgba(205, 250, 70, 0.45);
}

.video-generated-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.video-generated-actions button {
  width: 100%;
}

.video-cost-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.video-cost-card > div {
  display: grid;
  gap: 4px;
}

.video-cost-card span {
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.video-cost-card strong {
  color: var(--lime);
  font-size: 24px;
  line-height: 1;
}

.video-cost-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.video-cost-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #07090c;
}

.video-cost-card dt,
.video-cost-card dd {
  margin: 0;
  color: var(--dim);
  font-size: 11px;
}

.video-cost-card dd {
  color: var(--text);
  font-family: var(--mono);
}

.video-prompt-console {
  margin-top: 0;
}

.video-prompt-console textarea {
  min-height: 112px;
}

.video-run-list {
  display: grid;
  gap: 10px;
}

.video-run-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #090b0e;
}

.video-run-row.is-selected {
  border-color: rgba(205, 250, 70, 0.36);
  background: rgba(205, 250, 70, 0.04);
}

.video-run-row > button {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.video-run-row span,
.video-run-row em {
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-run-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-run-actions {
  display: flex;
  gap: 7px;
}

.video-empty-state {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px dashed #303642;
  border-radius: 13px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.video-empty-state.is-warning {
  border-color: rgba(245, 180, 70, 0.42);
  background: rgba(245, 180, 70, 0.045);
  color: var(--muted);
}

.video-empty-state.is-warning svg {
  width: 22px;
  height: 22px;
  color: #f5b446;
}

.video-empty-state strong,
.video-empty-state span {
  display: block;
}

.video-empty-state strong {
  color: var(--text);
  font-size: 13px;
}

.video-empty-state span {
  max-width: 260px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.45;
}

.video-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.videos-layout .video-preview {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 18px;
  overflow-y: auto;
}

.videos-layout .video-frame {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 22px;
}

.videos-layout .video-frame img,
.videos-layout .video-frame video,
.videos-layout .video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.videos-layout .video-frame iframe {
  background: #050607;
}

.videos-layout .video-frame svg {
  width: 42px;
  height: 42px;
  color: var(--lime);
}

.videos-layout .video-meta {
  display: grid;
  gap: 5px;
  width: 100%;
}

.videos-layout .video-meta strong,
.videos-layout .video-meta span {
  overflow-wrap: anywhere;
}

.slot-list article,
.job-list article {
  display: grid;
  grid-template-columns: 12px 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: #090b0e;
}

.slot-state {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.slot-state.done { background: var(--ok); }
.slot-state.active { background: var(--warn); box-shadow: 0 0 0 4px rgba(232, 184, 91, 0.08); }
.slot-state.idle { background: #3a414d; }

.slot-list em,
.job-list span {
  color: var(--dim);
  font-style: normal;
  font-size: 12px;
}

/* src/client/styles/05-carousels.css */
.carousel-review {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.carousel-composer {
  display: grid;
  grid-template-columns: minmax(0, 580px) minmax(0, 1fr) minmax(0, 320px);
  gap: 12px;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.carousel-source-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}

.carousel-face-preview {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 17px;
  background-color: #0d1015;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--dim);
  text-align: center;
  overflow: hidden;
}

.carousel-face-preview.has-image .carousel-face-fallback,
.carousel-face-preview.has-image .carousel-face-caption {
  display: none;
}

.carousel-face-fallback {
  font-size: 36px;
  font-weight: 800;
  color: var(--muted);
}

.carousel-face-caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--dim);
}

.carousel-face-preview.is-empty {
  background-image: linear-gradient(135deg, #1a1f27, #0b0e12);
}

.carousel-step3 {
  min-width: 0;
}

.carousel-base-drop {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 16px;
  border: 1px dashed #343945;
  border-radius: 17px;
  background: #07090c;
  color: var(--dim);
  text-align: center;
  background-size: cover;
  background-position: center;
}

.carousel-base-drop.has-image {
  border-style: solid;
  border-color: var(--line-soft);
  background-color: #07090c;
}

.carousel-base-empty {
  display: grid;
  place-items: center;
  width: min(100%, 380px);
  gap: 10px;
}

.carousel-base-empty[hidden] {
  display: none;
}

.carousel-base-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}

.carousel-base-actions[hidden] {
  display: none;
}

.carousel-base-actions .tiny-button {
  background: rgba(7, 9, 12, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.carousel-base-actions .tiny-button svg {
  width: 13px;
  height: 13px;
}

.carousel-url-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: min(100%, 320px);
  height: 38px;
  margin-top: 4px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(10, 13, 17, 0.9);
  color: var(--muted);
}

.carousel-url-inline input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.carousel-url-inline:focus-within {
  border-color: rgba(205, 250, 70, 0.65);
  box-shadow: 0 0 0 3px rgba(205, 250, 70, 0.08);
}

.carousel-url-inline svg {
  width: 14px;
  height: 14px;
  color: var(--dim);
}

.model-price-hint {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.45;
}

.model-price-hint strong,
[data-carousel-generate-price] {
  color: inherit;
  font-weight: 900;
}

.composer-hint {
  flex: 1;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.5;
}

.carousel-base-drop.is-dragging {
  border-color: rgba(205, 250, 70, 0.4);
  background-color: rgba(205, 250, 70, 0.045);
}

.carousel-base-empty svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
  color: var(--muted);
}

.carousel-base-empty strong {
  color: var(--text);
}

.carousel-base-empty span {
  display: block;
  max-width: 220px;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
}

.carousel-base-empty .tiny-button {
  margin-top: 12px;
}

.carousel-settings {
  align-content: start;
  grid-template-columns: 1fr;
  gap: 12px;
}

.carousel-composer .composer-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.carousel-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.carousel-editor {
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.carousel-editor .panel-header {
  align-items: center;
  margin-bottom: 13px;
}

.slide-step-actions {
  display: flex;
  gap: 6px;
}

.carousel-editor textarea {
  min-height: 150px;
}

.carousel-readonly-meta {
  display: grid;
  gap: 8px;
}

.carousel-readonly-meta article {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.carousel-readonly-meta span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.carousel-readonly-meta strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.retry-panel {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.retry-panel strong {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
}

.retry-panel span {
  color: var(--dim);
  font-size: 11px;
  line-height: 1.45;
}

.carousel-output-preview {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #050608;
}

.carousel-output-preview-frame {
  position: relative;
}

.carousel-output-preview img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.carousel-output-open-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(8, 10, 13, 0.82);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: zoom-in;
}

.slide-directive-card,
.slide-feedback-card,
.prompt-diff-card {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.slide-directive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slide-directive-head div {
  display: grid;
  gap: 2px;
}

.slide-directive-head span,
.prompt-diff-card summary span,
.prompt-diff-grid article > span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.slide-directive-head strong,
.prompt-diff-card summary strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.slide-directive-head i {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.slide-directive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.slide-directive-grid label,
.slide-directive-note {
  display: grid;
  gap: 5px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.slide-directive-grid select {
  min-width: 0;
  min-height: 34px;
  width: 100%;
  padding: 0 22px 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #07090b;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.slide-directive-note textarea {
  min-height: 62px;
  font-size: 11px;
}

.slide-feedback-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.slide-feedback-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.slide-feedback-grid label:has(input:checked) {
  border-color: rgba(205, 250, 70, 0.38);
  background: rgba(205, 250, 70, 0.08);
  color: var(--text);
}

.slide-feedback-grid input {
  width: 12px;
  height: 12px;
  accent-color: var(--lime);
}

.prompt-diff-card {
  display: block;
}

.prompt-diff-card[hidden] {
  display: none;
}

.prompt-diff-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.prompt-diff-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.prompt-diff-grid article {
  display: grid;
  gap: 6px;
}

.prompt-diff-grid pre {
  max-height: 140px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #050608;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.prompt-diff-added {
  padding: 1px 3px;
  border-radius: 5px;
  background: rgba(255, 73, 103, 0.38);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  color: #ffe1e7;
  outline: 1px solid rgba(255, 73, 103, 0.34);
}

.carousel-editor .console-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.editor-action-group {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.editor-action-group > span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.carousel-prompt-actions {
  margin-top: -2px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.carousel-prompt-actions .console-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 0;
}

.carousel-prompt-actions .primary-button,
.carousel-prompt-actions .ghost-button {
  width: 100%;
  min-height: 34px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 11px;
  white-space: nowrap;
}

.carousel-prompt-actions i {
  width: 15px;
  height: 15px;
}

.carousel-set-row {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.carousel-set-row.is-selected {
  border-color: rgba(205, 250, 70, 0.32);
  background: rgba(205, 250, 70, 0.035);
}

.carousel-set-row.is-approved {
  border-color: rgba(130, 217, 157, 0.25);
}

.carousel-set-row.is-rejected {
  opacity: 0.58;
}

.carousel-set-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.carousel-set-row header span,
.carousel-slide em {
  display: block;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.carousel-set-row header strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.carousel-slides {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.carousel-slides.has-reference {
  display: flex;
  align-items: stretch;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.carousel-slides.has-reference .carousel-slide-cell {
  flex: 0 0 clamp(150px, 11vw, 210px);
}

.carousel-slide-divider {
  display: flex;
  flex: 0 0 10px;
  align-items: center;
  justify-content: center;
  padding-bottom: 34px;
  color: rgba(205, 250, 70, 0.46);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
}

.carousel-add-slide-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding-bottom: 34px;
}

.carousel-slides.has-reference .carousel-add-slide-cell {
  flex: 0 0 44px;
}

.carousel-add-slide-button {
  position: relative;
  box-sizing: border-box;
  appearance: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(139, 149, 161, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(139, 149, 161, 0.82);
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.carousel-add-slide-button::before,
.carousel-add-slide-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.carousel-add-slide-button::after {
  width: 2px;
  height: 13px;
}

.carousel-add-slide-button:hover,
.carousel-add-slide-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(205, 250, 70, 0.42);
  background: rgba(205, 250, 70, 0.075);
  color: var(--lime);
}

.carousel-slide-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.carousel-slide {
  position: relative;
  display: grid;
  align-content: end;
  width: 100%;
  aspect-ratio: var(--slide-aspect, 4/5);
  padding: 11px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  background:
    linear-gradient(180deg, transparent 0 52%, rgba(0, 0, 0, 0.78)),
    linear-gradient(135deg, #222733, #101216);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.carousel-slide-prompt {
  margin: 0;
  padding: 0 2px;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.carousel-slide-prompt .dim {
  color: var(--dim);
  font-style: italic;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: spin 700ms linear infinite;
  vertical-align: middle;
}

.is-busy {
  opacity: 0.85;
  cursor: wait;
}

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

.carousel-slide::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 58%);
  pointer-events: none;
  z-index: 1;
}

.carousel-slide.has-output::before {
  inset: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0 45%, rgba(0, 0, 0, 0.78) 100%);
}

.image-run-outputs .image-output-slide.has-output {
  background: #05070a;
}

.image-run-outputs .image-output-slide.has-output::before {
  display: none;
}

.image-run-outputs .image-output-slide.has-output:not(.is-running)::after {
  display: none;
}

.carousel-slide-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-run-outputs .image-output-slide .carousel-slide-image {
  object-fit: contain !important;
  object-position: center center;
  background: #05070a;
  opacity: 0;
  transition: opacity 120ms ease;
}

.image-run-outputs .image-output-slide.is-image-loaded .carousel-slide-image {
  opacity: 1;
}

.image-run-outputs .image-output-slide.has-output {
  padding: 0;
}

.carousel-slide.has-output {
  cursor: pointer;
}

.carousel-slide-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 10, 13, 0.82);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  cursor: zoom-in;
}

.carousel-slide-state {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 18px);
  padding: 6px 8px;
  border: 1px solid rgba(205, 250, 70, 0.22);
  border-radius: 999px;
  background: rgba(8, 10, 13, 0.82);
  color: var(--text);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
}

.carousel-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.carousel-lightbox[hidden] {
  display: none;
}

.carousel-lightbox-inner {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(1120px, 100%);
  max-height: min(92vh, 980px);
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: #050608;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.52);
}

.carousel-lightbox-inner img {
  width: 100%;
  height: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #020305;
}

.carousel-lightbox footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
  background: #080a0d;
}

.carousel-lightbox footer strong,
.carousel-lightbox footer span {
  display: block;
}

.carousel-lightbox footer span,
.carousel-lightbox footer p {
  color: var(--dim);
  font-size: 11px;
}

.carousel-lightbox footer p {
  max-width: 58%;
  max-height: 54px;
  margin: 0;
  overflow: hidden;
  line-height: 1.45;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(8, 10, 13, 0.76);
  color: var(--text);
  cursor: pointer;
}

.lightbox-close {
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
}

.lightbox-nav {
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

.api-preview-block {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.api-preview-block summary {
  padding: 12px 14px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.api-preview-block .api-preview {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.carousel-slide.is-active {
  border-color: rgba(205, 250, 70, 0.36);
}

.carousel-slide.warning {
  border-color: rgba(232, 184, 91, 0.28);
}

.carousel-slide.is-running {
  border-color: rgba(205, 250, 70, 0.5);
  animation: slidePulse 1.6s ease-in-out infinite;
}

.carousel-slide.is-running::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--lime), transparent);
  background-size: 200% 100%;
  animation: slideProgress 1.4s linear infinite;
  z-index: 2;
}

@keyframes slidePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(205, 250, 70, 0.0); }
  50% { box-shadow: 0 0 0 4px rgba(205, 250, 70, 0.12); }
}

@keyframes slideProgress {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.carousel-slide.is-skipped {
  opacity: 0.58;
}

.carousel-slide.approved {
  border-color: rgba(130, 217, 157, 0.28);
}

.carousel-slide span {
  position: relative;
  z-index: 2;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
}

.carousel-slide em {
  position: relative;
  z-index: 2;
}

.carousel-slide small {
  position: relative;
  z-index: 2;
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
}

/* src/client/styles/06-production.css */
.carousel-empty {
  display: grid;
  place-items: center;
  min-height: 180px;
  border: 1px dashed #343945;
  border-radius: var(--radius-md);
  background: #090b0e;
  color: var(--dim);
  text-align: center;
}

.phone-preview,
.video-preview,
.caption-preview {
  display: grid;
  place-items: center;
  padding: 18px;
}

.phone-art,
.caption-video,
.video-frame {
  width: min(340px, 100%);
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(180deg, transparent 0 70%, rgba(0, 0, 0, 0.72)),
    linear-gradient(135deg, #2f343f, #111419 62%, #242a21);
}

.phone-caption,
.video-meta {
  margin-top: 14px;
  color: var(--dim);
  text-align: center;
}

.panel-inner {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.panel-inner h3 {
  margin-bottom: 12px;
}

.panel-inner .ghost-button,
.full-width {
  width: 100%;
  margin-bottom: 8px;
}

.segmented {
  display: flex;
  gap: 6px;
}

.segmented button,
.connection-tabs button {
  padding: 0 12px;
}

.video-frame {
  display: grid;
  place-items: center;
}

.video-frame svg {
  width: 44px;
  height: 44px;
  color: var(--muted);
}

.video-meta strong,
.video-meta span {
  display: block;
}

.video-meta span {
  margin-top: 4px;
  font-size: 12px;
}

.caption-video {
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.caption-video span {
  color: white;
  font-size: 26px;
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.9), 0 0 18px rgba(0, 0, 0, 0.8);
}

.caption-timeline {
  display: flex;
  gap: 6px;
  width: min(420px, 100%);
  margin-top: 16px;
}

.caption-timeline span {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: #1b2028;
}

.caption-timeline span:first-child,
.caption-timeline span:nth-child(2) {
  background: #68717f;
}

.job-table {
  display: grid;
  gap: 6px;
}

.job-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 0.7fr 0.8fr;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #090b0e;
  color: var(--muted);
  text-align: left;
}

.job-row.head {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--dim);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.job-row .ok { color: var(--ok); }
.job-row .warn { color: var(--warn); }
.job-row .error { color: var(--danger); }

/* src/client/styles/07-admin.css */
.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
}

.connection-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.connection-panel {
  display: none;
  gap: 10px;
}

.connection-panel.is-active {
  display: grid;
}

.instruction-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.instruction-tabs button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.instruction-tabs button.is-active {
  border-color: rgba(205, 250, 70, 0.4);
  background: var(--lime);
  color: #080a0b;
}

.instruction-tabs button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.instruction-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.instruction-panel.is-active {
  display: flex;
}

.instruction-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.instruction-meta strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.instruction-meta span {
  display: block;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.55;
}

.instruction-saved {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.instruction-template-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.image-instruction-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.image-instruction-editor {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.image-instruction-editor h3 {
  margin: 2px 0 5px;
  font-size: 15px;
}

.image-instruction-editor span {
  display: block;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.5;
}

.instruction-template-toolbar label,
.instruction-template-title {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.instruction-template-toolbar select,
.instruction-template-title input {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #090b0e;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.instruction-template-title input {
  padding: 0 12px;
}

.instruction-textarea {
  min-height: 320px;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.instruction-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.model-admin-status {
  min-height: 18px;
  margin: -2px 0 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: button-spin 700ms linear infinite;
}

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

.models-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 12px;
}

.model-admin-form,
.model-admin-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.model-face-drop {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 240px;
  padding: 15px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: #090b0e;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.model-face-drop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 7, 0.72);
  opacity: 0;
  transition: opacity 140ms ease;
}

.model-face-drop.has-image::before {
  opacity: 1;
}

.model-face-drop.is-dragging {
  border-color: rgba(205, 250, 70, 0.5);
  background-color: rgba(205, 250, 70, 0.055);
}

.model-face-drop > * {
  position: relative;
  z-index: 1;
}

.model-face-drop [data-model-face-empty] {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-height: 150px;
  text-align: center;
}

.model-face-drop [data-model-face-empty] svg {
  width: 30px;
  height: 30px;
  color: var(--lime);
}

.model-face-drop strong,
.model-face-drop span {
  display: block;
}

.model-face-drop span {
  max-width: 260px;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.45;
}

.model-face-drop .tiny-button {
  justify-self: center;
}

.model-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.model-card-actions {
  display: flex;
  gap: 8px;
}

.model-card-thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #222933, #0c0f14);
  background-position: center;
  background-size: cover;
}

.model-card strong,
.model-card span {
  display: block;
}

.model-card span {
  margin-top: 4px;
  color: var(--dim);
  font-size: 12px;
}

.connection-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 76px;
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.connection-card.credential-card {
  align-items: stretch;
}

.drive-connection-card {
  min-height: 118px;
  padding: 18px 20px;
}

.connection-card.is-configured {
  border-color: rgba(75, 210, 130, 0.36);
}

.connection-card.is-warning {
  border-color: rgba(245, 180, 70, 0.38);
}

.connection-card.is-error {
  border-color: rgba(255, 95, 110, 0.42);
}

.connection-card.muted-card {
  opacity: 0.72;
}

.drive-connection-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  width: 100%;
}

.drive-connection-copy {
  min-width: 0;
}

.drive-connection-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 17px;
}

.connection-card .drive-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  align-self: start;
  box-sizing: border-box;
  min-height: 30px;
  width: max-content;
  min-width: 118px;
  margin-top: 1px;
  padding: 0 13px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.connection-card .drive-status-pill svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: currentColor;
  stroke-width: 2.5;
}

.connection-card .drive-status-pill b {
  display: inline-block;
  flex: 0 0 auto;
  margin-top: 0;
  color: currentColor;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  white-space: nowrap;
}

.connection-card .drive-status-pill.is-connected {
  border-color: rgba(75, 232, 125, 0.86);
  background: rgba(75, 232, 125, 0.12);
  color: #41e876;
}

.connection-card .drive-status-pill.is-warning {
  border-color: rgba(245, 180, 70, 0.7);
  background: rgba(245, 180, 70, 0.12);
  color: #f5b446;
}

.connection-card .drive-status-pill.is-error {
  border-color: rgba(255, 95, 110, 0.72);
  background: rgba(255, 95, 110, 0.12);
  color: var(--danger);
}

.connection-card .drive-status-pill.is-checking svg {
  animation: button-spin 850ms linear infinite;
}

.drive-connection-copy > span,
.drive-connection-copy p {
  display: block;
  margin: 0;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
}

.drive-connection-copy [data-drive-status] {
  margin-top: 14px;
  color: var(--muted);
}

.drive-connection-meta {
  margin-top: 4px !important;
}

.drive-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 16px;
}

.drive-card-actions svg {
  width: 14px;
  height: 14px;
}

.drive-storage-card {
  align-items: stretch;
  flex-direction: column;
}

.drive-storage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.drive-storage-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.drive-storage-controls select {
  min-height: 32px;
  max-width: min(240px, 100%);
  padding: 0 30px 0 11px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #0d1117;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.drive-storage-map {
  display: grid;
  gap: 8px;
  width: 100%;
}

.drive-storage-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #080b0f;
}

.connection-card .drive-storage-row svg {
  width: 16px;
  height: 16px;
  color: var(--dim);
  stroke-width: 2.4;
}

.connection-card .drive-storage-row.is-checking svg {
  animation: button-spin 850ms linear infinite;
}

.connection-card .drive-storage-row strong,
.connection-card .drive-storage-row span,
.connection-card .drive-storage-row small {
  display: block;
}

.connection-card .drive-storage-row strong {
  color: var(--text);
  font-size: 13px;
}

.connection-card .drive-storage-row span,
.connection-card .drive-storage-row small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-card .drive-storage-row small {
  color: rgba(148, 163, 184, 0.64);
  font-family: var(--mono);
}

.connection-card .drive-storage-row b {
  color: var(--dim);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.drive-storage-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.drive-storage-row-actions .tiny-button {
  min-height: 28px;
  padding: 0 10px;
}

.connection-card .drive-storage-row.is-ready svg,
.connection-card .drive-storage-row.is-linked svg,
.connection-card .drive-storage-row.is-ready b,
.connection-card .drive-storage-row.is-linked b {
  color: #41e876;
}

.connection-card .drive-storage-row.is-creating svg {
  animation: button-spin 850ms linear infinite;
}

.connection-card .drive-storage-row.is-creating svg,
.connection-card .drive-storage-row.is-creating b {
  color: #f5b446;
}

.connection-card .drive-storage-row.is-missing svg,
.connection-card .drive-storage-row.is-missing b,
.connection-card .drive-storage-row.is-error svg,
.connection-card .drive-storage-row.is-error b {
  color: var(--danger);
}

.connection-card .drive-storage-row.is-waiting svg,
.connection-card .drive-storage-row.is-waiting b {
  color: #f5b446;
}

.drive-storage-empty {
  display: grid;
  min-height: 68px;
  place-items: center;
  color: var(--dim);
  font-size: 12px;
}

.credential-controls {
  display: grid;
  min-width: min(360px, 48%);
  gap: 8px;
}

.credential-controls textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #07090d;
  color: var(--text);
  padding: 10px 12px;
  font: 700 12px/1.45 "Inter", sans-serif;
}

.provider-switch {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  width: max-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

.provider-switch.is-saving {
  cursor: wait;
}

.provider-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.provider-switch .provider-switch-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  margin-top: 0;
  width: 46px;
  height: 26px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.provider-switch .provider-switch-track::after {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.38);
  transition: background 160ms ease;
}

.provider-switch input:checked + .provider-switch-track,
.provider-switch.is-active .provider-switch-track {
  border-color: rgba(197, 255, 50, 0.78);
  background: rgba(197, 255, 50, 0.34);
  justify-content: flex-end;
  box-shadow: inset 0 0 0 1px rgba(197, 255, 50, 0.12);
}

.provider-switch input:checked + .provider-switch-track::after,
.provider-switch.is-active .provider-switch-track::after {
  background: rgb(221, 255, 112);
}

.provider-switch input:focus-visible + .provider-switch-track {
  outline: 2px solid rgba(147, 197, 253, 0.65);
  outline-offset: 3px;
}

.provider-switch .provider-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  line-height: 1;
}

.provider-switch .provider-switch-label strong,
.provider-switch .provider-switch-label em {
  display: inline-flex;
  margin: 0;
  font-style: normal;
}

.provider-switch .provider-switch-label em {
  color: var(--dim);
}

.provider-switch input:checked ~ .provider-switch-label em,
.provider-switch.is-active .provider-switch-label em {
  color: var(--accent);
}

.provider-switch input:disabled + .provider-switch-track,
.provider-switch input:disabled ~ .provider-switch-label {
  opacity: 0.72;
}

.provider-route-badge {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border: 1px solid rgba(200, 255, 61, 0.24);
  border-radius: 999px;
  background: rgba(200, 255, 61, 0.08);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.credential-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.connection-card strong,
.connection-card span {
  display: block;
}

.connection-card span {
  margin-top: 4px;
  color: var(--dim);
  font-size: 12px;
}

.drive-browser-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.drive-browser-dialog[hidden] {
  display: none;
}

.drive-browser-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 3, 5, 0.72);
  backdrop-filter: blur(12px);
}

.drive-browser-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  width: min(780px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #080a0d;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

.drive-browser-panel header,
.drive-browser-current,
.drive-browser-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drive-browser-panel header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.drive-browser-panel h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.drive-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-size: 12px;
}

.drive-breadcrumbs button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.drive-breadcrumbs button.is-active {
  border-color: rgba(205, 250, 70, 0.4);
  color: var(--text);
}

.drive-browser-current {
  min-height: 54px;
  padding: 11px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: #090b0e;
}

.drive-browser-current strong,
.drive-browser-current span {
  display: block;
}

.drive-browser-current span {
  margin-top: 4px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}

.drive-browser-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 220px;
  overflow: auto;
}

.drive-browser-row {
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #0b0e12;
  color: var(--text);
  text-align: left;
}

button.drive-browser-row {
  cursor: pointer;
}

.drive-browser-row:hover {
  border-color: rgba(205, 250, 70, 0.32);
}

.drive-browser-row svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: var(--lime);
}

.drive-browser-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.drive-browser-row small {
  max-width: 230px;
  overflow: hidden;
  color: var(--dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-browser-row.is-file svg {
  color: var(--muted);
}

.drive-browser-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  color: var(--dim);
  text-align: center;
}

.drive-browser-empty strong {
  color: var(--text);
}

/* src/client/styles/08-state-and-utilities.css */
.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  color: var(--dim);
  text-align: center;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: var(--muted);
}

.empty-state strong {
  margin-bottom: 6px;
  color: var(--text);
}

.compact-density .panel,
.compact-density .run-composer {
  padding: 14px;
}

.compact-density .stage-step {
  min-height: 86px;
}

.density-spacious .panel,
.density-spacious .run-composer {
  padding: 24px;
}

.density-spacious .stage-step {
  min-height: 128px;
}

.density-spacious .workspace {
  padding: 24px 26px 26px;
}

.lime-minimal {
  --lime: #dce89a;
  --lime-2: #c3ce7c;
  --lime-soft: rgba(220, 232, 154, 0.055);
}

.lime-status {
  --lime-soft: rgba(205, 250, 70, 0.14);
}

.logs-bottom .command-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: minmax(0, 1fr) 280px;
}

.logs-bottom .log-panel {
  grid-column: 1 / -1;
}

.inspector-logs .command-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.inspector-logs .log-panel {
  display: none;
}

.logs-collapsed .command-layout {
  grid-template-columns: minmax(520px, 1fr) 300px 58px;
}

.logs-collapsed .log-panel {
  min-width: 0;
}

.logs-collapsed .log-head {
  height: 100%;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  gap: 14px;
  padding: 12px 8px;
  border-bottom: 0;
}

.logs-collapsed .log-head div:first-child {
  display: grid;
  place-items: center;
  gap: 8px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.logs-collapsed .log-head span,
.logs-collapsed #pauseLogs,
.logs-collapsed .log-filters,
.logs-collapsed .logs {
  display: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #242a34;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #323946;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* src/client/styles/09-responsive.css */
@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .command-layout,
  .images-workspace,
  .carousel-layout,
  .videos-layout,
  .caption-layout {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .log-panel,
  .video-preview,
  .caption-preview {
    min-height: 420px;
  }

  .two-column,
  .library-layout,
  .admin-layout,
  .models-admin-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .nav-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
  }

  .nav-section {
    min-width: 180px;
  }

  .workspace {
    min-height: 900px;
  }

  .stage-rail,
  .provider-grid,
	  .image-studio-grid,
	  .image-instruction-grid,
	  .carousel-composer,
  .video-setup-grid,
  .video-motion-card,
  .video-motion-workspace,
  .video-selected-frame,
  .video-generated-card,
  .video-cost-card,
  .carousel-settings,
  .output-review-layout,
  .images-review-layout,
  .output-grid,
  .asset-strip,
  .image-grid,
  .composer-grid,
  .workflow-canvas,
  .carousel-slides {
    grid-template-columns: 1fr;
  }

  .connection-card.credential-card {
    flex-direction: column;
  }

  .drive-connection-card {
    padding: 18px;
  }

  .drive-connection-main {
    grid-template-columns: 1fr;
  }

  .connection-card .drive-status-pill {
    justify-self: start;
    min-width: 0;
  }

  .drive-storage-header {
    flex-direction: column;
  }

  .drive-storage-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .drive-storage-controls select {
    width: 100%;
    max-width: none;
  }

  .credential-controls {
    min-width: 0;
  }

}

/* src/client/styles/10-auth.css */
/* ===========================================================
   Auth gate
   Default state: body.auth-pending → login visible, app hidden.
   After successful session: body.auth-ready → app visible, login hidden.

   Synchronous boot hint in <head> (set by inline script before auth.js
   loads): html.auth-boot-session = a non-expired Supabase session token
   is already in localStorage, so render the app shell straight away and
   never flash the login screen during the ~3-5s while auth.js boots.
   html.auth-boot-no-session = no token, default behaviour (show login).
   auth.js can override either hint after its real getSession() resolves.
   =========================================================== */
.auth-screen { display: none; }
body.auth-pending .app-shell { display: none; }
body.auth-pending .auth-screen { display: flex; }
body.auth-ready .auth-screen { display: none; }

/* Pre-auth optimistic render for already-signed-in users — kills the
   login flash on page refresh. */
html.auth-boot-session body.auth-pending .auth-screen { display: none; }
html.auth-boot-session body.auth-pending .app-shell { display: grid; }

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #060709 0%, var(--bg) 50%, #030404 100%);
  padding: 32px;
  overflow: auto;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--lime);
  color: #0b0d10;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}

.auth-brand strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.2px;
}

.auth-brand span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.auth-card h1 {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.auth-sub {
  margin: -4px 0 6px;
  color: var(--muted);
  font-size: 13px;
}

#auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.auth-field input {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
}

.auth-field input:focus {
  border-color: var(--lime);
  background: var(--panel-3);
}

.auth-field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-error {
  display: none;
  padding: 10px 12px;
  background: rgba(255, 105, 120, 0.08);
  border: 1px solid rgba(255, 105, 120, 0.35);
  border-radius: var(--radius-sm);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.4;
}

.auth-submit {
  background: var(--lime);
  color: #0b0d10;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 120ms ease, transform 60ms ease;
  margin-top: 4px;
}

.auth-submit:hover { background: var(--lime-2); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.6; cursor: progress; }

.auth-footnote {
  margin: 6px 0 0;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

.auth-footnote a {
  color: var(--lime-2);
  text-decoration: none;
}
.auth-footnote a:hover { text-decoration: underline; }

/* Account card with sign-out */
.account-card .account-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.account-card .account-meta strong,
.account-card .account-meta span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}
.account-card .account-signout {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms;
  flex-shrink: 0;
}
.account-card .account-signout:hover {
  color: var(--danger);
  border-color: rgba(255, 105, 120, 0.4);
  background: rgba(255, 105, 120, 0.06);
}
.account-card .account-signout i {
  width: 14px;
  height: 14px;
}
