:root {
  --ink: #111827;
  --muted: #687385;
  --paper: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --line: rgba(17, 24, 39, 0.1);
  --line-strong: rgba(17, 24, 39, 0.16);
  --dark: #090d14;
  --dark-2: #111722;
  --dark-3: #1a2230;
  --teal: #0ea5a3;
  --violet: #6d5dfc;
  --amber: #b7791f;
  --coral: #d05342;
  --blue: #2f6fed;
  --green: #13a76b;
  --shadow: 0 16px 44px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 306px;
  padding: 22px;
  color: #f8fafc;
  background: linear-gradient(180deg, #080b11 0%, #111722 56%, #0c1018 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: #f8fafc;
  text-decoration: none;
  font-weight: 850;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--teal));
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(14, 165, 163, 0.28);
}

.panel,
.work-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar .panel {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.compact {
  padding: 16px;
}

label {
  display: block;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.sidebar label {
  color: rgba(248, 250, 252, 0.62);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(109, 93, 252, 0.5);
  box-shadow: 0 0 0 4px rgba(109, 93, 252, 0.1);
}

input:disabled,
select:disabled {
  color: rgba(21, 23, 22, 0.44);
  background: #eef0eb;
  cursor: not-allowed;
}

.sidebar input:disabled {
  color: rgba(248, 250, 252, 0.52);
  background: rgba(255, 255, 255, 0.06);
}

textarea {
  min-height: 180px;
  padding: 14px;
  line-height: 1.7;
  resize: vertical;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
}

.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.current-context {
  display: grid;
  gap: 8px;
}

.context-pill {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #f8fafc;
  background: var(--dark-3);
  font-weight: 850;
}

.context-hint {
  margin: 4px 0 0;
  color: rgba(248, 250, 252, 0.58);
  font-size: 0.82rem;
  line-height: 1.5;
}

.app-nav {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

.nav-item {
  position: relative;
  height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(248, 250, 252, 0.72);
  background: transparent;
  text-align: left;
  padding: 0 12px 0 34px;
  font-weight: 800;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(248, 250, 252, 0.26);
  transform: translateY(-50%);
}

.nav-item.active,
.nav-item:hover {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.075);
}

.nav-item.active::before {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 165, 163, 0.14);
}

.status-panel {
  padding: 16px;
}

.panel-title {
  margin: 0 0 12px;
  color: rgba(248, 250, 252, 0.88);
  font-weight: 850;
}

.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(248, 250, 252, 0.62);
}

.stat-row strong {
  color: #f8fafc;
}

.workspace {
  min-height: 100vh;
  margin-left: 306px;
  padding: 26px 30px 34px;
}

.topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--violet);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 1.8rem;
  line-height: 1.18;
}

.context-breadcrumb {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

.topbar-actions,
.inline-actions,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover,
.file-button:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.button.primary {
  color: #fff;
  border-color: var(--dark);
  background: linear-gradient(180deg, #171d2a, #0b0f17);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.9);
}

.button.full {
  width: 100%;
  margin-top: 16px;
}

.button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
}

.provider-grid {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
}

.feature-center-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(460px, 1.08fr);
  gap: 16px;
  align-items: start;
}

.delivery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.generation-settings-panel {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(143, 252, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(143, 252, 255, 0.055), transparent 38%),
    rgba(255, 255, 255, 0.035);
}

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

.generation-settings-head h3 {
  margin: 3px 0 0;
  font-size: 1.02rem;
}

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

.generation-settings-grid label {
  display: grid;
  gap: 7px;
  color: rgba(238, 244, 243, 0.72);
  font-size: 0.82rem;
}

.generation-settings-grid select {
  min-height: 40px;
  border: 1px solid rgba(195, 226, 232, 0.16);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(5, 9, 13, 0.78);
}

.generation-settings-grid select:focus {
  outline: none;
  border-color: rgba(143, 252, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(143, 252, 255, 0.08);
}

.storyboard-rule-panel {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(143, 252, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(143, 252, 255, 0.06), transparent 36%),
    rgba(255, 255, 255, 0.035);
}

.storyboard-rule-top {
  display: grid;
  grid-template-columns: auto minmax(240px, 360px);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.storyboard-rule-select,
.storyboard-guide-field {
  margin: 0;
}

.storyboard-guide-field input {
  height: 44px;
}

.storyboard-rule-select select,
.storyboard-guide-field input {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
}

.work-panel,
#assetsView,
#storyboardView,
#exportView {
  padding: 20px;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(420px, 0.78fr);
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.command-panel {
  min-height: 248px;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, #111827 0%, #0b1019 100%);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.18);
}

.command-panel .eyebrow {
  color: #7dd8d4;
}

.command-panel h2 {
  color: #f8fafc;
}

.workflow-timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.workflow-step {
  position: relative;
  min-height: 88px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.workflow-step span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 12px;
  border-radius: 8px;
  color: rgba(248, 250, 252, 0.7);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.workflow-step strong {
  display: block;
  font-size: 0.92rem;
}

.workflow-step.done {
  border-color: rgba(14, 165, 163, 0.42);
  background: rgba(14, 165, 163, 0.1);
}

.workflow-step.done span {
  color: #fff;
  background: var(--teal);
}

.workflow-step.current {
  border-color: rgba(109, 93, 252, 0.72);
  background: rgba(109, 93, 252, 0.12);
  box-shadow: inset 0 0 0 1px rgba(109, 93, 252, 0.22);
}

.workflow-step.current span {
  color: #fff;
  background: var(--violet);
}

.next-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.next-action-card h3 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.next-action-card p:last-child {
  margin-bottom: 0;
  color: rgba(248, 250, 252, 0.68);
  line-height: 1.55;
}

.next-action-card .button.secondary {
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.readiness-panel {
  display: flex;
  flex-direction: column;
}

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

.readiness-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  min-height: 64px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-soft);
  text-align: left;
}

.readiness-item:hover {
  border-color: rgba(21, 23, 22, 0.28);
}

.readiness-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.readiness-item strong {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--coral);
  font-size: 0.72rem;
}

.readiness-item.ready strong {
  background: var(--green);
}

.readiness-item small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-ops-grid {
  margin-top: 0;
  align-items: start;
}

.backend-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 720px;
}

.backend-status.online {
  color: var(--green);
}

.backend-status.offline {
  color: var(--coral);
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

#scriptText {
  min-height: calc(100vh - 238px);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei", monospace;
  font-size: 0.95rem;
}

.style-setting-box {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.compact-head {
  margin-bottom: 10px;
}

.compact-head h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.compact-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.style-prompt-input {
  min-height: 160px;
}

.preset-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.preset-chip,
.view-toggle button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 850;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.preset-chip {
  padding: 0 12px;
}

.preset-chip:hover,
.view-toggle button:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 163, 0.32);
  color: var(--ink);
}

.preset-chip.active,
.view-toggle button.active {
  color: #06100f;
  border-color: rgba(143, 252, 255, 0.42);
  background: linear-gradient(135deg, rgba(143, 252, 255, 0.95), rgba(255, 207, 105, 0.92));
  box-shadow: 0 12px 28px rgba(14, 165, 163, 0.16);
}

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(195, 226, 232, 0.14);
  border-radius: 999px;
  background: rgba(5, 9, 13, 0.45);
}

.view-toggle button {
  padding: 0 12px;
  border-color: transparent;
  background: transparent;
}

.summary-list {
  display: grid;
  gap: 12px;
}

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

.summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.summary-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.warning-card {
  border-color: rgba(183, 121, 31, 0.35);
  background: rgba(183, 121, 31, 0.08);
}

.project-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr);
}

.project-create-shell {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.create-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  gap: 10px;
  align-items: end;
}

.video-create-section {
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.6fr) 150px 150px;
}

.storage-list,
.task-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.storage-card,
.task-card,
.empty-state {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.storage-card {
  display: block;
}

.project-group-card {
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.project-group-card.selected {
  border-color: rgba(109, 93, 252, 0.38);
  box-shadow: inset 0 0 0 1px rgba(109, 93, 252, 0.12), var(--shadow-soft);
}

.group-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 0;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.group-head:hover {
  background: #f8fafc;
}

.group-head strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--violet);
  background: rgba(109, 93, 252, 0.1);
  font-size: 0.76rem;
}

.tree-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.storage-card h3,
.task-card h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.storage-card p,
.task-card p,
.empty-state {
  color: var(--muted);
  line-height: 1.55;
}

.project-stack {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px 28px;
}

.project-row {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #f8fafc;
  text-align: left;
}

.project-row:hover {
  border-color: rgba(109, 93, 252, 0.3);
  background: #f3f4ff;
}

.project-row.active {
  color: #fff;
  border-color: var(--violet);
  background: linear-gradient(135deg, #6658e8, #0f172a);
}

.project-row.active small {
  color: rgba(248, 250, 252, 0.68);
}

.empty-project-row {
  padding: 12px;
  border: 1px dashed rgba(17, 24, 39, 0.18);
  border-radius: 7px;
  color: var(--muted);
  background: #f8fafc;
}

.project-row small,
.muted {
  color: var(--muted);
}

.storage-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.storage-summary .summary-card h3 {
  font-size: 1.25rem;
}

.task-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.task-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 0.76rem;
  font-weight: 850;
}

.task-card.running .task-status {
  background: var(--amber);
}

.task-card.done .task-status {
  background: var(--green);
}

.task-card.blocked .task-status,
.task-card.failed .task-status {
  background: var(--coral);
}

.progress-track {
  height: 8px;
  margin: 12px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--teal));
}

.task-result {
  max-height: 72px;
  overflow: auto;
  margin-bottom: 0;
  font-size: 0.86rem;
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.result-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

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

.asset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 4px 0 18px;
  border-bottom: 1px solid var(--line);
}

.asset-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.asset-tab.active {
  color: var(--violet);
  border-bottom-color: var(--violet);
}

.asset-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(109, 93, 252, 0.12);
  font-size: 0.78rem;
}

.director-note-panel {
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid rgba(109, 93, 252, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(109, 93, 252, 0.06), rgba(14, 165, 163, 0.04));
}

.director-note-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.director-note-head h3 {
  margin-bottom: 5px;
  font-size: 1rem;
}

.director-note-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.director-note-input {
  min-height: 74px;
  border-color: rgba(109, 93, 252, 0.28);
  background: #fff;
}

.asset-card {
  min-height: 154px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.asset-card:hover {
  border-color: rgba(109, 93, 252, 0.24);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.1);
}

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

.asset-slot {
  min-width: 0;
}

.asset-slot.is-generating .slot-thumb,
.asset-slot.is-queued .slot-thumb,
.asset-slot.has-generation-error .slot-thumb {
  position: relative;
  overflow: hidden;
}

.slot-generation-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 14px;
  color: #f8fffc;
  text-align: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(33, 209, 195, 0.2), transparent 42%),
    rgba(3, 7, 10, 0.72);
  backdrop-filter: blur(3px);
}

.slot-generation-overlay i {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.slot-generation-overlay strong {
  font-size: 0.92rem;
}

.slot-generation-overlay small {
  color: rgba(248, 255, 252, 0.72);
  line-height: 1.35;
}

.slot-error-text {
  margin: 7px 0 0;
  color: #ff9a88;
  font-size: 0.78rem;
  line-height: 1.35;
}

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

.asset-slot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.asset-slot-tools {
  display: flex;
  gap: 5px;
}

.icon-mini {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--violet);
  background: #fff;
  font-weight: 850;
}

.icon-mini.orange {
  color: #fff;
  border-color: var(--amber);
  background: var(--amber);
}

.asset-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px dashed rgba(17, 24, 39, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: #f8fafc;
  font-weight: 850;
}

.slot-thumb {
  cursor: pointer;
  padding: 0;
}

.slot-thumb span {
  display: grid;
  gap: 4px;
}

.slot-thumb small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

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

.asset-thumb.has-image {
  border-style: solid;
}

.asset-meta,
.asset-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.asset-card .type {
  display: inline-flex;
  margin-bottom: 0;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.asset-status {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.asset-status.warn,
.asset-directory-item small.warn {
  color: var(--amber);
}

.asset-status.ready,
.asset-directory-item small.ready {
  color: var(--teal);
}

.asset-card h3 {
  margin: 12px 0 8px;
}

.asset-card p {
  color: var(--muted);
  line-height: 1.55;
}

.asset-note-chip {
  margin-top: 10px;
  padding: 8px;
  border-radius: 6px;
  color: #3d328f;
  background: rgba(109, 93, 252, 0.08);
  font-size: 0.82rem;
  line-height: 1.45;
}

.asset-actions {
  margin-top: 14px;
}

.slot-prompt-preview {
  display: -webkit-box;
  min-height: 40px;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f8fafc;
  font-size: 0.82rem;
}

td {
  line-height: 1.58;
}

.editable {
  min-width: 260px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.editable:focus {
  border-color: rgba(109, 93, 252, 0.34);
  background: rgba(109, 93, 252, 0.06);
  outline: none;
}

.prompt-line {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  color: #315a5a;
  background: rgba(14, 165, 163, 0.08);
  font-size: 0.86rem;
}

.shot-reference-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
}

.shot-reference-row span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(14, 165, 163, 0.18);
  border-radius: 999px;
  color: #116362;
  background: rgba(14, 165, 163, 0.08);
  font-size: 0.76rem;
  font-weight: 850;
}

.shot-continuity,
.shot-missing {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  line-height: 1.5;
}

.shot-continuity {
  color: #315a5a;
  background: rgba(14, 165, 163, 0.06);
}

.shot-missing {
  color: #7b3f00;
  background: rgba(245, 158, 11, 0.12);
}

.seedance-prompt {
  max-height: 150px;
  overflow: auto;
}

.text-button {
  margin-top: 8px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 850;
  padding: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
}

.badge.warn {
  background: var(--amber);
}

.badge.ready {
  background: var(--green);
}

.preset-textarea {
  min-height: 220px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.skill-detail {
  margin-top: 14px;
}

.skill-detail p {
  margin-bottom: 8px;
}

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

.capability-card {
  position: relative;
  min-height: 178px;
  padding: 18px;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(33, 209, 195, 0.09), transparent 46%),
    rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.capability-card:hover {
  transform: translateY(-2px);
  border-color: rgba(33, 209, 195, 0.36);
  background:
    linear-gradient(145deg, rgba(33, 209, 195, 0.14), rgba(240, 166, 59, 0.08)),
    rgba(255, 255, 255, 0.055);
}

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

.capability-card strong {
  margin: 34px 0 10px;
  font-size: 1.05rem;
}

.capability-card span {
  color: var(--muted);
  line-height: 1.55;
}

.capability-card em {
  margin-top: 16px;
  color: var(--teal);
  font-style: normal;
  font-weight: 820;
}

.capability-mark {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #071014;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  font-size: 0.82rem;
  font-weight: 900;
}

.capability-plain-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.capability-plain-summary span {
  padding: 7px 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
}

.advanced-rule-editor,
.custom-rule-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.advanced-rule-editor summary,
.custom-rule-box summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 820;
}

.skill-detail label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.skill-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.skill-edit-field {
  min-height: 92px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
}

.skill-edit-field.tall {
  min-height: 178px;
}

.skill-result {
  min-height: 260px;
  margin-top: 14px;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.canvas-toolbar span {
  min-width: 52px;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.delivery-canvas-viewport {
  position: relative;
  height: min(78vh, 820px);
  min-height: 560px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
  background:
    linear-gradient(rgba(195, 226, 232, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(195, 226, 232, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 20% 10%, rgba(33, 209, 195, 0.08), transparent 28%),
    rgba(4, 7, 10, 0.9);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.delivery-canvas-viewport.is-panning {
  cursor: grabbing;
}

.delivery-canvas-viewport.is-drop-target {
  outline: 2px solid rgba(143, 252, 255, 0.72);
  outline-offset: -6px;
  box-shadow: inset 0 0 54px rgba(143, 252, 255, 0.16);
}

.delivery-canvas {
  position: relative;
  width: 5200px;
  min-height: 3200px;
  transform-origin: 0 0;
}

.canvas-empty {
  position: absolute;
  top: 40%;
  left: 50%;
  width: min(560px, 88vw);
  padding: 26px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  border: 1px dashed rgba(195, 226, 232, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  transform: translate(-50%, -50%);
  text-align: center;
}

.canvas-empty strong {
  color: var(--text);
  font-size: 1.35rem;
  text-transform: uppercase;
}

.canvas-node {
  position: absolute;
  z-index: 2;
  min-height: 138px;
  overflow: visible;
  color: var(--text);
  border: 1px solid rgba(195, 226, 232, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(16, 23, 30, 0.96), rgba(9, 13, 18, 0.98));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.canvas-port {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid rgba(4, 7, 10, 0.96);
  border-radius: 999px;
  background: linear-gradient(135deg, #ccff00, #69f4ff);
  box-shadow:
    0 0 0 1px rgba(143, 252, 255, 0.32),
    0 0 24px rgba(143, 252, 255, 0.32);
  cursor: crosshair;
  transform: translateY(-50%);
}

.canvas-port:hover {
  filter: brightness(1.18) saturate(1.4);
  transform: translateY(-50%) scale(1.18);
}

.canvas-port-input {
  left: -8px;
}

.canvas-port-output {
  right: -8px;
}

.canvas-edge-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: visible;
}

.canvas-edge {
  fill: none;
  stroke: rgba(143, 252, 255, 0.48);
  stroke-width: 1.35;
  stroke-dasharray: 8 10;
  animation: canvas-edge-flow 12s linear infinite;
}

.canvas-edge-glow {
  fill: none;
  stroke: rgba(143, 252, 255, 0.18);
  stroke-width: 7;
  filter: blur(5px);
}

.canvas-edge-label {
  fill: rgba(238, 244, 243, 0.56);
  font: 800 11px/1 "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes canvas-edge-flow {
  to {
    stroke-dashoffset: -180;
  }
}

.canvas-node-drag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  color: var(--muted);
  border-bottom: 1px solid rgba(195, 226, 232, 0.12);
  background: rgba(255, 255, 255, 0.035);
  cursor: grab;
  user-select: none;
}

.canvas-node-drag span {
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.7rem;
  font-weight: 900;
}

.canvas-node-delete {
  width: 24px;
  height: 24px;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.canvas-node-delete:hover {
  color: #150b08;
  background: var(--coral);
}

.canvas-node-image {
  width: calc(100% - 20px);
  height: 112px;
  object-fit: cover;
  margin: 10px 10px 0;
  border-radius: 6px;
  border: 1px solid rgba(195, 226, 232, 0.12);
}

.canvas-node-file {
  display: grid;
  gap: 4px;
  margin: 12px;
  padding: 14px;
  border: 1px dashed rgba(143, 252, 255, 0.26);
  border-radius: 8px;
  background: rgba(143, 252, 255, 0.055);
}

.canvas-node-file strong,
.canvas-node-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-node-file span,
.canvas-node-meta {
  color: var(--muted);
  font-size: 0.74rem;
}

.canvas-node-meta {
  margin: -2px 12px 8px;
}

.canvas-node h3,
.canvas-node p {
  outline: none;
}

.canvas-node h3 {
  margin: 12px 12px 7px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.canvas-node p {
  white-space: pre-wrap;
  margin: 0 12px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.canvas-node-note {
  border-color: rgba(240, 166, 59, 0.32);
}

.canvas-node-brief,
.canvas-node-handoff {
  border-color: rgba(33, 209, 195, 0.28);
}

.canvas-node-placement {
  border-color: rgba(255, 207, 105, 0.34);
}

.canvas-node-shot {
  border-color: rgba(143, 252, 255, 0.3);
}

.canvas-node-video {
  border-color: rgba(145, 122, 255, 0.36);
}

.canvas-node.is-connecting {
  border-color: rgba(204, 255, 0, 0.72);
  box-shadow:
    0 0 0 1px rgba(204, 255, 0, 0.2),
    0 0 52px rgba(204, 255, 0, 0.16),
    0 20px 70px rgba(0, 0, 0, 0.44);
}

.canvas-connect-menu {
  position: absolute;
  z-index: 10;
  width: 280px;
  padding: 10px;
  border: 1px solid rgba(195, 226, 232, 0.16);
  border-radius: 12px;
  background: rgba(24, 25, 28, 0.96);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.46);
}

.canvas-connect-search {
  width: 100%;
  margin: 0 0 8px;
  padding: 9px 10px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
}

.canvas-connect-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 9px;
  color: var(--text);
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.canvas-connect-menu button:hover {
  background: rgba(143, 252, 255, 0.1);
}

.canvas-connect-menu strong,
.canvas-connect-menu small {
  display: block;
}

.canvas-connect-menu small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.canvas-action-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #05070a;
  background: linear-gradient(135deg, #ccff00, #69f4ff);
  font-weight: 900;
}

.export-panel .export-preview {
  min-height: 520px;
}

.export-preview {
  width: 100%;
  min-height: calc(100vh - 210px);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: #fff;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 10, 16, 0.58);
}

.modal-card {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.modal-head,
.image-editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2,
.image-editor-top h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  width: 34px;
  height: 34px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 1.5rem;
}

.prompt-editor-text {
  min-height: 290px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px;
}

.image-editor-modal {
  place-items: stretch;
  padding: 0;
  background: rgba(5, 6, 12, 0.78);
}

.image-editor-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  color: #f7f7fb;
  background: #080910;
}

.image-editor-top {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, 0.1);
  background: #171629;
}

.image-editor-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  min-height: 0;
  flex: 1 1 auto;
}

.canvas-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.editor-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #1b1b2f;
}

.editor-toolbar button,
.editor-toolbar input[type="color"],
.save-editor-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #f7f7fb;
  background: #25253a;
  font-weight: 850;
}

.editor-toolbar button.active {
  background: #8f2cff;
}

.editor-toolbar input[type="color"] {
  padding: 3px;
}

.save-editor-button {
  width: 64px;
  background: #18a75f;
}

#imageEditorCanvas {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fff;
  cursor: crosshair;
}

.image-edit-status {
  position: absolute;
  left: 50%;
  top: 92px;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 220px;
  padding: 14px 18px;
  border: 1px solid rgba(124, 243, 228, 0.42);
  border-radius: 8px;
  color: #eefcff;
  background:
    linear-gradient(135deg, rgba(9, 18, 28, 0.92), rgba(26, 27, 47, 0.9)),
    repeating-linear-gradient(0deg, rgba(124, 243, 228, 0.08) 0 1px, transparent 1px 7px);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.36), 0 0 32px rgba(124, 243, 228, 0.16);
  transform: translateX(-50%);
}

.image-edit-status i {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #7cf3e4;
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

.image-edit-status strong {
  font-size: 15px;
}

.image-edit-status span {
  color: #9fb5c2;
  font-size: 12px;
}

.editor-side {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  overflow: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: #111223;
}

.editor-control-card {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #1b1b2f;
}

.editor-control-card h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.editor-control-card label {
  color: rgba(247, 247, 251, 0.72);
}

.editor-control-card textarea {
  min-height: 94px;
  color: #f7f7fb;
  background: #25253a;
  border-color: rgba(255, 255, 255, 0.12);
}

.camera-preview-box {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 130px;
  margin-bottom: 12px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(16, 39, 68, 0.9), rgba(15, 15, 28, 0.94)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 12px);
  perspective: 520px;
}

.camera-preview-cube {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  color: #2b1704;
  background: linear-gradient(145deg, #ffd85c, #d86b16);
  font-size: 2rem;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  transform-style: preserve-3d;
  transition: transform 160ms ease;
}

#cameraViewLabel,
.editor-control-card span {
  color: rgba(247, 247, 251, 0.68);
  font-size: 0.78rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.check-row input {
  width: auto;
}

.edit-reference-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 72px;
  margin-bottom: 10px;
}

.edit-reference-list > span {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 72px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(247, 247, 251, 0.42);
}

.edit-reference-thumb {
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #080910;
}

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

.editor-generate-actions {
  display: grid;
  gap: 10px;
}

.button.is-loading {
  position: relative;
  opacity: 0.72;
}

.button.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 8px;
  color: #fffdf8;
  background: var(--dark);
  box-shadow: 0 18px 50px rgba(12, 14, 13, 0.22);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .asset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-grid,
  .provider-grid,
  .feature-center-grid,
  .delivery-grid,
  .command-grid {
    grid-template-columns: 1fr;
  }

  .capability-grid {
    grid-template-columns: 1fr;
  }

  .workflow-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .create-section,
  .video-create-section,
  .storage-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
    width: auto;
    max-height: none;
  }

  .workspace {
    margin-left: 0;
    padding: 20px;
  }

  .topbar,
  .panel-head,
  .next-action-card {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-actions,
  .inline-actions,
  .segmented {
    width: 100%;
  }

  .button,
  .file-button {
    width: 100%;
  }

  .delivery-canvas-viewport {
    min-height: 420px;
  }

  .delivery-canvas {
    width: 1240px;
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }

  .workflow-timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .readiness-list {
    grid-template-columns: 1fr;
  }

  .asset-slot-grid,
  .image-editor-main {
    grid-template-columns: 1fr;
  }

  .editor-side {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  #scriptText {
    min-height: 420px;
  }
}

/* Cinematic product-system refresh */
:root {
  --ink: #eef4f3;
  --ink-strong: #fbfffe;
  --muted: #8c9ba5;
  --paper: #06080c;
  --panel: rgba(13, 18, 24, 0.92);
  --panel-soft: rgba(18, 25, 33, 0.86);
  --panel-warm: rgba(25, 21, 17, 0.92);
  --line: rgba(176, 201, 208, 0.14);
  --line-strong: rgba(195, 226, 232, 0.28);
  --dark: #05070a;
  --dark-2: #0c1117;
  --dark-3: #141b24;
  --teal: #21d1c3;
  --violet: #8d78ff;
  --amber: #f0a63b;
  --coral: #ff6b5f;
  --blue: #52a3ff;
  --green: #45d18a;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 14px 46px rgba(0, 0, 0, 0.24);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(240, 166, 59, 0.08), transparent 31%),
    linear-gradient(180deg, #090d12 0%, #05070a 58%, #070a0f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 76%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0;
  z-index: -1;
  height: 42vh;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(33, 209, 195, 0.08) 34%, rgba(240, 166, 59, 0.1) 62%, transparent 92%),
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.52));
}

.sidebar {
  width: 292px;
  padding: 20px 18px;
  background:
    linear-gradient(180deg, rgba(14, 19, 26, 0.98), rgba(8, 11, 16, 0.98)),
    linear-gradient(90deg, rgba(33, 209, 195, 0.08), transparent 36%);
  border-right-color: rgba(191, 221, 226, 0.12);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03), 16px 0 56px rgba(0, 0, 0, 0.24);
}

.brand {
  width: 100%;
  margin-bottom: 18px;
  padding: 8px 9px;
  border: 1px solid rgba(143, 252, 255, 0.08);
  border-radius: 13px;
  letter-spacing: 0;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018) 45%, rgba(33, 209, 195, 0.055)),
    rgba(255, 255, 255, 0.018);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 14px 38px rgba(0, 0, 0, 0.18);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.brand:hover,
.brand:focus-visible {
  border-color: rgba(143, 252, 255, 0.2);
  background:
    linear-gradient(110deg, rgba(143, 252, 255, 0.08), rgba(255, 255, 255, 0.026) 46%, rgba(255, 207, 105, 0.06)),
    rgba(255, 255, 255, 0.024);
}

.brand:active {
  transform: translateY(1px) scale(0.99);
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: none;
  box-shadow:
    0 14px 34px rgba(33, 209, 195, 0.14),
    0 0 0 1px rgba(143, 252, 255, 0.06);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.panel,
.work-panel,
#assetsView,
#storyboardView,
#exportView {
  border-color: var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(19, 26, 34, 0.96), rgba(11, 16, 22, 0.94));
  box-shadow: var(--shadow-soft);
}

.sidebar .panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border-color: rgba(195, 226, 232, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-title {
  color: rgba(238, 244, 243, 0.88);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

label,
.sidebar label,
.context-hint,
.context-breadcrumb,
.backend-status,
.summary-card p,
.storage-card p,
.task-card p,
.asset-card p,
.asset-status,
.muted,
.project-row small,
.compact-head p,
.director-note-head p,
.slot-prompt-preview,
.slot-thumb small {
  color: var(--muted);
}

input,
select,
textarea,
.sidebar input:disabled {
  border-color: rgba(195, 226, 232, 0.14);
  color: var(--ink);
  background: rgba(6, 9, 13, 0.72);
}

input::placeholder,
textarea::placeholder {
  color: rgba(140, 155, 165, 0.62);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(33, 209, 195, 0.54);
  box-shadow: 0 0 0 4px rgba(33, 209, 195, 0.09);
}

input:disabled,
select:disabled {
  color: rgba(238, 244, 243, 0.38);
  background: rgba(255, 255, 255, 0.035);
}

.context-pill {
  min-height: 42px;
  border-color: rgba(33, 209, 195, 0.18);
  color: var(--ink-strong);
  background:
    linear-gradient(90deg, rgba(33, 209, 195, 0.1), rgba(141, 120, 255, 0.08)),
    rgba(255, 255, 255, 0.035);
}

.icon-button {
  border-color: rgba(195, 226, 232, 0.16);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.app-nav {
  gap: 6px;
}

.nav-item {
  height: 40px;
  border-radius: 9px;
  color: rgba(238, 244, 243, 0.65);
  font-size: 0.92rem;
}

.nav-item.active,
.nav-item:hover {
  color: var(--ink-strong);
  border-color: rgba(33, 209, 195, 0.18);
  background: linear-gradient(90deg, rgba(33, 209, 195, 0.12), rgba(141, 120, 255, 0.08));
}

.nav-item.active::before {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(240, 166, 59, 0.13);
}

.stat-row {
  border-top-color: rgba(195, 226, 232, 0.1);
  color: rgba(238, 244, 243, 0.6);
}

.stat-row strong {
  color: var(--ink-strong);
}

.workspace {
  margin-left: 292px;
  padding: 22px 26px 38px;
}

.topbar {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 136px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 24px 26px;
  border-color: rgba(195, 226, 232, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(110deg, rgba(13, 18, 24, 0.97) 0%, rgba(11, 16, 22, 0.92) 52%, rgba(26, 20, 15, 0.88) 100%);
  box-shadow: var(--shadow);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(33, 209, 195, 0.08) 48% 49%, transparent 49% 100%),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(255, 255, 255, 0.035) 58px 59px);
  opacity: 0.55;
}

.signal-art-canvas {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  width: min(760px, 58vw);
  height: 100%;
  pointer-events: none;
  opacity: 0.86;
  filter: contrast(1.08) saturate(1.08);
  mix-blend-mode: screen;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0, #000 18%, #000 92%, transparent 100%),
    linear-gradient(180deg, transparent 0, #000 20%, #000 82%, transparent 100%);
  mask-image:
    linear-gradient(90deg, transparent 0, #000 18%, #000 92%, transparent 100%),
    linear-gradient(180deg, transparent 0, #000 20%, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.topbar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(5, 9, 13, 0.96) 0 48%, rgba(5, 9, 13, 0.12) 66%, rgba(5, 9, 13, 0.86) 100%),
    linear-gradient(112deg, transparent 0 63%, rgba(255, 255, 255, 0.28) 63.1% 63.25%, transparent 63.5% 100%),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(255, 255, 255, 0.035) 6px 7px),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(210, 242, 255, 0.05) 54px 55px);
  opacity: 0.84;
}

.topbar > :not(.signal-art-canvas) {
  position: relative;
  z-index: 2;
}

.eyebrow {
  color: var(--amber);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}

h1,
h2,
h3 {
  color: var(--ink-strong);
  letter-spacing: 0;
}

h1 {
  font-size: 2rem;
}

.topbar h1 {
  font-size: clamp(1.95rem, 2.35vw, 2.65rem);
  line-height: 1.05;
}

.topbar-actions,
.inline-actions,
.segmented {
  align-items: center;
}

.button,
.file-button,
.text-button {
  border-color: rgba(195, 226, 232, 0.16);
  border-radius: 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.button:hover,
.file-button:hover {
  border-color: rgba(33, 209, 195, 0.4);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.button.primary {
  color: #07100f;
  border-color: rgba(33, 209, 195, 0.38);
  background: linear-gradient(135deg, #37e0d2, #f0a63b);
  box-shadow: 0 16px 38px rgba(33, 209, 195, 0.18);
}

.button.secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.button.small {
  min-height: 32px;
}

.backend-status.online {
  color: var(--teal);
}

.backend-status.offline {
  color: var(--coral);
}

.command-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(390px, 0.82fr);
  gap: 18px;
}

.command-panel {
  position: relative;
  overflow: hidden;
  min-height: 286px;
  border-color: rgba(33, 209, 195, 0.15);
  background:
    linear-gradient(135deg, rgba(18, 25, 33, 0.98), rgba(7, 11, 16, 0.98) 56%, rgba(28, 22, 15, 0.95)),
    var(--panel);
  box-shadow: 0 28px 86px rgba(0, 0, 0, 0.38);
}

.command-panel::before {
  content: "";
  position: absolute;
  inset: 16px 18px auto auto;
  width: min(390px, 44%);
  height: 142px;
  pointer-events: none;
  border: 1px solid rgba(195, 226, 232, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(90deg, transparent 0 10%, rgba(33, 209, 195, 0.58) 10% 11%, transparent 11% 28%, rgba(240, 166, 59, 0.52) 28% 29%, transparent 29% 47%, rgba(141, 120, 255, 0.5) 47% 48%, transparent 48%),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(255, 255, 255, 0.045) 23px 24px),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  opacity: 0.28;
}

.command-panel::after {
  content: "";
  position: absolute;
  right: 58px;
  top: 74px;
  width: min(250px, 32%);
  height: 72px;
  pointer-events: none;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(33, 209, 195, 0.32), transparent 38%),
    linear-gradient(160deg, rgba(240, 166, 59, 0.34), transparent 70%),
    linear-gradient(180deg, #182630, #0e141b);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  opacity: 0.34;
}

.command-panel > * {
  position: relative;
  z-index: 1;
}

.command-panel .eyebrow {
  color: var(--teal);
}

.workflow-timeline {
  grid-template-columns: repeat(6, minmax(94px, 1fr));
  gap: 9px;
}

.workflow-step {
  min-height: 94px;
  border-color: rgba(195, 226, 232, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.workflow-step span {
  border-radius: 8px;
  color: rgba(238, 244, 243, 0.72);
  background: rgba(255, 255, 255, 0.065);
}

.workflow-step.done {
  border-color: rgba(33, 209, 195, 0.35);
  background: rgba(33, 209, 195, 0.08);
}

.workflow-step.done span {
  color: #07100f;
  background: var(--teal);
}

.workflow-step.current {
  border-color: rgba(240, 166, 59, 0.5);
  background: rgba(240, 166, 59, 0.1);
  box-shadow: inset 0 0 0 1px rgba(240, 166, 59, 0.12);
}

.workflow-step.current span {
  color: #130b04;
  background: var(--amber);
}

.next-action-card {
  border-color: rgba(195, 226, 232, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.next-action-card h3 {
  color: var(--ink-strong);
}

.next-action-card p:last-child {
  color: rgba(238, 244, 243, 0.66);
}

.readiness-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.readiness-item,
.summary-card,
.storage-card,
.task-card,
.empty-state,
.asset-card,
.style-setting-box,
.director-note-panel,
.project-create-shell,
.table-wrap {
  border-color: rgba(195, 226, 232, 0.13);
  color: var(--ink);
  background: linear-gradient(180deg, rgba(18, 25, 33, 0.88), rgba(11, 16, 22, 0.88));
  box-shadow: none;
}

.readiness-item {
  min-height: 70px;
  position: relative;
  overflow: hidden;
}

.readiness-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--coral);
}

.readiness-item.ready::before {
  background: var(--green);
}

.readiness-item span {
  color: var(--ink-strong);
}

.readiness-item strong {
  color: #140906;
  background: var(--coral);
}

.readiness-item.ready strong {
  color: #06120d;
  background: var(--green);
}

.project-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 18px;
}

.project-create-shell {
  gap: 14px;
  padding: 16px;
}

.video-create-section {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.55fr);
}

.video-create-section > div:first-child {
  grid-column: 1 / -1;
}

.video-create-section > .button {
  grid-column: 1 / -1;
}

.storage-list,
.task-list {
  gap: 10px;
}

.project-group-card {
  overflow: hidden;
  background: rgba(12, 17, 23, 0.9);
}

.group-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
}

.project-group-card.selected {
  border-color: rgba(240, 166, 59, 0.44);
  box-shadow: inset 0 0 0 1px rgba(240, 166, 59, 0.1), 0 18px 46px rgba(0, 0, 0, 0.22);
}

.group-head {
  color: var(--ink);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
}

.group-delete-button {
  min-width: 64px;
  margin: 14px 14px 14px 0;
  border: 1px solid rgba(255, 107, 95, 0.26);
  border-radius: 9px;
  color: rgba(255, 188, 181, 0.86);
  background: rgba(255, 107, 95, 0.07);
  font-size: 0.84rem;
  font-weight: 850;
}

.group-delete-button:hover {
  color: #180806;
  background: var(--coral);
}

.group-scope-note {
  margin: -6px 16px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.group-head:hover {
  background: rgba(255, 255, 255, 0.075);
}

.group-head strong {
  color: #130b04;
  background: var(--amber);
}

.tree-kicker {
  color: var(--teal);
}

.project-stack {
  padding: 0 14px 14px 24px;
}

.project-row {
  border-color: rgba(195, 226, 232, 0.12);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.project-row:hover {
  border-color: rgba(33, 209, 195, 0.34);
  background: rgba(33, 209, 195, 0.08);
}

.project-row.active {
  color: #06100f;
  border-color: rgba(33, 209, 195, 0.62);
  background: linear-gradient(135deg, var(--teal), #b8fff6);
}

.project-row.active small {
  color: rgba(6, 16, 15, 0.62);
}

.empty-project-row {
  border-color: rgba(195, 226, 232, 0.12);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.storage-summary {
  gap: 10px;
}

.storage-summary .summary-card h3 {
  color: var(--ink-strong);
}

.task-status,
.badge {
  color: #06100f;
  background: var(--blue);
}

.task-card.running .task-status,
.badge.warn {
  background: var(--amber);
}

.task-card.done .task-status,
.badge.ready {
  background: var(--green);
}

.task-card.blocked .task-status,
.task-card.failed .task-status {
  color: #180806;
  background: var(--coral);
}

.progress-track {
  background: rgba(195, 226, 232, 0.1);
}

.progress-track span {
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.result-link,
.text-button {
  color: var(--teal);
}

.style-setting-box {
  background:
    linear-gradient(135deg, rgba(33, 209, 195, 0.055), rgba(141, 120, 255, 0.045)),
    rgba(11, 16, 22, 0.86);
}

#scriptText,
.style-prompt-input,
.director-note-input,
.preset-textarea,
.export-preview {
  background:
    linear-gradient(180deg, rgba(6, 9, 13, 0.9), rgba(9, 13, 18, 0.9));
}

.asset-tabs {
  border-bottom-color: rgba(195, 226, 232, 0.12);
}

.asset-tab {
  color: rgba(238, 244, 243, 0.6);
}

.asset-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.asset-tab span {
  background: rgba(33, 209, 195, 0.12);
}

.director-note-panel {
  border-color: rgba(240, 166, 59, 0.32);
  background:
    linear-gradient(135deg, rgba(240, 166, 59, 0.11), rgba(33, 209, 195, 0.04)),
    rgba(11, 16, 22, 0.88);
}

.director-note-input {
  border-color: rgba(240, 166, 59, 0.32);
}

.asset-workflow-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(33, 209, 195, 0.08), rgba(240, 166, 59, 0.08), rgba(141, 120, 255, 0.08)),
    repeating-linear-gradient(90deg, rgba(195, 226, 232, 0.04) 0 1px, transparent 1px 18px);
}

.asset-flow-btn {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(195, 226, 232, 0.18);
  border-radius: 7px;
  color: var(--ink-strong);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 850;
  letter-spacing: 0;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.asset-flow-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(195, 226, 232, 0.38);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.asset-flow-btn.extract {
  color: #140a02;
  border-color: rgba(240, 166, 59, 0.72);
  background: linear-gradient(135deg, var(--amber), #d97816);
}

.asset-flow-btn.prompt {
  color: #031511;
  border-color: rgba(33, 209, 195, 0.75);
  background: linear-gradient(135deg, var(--teal), #95ffe7);
}

.asset-flow-btn.batch {
  color: #f4f0ff;
  border-color: rgba(141, 120, 255, 0.68);
  background: linear-gradient(135deg, #5a45d9, #8d78ff);
}

.asset-flow-btn.add {
  color: #06120d;
  border-color: rgba(125, 245, 182, 0.7);
  background: linear-gradient(135deg, var(--green), #f4d35e);
}

.asset-flow-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.asset-flow-btn[hidden] {
  display: none;
}

.asset-card:hover {
  border-color: rgba(33, 209, 195, 0.28);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
}

.icon-mini {
  border-color: rgba(195, 226, 232, 0.14);
  color: var(--teal);
  background: rgba(255, 255, 255, 0.05);
}

.icon-mini.orange {
  color: #130b04;
  border-color: rgba(240, 166, 59, 0.72);
  background: var(--amber);
}

.icon-mini:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(0.4);
}

.asset-thumb {
  border-color: rgba(195, 226, 232, 0.15);
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(33, 209, 195, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.035);
}

.asset-card .type {
  color: var(--teal);
}

.asset-note-chip,
.prompt-line {
  color: rgba(238, 244, 243, 0.78);
  background: rgba(33, 209, 195, 0.08);
}

.shot-reference-row span {
  border-color: rgba(33, 209, 195, 0.28);
  color: rgba(143, 252, 255, 0.9);
  background: rgba(33, 209, 195, 0.1);
}

.shot-continuity {
  color: rgba(238, 244, 243, 0.72);
  background: rgba(143, 252, 255, 0.055);
}

.shot-missing {
  color: rgba(255, 207, 105, 0.96);
  background: rgba(255, 184, 76, 0.1);
}

table {
  color: var(--ink);
}

th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

th,
td {
  border-bottom-color: rgba(195, 226, 232, 0.11);
}

.editable:focus {
  border-color: rgba(33, 209, 195, 0.34);
  background: rgba(33, 209, 195, 0.07);
}

.modal {
  background: rgba(3, 5, 8, 0.74);
}

.modal-card {
  border-color: rgba(195, 226, 232, 0.16);
  background: #10161d;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.46);
}

.modal-head,
.modal-actions {
  border-color: rgba(195, 226, 232, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

.modal-close {
  color: var(--muted);
}

.prompt-editor-text {
  border-bottom-color: rgba(195, 226, 232, 0.12);
}

.toast {
  border: 1px solid rgba(195, 226, 232, 0.16);
  color: var(--ink);
  background: rgba(12, 17, 23, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

@media (max-width: 1180px) {
  .command-panel::before,
  .command-panel::after,
  .signal-art-canvas,
  .topbar::after {
    display: none;
  }

  .generation-settings-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    width: auto;
    padding: 18px;
  }

  .workspace {
    margin-left: 0;
    padding: 16px;
  }

  .topbar {
    min-height: 0;
    padding: 20px;
  }

  .topbar h1 {
    font-size: 2rem;
  }

  .readiness-list {
    grid-template-columns: 1fr;
  }

  .inline-field {
    grid-template-columns: 1fr;
  }

  .icon-button {
    min-height: 38px;
  }

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

  .group-delete-button {
    width: auto;
    min-height: 36px;
    margin: 0 14px 14px;
  }
}

/* Signal ASCII visual layer: original procedural styling, no external artwork. */
:root {
  --pointer-x: 72vw;
  --pointer-y: 22vh;
  --signal-cyan: #8ffcff;
  --signal-blue: #7db7ff;
  --signal-gold: #ffcf69;
  --signal-red: #ff3d55;
}

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  mix-blend-mode: screen;
}

#asciiFxCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.78;
}

.scanline-field,
.optic-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scanline-field {
  opacity: 0.42;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, transparent, rgba(143, 252, 255, 0.13), transparent);
  mask-image: radial-gradient(circle at var(--pointer-x) var(--pointer-y), #000 0 26%, transparent 62%);
  animation: signal-scan 7s linear infinite;
}

.optic-frame {
  opacity: 0.66;
  background:
    linear-gradient(90deg, transparent 7%, rgba(143, 252, 255, 0.28) 7.08%, transparent 7.2%),
    linear-gradient(90deg, transparent 88%, rgba(255, 207, 105, 0.24) 88.08%, transparent 88.2%),
    linear-gradient(180deg, transparent 14%, rgba(143, 252, 255, 0.18) 14.08%, transparent 14.2%),
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(143, 252, 255, 0.18), transparent 19%);
  filter: blur(0.1px);
}

body.motion-ready {
  cursor: crosshair;
}

body.motion-ready::before {
  z-index: 0;
  opacity: 0.95;
  background-image:
    linear-gradient(rgba(143, 252, 255, 0.058) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 252, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(143, 252, 255, 0.16), transparent 24%);
  background-size: 34px 34px, 34px 34px, auto;
}

.workspace,
.modal,
.toast {
  position: relative;
  z-index: 2;
}

.sidebar {
  position: fixed;
  z-index: 2;
}

.topbar,
.work-panel,
.panel,
.summary-card,
.storage-card,
.task-card,
.asset-card,
.project-group-card,
.capability-card,
.canvas-node {
  backdrop-filter: blur(18px) saturate(1.2);
}

.topbar {
  border-color: rgba(143, 252, 255, 0.22);
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(143, 252, 255, 0.08), transparent 28%),
    linear-gradient(110deg, rgba(5, 9, 13, 0.98) 0%, rgba(9, 14, 20, 0.92) 46%, rgba(22, 18, 15, 0.9) 100%);
}

.workspace::before {
  content: "";
  position: fixed;
  inset: 0 0 0 292px;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 54%, rgba(143, 252, 255, 0.08) 54.2%, transparent 54.6%),
    linear-gradient(154deg, transparent 0 62%, rgba(255, 207, 105, 0.08) 62.1%, transparent 62.55%),
    radial-gradient(circle at 78% 22%, rgba(143, 252, 255, 0.12), transparent 18%);
  filter: blur(0.2px);
}

.topbar h1 {
  text-shadow:
    0 0 18px rgba(143, 252, 255, 0.18),
    2px 0 0 rgba(143, 252, 255, 0.12),
    -2px 0 0 rgba(255, 61, 85, 0.08);
  animation: title-signal 5.6s steps(1, end) infinite;
}

.topbar::before,
.command-panel::before,
.delivery-canvas-viewport::before {
  animation: signal-drift 11s linear infinite;
}

.topbar::after {
  box-shadow:
    0 0 34px rgba(143, 252, 255, 0.16),
    0 0 70px rgba(255, 207, 105, 0.07),
    inset 0 0 26px rgba(143, 252, 255, 0.11),
    inset 0 0 1px rgba(255, 255, 255, 0.34);
  animation:
    spectrum-pulse 3.6s ease-in-out infinite,
    strip-flow 14s linear infinite;
}

.button,
.file-button,
.icon-button,
.nav-item,
.capability-card,
.asset-card,
.summary-card,
.canvas-node {
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    filter 180ms ease;
}

.button,
.file-button,
.icon-button {
  position: relative;
  overflow: hidden;
}

.button::after,
.file-button::after,
.icon-button::after {
  content: "";
  position: absolute;
  inset: -120% auto -120% -42%;
  width: 34%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: skewX(-18deg);
  opacity: 0;
}

.button:hover::after,
.file-button:hover::after,
.icon-button:hover::after {
  animation: button-sweep 760ms ease;
}

.button:hover,
.file-button:hover,
.icon-button:hover,
.nav-item:hover {
  filter: saturate(1.18);
}

.button:active,
.file-button:active,
.icon-button:active,
.capability-card:active,
.asset-card:active,
.canvas-node:active {
  transform: translateY(1px) scale(0.985);
}

.button.primary {
  background:
    linear-gradient(135deg, rgba(143, 252, 255, 0.96), rgba(255, 207, 105, 0.96)),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  box-shadow:
    0 0 0 1px rgba(143, 252, 255, 0.16),
    0 18px 52px rgba(143, 252, 255, 0.18),
    0 0 48px rgba(255, 207, 105, 0.08);
}

.nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(143, 252, 255, 0.1), 0 0 24px rgba(143, 252, 255, 0.08);
}

.view.active {
  animation: view-materialize 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.work-panel:hover,
.summary-card:hover,
.task-card:hover,
.capability-card:hover,
.asset-card:hover {
  border-color: rgba(143, 252, 255, 0.3);
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(143, 252, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.work-panel,
.summary-card,
.capability-card,
.asset-card,
.canvas-node {
  position: relative;
}

.work-panel::after,
.summary-card::after,
.capability-card::after,
.asset-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(143, 252, 255, 0.34), transparent) top left / 100% 1px no-repeat,
    linear-gradient(180deg, transparent, rgba(255, 207, 105, 0.22), transparent) top right / 1px 100% no-repeat;
  opacity: 0;
  transition: opacity 180ms ease;
}

.work-panel:hover::after,
.summary-card:hover::after,
.capability-card:hover::after,
.asset-card:hover::after {
  opacity: 1;
}

.capability-card {
  overflow: hidden;
  isolation: isolate;
}

.capability-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.6;
  background:
    repeating-linear-gradient(135deg, rgba(143, 252, 255, 0.09) 0 1px, transparent 1px 16px),
    radial-gradient(circle at 80% 10%, rgba(255, 207, 105, 0.16), transparent 32%);
  transform: translateX(-14%);
  transition: transform 240ms ease, opacity 240ms ease;
}

.capability-card:hover::before {
  opacity: 0.95;
  transform: translateX(0);
}

.capability-mark {
  box-shadow: 0 0 26px rgba(143, 252, 255, 0.22);
}

.delivery-canvas-viewport {
  position: relative;
  background:
    linear-gradient(rgba(143, 252, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 252, 255, 0.048) 1px, transparent 1px),
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(143, 252, 255, 0.11), transparent 23%),
    rgba(2, 5, 8, 0.94);
  background-size: 28px 28px, 28px 28px, auto, auto;
}

.delivery-canvas-viewport::before {
  content: "PROMPT / FRAME / ASSET / CANVAS / OUTPUT / 01 10 11";
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1;
  display: block;
  padding: 6px 10px;
  color: rgba(143, 252, 255, 0.38);
  font: 700 10px/1.2 Consolas, "SFMono-Regular", monospace;
  letter-spacing: 0.18em;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 8, 12, 0.92), transparent);
}

.canvas-node {
  border-color: rgba(143, 252, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(12, 18, 24, 0.96), rgba(4, 8, 12, 0.98));
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.canvas-node::after {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(143, 252, 255, 0.34), transparent) top left / 100% 1px no-repeat,
    linear-gradient(180deg, transparent, rgba(255, 207, 105, 0.22), transparent) top right / 1px 100% no-repeat;
  opacity: 0;
  transition: opacity 180ms ease;
}

.canvas-node:hover::after {
  opacity: 1;
}

.canvas-node-drag {
  background:
    linear-gradient(90deg, rgba(143, 252, 255, 0.08), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
}

.storyboard-table tbody tr,
.project-row,
.task-card {
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.storyboard-table tbody tr:hover,
.project-row:hover {
  transform: translateX(3px);
}

.tap-burst {
  position: fixed;
  z-index: 80;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border: 1px solid rgba(143, 252, 255, 0.78);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 22px rgba(143, 252, 255, 0.48);
  animation: tap-burst 620ms ease-out forwards;
}

@keyframes signal-scan {
  0% {
    transform: translateY(-3%);
  }
  100% {
    transform: translateY(3%);
  }
}

@keyframes signal-drift {
  0% {
    background-position: 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 120px 0, -80px 0, 0 80px;
  }
}

@keyframes spectrum-pulse {
  0%,
  100% {
    opacity: 0.58;
    filter: saturate(1);
  }
  50% {
    opacity: 0.92;
    filter: saturate(1.35);
  }
}

@keyframes strip-flow {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0;
  }
  100% {
    background-position: 0 0, 18px 0, -24px 0, 0 28px, -76px 0;
  }
}

@keyframes title-signal {
  0%,
  88%,
  100% {
    filter: none;
    transform: translateX(0);
  }
  90% {
    filter: brightness(1.25) contrast(1.1);
    transform: translateX(1px);
  }
  91% {
    transform: translateX(-1px);
  }
  92% {
    transform: translateX(0);
  }
}

@keyframes button-sweep {
  0% {
    opacity: 0;
    transform: translateX(0) skewX(-18deg);
  }
  22% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translateX(420%) skewX(-18deg);
  }
}

@keyframes view-materialize {
  0% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes tap-burst {
  0% {
    opacity: 0.95;
    width: 10px;
    height: 10px;
  }
  100% {
    opacity: 0;
    width: 92px;
    height: 92px;
  }
}

.command-panel {
  border-color: rgba(196, 231, 245, 0.16);
  background:
    radial-gradient(circle at 78% 17%, rgba(199, 238, 255, 0.13), transparent 18%),
    radial-gradient(circle at 58% 72%, rgba(240, 166, 59, 0.08), transparent 22%),
    linear-gradient(150deg, rgba(13, 19, 27, 0.96), rgba(5, 8, 13, 0.98) 58%, rgba(10, 14, 20, 0.96));
}

.command-panel::before {
  inset: auto -5% 8px 42%;
  width: auto;
  height: 76%;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(118deg, transparent 0 54%, rgba(224, 247, 255, 0.17) 54.1% 54.25%, transparent 54.6% 100%),
    linear-gradient(144deg, transparent 0 62%, rgba(143, 252, 255, 0.11) 62.1% 62.35%, transparent 62.7% 100%),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(201, 239, 249, 0.06) 34px 35px),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(255, 255, 255, 0.025) 8px 9px);
  opacity: 0.72;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 18%, #000 82%, transparent 100%);
}

.command-panel::after {
  right: 11%;
  top: 34%;
  width: 210px;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(241, 249, 255, 0.66), transparent);
  box-shadow:
    0 0 20px rgba(143, 252, 255, 0.3),
    0 24px 38px rgba(255, 207, 105, 0.08);
  opacity: 0.52;
}

.workflow-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr));
  gap: 0;
  margin: 16px 0 18px;
  padding: 20px 14px 18px;
  overflow: hidden;
  border: 1px solid rgba(196, 231, 245, 0.11);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    linear-gradient(90deg, rgba(143, 252, 255, 0.05), transparent 22%, rgba(255, 207, 105, 0.04) 66%, transparent);
}

.workflow-timeline::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 39px;
  height: 1px;
  background:
    linear-gradient(90deg, rgba(143, 252, 255, 0.7), rgba(224, 247, 255, 0.34) 38%, rgba(255, 207, 105, 0.36), rgba(255, 255, 255, 0.1));
  box-shadow: 0 0 18px rgba(143, 252, 255, 0.16);
}

.workflow-step {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  min-height: 66px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  color: rgba(238, 244, 243, 0.72);
  background: transparent;
  box-shadow: none;
}

.workflow-step span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 0 12px;
  border: 1px solid rgba(196, 231, 245, 0.16);
  border-radius: 999px;
  color: rgba(238, 244, 243, 0.62);
  background: rgba(8, 13, 20, 0.92);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.04);
  font-size: 0.85rem;
  font-weight: 800;
}

.workflow-step strong {
  display: block;
  max-width: 72px;
  color: rgba(238, 244, 243, 0.72);
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: center;
}

.workflow-step.done,
.workflow-step.current {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workflow-step.done span {
  color: #061311;
  border-color: rgba(143, 252, 255, 0.54);
  background: linear-gradient(135deg, #8ffcff, #55dccf);
  box-shadow:
    0 0 22px rgba(143, 252, 255, 0.24),
    inset 0 0 10px rgba(255, 255, 255, 0.32);
}

.workflow-step.done strong {
  color: rgba(238, 244, 243, 0.9);
}

.workflow-step.current::before {
  content: "";
  position: absolute;
  top: -18px;
  width: 62px;
  height: 86px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(255, 207, 105, 0.24), transparent 64%);
  filter: blur(2px);
}

.workflow-step.current span {
  color: #080806;
  border-color: rgba(255, 231, 173, 0.82);
  background: linear-gradient(135deg, #fff6b1, #f0a63b);
  box-shadow:
    0 0 30px rgba(255, 207, 105, 0.34),
    0 0 1px rgba(255, 255, 255, 0.72) inset;
}

.workflow-step.current strong {
  color: #fff8dc;
}

.next-action-card {
  position: relative;
  padding: 18px 18px 18px 22px;
  overflow: hidden;
  border: 1px solid rgba(196, 231, 245, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(143, 252, 255, 0.08), transparent 30%),
    rgba(255, 255, 255, 0.04);
}

.next-action-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8ffcff, #f0a63b);
  box-shadow: 0 0 18px rgba(143, 252, 255, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  #asciiFxCanvas,
  .scanline-field,
  .optic-frame {
    display: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: static;
  }

  .generation-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Asset directory, storyboard split view, task repair, and provider setup wizard */
.nav-item.settings-entry {
  color: rgba(238, 244, 243, 0.48);
  font-size: 0.86rem;
}

.asset-library-layout,
.storyboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.asset-editor-panel,
.shot-detail-panel {
  width: 100%;
}

.asset-directory-panel .asset-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 18px;
  border-bottom: 1px solid rgba(195, 226, 232, 0.12);
}

.asset-directory-panel .asset-tab {
  width: auto;
  justify-content: center;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}

.asset-directory-panel .asset-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  background: transparent;
}

.asset-directory-panel,
.asset-editor-panel,
.storyboard-list-panel,
.shot-detail-panel {
  min-width: 0;
}

.asset-directory-panel,
.storyboard-list-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.asset-directory {
  display: grid;
  gap: 12px;
}

.asset-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  border-bottom: 0;
}

.asset-tab {
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.asset-tab.active {
  border-color: rgba(143, 252, 255, 0.42);
  background: rgba(143, 252, 255, 0.09);
}

.asset-directory-group {
  overflow: hidden;
  border: 1px solid rgba(195, 226, 232, 0.1);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.42);
}

.asset-directory-type,
.asset-directory-item,
.storyboard-list-item,
.shot-linked-asset {
  width: 100%;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.asset-directory-type {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 9px 11px;
  color: var(--ink-strong);
  font-weight: 850;
}

.asset-directory-type strong {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 22px;
  border-radius: 999px;
  color: #06100f;
  background: var(--teal);
  font-size: 0.76rem;
}

.asset-directory-items {
  display: grid;
  gap: 4px;
  padding: 0 8px 8px;
}

.asset-directory-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
}

.asset-directory-item span,
.storyboard-list-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-directory-item small,
.asset-directory-empty,
.storyboard-list-item small,
.shot-linked-asset small,
.shot-linked-empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.asset-directory-item:hover,
.asset-directory-item.selected,
.storyboard-list-item:hover,
.storyboard-list-item.selected {
  border-color: rgba(143, 252, 255, 0.32);
  background: rgba(143, 252, 255, 0.08);
}

.asset-directory-empty,
.shot-linked-empty {
  padding: 10px;
}

.asset-detail {
  display: block;
}

.asset-editor-card {
  padding: 18px;
}

.asset-detail-head,
.shot-detail-head,
.shot-linked-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.asset-detail-head h3,
.shot-detail-head h3 {
  margin: 5px 0 0;
}

.asset-editor-fields,
.shot-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.asset-editor-fields .wide,
.shot-field-grid .wide {
  grid-column: 1 / -1;
}

.asset-editor-fields textarea,
.shot-field-grid textarea {
  min-height: 96px;
  padding: 10px 12px;
  line-height: 1.55;
}

.asset-slot-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.storyboard-list {
  display: grid;
  gap: 8px;
}

.storyboard-list-item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 10px;
  min-height: 78px;
  padding: 11px;
  border: 1px solid rgba(195, 226, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.storyboard-list-item > span {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: #06100f;
  background: linear-gradient(135deg, var(--teal), var(--amber));
  font-size: 0.78rem;
  font-weight: 900;
}

.storyboard-list-item .badge {
  justify-self: start;
  min-height: 22px;
  padding: 0 7px;
  font-size: 0.72rem;
  font-style: normal;
}

.shot-detail-panel {
  padding: 0;
}

.shot-detail-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.shot-detail-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

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

.shot-prompt-editor {
  min-height: 160px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

.shot-linked-assets {
  margin: 16px 0;
  padding: 13px;
  border: 1px solid rgba(195, 226, 232, 0.11);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.36);
}

.shot-linked-head h4 {
  margin: 0;
  color: var(--ink-strong);
}

.shot-linked-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.shot-linked-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.shot-linked-asset {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 2px 9px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  border: 1px solid rgba(195, 226, 232, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.shot-linked-asset img,
.shot-linked-asset > span {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(143, 252, 255, 0.12);
}

.shot-linked-asset > span {
  display: grid;
  place-items: center;
  color: var(--teal);
  font-weight: 900;
}

.shot-linked-asset strong {
  overflow: hidden;
  color: var(--ink-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#assetsView .asset-directory-panel {
  position: static;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

#assetDirectory,
#storyboardView .storyboard-list-panel {
  display: none;
}

.asset-detail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.asset-detail.asset-list-view {
  grid-template-columns: minmax(0, 1fr);
}

.asset-detail.asset-list-view .asset-card {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.7fr);
  gap: 12px 18px;
  align-items: start;
}

.asset-detail.asset-list-view .asset-slot-grid,
.asset-detail.asset-list-view .asset-card > .asset-slot {
  grid-column: 2;
  grid-row: 1 / span 5;
  margin-top: 0;
}

.asset-detail.asset-list-view .asset-card h3 {
  margin-top: 4px;
}

.asset-detail.asset-list-view .asset-card p {
  margin-bottom: 0;
}

.storyboard-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.storyboard-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

.storyboard-table th,
.storyboard-table td {
  vertical-align: top;
  padding: 12px;
  border-bottom: 1px solid rgba(195, 226, 232, 0.12);
  text-align: left;
}

.storyboard-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: rgba(9, 14, 20, 0.96);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.storyboard-table tbody tr.selected,
.storyboard-table tbody tr:hover {
  background: rgba(143, 252, 255, 0.055);
}

.shot-code-cell strong,
.shot-code-cell small {
  display: block;
}

.shot-code-cell strong {
  color: var(--ink-strong);
  font-size: 0.98rem;
}

.shot-code-cell small {
  margin-top: 5px;
  color: var(--muted);
}

.table-input {
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(195, 226, 232, 0.14);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(5, 9, 13, 0.68);
}

.table-input:focus {
  outline: none;
  border-color: rgba(143, 252, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(143, 252, 255, 0.08);
}

.table-input.compact {
  min-height: 74px;
}

.shot-description-input {
  min-height: 128px;
}

.shot-readiness {
  display: grid;
  gap: 4px;
  margin: 14px 0;
  padding: 10px 12px;
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 8px;
  background: rgba(4, 8, 12, 0.48);
}

.shot-readiness.warn {
  border-color: rgba(255, 184, 77, 0.36);
  background: rgba(255, 184, 77, 0.08);
}

.shot-readiness.ready {
  border-color: rgba(143, 252, 255, 0.28);
  background: rgba(143, 252, 255, 0.07);
}

.shot-readiness strong {
  color: var(--ink-strong);
  font-size: 0.82rem;
}

.shot-readiness span,
.shot-readiness-mini {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.asset-match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.asset-match-row button {
  max-width: 110px;
  padding: 4px 7px;
  border: 1px solid rgba(143, 252, 255, 0.18);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(143, 252, 255, 0.08);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-prompt-table-input {
  min-height: 156px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.shot-reference-row.compact,
.shot-continuity.compact,
.shot-missing.compact {
  margin-top: 5px;
  font-size: 0.74rem;
}

.storyboard-row-actions {
  min-width: 110px;
}

.storyboard-row-actions .button {
  width: 100%;
  margin-bottom: 7px;
}

.task-failure {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 107, 95, 0.24);
  border-radius: 8px;
  background: rgba(255, 107, 95, 0.08);
}

.task-failure strong {
  color: #ffbeb8;
  font-size: 0.82rem;
}

.task-failure p {
  margin: 5px 0 9px;
  color: rgba(255, 224, 220, 0.82);
}

.provider-wizard-status {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.provider-wizard-status strong {
  color: var(--ink-strong);
}

.provider-wizard-status span {
  color: var(--muted);
  line-height: 1.45;
}

.provider-wizard-status.done {
  border-color: rgba(69, 209, 138, 0.28);
  background: rgba(69, 209, 138, 0.08);
}

.provider-wizard-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 14px;
}

.provider-wizard-steps button {
  min-height: 42px;
  padding: 7px 8px;
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.78rem;
  font-weight: 850;
}

.provider-wizard-steps button.active {
  color: #06100f;
  border-color: rgba(143, 252, 255, 0.5);
  background: linear-gradient(135deg, var(--teal), #d8fffb);
}

.provider-wizard-steps button.done:not(.active) {
  color: var(--green);
  border-color: rgba(69, 209, 138, 0.28);
}

.provider-wizard-steps button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.provider-step-panel {
  display: none;
}

.provider-step-panel.active {
  display: block;
}

.provider-test-card {
  padding: 14px;
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.provider-test-card p {
  color: var(--muted);
  line-height: 1.55;
}

.provider-wizard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  margin-top: 14px;
}

.field-needs-attention {
  border-color: rgba(255, 207, 105, 0.86) !important;
  box-shadow: 0 0 0 4px rgba(255, 207, 105, 0.16) !important;
}

@media (max-width: 1180px) {
  .asset-library-layout,
  .storyboard-layout {
    grid-template-columns: 1fr;
  }

  .asset-directory-panel,
  .storyboard-list-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .asset-tabs,
  .asset-editor-fields,
  .shot-field-grid,
  .provider-wizard-steps,
  .provider-wizard-actions {
    grid-template-columns: 1fr;
  }

  .storyboard-rule-top,
  .asset-detail.asset-list-view .asset-card {
    grid-template-columns: 1fr;
  }

  .asset-detail.asset-list-view .asset-slot-grid,
  .asset-detail.asset-list-view .asset-card > .asset-slot {
    grid-column: 1;
    grid-row: auto;
  }

  .shot-detail-head,
  .asset-detail-head {
    flex-direction: column;
  }
}

/* Final dark-system pass: keep late-added workflow controls in the same visual language. */
:root {
  color-scheme: dark;
}

body input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]),
body select,
body textarea,
.table-input,
.storyboard-guide-field input,
.storyboard-rule-select select,
.generation-settings-grid select,
.shot-field-grid textarea,
.asset-editor-fields textarea {
  color: var(--ink) !important;
  background:
    linear-gradient(180deg, rgba(8, 13, 18, 0.96), rgba(3, 7, 11, 0.94)) !important;
  border-color: rgba(143, 252, 255, 0.18) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 0 0 1px rgba(255, 255, 255, 0.01) !important;
}

body input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"])::placeholder,
body textarea::placeholder {
  color: rgba(160, 177, 188, 0.58) !important;
}

body input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):focus,
body select:focus,
body textarea:focus,
.table-input:focus {
  border-color: rgba(143, 252, 255, 0.62) !important;
  box-shadow:
    0 0 0 3px rgba(143, 252, 255, 0.1),
    0 18px 42px rgba(0, 0, 0, 0.18) !important;
}

body input:disabled,
body select:disabled,
body textarea:disabled {
  color: rgba(238, 244, 243, 0.42) !important;
  background:
    linear-gradient(180deg, rgba(238, 244, 243, 0.055), rgba(238, 244, 243, 0.03)) !important;
  border-color: rgba(238, 244, 243, 0.11) !important;
  opacity: 1 !important;
}

body select option {
  color: #eef4f3;
  background: #070b10;
}

@media (max-width: 1180px) {
  .project-grid,
  .project-ops-grid,
  .work-grid.project-grid.project-ops-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .project-grid > *,
  .project-ops-grid > *,
  #groupList,
  .storage-list,
  .task-list {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 820px) {
  .workspace {
    margin-left: 0 !important;
    width: 100%;
    padding: 16px !important;
  }

  .sidebar {
    position: relative !important;
    width: 100% !important;
    inset: auto !important;
  }

  .workspace::before {
    inset: 0 !important;
  }
}

.quick-project-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 10px;
  margin: 8px 0 2px;
  padding: 10px;
  border: 1px solid rgba(143, 252, 255, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(143, 252, 255, 0.075), rgba(255, 205, 98, 0.035)),
    rgba(3, 8, 12, 0.62);
}

.quick-project-switcher label {
  margin: 0;
  color: rgba(238, 244, 243, 0.64);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.quick-project-switcher select {
  height: 38px;
  margin-top: -2px;
}

.quick-project-switcher label:nth-of-type(1),
.quick-project-switcher select:nth-of-type(1) {
  grid-column: 1;
}

.quick-project-switcher label:nth-of-type(2),
.quick-project-switcher select:nth-of-type(2) {
  grid-column: 2;
}

.project-create-shell,
.project-group-card,
.summary-card,
.storage-card,
.task-card,
.provider-test-card,
.provider-wizard-status,
.storyboard-rule-panel,
.generation-settings-panel,
.asset-note-panel {
  color: var(--ink) !important;
  border-color: rgba(143, 252, 255, 0.16) !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(143, 252, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(24, 33, 42, 0.82), rgba(9, 15, 22, 0.9)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 18px 50px rgba(0, 0, 0, 0.16) !important;
}

.project-group-card.selected {
  border-color: rgba(255, 205, 98, 0.5) !important;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 205, 98, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(25, 31, 37, 0.92), rgba(10, 14, 18, 0.94)) !important;
}

.segmented,
.view-toggle,
.storyboard-mode-toggle {
  border: 1px solid rgba(143, 252, 255, 0.11);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(3, 8, 12, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.segmented button,
.view-toggle button,
.storyboard-mode-toggle button {
  color: rgba(238, 244, 243, 0.68);
  background: transparent;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.segmented button:hover,
.view-toggle button:hover,
.storyboard-mode-toggle button:hover {
  color: var(--ink-strong);
  transform: translateY(-1px);
}

.segmented button.active,
.view-toggle button.active,
.storyboard-mode-toggle button.active {
  color: #06100f;
  background: linear-gradient(110deg, var(--teal), var(--amber));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 12px 34px rgba(143, 252, 255, 0.16);
}

.storyboard-rule-panel {
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.storyboard-rule-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(143, 252, 255, 0.06), transparent),
    repeating-linear-gradient(90deg, transparent 0 68px, rgba(255, 255, 255, 0.025) 68px 69px);
  opacity: 0.7;
}

.storyboard-rule-panel > * {
  position: relative;
  z-index: 1;
}

.storyboard-rule-status {
  margin: -4px 0 0;
  color: rgba(143, 252, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 800;
}

#generateSeedanceFlowBtn,
#queueStoryboardTasksBtn,
#createProjectBtn,
#createGroupBtn,
#createShotTasksBtn,
.button.primary {
  color: #06100f !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: linear-gradient(110deg, var(--teal), var(--amber)) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 18px 44px rgba(143, 252, 255, 0.14) !important;
}

.button,
button.secondary,
.project-group-card .button {
  border-color: rgba(238, 244, 243, 0.14);
}

.storyboard-table th {
  background:
    linear-gradient(180deg, rgba(9, 14, 20, 0.98), rgba(8, 12, 18, 0.96)) !important;
}

.storyboard-table tbody tr {
  background: rgba(9, 15, 22, 0.58);
}

.storyboard-table tbody tr:nth-child(even) {
  background: rgba(18, 28, 36, 0.55);
}

.storyboard-table tbody tr:hover,
.storyboard-table tbody tr.selected {
  background:
    linear-gradient(90deg, rgba(143, 252, 255, 0.075), rgba(255, 205, 98, 0.035)) !important;
}

@media (max-width: 820px) {
  .quick-project-switcher {
    grid-template-columns: 1fr;
  }

  .quick-project-switcher label:nth-of-type(1),
  .quick-project-switcher select:nth-of-type(1),
  .quick-project-switcher label:nth-of-type(2),
  .quick-project-switcher select:nth-of-type(2) {
    grid-column: 1;
  }
}

/* Final dark-console polish for storyboard and asset production controls. */
#storyboardView > .panel-head .segmented,
#storyboardView > .panel-head .inline-actions,
#assetsView > .panel-head .inline-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid rgba(143, 252, 255, 0.13);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(3, 8, 12, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 42px rgba(0, 0, 0, 0.22);
}

#storyboardView > .panel-head .segmented {
  flex-wrap: nowrap;
  width: auto;
}

.story-action-btn,
#generatePromptsBtn,
#generateSeedanceFlowBtn,
#markReadyBtn,
#queueStoryboardTasksBtn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(238, 244, 243, 0.16);
  border-radius: 10px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.028)),
    rgba(255, 255, 255, 0.035);
  font-weight: 850;
  letter-spacing: 0;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.story-action-btn:hover,
#generatePromptsBtn:hover,
#generateSeedanceFlowBtn:hover,
#markReadyBtn:hover,
#queueStoryboardTasksBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 252, 255, 0.34);
  box-shadow:
    0 0 0 1px rgba(143, 252, 255, 0.08),
    0 14px 36px rgba(0, 0, 0, 0.22);
}

#generateSeedanceFlowBtn,
#queueStoryboardTasksBtn,
.story-action-btn.primary,
.story-action-btn.accent {
  color: #06100f !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  background:
    linear-gradient(110deg, rgba(143, 252, 255, 0.98), rgba(255, 207, 105, 0.96)),
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 16px 42px rgba(143, 252, 255, 0.15) !important;
}

#markReadyBtn {
  color: rgba(238, 244, 243, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.045);
}

.storyboard-rule-panel,
.generation-settings-panel,
.asset-note-panel {
  border-radius: 14px !important;
}

.storyboard-rule-panel select,
.storyboard-rule-panel input,
.generation-settings-panel select,
.generation-settings-panel input,
.asset-note-panel textarea {
  color: var(--ink) !important;
  border-color: rgba(143, 252, 255, 0.2) !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    rgba(2, 7, 11, 0.78) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.asset-slot-tools .icon-mini,
.icon-mini {
  color: rgba(238, 244, 243, 0.92);
  border-color: rgba(143, 252, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.025)),
    rgba(2, 7, 11, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.asset-slot-tools .icon-mini:hover,
.icon-mini:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 252, 255, 0.4);
  color: var(--teal);
}

.asset-slot-tools .icon-mini.orange,
.icon-mini.orange {
  color: #07100f;
  border-color: rgba(255, 207, 105, 0.42);
  background: linear-gradient(135deg, var(--amber), var(--teal));
  box-shadow: 0 8px 24px rgba(255, 184, 77, 0.14);
}

.asset-slot-tools .icon-mini:disabled,
.icon-mini:disabled,
.story-action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.asset-card .button.primary.small {
  min-height: 34px;
  border-radius: 8px;
}

.asset-card .button.secondary.small {
  color: var(--ink);
  border-color: rgba(238, 244, 243, 0.14);
  background: rgba(255, 255, 255, 0.055);
}

/* Storyboard sheet path and 3D blocking studio */
.storyboard-sheet-panel {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
  padding: 18px;
  border: 1px solid rgba(143, 252, 255, 0.18);
  border-radius: var(--radius-sm);
  background:
    radial-gradient(circle at 8% 0%, rgba(143, 252, 255, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(22, 32, 40, 0.88), rgba(6, 11, 16, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 22px 58px rgba(0, 0, 0, 0.18);
}

.storyboard-sheet-panel[hidden] {
  display: none;
}

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

.storyboard-sheet-grid label,
.storyboard-sheet-options label,
.blocking-control-grid label,
.blocking-transform-grid label,
.blocking-wide-label {
  display: grid;
  gap: 7px;
  color: rgba(238, 244, 243, 0.72);
  font-size: 0.78rem;
  font-weight: 760;
}

.storyboard-sheet-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.storyboard-sheet-options label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(143, 252, 255, 0.12);
  border-radius: 999px;
  background: rgba(3, 8, 12, 0.46);
}

.storyboard-sheet-preview,
#blockingPromptPreview {
  min-height: 170px;
  resize: vertical;
  font-family: Consolas, "SFMono-Regular", monospace;
  line-height: 1.62;
}

#blockingView {
  min-height: calc(100vh - 160px);
}

.blocking-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(320px, 420px);
  gap: 18px;
  align-items: stretch;
}

.blocking-stage-panel,
.blocking-inspector {
  overflow: hidden;
}

.blocking-stage-panel .panel-head {
  align-items: flex-start;
}

.blocking-stage {
  position: relative;
  height: clamp(460px, 58vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(143, 252, 255, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 55% 24%, rgba(143, 252, 255, 0.2), transparent 22%),
    linear-gradient(125deg, rgba(6, 11, 17, 0.96), rgba(4, 9, 14, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 -40px 120px rgba(0, 0, 0, 0.34),
    0 30px 70px rgba(0, 0, 0, 0.22);
}

.blocking-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(143, 252, 255, 0.055) 1px, transparent 1px),
    linear-gradient(0deg, rgba(143, 252, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 45%, #000, transparent 72%);
}

.blocking-webgl {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

.blocking-webgl:active {
  cursor: grabbing;
}

.blocking-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(238, 244, 243, 0.58);
  font-weight: 800;
}

.blocking-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.blocking-inspector {
  display: grid;
  gap: 14px;
}

.blocking-object-list {
  display: grid;
  gap: 9px;
  max-height: 220px;
  overflow: auto;
  padding-right: 3px;
}

.blocking-object-pill {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid rgba(143, 252, 255, 0.13);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(3, 8, 12, 0.58);
  text-align: left;
}

.blocking-object-pill span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--object-color, var(--teal));
  box-shadow: 0 0 18px var(--object-color, var(--teal));
}

.blocking-object-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blocking-object-pill em {
  color: rgba(238, 244, 243, 0.48);
  font-size: 0.72rem;
  font-style: normal;
}

.blocking-object-pill:hover,
.blocking-object-pill.active {
  border-color: rgba(143, 252, 255, 0.48);
  background:
    radial-gradient(circle at 0% 0%, rgba(143, 252, 255, 0.18), transparent 46%),
    rgba(12, 22, 29, 0.82);
  transform: translateY(-1px);
}

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

.blocking-control-grid {
  padding: 12px;
  border: 1px solid rgba(143, 252, 255, 0.13);
  border-radius: 12px;
  background: rgba(3, 8, 12, 0.44);
}

.blocking-transform-grid input {
  min-width: 0;
}

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

  .storyboard-sheet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .storyboard-sheet-grid,
  .blocking-control-grid,
  .blocking-transform-grid {
    grid-template-columns: 1fr;
  }

  .blocking-stage {
    height: 420px;
  }
}

.style-preset-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 14px;
}

.style-preset-card {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 170px;
  overflow: hidden;
  padding: 0;
  color: rgba(238, 244, 243, 0.9);
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 14px;
  background: rgba(4, 8, 11, 0.82);
  text-align: left;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.style-preset-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 72%;
  background: linear-gradient(180deg, transparent, rgba(3, 7, 10, 0.2) 20%, rgba(3, 7, 10, 0.94));
  pointer-events: none;
}

.style-preset-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 220ms ease;
}

.style-preset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 252, 255, 0.38);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(143, 252, 255, 0.08),
    0 0 34px rgba(33, 209, 195, 0.12);
}

.style-preset-card:hover img {
  transform: scale(1.06);
}

.style-preset-card.active {
  border-color: rgba(143, 252, 255, 0.82);
  box-shadow:
    0 0 0 1px rgba(143, 252, 255, 0.22),
    0 0 38px rgba(33, 209, 195, 0.2),
    inset 0 0 34px rgba(33, 209, 195, 0.08);
}

.style-preset-card.custom-style-card {
  border-color: rgba(255, 224, 118, 0.22);
}

.style-preset-card.custom-style-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 6px);
  opacity: 0.28;
  pointer-events: none;
}

.style-preset-card.custom-style-card.active {
  border-color: rgba(255, 224, 118, 0.86);
  box-shadow:
    0 0 0 1px rgba(255, 224, 118, 0.2),
    0 0 38px rgba(255, 188, 72, 0.16),
    0 0 34px rgba(33, 209, 195, 0.12),
    inset 0 0 34px rgba(255, 224, 118, 0.06);
}

.style-preset-copy {
  position: absolute;
  inset: auto 12px 12px;
  z-index: 2;
  display: grid;
  gap: 4px;
}

.style-preset-copy strong {
  color: var(--ink-strong);
  font-size: 1rem;
  font-weight: 900;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.52);
}

.style-preset-copy small {
  color: rgba(238, 244, 243, 0.62);
  font-size: 0.74rem;
  line-height: 1.35;
}

.style-custom-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: 14px;
  align-items: stretch;
}

.style-custom-field,
.style-reference-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  color: rgba(238, 244, 243, 0.76);
  border: 1px solid rgba(195, 226, 232, 0.12);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(33, 209, 195, 0.055), rgba(141, 120, 255, 0.04)),
    rgba(3, 8, 12, 0.6);
}

.style-custom-field {
  font-size: 0.86rem;
  font-weight: 800;
}

.style-custom-note {
  min-height: 132px;
  resize: vertical;
  color: var(--ink-strong);
  border: 1px solid rgba(143, 252, 255, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(4, 8, 12, 0.94), rgba(7, 12, 17, 0.94));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.style-custom-note:focus {
  border-color: rgba(143, 252, 255, 0.56);
  box-shadow:
    0 0 0 3px rgba(33, 209, 195, 0.11),
    inset 0 1px rgba(255, 255, 255, 0.05);
}

.style-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.style-reference-head strong {
  color: var(--ink-strong);
}

.style-reference-upload {
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 16px;
  color: rgba(238, 244, 243, 0.72);
  border: 1px dashed rgba(143, 252, 255, 0.28);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(143, 252, 255, 0.16), transparent 58%),
    rgba(0, 0, 0, 0.2);
  cursor: pointer;
  text-align: center;
  font: inherit;
}

.style-reference-upload span {
  color: var(--ink-strong);
  font-weight: 900;
}

.style-reference-upload small,
.style-status-text {
  color: rgba(238, 244, 243, 0.5);
}

.style-reference-file,
.style-reference-upload input {
  display: none;
}

.style-reference-preview {
  min-height: 44px;
  overflow: hidden;
  border: 1px solid rgba(195, 226, 232, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(238, 244, 243, 0.55);
  font-size: 0.8rem;
}

.style-reference-preview:not(:has(img)) {
  display: grid;
  place-items: center;
  padding: 10px;
}

.style-reference-preview img {
  display: block;
  width: 100%;
  height: 116px;
  object-fit: cover;
}

.style-reference-preview span {
  display: block;
  padding: 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-status-text {
  margin: 0;
  font-size: 0.78rem;
}

.style-prompt-hidden {
  display: none !important;
}

.brand {
  position: relative;
  isolation: isolate;
  gap: 12px;
  min-height: 58px;
  padding: 9px 11px;
  overflow: hidden;
  border: 1px solid rgba(151, 241, 255, 0.13);
  border-radius: 16px;
  color: #f5fbff;
  background:
    radial-gradient(105px 72px at 18% 34%, rgba(129, 249, 255, 0.2), transparent 68%),
    linear-gradient(118deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.016) 42%, rgba(255, 212, 106, 0.05)),
    rgba(4, 8, 12, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(139, 250, 255, 0.05),
    0 18px 46px rgba(0, 0, 0, 0.28);
}

.brand::before,
.brand::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.brand::before {
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 6px),
    linear-gradient(90deg, transparent, rgba(125, 244, 255, 0.16), transparent);
  opacity: 0.22;
  transform: translateX(-38%);
  transition: transform 520ms ease, opacity 220ms ease;
}

.brand::after {
  width: 76px;
  height: 76px;
  right: -35px;
  top: -28px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 224, 118, 0.16), transparent 67%);
  opacity: 0.74;
}

.brand:hover::before,
.brand:focus-visible::before {
  opacity: 0.36;
  transform: translateX(28%);
}

.brand > span:last-child {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.01em;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.72),
    0 0 20px rgba(126, 248, 255, 0.14);
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(248, 255, 255, 0.12), rgba(98, 239, 255, 0.03)),
    rgba(2, 7, 12, 0.64);
  box-shadow:
    0 0 0 1px rgba(191, 252, 255, 0.2),
    0 0 0 4px rgba(80, 236, 255, 0.035),
    0 14px 34px rgba(80, 236, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 18px;
  border: 1px solid rgba(128, 248, 255, 0.12);
  opacity: 0.74;
}

.brand-mark img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  filter:
    drop-shadow(0 0 8px rgba(130, 246, 255, 0.24))
    drop-shadow(0 0 18px rgba(255, 221, 118, 0.11));
}

.button.is-loading,
button.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.82;
}

.button.is-loading::after,
button.is-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@media (max-width: 1180px) {
  .style-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .style-custom-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .style-preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .style-preset-grid {
    grid-template-columns: 1fr;
  }
}
