:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d8dee9;
  --blue: #2548ff;
  --dark: #090b10;
  --shadow: 0 22px 70px rgba(17, 24, 39, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Segoe UI",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.home {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.entry-panel {
  width: min(760px, 100%);
  display: grid;
  gap: 34px;
  justify-items: center;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
  font-weight: 900;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.entry-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.entry-actions.path-only {
  width: min(260px, 100%);
  grid-template-columns: 1fr;
}

.entry-note {
  width: min(620px, 100%);
  margin: -18px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.7;
}

.entry-button {
  min-height: 168px;
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 900;
  text-decoration: none;
}

.entry-button.primary {
  background: var(--blue);
}

.entry-button.dark {
  background: var(--dark);
}

.entry-button.path {
  background: #0f766e;
}

.project-path-summary {
  width: 100%;
  margin: -18px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  word-break: break-all;
}

.button-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.15);
}

.button-icon svg {
  width: 30px;
  height: 30px;
}

.project-section {
  width: 100%;
  display: grid;
  gap: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.project-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 12px 36px rgba(17, 24, 39, 0.08);
  padding: 16px;
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.project-card strong {
  font-size: 18px;
}

.project-card span {
  color: var(--muted);
  font-size: 13px;
}

.page {
  min-height: 100vh;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 32px;
}

.page-head {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.back-link {
  width: fit-content;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 800;
}

.page-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  gap: 16px;
}

.runtime-bridge {
  border: 1px solid #b9c6ff;
  border-radius: var(--radius);
  background: #eef2ff;
  color: var(--ink);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.runtime-bridge h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.runtime-bridge p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.runtime-button {
  text-decoration: none;
  flex: 0 0 auto;
}

.api-page-form {
  margin-bottom: 28px;
}

.api-groups {
  display: grid;
  gap: 16px;
}

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

.api-gate-panel {
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.7fr) auto;
  align-items: center;
  gap: 12px;
}

.api-gate-panel[data-state="ok"] {
  border-color: rgba(8, 122, 83, 0.22);
}

.api-gate-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.api-gate-copy strong {
  font-size: 15px;
  font-weight: 900;
}

.api-gate-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.api-gate-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.api-gate-pill {
  min-height: 30px;
  border-radius: 999px;
  background: #fff0f0;
  color: #b42318;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.api-gate-pill.ok {
  background: #e8f8f2;
  color: #087a53;
}

.api-gate-pill em {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  opacity: 0.78;
}

.api-gate-action {
  white-space: nowrap;
}

.function-card {
  min-height: 132px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 18px;
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 900;
}

.function-card.is-locked {
  opacity: 0.58;
  cursor: not-allowed;
}

.function-card.is-checking {
  outline: 3px solid rgba(46, 115, 255, 0.18);
}

.workflow-nav {
  width: fit-content;
  max-width: min(100%, 620px);
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 4px;
  justify-self: center;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.08);
}

.workflow-nav-item {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0 14px;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  box-shadow: none;
}

.workflow-nav-item:hover,
.workflow-nav-item.is-active {
  border-color: transparent;
  background: #050505;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset;
}

.workflow-nav-item[aria-disabled="true"] {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.dark-workflow-nav {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  margin-bottom: 0;
  background: rgba(18, 22, 32, 0.92);
  border-color: #303746;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.dark-workflow-nav .workflow-nav-item {
  border-color: transparent;
  background: transparent;
  color: #9ca3af;
  font-size: 14px;
  box-shadow: none;
}

.dark-workflow-nav .workflow-nav-item:hover,
.dark-workflow-nav .workflow-nav-item.is-active {
  border-color: transparent;
  background: #fff;
  color: #050505;
  box-shadow: none;
}

.project-backup-section {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.project-backup-list {
  display: grid;
  gap: 10px;
}

.project-backup-card {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.project-backup-card div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.project-backup-card > div:first-child {
  flex: 1;
}

.project-backup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.project-backup-card strong {
  font-size: 15px;
  font-weight: 900;
}

.project-backup-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dialog {
  width: min(460px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(9, 11, 16, 0.45);
}

.dialog-card {
  max-height: calc(100vh - 28px);
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.api-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-group h2,
.api-group h3 {
  grid-column: 1 / -1;
}

.full-field {
  grid-column: 1 / -1;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
  padding: 0;
  flex: 0 0 auto;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
  padding: 0 12px;
}

input,
select {
  min-height: 44px;
}

.secret-input-wrap {
  position: relative;
  width: 100%;
}

.secret-input-wrap input {
  padding-right: 46px;
}

.secret-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.secret-toggle:hover,
.secret-toggle.is-visible {
  background: rgba(37, 72, 255, 0.08);
  color: var(--blue);
}

.secret-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

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

.code-input {
  min-height: 300px;
  font-family:
    Consolas,
    "Cascadia Mono",
    "Courier New",
    monospace;
  font-size: 13px;
  line-height: 1.55;
}

.code-input.short {
  min-height: 130px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 72, 255, 0.12);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.form-button {
  min-width: 104px;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  font-weight: 800;
}

.form-button.primary {
  background: var(--blue);
  color: #fff;
}

.form-button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.form-button.danger {
  background: #d92d20;
  color: #fff;
}

.form-button.mini {
  min-width: 0;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.form-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dialog-note {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.dialog-note a {
  color: var(--blue);
  font-weight: 800;
}

.api-test-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.image-provider-group {
  align-items: start;
}

.image-provider-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

[data-image-provider-panel="gpt2"] label {
  grid-column: 1 / -1;
}

.gpt2-key-field input {
  min-height: 52px;
  font-size: 15px;
  font-weight: 800;
}

.image-provider-panel .code-input {
  min-height: 220px;
}

.image-provider-panel .code-input.short {
  min-height: 110px;
}

.api-test-bar {
  display: grid;
  grid-template-columns: auto minmax(86px, max-content);
  gap: 10px 12px;
  align-items: center;
}

.api-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcff;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.api-summary:empty {
  display: none;
}

.api-summary div {
  display: grid;
  gap: 4px;
}

.api-summary b {
  color: var(--muted);
  font-size: 12px;
}

.api-summary span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.api-status {
  min-height: 28px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.api-status.ok {
  background: #e8f8f2;
  color: #087a53;
}

.api-status.fail {
  background: #fff0f0;
  color: #b42318;
}

.api-status.testing {
  background: #fff3df;
  color: #a26306;
}

.workflow-card {
  gap: 18px;
}

.style-detail {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 16px;
}

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

.style-detail-head span {
  color: var(--muted);
  font-weight: 900;
}

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

.style-preview-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #eef2f7;
}

.style-gallery {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.style-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  padding: 10px;
  display: grid;
  gap: 8px;
  text-align: left;
}

.style-card.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 72, 255, 0.14);
}

.style-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  background: #eef2f7;
}

.style-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.style-card strong {
  font-size: 15px;
  line-height: 1.35;
}

.breakdown-body {
  background: #050505;
  color: #fff;
}

.breakdown-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 0;
}

.episode-sidebar {
  min-height: 100vh;
  background: #050505;
  border-right: 1px solid #1d1d1d;
  padding: 76px 10px 16px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.dark-back {
  width: fit-content;
  border-color: transparent;
  background: transparent;
  color: #fff;
}

.upload-panel {
  border: 1px solid #1f1f1f;
  border-radius: 8px;
  background: #121212;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.upload-button {
  min-height: 42px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #1d1d1d;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.upload-button input {
  display: none;
}

.upload-panel .form-button {
  width: 100%;
}

.upload-panel .reset-breakdown-button {
  border: 1px solid #4a2424;
  background: #201010;
  color: #ffb4b4;
}

.upload-panel .reset-breakdown-button:hover {
  border-color: #d92d20;
  color: #fff;
}

.breakdown-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.breakdown-controls .form-button.secondary {
  border-color: #303030;
  background: #1d1d1d;
  color: #fff;
}

.upload-panel .dialog-note {
  color: #9ca3af;
}

.upload-panel .dialog-note[data-tone="ok"] {
  color: #52d991;
}

.upload-panel .dialog-note[data-tone="warn"] {
  color: #f8c15c;
}

.upload-panel .dialog-note[data-tone="error"] {
  color: #ff8a8a;
}

.breakdown-progress {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
}

.progress-row span,
.progress-row em {
  color: #cbd5e1;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.progress-row em {
  color: #8b95a7;
}

.progress-track {
  grid-column: 1 / -1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #272727;
}

.progress-track span {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #3152ff;
  transition: width 0.35s ease;
}

.progress-row + .progress-row .progress-track span {
  background: #52d991;
}

.episode-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding-right: 4px;
}

.episode-item {
  min-height: 64px;
  border: 0;
  border-radius: 10px;
  background: #121212;
  color: #fff;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  text-align: left;
}

.episode-item.is-active,
.episode-item:hover {
  background: #1f1f1f;
}

.episode-icon {
  width: 30px;
  height: 36px;
  border-radius: 6px;
  background:
    linear-gradient(#fff 0 0) 9px 10px / 12px 2px no-repeat,
    linear-gradient(#fff 0 0) 9px 16px / 12px 2px no-repeat,
    linear-gradient(#fff 0 0) 9px 22px / 8px 2px no-repeat,
    #f4f4f4;
}

.episode-item strong,
.episode-item em {
  display: block;
}

.episode-item strong {
  font-size: 15px;
}

.episode-item em {
  margin-top: 4px;
  color: #9ca3af;
  font-size: 13px;
  font-style: normal;
}

.script-detail {
  min-height: calc(100vh - 6px);
  margin: 3px 3px 3px 0;
  border-radius: 12px 0 0 12px;
  background: #1f1f1f;
  overflow: auto;
  padding: 82px 36px 42px;
}

.script-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 26px;
}

.script-detail h1,
.script-detail h2 {
  color: #fff;
  font-size: 22px;
}

.script-detail-head span {
  color: #9ca3af;
  font-size: 13px;
}

.scene-list {
  display: grid;
  gap: 28px;
}

.empty-breakdown {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: #9ca3af;
  border: 1px dashed #3a3a3a;
  border-radius: 8px;
}

.scene-block {
  display: grid;
  gap: 8px;
}

.scene-block h3 {
  color: #8b8b8b;
  font-size: 16px;
  margin-bottom: 10px;
}

.scene-block h4 {
  color: #fff;
  font-size: 16px;
  margin: 0;
}

.scene-characters,
.scene-line {
  margin: 0;
  color: #fff;
  font-size: 15px;
  line-height: 1.55;
}

.scene-characters {
  font-weight: 800;
}

.scene-lines {
  display: grid;
  gap: 3px;
}

.action-line {
  color: #f8fbff;
}

.dialogue-line {
  color: #fff;
}

.workflow-step {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  background: rgba(35, 229, 214, 0.13);
  color: #23e5d6;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.script-tabs {
  display: flex;
  gap: 24px;
  margin: -12px 0 26px;
  border-bottom: 1px solid #303030;
}

.script-tab {
  min-height: 48px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #838b98;
  padding: 0;
  font-size: 20px;
  font-weight: 900;
}

.script-tab.is-active {
  border-color: #23e5d6;
  color: #fff;
}

.planning-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 42px;
  max-width: 1180px;
}

.planning-field {
  display: grid;
  gap: 10px;
}

.planning-field.is-wide {
  grid-column: 1 / -1;
}

.planning-field h2 {
  position: relative;
  color: #fff;
  font-size: 18px;
  padding-left: 12px;
}

.planning-field h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: #23e5d6;
}

.planning-field p {
  margin: 0;
  color: #f1f5f9;
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.asset-body {
  height: 100vh;
  overflow: hidden;
  background: #0b0d12;
  color: #f8fbff;
}

.asset-shell {
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.asset-sidebar {
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid #242833;
  background: #090b10;
  padding: 76px 12px 16px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
}

.asset-panel {
  border: 1px solid #242833;
  border-radius: 8px;
  background: #121620;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.asset-panel h2 {
  color: #fff;
  font-size: 16px;
}

.asset-panel label {
  color: #aab3c2;
}

.asset-panel input,
.asset-panel select,
.asset-panel textarea {
  border-color: #303746;
  background: #0c1018;
  color: #fff;
}

.asset-panel .dialog-note[data-tone="ok"] {
  color: #52d991;
}

.asset-panel .dialog-note[data-tone="warn"] {
  color: #f8c15c;
}

.asset-panel .dialog-note[data-tone="error"] {
  color: #ff8a8a;
}

.asset-style-current {
  min-height: 86px;
  border: 1px solid #303746;
  border-radius: 8px;
  background: #0c1018;
  color: #fff;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  text-align: left;
}

.asset-style-current span {
  width: 76px;
  height: 66px;
  border-radius: 6px;
  background: #171c28 center / cover no-repeat;
}

.asset-model-field {
  display: grid;
  gap: 6px;
}

.asset-model-field select {
  width: 100%;
  min-height: 38px;
  padding: 0 34px 0 10px;
  color-scheme: dark;
}

.asset-model-field select:disabled {
  color: #596160;
  opacity: 1;
  cursor: not-allowed;
}

.asset-model-field small {
  color: #76817f;
  font-size: 10px;
  line-height: 1.45;
}

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

.asset-category-actions .form-button {
  min-width: 0;
  min-height: 30px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.asset-category-actions .form-button.primary {
  border-color: #52cfa8;
  background: #62d9b4;
  color: #092019;
}

.asset-category-actions .form-button.primary:hover {
  background: #78dfbf;
}

.asset-image-category-actions .form-button.secondary {
  border-color: #367f6c;
  background: #152720;
  color: #72dfbd;
}

.asset-image-category-actions .form-button.secondary:hover {
  border-color: #52cfa8;
  background: #1b332a;
}

.asset-style-current span:empty {
  display: block;
}

.asset-style-current strong {
  font-size: 14px;
  line-height: 1.35;
}

.asset-style-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.asset-style-grid {
  max-height: min(680px, calc(100vh - 140px));
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.asset-style-option {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  display: grid;
  gap: 7px;
  text-align: left;
}

.asset-style-option.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 72, 255, 0.14);
}

.asset-style-option img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  background: #eef2f7;
}

.asset-style-option span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.asset-style-option strong {
  font-size: 14px;
  line-height: 1.35;
}

.asset-style-option small {
  display: -webkit-box;
  overflow: hidden;
  color: #596579;
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.style-prompt-editor {
  min-height: 170px;
}

.episode-asset-panel {
  min-height: 0;
}

.asset-episode-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
}

.episode-batch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.episode-batch-actions .form-button {
  width: 100%;
  min-width: 0;
}

.episode-selection-hint {
  margin: 0;
  color: #8b95a7;
  font-size: 12px;
  line-height: 1.45;
}

.asset-episode-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
  align-items: stretch;
}

.asset-episode-choice.is-active .asset-episode-item,
.asset-episode-choice:hover .asset-episode-item {
  border-color: #3152ff;
  background: #151b2a;
}

.asset-episode-check {
  min-height: 58px;
  border: 1px solid #242833;
  border-radius: 8px;
  background: #0c1018;
  display: grid;
  place-items: center;
  padding: 0;
}

.asset-episode-check input {
  width: 18px;
  min-height: 18px;
  accent-color: #3152ff;
}

.asset-episode-item {
  min-height: 58px;
  border: 1px solid #242833;
  border-radius: 8px;
  background: #0c1018;
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 8px;
  padding: 10px;
  text-align: left;
}

.asset-episode-item.is-active,
.asset-episode-item:hover {
  border-color: #3152ff;
  background: #151b2a;
}

.asset-episode-item strong {
  grid-column: 1 / -1;
  font-size: 15px;
}

.asset-episode-item span {
  color: #8b95a7;
  font-size: 12px;
  font-weight: 800;
}

.asset-episode-item em {
  width: fit-content;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(35, 229, 214, 0.12);
  color: #23e5d6;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.asset-episode-item em:hover {
  background: #23e5d6;
  color: #041114;
}

.episode-doc-dialog {
  width: min(820px, calc(100vw - 32px));
}

.episode-doc-content {
  max-height: min(680px, calc(100vh - 150px));
  overflow: auto;
  display: grid;
  gap: 12px;
}

.episode-doc-scene {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.episode-doc-scene h3 {
  color: var(--ink);
  font-size: 17px;
}

.episode-doc-scene p {
  margin: 0;
  color: #344054;
  font-size: 14px;
  line-height: 1.7;
}

.episode-doc-scene b {
  margin-right: 8px;
  color: var(--muted);
}

.episode-doc-lines {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}

.asset-workspace {
  min-width: 0;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding: 82px 24px 24px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

.asset-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.asset-head h1 {
  color: #fff;
  font-size: 28px;
  margin-top: 8px;
}

.asset-head p {
  margin: 8px 0 0;
  color: #9ca3af;
}

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

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

.asset-category {
  min-width: 0;
  min-height: 0;
  border: 1px solid #242833;
  border-radius: 8px;
  background: #121620;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.asset-category h2 {
  color: #fff;
  font-size: 18px;
}

.asset-card-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
}

.asset-card {
  border: 1px solid #2b3140;
  border-radius: 8px;
  overflow: hidden;
  background: #0c1018;
}

.asset-image {
  aspect-ratio: 1 / 1;
  background: #171c28;
}

.asset-image img,
.asset-image-placeholder {
  width: 100%;
  height: 100%;
}

.asset-image img {
  display: block;
  object-fit: cover;
}

.asset-image-placeholder {
  display: grid;
  place-items: center;
  color: #8b95a7;
  font-weight: 900;
}

.asset-card-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.asset-card-body h3 {
  color: #fff;
  font-size: 16px;
}

.asset-card-body h4 {
  margin: 0;
  color: #fff;
  font-size: 14px;
}

.asset-card-body p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.55;
}

.asset-card-body textarea {
  min-height: 130px;
  border-color: #303746;
  background: #090b10;
  color: #fff;
  font-size: 12px;
}

.asset-error {
  color: #ff8a8a !important;
}

.character-asset-card {
  overflow: visible;
}

.asset-episode-tag {
  margin-left: 6px;
  color: #8b95a7;
  font-size: 12px;
  font-weight: 800;
}

.appearance-card {
  border: 1px solid #242833;
  border-radius: 8px;
  background: #090b10;
  overflow: hidden;
  display: grid;
  gap: 0;
}

.appearance-card .asset-image {
  aspect-ratio: 16 / 10;
}

.appearance-body {
  padding: 10px;
  display: grid;
  gap: 9px;
}

.appearance-body p {
  color: #aab3c2;
}

.appearance-body textarea {
  min-height: 120px;
  border-color: #303746;
  background: #05070b;
  color: #fff;
  font-size: 12px;
}

.asset-empty {
  min-height: 90px;
  border: 1px dashed #303746;
  border-radius: 8px;
  color: #8b95a7;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
}

.asset-designer {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(540px, 0.95fr) minmax(420px, 1.05fr);
  gap: 16px;
}

.asset-overview,
.asset-detail-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid #242833;
  border-radius: 8px;
  background: #11151d;
}

.asset-overview {
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

.asset-tabs {
  display: flex;
  gap: 22px;
}

.asset-tab {
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #7d8798;
  padding: 0;
  font-size: 18px;
  font-weight: 900;
}

.asset-tab.is-active {
  border-color: #23e5d6;
  color: #fff;
}

.asset-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-status-chip {
  min-height: 38px;
  border-radius: 8px;
  background: #1b202b;
  color: #d7deea;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
}

.asset-status-chip.is-active {
  background: rgba(35, 229, 214, 0.12);
  color: #23e5d6;
}

.asset-toolbar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.asset-episode-pager {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
}

.asset-pager-summary {
  flex: 0 0 auto;
  color: #8b95a7;
  font-size: 12px;
  font-weight: 900;
}

.asset-pager-buttons {
  min-width: 0;
  overflow-x: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-bottom: 2px;
}

.asset-page-number,
.asset-page-jump {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid #2a3140;
  border-radius: 6px;
  background: #0b0f16;
  color: #aab3c2;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.asset-page-number:hover,
.asset-page-number.is-active,
.asset-page-jump:hover {
  border-color: #23e5d6;
  color: #23e5d6;
}

.asset-page-number.is-active {
  background: rgba(35, 229, 214, 0.12);
}

.asset-page-jump:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.asset-list-grid {
  min-height: 0;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding-right: 2px;
}

.asset-overview-card {
  position: relative;
  min-width: 0;
  min-height: 118px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #0b0f16;
  color: #fff;
  overflow: hidden;
}

.asset-overview-main {
  width: 100%;
  min-height: 118px;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.asset-overview-main:focus-visible {
  outline: 2px solid #23e5d6;
  outline-offset: -2px;
}

.asset-card-close,
.asset-card-delete {
  position: absolute;
  z-index: 5;
  border: 0;
  cursor: pointer;
}

.asset-card-close {
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(239, 45, 34, 0.92);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.asset-card-close:hover {
  background: #ff453a;
}

.asset-card-delete {
  right: 8px;
  bottom: 8px;
  min-height: 22px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.18);
  color: #ff9a9a;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
}

.asset-card-delete:hover {
  background: #ef4444;
  color: #fff;
}

.asset-overview-card:hover,
.asset-overview-card.is-active {
  border-color: #23e5d6;
  background: #141a24;
}

.asset-overview-thumb {
  width: 76px;
  height: 96px;
  align-self: center;
  justify-self: center;
  overflow: hidden;
  border-radius: 6px;
  background: #1b202b;
}

.asset-overview-thumb-scenes {
  width: 96px;
  height: 54px;
}

.asset-overview-thumb-props {
  width: 76px;
  height: 76px;
}

.asset-overview-thumb img,
.asset-overview-thumb .asset-image-placeholder {
  width: 100%;
  height: 100%;
}

.asset-overview-thumb img {
  display: block;
  object-fit: cover;
}

.asset-overview-thumb .asset-image-placeholder {
  font-size: 12px;
}

.asset-overview-info {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding-right: 22px;
  padding-bottom: 26px;
}

.asset-overview-info strong,
.asset-overview-info em,
.asset-overview-info span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-overview-info strong {
  white-space: nowrap;
  font-size: 16px;
  font-weight: 900;
}

.asset-overview-info em {
  white-space: nowrap;
  color: #8b95a7;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.asset-overview-info span {
  display: -webkit-box;
  color: #b8c1d1;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.asset-mini-status {
  position: absolute;
  left: 106px;
  bottom: 8px;
  max-width: calc(100% - 210px);
  min-height: 22px;
  border-radius: 999px;
  background: #242b38;
  color: #aab3c2;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-mini-status.done {
  background: rgba(82, 217, 145, 0.15);
  color: #52d991;
}

.asset-mini-status.generating {
  background: rgba(248, 193, 92, 0.15);
  color: #f8c15c;
}

.asset-mini-status.error {
  background: rgba(255, 138, 138, 0.16);
  color: #ff8a8a;
}

.asset-mini-delete {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.18);
  color: #ff9a9a;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.asset-mini-delete:hover {
  background: #ef4444;
  color: #fff;
}

.asset-detail-panel {
  overflow: hidden;
  padding: 14px;
}

.asset-runtime {
  border: 1px solid #242833;
  border-radius: 8px;
  background: #0c1018;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.asset-runtime-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
}

.asset-runtime-head strong {
  min-width: 0;
  color: #fff;
  font-size: 14px;
}

.asset-runtime-head span {
  color: #8b95a7;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.asset-runtime-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #1f2430;
}

.asset-runtime-track span {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #23e5d6, #3152ff);
  transition: width 0.35s ease;
}

.asset-runtime[data-state="ok"] .asset-runtime-track span {
  background: linear-gradient(90deg, #52d991, #23e5d6);
}

.asset-runtime[data-state="error"] .asset-runtime-track span {
  background: linear-gradient(90deg, #ff8a8a, #f8c15c);
}

.asset-detail-headline {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.asset-detail-headline h2 {
  color: #fff;
  font-size: 24px;
}

.asset-detail-headline span {
  color: #8b95a7;
  font-size: 13px;
  font-weight: 900;
}

.asset-detail-layout {
  height: calc(100% - 54px);
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(380px, 0.95fr) minmax(340px, 0.72fr);
  gap: 18px;
}

.asset-detail-layout-scenes {
  grid-template-columns: minmax(620px, 1.18fr) minmax(340px, 0.82fr);
}

.asset-detail-layout-props {
  grid-template-columns: minmax(420px, 0.92fr) minmax(340px, 0.78fr);
}

.asset-visual-column {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 12px;
}

.asset-preview-stage {
  position: relative;
  width: min(100%, 540px);
  max-height: min(100%, 620px);
  aspect-ratio: 9 / 16;
  justify-self: center;
  border-radius: 8px;
  background: #1a1d22;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.asset-preview-characters {
  width: min(100%, 540px);
  aspect-ratio: 9 / 16;
}

.asset-preview-scenes {
  width: min(100%, 920px);
  max-height: min(100%, 520px);
  aspect-ratio: 16 / 9;
}

.asset-preview-props {
  width: min(100%, 560px);
  max-height: min(100%, 560px);
  aspect-ratio: 1 / 1;
}

.asset-preview-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}

.asset-large-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #7d8798;
  font-size: 22px;
  font-weight: 900;
}

.asset-meta-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 16px;
  border-left: 1px solid #242833;
  padding: 2px 4px 0 18px;
}

.asset-meta-panel h3 {
  color: #aab3c2;
  font-size: 14px;
  margin-bottom: 8px;
}

.asset-meta-panel p {
  margin: 0;
  color: #e6ebf3;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.asset-meta-panel label {
  color: #aab3c2;
}

.asset-meta-panel textarea {
  min-height: 190px;
  border-color: #303746;
  background: #080b10;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
}

.appearance-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 2px;
}

.appearance-thumb {
  position: relative;
  width: 104px;
  min-width: 104px;
  border: 1px solid #303746;
  border-radius: 8px;
  background: #0b0f16;
  color: #fff;
  display: grid;
  gap: 6px;
  padding: 8px;
}

.appearance-thumb-main {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: grid;
  gap: 6px;
  padding: 0;
  text-align: inherit;
}

.appearance-thumb.is-active {
  border-color: #23e5d6;
  box-shadow: 0 0 0 2px rgba(35, 229, 214, 0.18);
}

.appearance-thumb.is-generating {
  border-color: #ef2d22;
  box-shadow: 0 0 0 2px rgba(239, 45, 34, 0.2);
}

.appearance-thumb.is-generating .appearance-thumb-placeholder {
  background: rgba(239, 45, 34, 0.18);
  color: #ffaaa4;
}

.appearance-thumb img,
.appearance-thumb-placeholder {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  background: #1b202b;
}

.appearance-thumb img {
  object-fit: cover;
  display: block;
}

.appearance-thumb-placeholder {
  display: grid;
  place-items: center;
  color: #8b95a7;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  padding: 8px;
}

.appearance-thumb em {
  min-width: 0;
  overflow: hidden;
  color: #cbd5e1;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-image-tools {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.asset-image-tool {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(8, 11, 16, 0.86);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  position: absolute;
  z-index: 13;
  pointer-events: auto;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.asset-image-tool.delete {
  top: 8px;
  right: 8px;
  background: rgba(239, 45, 34, 0.92);
}

.asset-image-tool.upload {
  right: 8px;
  bottom: 8px;
  background: rgba(35, 229, 214, 0.92);
  color: #041114;
}

.asset-image-tool svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  pointer-events: none;
}

.asset-image-tool path {
  pointer-events: none;
}

.appearance-thumb .asset-image-tool {
  width: 24px;
  height: 24px;
}

.appearance-thumb .asset-image-tool.delete {
  top: 4px;
  right: 4px;
}

.appearance-thumb .asset-image-tool.upload {
  right: 4px;
  bottom: 24px;
}

.image-lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: 0;
  background: rgba(0, 0, 0, 0.88);
  padding: 32px;
  color: #fff;
}

.image-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.image-lightbox[open] {
  display: grid;
  place-items: center;
  gap: 12px;
}

.image-lightbox img {
  max-width: min(94vw, 1400px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.image-lightbox p {
  margin: 0;
  color: #d7deea;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  background: #fff;
}

@media (max-width: 1280px) {
  .asset-designer,
  .asset-detail-layout {
    grid-template-columns: 1fr;
  }

  .appearance-strip {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .home {
    padding: 22px;
  }

  .entry-actions {
    grid-template-columns: 1fr;
  }

  .entry-button {
    min-height: 132px;
  }

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

  .page {
    padding: 22px;
  }

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

  .workflow-nav {
    grid-template-columns: 1fr;
  }

  .api-gate-panel {
    grid-template-columns: 1fr;
  }

  .api-gate-action {
    width: 100%;
  }

  .runtime-bridge {
    display: grid;
  }

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

  .api-test-bar,
  .api-summary {
    grid-template-columns: 1fr;
  }

  .breakdown-shell {
    grid-template-columns: 1fr;
  }

  .episode-sidebar {
    min-height: auto;
  }

  .script-detail {
    margin: 0;
    border-radius: 0;
    padding: 22px;
  }

  .script-tabs {
    gap: 16px;
  }

  .script-tab {
    font-size: 18px;
  }

  .planning-board,
  .asset-designer,
  .asset-list-grid,
  .asset-detail-layout {
    grid-template-columns: 1fr;
  }

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

  .asset-sidebar {
    min-height: auto;
  }

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

  .asset-workspace {
    padding: 16px;
  }

  .asset-tabs,
  .asset-status-row,
  .asset-toolbar {
    justify-content: flex-start;
  }

  .asset-overview-main {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .asset-detail-layout-characters,
  .asset-detail-layout-scenes,
  .asset-detail-layout-props {
    grid-template-columns: 1fr;
  }

  .asset-meta-panel {
    border-left: 0;
    padding-left: 0;
  }
}

/* Script breakdown workspace: cinema-inspired, calm and task focused. */
.breakdown-body {
  --breakdown-bg: #0f1218;
  --breakdown-panel: #0f1218;
  --breakdown-raised: #191e1f;
  --breakdown-line: #293031;
  --breakdown-muted: #929c9d;
  --breakdown-accent: #ffb447;
  min-height: 100dvh;
  background: var(--breakdown-bg);
  color: #eef3f1;
}

.breakdown-shell {
  min-height: 100dvh;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
  background: var(--breakdown-bg);
}

.episode-sidebar {
  min-height: 100dvh;
  padding: 18px;
  gap: 16px;
  border-right: 1px solid var(--breakdown-line);
  background: var(--breakdown-bg);
}

.dark-workflow-nav {
  top: 12px;
  left: 338px;
  right: 18px;
  width: auto;
  max-width: none;
  min-height: 48px;
  transform: none;
  grid-template-columns: repeat(3, minmax(104px, 136px));
  justify-content: start;
  padding: 6px;
  border: 1px solid var(--breakdown-line);
  border-radius: 999px;
  background: rgba(18, 22, 23, 0.94);
  box-shadow: 0 18px 50px rgba(3, 7, 7, 0.28);
  backdrop-filter: blur(18px);
}

.dark-workflow-nav .workflow-nav-item {
  min-height: 34px;
  border-radius: 999px;
  color: #899394;
  font-weight: 700;
}

.dark-workflow-nav .workflow-nav-item:hover {
  background: #202627;
  color: #dbe2e0;
}

.dark-workflow-nav .workflow-nav-item.is-active {
  background: var(--breakdown-accent);
  color: #211507;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.upload-panel {
  padding: 14px;
  gap: 10px;
  border-color: var(--breakdown-line);
  border-radius: 14px;
  background: var(--breakdown-panel);
  box-shadow: 0 18px 40px rgba(3, 7, 7, 0.18);
}

.upload-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e4eae8;
  font-size: 13px;
  font-weight: 800;
}

.upload-panel-head small {
  color: #717c7d;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.upload-button {
  min-height: 72px;
  border: 1px dashed #3a4444;
  border-radius: 10px;
  background: #151a1b;
  align-content: center;
  gap: 4px;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.upload-button:hover {
  border-color: var(--breakdown-accent);
  background: #211d17;
}

.upload-button:active,
.upload-panel .form-button:active {
  transform: translateY(1px);
}

.upload-button small {
  color: var(--breakdown-muted);
  font-size: 11px;
  font-weight: 500;
}

.script-file-picker { display: flex; align-items: stretch; gap: 8px; min-width: 0; overflow-x: auto; padding: 1px 1px 5px; scrollbar-width: thin; scrollbar-color: #384240 transparent; }
.script-file-cards { display: contents; }
.script-file-card, .script-file-add { position: relative; flex: 0 0 64px; width: 64px; height: 72px; border: 1px solid #36403f; border-radius: 10px; overflow: hidden; }
.script-file-card { display: grid; align-content: end; gap: 3px; padding: 10px 7px 7px; background: linear-gradient(145deg, #d8ebe6, #8cb4aa); color: #10211d; }
.script-file-card:nth-child(3n + 2) { background: linear-gradient(145deg, #e9d7bd, #b4885d); }
.script-file-card:nth-child(3n) { background: linear-gradient(145deg, #ccd5e6, #8291ad); }
.script-file-card strong { font-size: 12px; letter-spacing: .04em; }
.script-file-card > span { overflow: hidden; color: rgba(8, 24, 20, .75); font-size: 9px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.script-file-remove { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(13, 19, 18, .82); color: #f3f7f5; font: 700 15px/1 Arial, sans-serif; cursor: pointer; }
.script-file-remove:hover { background: #111817; transform: scale(1.06); }
.script-file-add { display: grid; flex: 0 0 64px; place-content: center; justify-items: center; gap: 6px; border-style: dashed; background: #151a1b; color: #929d9b; cursor: pointer; transition: border-color 180ms ease, background 180ms ease, color 180ms ease; }
.script-file-add:hover { border-color: var(--breakdown-accent); background: #211d17; color: var(--breakdown-accent); }
.script-file-add:active { transform: translateY(1px); }
.script-file-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.script-file-add > span { position: relative; width: 22px; height: 22px; }
.script-file-add > span::before, .script-file-add > span::after { content: ""; position: absolute; top: 10px; left: 2px; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.script-file-add > span::after { transform: rotate(90deg); }
.script-file-add small { font-size: 9px; font-weight: 700; white-space: nowrap; }
 
.prompt-rule-field {
  display: grid;
  gap: 7px;
}

.prompt-rule-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #aeb7b5;
  font-size: 12px;
  font-weight: 700;
}

.prompt-rule-label small {
  color: #778280;
  font-size: 10px;
  font-weight: 600;
}

.prompt-rule-label small.is-custom {
  color: var(--breakdown-accent);
}

.prompt-rule-control {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 48px;
  border: 1px dashed #3a4444;
  border-radius: 10px;
  background: #151a1b;
  transition: border-color 180ms ease, background 180ms ease;
}

.prompt-rule-control:hover,
.prompt-rule-control:focus-within {
  border-color: var(--breakdown-accent);
  background: #211d17;
}

.prompt-rule-control.has-custom-rule {
  border-style: solid;
  border-color: rgba(255, 180, 71, 0.4);
  background: rgba(255, 180, 71, 0.08);
}

.prompt-rule-upload {
  position: relative;
  display: grid;
  flex: 1;
  min-width: 0;
  align-content: center;
  gap: 2px;
  padding: 8px 34px 8px 11px;
  cursor: pointer;
}

.prompt-rule-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.prompt-rule-upload > span,
.prompt-rule-upload > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prompt-rule-upload > span {
  color: #dce4e1;
  font-size: 11px;
  font-weight: 750;
}

.prompt-rule-upload > small {
  color: #778280;
  font-size: 9px;
  font-weight: 600;
}

.has-custom-rule .prompt-rule-upload > span {
  color: var(--breakdown-accent);
}

.prompt-rule-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #26302e;
  color: #dce4e1;
  font: 700 16px/1 Arial, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}

.prompt-rule-remove:hover {
  background: #35423f;
  color: #ffffff;
}

.prompt-rule-remove:active {
  transform: translateY(-50%) scale(0.96);
}

.prompt-rule-upload:has(input:disabled),
.prompt-rule-remove:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.custom-breakdown-result {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.custom-breakdown-result-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--breakdown-line);
}

.custom-breakdown-result-head span {
  color: var(--breakdown-accent);
  font-size: 11px;
  font-weight: 750;
}

.custom-breakdown-result-head h2 {
  margin: 4px 0 0;
}

.custom-breakdown-result-head em {
  color: var(--breakdown-muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.custom-breakdown-result pre {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--breakdown-line);
  border-radius: 12px;
  background: #101514;
  color: #dfe6e3;
  font: 500 13px/1.9 "Microsoft YaHei", "PingFang SC", sans-serif;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.upload-panel .form-button {
  min-height: 44px;
  border-radius: 999px;
}

.breakdown-model-field {
  gap: 7px;
  color: #aeb7b5;
  font-size: 12px;
  font-weight: 700;
}

.breakdown-model-field select {
  min-height: 42px;
  border: 1px solid #333c3d;
  border-radius: 10px;
  background: #101415;
  color: #e9eeec;
  padding: 0 34px 0 11px;
  outline: 0;
}

.breakdown-model-field select:hover {
  border-color: #465250;
}

.breakdown-model-field select:focus {
  border-color: var(--breakdown-accent);
  box-shadow: 0 0 0 3px rgba(255, 180, 71, 0.14);
}

.breakdown-model-field select:disabled {
  color: #717c7d;
  cursor: not-allowed;
}

.breakdown-credit-cost {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.breakdown-credit-cost span {
  color: #76817f;
  font-size: 11px;
}

.breakdown-credit-cost strong {
  color: var(--breakdown-accent);
  font-size: 13px;
  font-weight: 800;
}

.upload-panel .form-button.primary {
  background: var(--breakdown-accent);
  color: #211507;
}

.upload-panel .reset-breakdown-button {
  border-color: #3d2f2f;
  background: transparent;
  color: #d39a9a;
}

.upload-panel .dialog-note:not(:empty) {
  min-height: 0;
  margin-top: 2px;
  padding: 10px;
  border-radius: 9px;
  background: #181d1e;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.progress-track {
  height: 5px;
  background: #252b2c;
}

.progress-track span,
.progress-row + .progress-row .progress-track span {
  background: var(--breakdown-accent);
}

.episode-list {
  gap: 4px;
  padding: 2px 2px 2px 0;
  scrollbar-color: #35403f transparent;
}

.episode-item {
  min-height: 62px;
  grid-template-columns: 32px 1fr;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}

.episode-item:hover {
  background: #151a1b;
}

.episode-item.is-active {
  border-color: #4a3b26;
  background: #211d17;
}

.episode-icon {
  width: 28px;
  height: 34px;
  opacity: 0.62;
  background:
    linear-gradient(#26302e 0 0) 8px 9px / 12px 2px no-repeat,
    linear-gradient(#26302e 0 0) 8px 15px / 12px 2px no-repeat,
    linear-gradient(#26302e 0 0) 8px 21px / 8px 2px no-repeat,
    #b9c9c4;
}

.episode-item.is-active .episode-icon {
  opacity: 1;
  background-color: var(--breakdown-accent);
}

.script-detail {
  min-height: 100dvh;
  margin: 0;
  padding: 116px clamp(28px, 4vw, 64px) 56px;
  border-radius: 0;
  background: var(--breakdown-panel);
}

.script-detail-head {
  align-items: end;
  margin-bottom: 28px;
}

.script-detail-head > div {
  display: grid;
  gap: 7px;
}

.script-detail h1 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.script-detail-head p {
  max-width: 620px;
  margin: 0;
  color: var(--breakdown-muted);
  font-size: 14px;
  line-height: 1.6;
}

.workflow-step {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--breakdown-accent);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.script-detail-head .script-file-name {
  max-width: 280px;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid var(--breakdown-line);
  border-radius: 9px;
  background: var(--breakdown-raised);
  color: #aeb8b6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-tabs {
  gap: 8px;
  margin: 0 0 28px;
  padding-bottom: 8px;
  border-bottom-color: var(--breakdown-line);
}

.script-tab {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 14px;
  color: #7f898a;
  font-size: 14px;
  font-weight: 700;
}

.script-tab:hover {
  background: #1a2021;
  color: #cbd3d1;
}

.script-tab.is-active {
  background: #2b2419;
  color: var(--breakdown-accent);
}

.empty-breakdown {
  min-height: min(470px, 56vh);
  grid-template-columns: auto minmax(0, 460px);
  place-content: center;
  place-items: center start;
  gap: 18px 22px;
  padding: 40px;
  border-color: #333c3d;
  border-radius: 14px;
  background: #111516;
}

.empty-breakdown-mark {
  width: 52px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #3a4744;
  border-radius: 10px;
  background: #1c2623;
  color: var(--breakdown-accent);
  font-size: 18px;
  font-weight: 900;
}

.empty-breakdown strong {
  display: block;
  margin-bottom: 7px;
  color: #e8eeec;
  font-size: 18px;
}

.empty-breakdown p {
  margin: 0;
  color: var(--breakdown-muted);
  font-size: 14px;
  line-height: 1.65;
}

.empty-breakdown-formats {
  grid-column: 2;
  color: #65706f;
  font-size: 11px;
}

.planning-board {
  gap: 30px 48px;
}

.planning-field h2::before {
  background: var(--breakdown-accent);
}

@media (max-width: 900px) {
  .breakdown-shell {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .dark-workflow-nav {
    left: 288px;
  }

  .script-detail-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .breakdown-shell {
    display: block;
  }

  .episode-sidebar {
    min-height: auto;
    padding: 92px 14px 16px;
    border-right: 0;
  }

  .dark-workflow-nav {
    top: 12px;
    left: 12px;
    right: 12px;
    min-height: 58px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 8px;
  }

  .dark-workflow-nav .workflow-nav-item {
    min-width: 0;
    padding: 0 6px;
    font-size: 12px;
  }

  .script-detail {
    min-height: auto;
    padding: 28px 16px 40px;
  }

  .empty-breakdown {
    min-height: 340px;
    grid-template-columns: 1fr;
    place-items: center;
    text-align: center;
  }

  .empty-breakdown-formats {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .breakdown-body *,
  .breakdown-body *::before,
  .breakdown-body *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Asset workspace: shares the script breakdown production-console language. */
.asset-body {
  --asset-bg: #0f1218;
  --asset-panel: #0f1218;
  --asset-raised: #191e1f;
  --asset-line: #293031;
  --asset-muted: #929c9d;
  --asset-accent: #ffb447;
  --breakdown-accent: var(--asset-accent);
  height: 100dvh;
  background: var(--asset-bg);
  color: #eef3f1;
}

.asset-shell {
  height: 100dvh;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--asset-bg);
}

.asset-sidebar {
  height: 100dvh;
  padding: 20px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border-right-color: var(--asset-line);
  background: #0e1112;
  scrollbar-color: #35403f transparent;
}

.asset-body .dark-workflow-nav {
  left: 338px;
  right: 18px;
}

.asset-panel {
  flex: 0 0 auto;
  gap: 9px;
  padding: 12px;
  border-color: var(--asset-line);
  border-radius: 14px;
  background: var(--asset-panel);
  box-shadow: 0 18px 40px rgba(3, 7, 7, 0.14);
}

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

.asset-panel-head span {
  color: #6f7a79;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.asset-panel h2 {
  color: #e7edeb;
  font-size: 14px;
}

.asset-panel label {
  color: #a8b1af;
  font-size: 12px;
}

.asset-panel input,
.asset-panel select,
.asset-panel textarea {
  border-color: #333c3d;
  border-radius: 10px;
  background: #101415;
  color: #e9eeec;
}

.asset-panel input:focus,
.asset-panel select:focus,
.asset-panel textarea:focus {
  border-color: var(--asset-accent);
  box-shadow: 0 0 0 3px rgba(255, 180, 71, 0.14);
}

.asset-style-current {
  min-height: 72px;
  border-color: #333c3d;
  border-radius: 10px;
  background: #101415;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.asset-style-current:hover {
  border-color: var(--asset-accent);
  background: #17201e;
}

.asset-style-current:active,
.asset-body .form-button:active {
  transform: translateY(1px);
}

.asset-style-current span {
  width: 62px;
  height: 54px;
  border-radius: 8px;
  background-color: #1b2122;
}

.asset-sidebar .form-button.secondary,
.episode-batch-actions .form-button.secondary {
  border: 1px solid #333c3d;
  background: #1a2021;
  color: #d9e0de;
}

.asset-sidebar .form-button.secondary:hover,
.episode-batch-actions .form-button.secondary:hover {
  border-color: #4a5754;
  background: #202827;
}

.asset-sidebar .asset-image-category-actions .form-button.secondary {
  border-color: var(--asset-accent);
  background: var(--asset-accent);
  color: #211507;
  font-weight: 800;
}

.asset-sidebar .asset-image-category-actions .form-button.secondary:hover {
  border-color: #ffc261;
  background: #ffc261;
  color: #211507;
}

.style-prompt-editor {
  min-height: 118px;
  line-height: 1.55;
}

.asset-style-panel {
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.asset-style-panel .asset-panel-head {
  align-items: flex-start;
}

.asset-style-panel .asset-style-current {
  width: fit-content;
  max-width: calc(100% - 72px);
  min-height: auto;
  padding: 4px 9px;
  border: 1px solid rgba(255, 180, 71, 0.42);
  border-radius: 999px;
  display: block;
  background: rgba(255, 180, 71, 0.11);
  color: #9aead0;
  text-align: right;
  cursor: pointer;
}

.asset-style-panel .asset-style-current:hover {
  border-color: var(--asset-accent);
  background: rgba(255, 180, 71, 0.18);
  color: #c0f4e1;
}

.asset-style-panel .asset-style-current:focus-visible {
  outline: 2px solid var(--asset-accent);
  outline-offset: 3px;
}

.asset-style-panel .asset-style-current span {
  display: none;
}

.asset-style-panel .asset-style-current strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.asset-style-panel .style-prompt-editor {
  width: 100%;
  min-height: 118px;
}

.asset-style-tools-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.asset-style-tools-panel > * {
  min-width: 0;
}

.asset-style-tools-panel input[type="file"] {
  width: 100%;
}

.asset-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 2147483000;
  width: max-content;
  max-width: min(560px, calc(100vw - 28px));
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 7px 18px;
  border: 1px solid #3c4546;
  border-radius: 999px;
  background: rgba(23, 29, 30, 0.94);
  color: #eef3f1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, -6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.asset-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.asset-toast.error {
  border-color: rgba(255, 107, 122, 0.62);
  color: #ffd6db;
}

@media (prefers-reduced-motion: reduce) {
  .asset-toast {
    transition: none;
  }
}

.episode-asset-panel {
  min-height: max-content;
}

.asset-panel .dialog-note:not(:empty) {
  min-height: 0;
  padding: 9px 10px;
  border-radius: 9px;
  background: #181d1e;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.asset-workspace {
  height: 100dvh;
  padding: 62px clamp(24px, 3vw, 48px) 20px;
  gap: 9px;
  background: var(--asset-panel);
}

.asset-head {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
}

.asset-head h1 {
  margin: 0;
  color: #eef3f1;
  font-size: clamp(20px, 1.6vw, 24px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.asset-actions-wrap {
  display: grid;
  justify-items: end;
}

.asset-actions {
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 7px;
}

.asset-actions .form-button.primary {
  min-height: 36px;
  border-radius: 9px;
  background: var(--asset-accent);
  color: #092019;
  padding: 0 13px;
  font-size: 13px;
  white-space: nowrap;
}

.asset-actions .form-button.primary:hover {
  background: #ffc261;
}

.asset-runtime {
  border-color: #35413e;
  border-radius: 12px;
  background: #17201e;
}

.asset-runtime-track span {
  background: var(--asset-accent);
}

.asset-designer {
  display: block;
}

.asset-overview {
  height: 100%;
  border: 0;
  border-radius: 14px;
  background: #111516;
}

.asset-overview {
  gap: 12px;
  padding: 16px;
  grid-template-rows: auto auto auto;
  scrollbar-color: #35403f transparent;
}

.asset-tabs {
  gap: 6px;
  padding-bottom: 0;
  border-bottom: 0;
}

.asset-tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--asset-line);
}

.asset-filter-row {
  padding-top: 0;
}

.asset-tabs-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  flex: 1 1 460px;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-tab {
  min-height: 38px;
  border: 0;
  border-radius: 9px;
  padding: 0 13px;
  color: #7f898a;
  font-size: 14px;
  font-weight: 700;
}

.asset-tab:hover {
  background: #1a2021;
  color: #cbd3d1;
}

.asset-tab.is-active {
  background: #2b2419;
  color: var(--asset-accent);
}

.asset-status-row {
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.asset-status-chip {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #aeb7b5;
  padding: 0 5px;
  font-size: 12px;
  font-weight: 700;
}

.asset-status-chip:hover {
  background: transparent;
  color: #eef3f1;
}

.asset-status-chip.is-active {
  background: transparent;
  color: var(--asset-accent);
}

.asset-toolbar {
  flex: 0 0 auto;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 0;
  border: 0;
}

.asset-toolbar-spacer {
  flex: 1 1 24px;
}

.asset-toolbar .form-button {
  min-width: 0;
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.asset-toolbar .form-button.secondary {
  border-color: #35403f;
  background: #1a2021;
  color: #d6dddb;
}

.asset-toolbar .form-button.danger {
  background: #a9342d;
  color: #fff;
}

.asset-toolbar .form-button.asset-danger-quiet {
  border: 1px solid #493130;
  background: transparent;
  color: #d49b97;
}

.asset-toolbar .form-button.asset-danger-quiet:hover {
  border-color: #7a403b;
  background: #251817;
  color: #f1b2ad;
}

.asset-episode-pager {
  min-height: 34px;
  color: #cbd5e1;
}

.asset-pager-summary {
  color: #7f898a;
  font-weight: 700;
}

.asset-page-number,
.asset-page-jump {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-color: #30393a;
  border-radius: 8px;
  background: #151a1b;
  color: #9da7a5;
}

.asset-page-number:hover,
.asset-page-number.is-active,
.asset-page-jump:hover {
  border-color: var(--asset-accent);
  color: var(--asset-accent);
}

.asset-page-number.is-active {
  background: #1c2a26;
}

.asset-list-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 12px;
}

.asset-overview-card {
  height: max-content;
  min-height: 0;
  border-color: #202728;
  border-radius: 11px;
  background: #151a1b;
  display: grid;
  grid-template-rows: auto auto;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.asset-overview-card:hover {
  border-color: #3c4c48;
  background: #19201f;
  transform: translateY(-1px);
}

.asset-overview-main:focus-visible {
  outline-color: var(--asset-accent);
}

.asset-overview-main {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  padding: 0;
}

.asset-overview-thumb,
.asset-overview-thumb-scenes,
.asset-overview-thumb-props {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 0;
  background: #1b2024;
}

.asset-overview-thumb img,
.asset-overview-thumb .asset-image-placeholder {
  width: 100%;
  height: 100%;
}

.asset-overview-thumb img {
  object-fit: contain;
}

.asset-overview-thumb .asset-image-placeholder {
  display: grid;
  place-items: center;
  color: #6f7978;
  font-size: 13px;
  font-weight: 700;
}

.asset-category-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  min-height: 24px;
  border: 1px solid rgba(255, 180, 71, 0.42);
  border-radius: 8px;
  background: rgba(16, 34, 29, 0.9);
  color: var(--asset-accent);
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.asset-category-badge-characters {
  border-color: rgba(255, 180, 71, 0.48);
  background: rgba(16, 52, 42, 0.92);
  color: #6ee7bd;
}

.asset-category-badge-scenes {
  border-color: rgba(104, 167, 255, 0.5);
  background: rgba(20, 42, 72, 0.92);
  color: #86b9ff;
}

.asset-category-badge-props {
  border-color: rgba(239, 178, 83, 0.52);
  background: rgba(64, 43, 18, 0.92);
  color: #f4bd69;
}

.asset-overview-info {
  min-height: 154px;
  align-content: start;
  gap: 6px;
  padding: 12px 12px 10px;
  overflow: visible;
}

.asset-overview-info strong {
  font-size: 15px;
}

.asset-overview-info > .asset-card-title-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  overflow: visible;
}

.asset-card-title-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-overview-info em {
  color: #84908e;
  font-size: 12px;
}

.asset-overview-info > .asset-card-prompt {
  min-height: 56px;
  color: #aeb8b6;
  font-size: 12px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
}

.asset-mini-status {
  position: static;
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  font-size: 11px;
  line-height: 1.2;
}

.asset-mini-status.done {
  background: transparent;
  color: var(--asset-accent);
}

.asset-mini-status.pending {
  background: transparent;
  color: #8d9795;
}

.asset-mini-status.error {
  background: transparent;
  color: #ff7770;
}

.asset-mini-status.generating {
  background: transparent;
  color: #f2bd63;
}

.asset-card-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #151a1b;
  padding: 0 12px 12px;
}

.asset-card-generate {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 32px;
  border: 1px solid #3e8fc9;
  border-radius: 9px;
  background: transparent;
  color: #58b8f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.asset-card-generate:hover {
  border-color: #63c5ff;
  background: rgba(62, 143, 201, 0.12);
  color: #82d2ff;
}

.asset-card-generate.is-running {
  border-color: #b9674f;
  color: #e89a80;
}

.asset-card-action-icon {
  font-size: 16px;
  line-height: 1;
}

.asset-card-close {
  background: rgba(169, 52, 45, 0.94);
}

.asset-card-delete {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 6;
  width: 32px;
  height: 32px;
  min-height: 32px;
  background: transparent;
  color: #9aa4a2;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.asset-card-delete svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.asset-card-delete:hover {
  background: transparent;
  color: #ff8b84;
}

.asset-card-delete:active {
  transform: translateY(1px);
}

.asset-empty {
  min-height: 120px;
  border-color: #333c3d;
  border-radius: 12px;
  color: var(--asset-muted);
  background: #101415;
  line-height: 1.6;
}

.asset-empty-featured {
  min-height: 100%;
  align-content: center;
  gap: 8px;
  padding: 40px;
}

.asset-empty-featured > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border: 1px solid #3a4744;
  border-radius: 12px;
  background: #1c2623;
  color: var(--asset-accent);
  font-size: 17px;
  font-weight: 900;
}

.asset-empty-featured strong {
  color: #e8eeec;
  font-size: 17px;
}

.asset-empty-featured p {
  max-width: 360px;
  margin: 0;
  color: var(--asset-muted);
  font-size: 13px;
}

.asset-detail-dialog {
  width: min(1320px, calc(100vw - 48px));
  max-width: none;
  height: min(820px, calc(100dvh - 48px));
  max-height: none;
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
  color: #eef3f1;
}

.asset-detail-dialog::backdrop {
  background: rgba(5, 8, 8, 0.78);
  backdrop-filter: blur(5px);
}

.asset-detail-dialog[open] {
  animation: asset-detail-dialog-in 180ms ease-out;
}

.asset-detail-dialog-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid #35403f;
  border-radius: 14px;
  background: #111516;
  box-shadow: 0 28px 90px rgba(2, 8, 7, 0.56);
}

.asset-detail-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  width: 36px;
  height: 36px;
  border: 1px solid #3a4544;
  border-radius: 10px;
  background: #1b2122;
  color: #dce4e2;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.asset-detail-dialog-close span {
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-1px);
}

.asset-detail-dialog-close:hover {
  border-color: #53615e;
  background: #252d2c;
  color: #fff;
}

.asset-detail-dialog-close:active {
  transform: translateY(1px);
}

.asset-detail-dialog-close:focus-visible {
  outline: 2px solid var(--asset-accent);
  outline-offset: 2px;
}

.asset-detail-dialog .asset-detail-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  padding: 16px;
}

.asset-detail-dialog .asset-detail-headline {
  padding-right: 48px;
}

@keyframes asset-detail-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .asset-detail-dialog[open] {
    animation: none;
  }
}

.asset-style-dialog .dialog-card,
.episode-doc-dialog .dialog-card,
#assetResetDialog .dialog-card {
  background: #171b1c;
  color: #eef3f1;
}

.asset-style-option {
  border-color: #30393a;
  border-radius: 11px;
  background: #111516;
  color: #eef3f1;
}

.asset-style-option.is-active {
  border-color: var(--asset-accent);
  box-shadow: 0 0 0 3px rgba(255, 180, 71, 0.14);
}

.asset-style-option span,
.asset-style-option small {
  color: #929c9d;
}

@media (max-width: 1180px) {
  .asset-overview {
    min-height: 480px;
  }

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

  .asset-status-row {
    width: 100%;
    justify-content: flex-end;
  }

  .asset-list-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }

}

@media (max-width: 900px) {
  .asset-shell {
    grid-template-columns: 270px minmax(0, 1fr);
  }

  .asset-body .dark-workflow-nav {
    left: 288px;
  }

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

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

  .asset-list-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 640px) {
  .asset-body {
    height: auto;
    overflow: auto;
  }

  .asset-shell {
    height: auto;
    display: block;
  }

  .asset-sidebar {
    height: auto;
    padding: 92px 14px 16px;
  }

  .asset-body .dark-workflow-nav {
    left: 12px;
    right: 12px;
  }

  .asset-workspace {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 28px 16px 40px;
  }

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

  .asset-tabs-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .asset-tabs-actions {
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #35403f transparent;
  }

  .asset-tabs,
  .asset-toolbar {
    flex: 0 0 auto;
  }

  .asset-status-row {
    width: 100%;
    justify-content: flex-start;
  }

  .asset-actions-wrap {
    width: 100%;
    justify-items: stretch;
    margin-left: 0;
  }

  .asset-designer {
    overflow: visible;
  }

  .asset-overview {
    height: auto;
  }

  .asset-detail-dialog {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
  }

  .asset-detail-dialog-card,
  .asset-detail-dialog .asset-detail-panel {
    overflow-y: auto;
  }

  .asset-detail-dialog .asset-detail-panel {
    height: auto;
    min-height: 100%;
    padding: 14px;
  }

  .asset-detail-dialog .asset-detail-layout {
    height: auto;
    overflow: visible;
  }

  .asset-detail-dialog .asset-visual-column,
  .asset-detail-dialog .asset-meta-panel {
    overflow: visible;
  }

  .asset-detail-dialog-close {
    top: 12px;
    right: 12px;
  }

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

  .asset-toolbar-spacer {
    display: none;
  }
}

/* Host light theme: align the two production workspaces with the main app. */
body[data-theme="light"].breakdown-body {
  color-scheme: light;
  --breakdown-bg: #f4f6f8;
  --breakdown-panel: #ffffff;
  --breakdown-raised: #f1f3f5;
  --breakdown-line: #d8dde3;
  --breakdown-muted: #667085;
  background: var(--breakdown-bg);
  color: #202733;
}

body[data-theme="light"] .breakdown-shell,
body[data-theme="light"] .episode-sidebar {
  background: var(--breakdown-bg);
}

body[data-theme="light"] .dark-workflow-nav {
  border-color: #d8dde3;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(34, 44, 58, 0.11);
}

body[data-theme="light"] .dark-workflow-nav .workflow-nav-item {
  color: #687180;
}

body[data-theme="light"] .dark-workflow-nav .workflow-nav-item:hover {
  background: #f0f2f5;
  color: #202733;
}

body[data-theme="light"] .dark-workflow-nav .workflow-nav-item.is-active {
  color: #352208;
}

body[data-theme="light"] .upload-panel {
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(34, 44, 58, 0.07);
}

body[data-theme="light"] .upload-panel-head,
body[data-theme="light"] .prompt-rule-upload > span,
body[data-theme="light"] .planning-field h2 {
  color: #202733;
}

body[data-theme="light"] .upload-panel-head small,
body[data-theme="light"] .prompt-rule-label small,
body[data-theme="light"] .prompt-rule-upload > small,
body[data-theme="light"] .breakdown-credit-cost span {
  color: #7a8493;
}

body[data-theme="light"] .upload-button,
body[data-theme="light"] .script-file-add,
body[data-theme="light"] .prompt-rule-control,
body[data-theme="light"] .breakdown-model-field select {
  border-color: #cfd6de;
  background: #f8fafb;
  color: #202733;
  color-scheme: light;
}

body[data-theme="light"] .upload-button:hover,
body[data-theme="light"] .script-file-add:hover,
body[data-theme="light"] .prompt-rule-control:hover,
body[data-theme="light"] .prompt-rule-control:focus-within {
  border-color: var(--breakdown-accent);
  background: #fff7eb;
}

body[data-theme="light"] .prompt-rule-label,
body[data-theme="light"] .breakdown-model-field {
  color: #4f5968;
}

body[data-theme="light"] .prompt-rule-remove {
  background: #e6eaee;
  color: #4f5968;
}

body[data-theme="light"] .prompt-rule-remove:hover {
  background: #d8dee4;
  color: #202733;
}

body[data-theme="light"] .custom-breakdown-result pre,
body[data-theme="light"] .upload-panel .dialog-note:not(:empty) {
  border-color: var(--breakdown-line);
  background: #f8fafb;
  color: #28313d;
}

body[data-theme="light"] .progress-track {
  background: #e5e9ed;
}

body[data-theme="light"] .episode-item:hover {
  background: #eef1f4;
}

body[data-theme="light"] .episode-item.is-active {
  border-color: #e5bd77;
  background: #fff4e2;
}

body[data-theme="light"] .script-detail {
  background: #ffffff;
}

body[data-theme="light"] .script-detail h1,
body[data-theme="light"] .planning-field p,
body[data-theme="light"] .empty-breakdown strong {
  color: #202733;
}

body[data-theme="light"] .script-detail-head .script-file-name {
  background: #f1f3f5;
  color: #596373;
}

body[data-theme="light"] .script-tab {
  color: #687180;
}

body[data-theme="light"] .script-tab:hover {
  background: #f0f2f5;
  color: #202733;
}

body[data-theme="light"] .script-tab.is-active {
  background: #fff1da;
  color: #9a5a00;
}

body[data-theme="light"] .empty-breakdown {
  border-color: #d8dde3;
  background: #f8fafb;
}

body[data-theme="light"] .empty-breakdown-mark {
  border-color: #d6dde2;
  background: #edf2ef;
}

body[data-theme="light"] .empty-breakdown-formats {
  color: #7a8493;
}

body[data-theme="light"].asset-body {
  color-scheme: light;
  --asset-bg: #f4f6f8;
  --asset-panel: #ffffff;
  --asset-raised: #f1f3f5;
  --asset-line: #d8dde3;
  --asset-muted: #667085;
  background: var(--asset-bg);
  color: #202733;
}

body[data-theme="light"] .asset-shell,
body[data-theme="light"] .asset-sidebar {
  background: var(--asset-bg);
}

body[data-theme="light"] .asset-panel {
  border-color: var(--asset-line);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(34, 44, 58, 0.07);
}

body[data-theme="light"] .asset-style-panel,
body[data-theme="light"] .asset-style-tools-panel {
  background: transparent;
  box-shadow: none;
}

body[data-theme="light"] .asset-panel h2,
body[data-theme="light"] .asset-head h1,
body[data-theme="light"] .asset-overview-info strong,
body[data-theme="light"] .asset-empty-featured strong,
body[data-theme="light"] .asset-detail-headline h2 {
  color: #202733;
}

body[data-theme="light"] .asset-panel label,
body[data-theme="light"] .asset-overview-info > .asset-card-prompt,
body[data-theme="light"] .asset-detail-headline span {
  color: #596373;
}

body[data-theme="light"] .asset-panel input,
body[data-theme="light"] .asset-panel select,
body[data-theme="light"] .asset-panel textarea,
body[data-theme="light"] .asset-style-current {
  border-color: #cfd6de;
  background: #ffffff;
  color: #202733;
  color-scheme: light;
}

body[data-theme="light"] .asset-style-current:hover {
  border-color: var(--asset-accent);
  background: #fff7eb;
}

body[data-theme="light"] .asset-style-panel .asset-style-current {
  border-color: #e5bd77;
  background: #fff4e2;
  color: #256b57;
}

body[data-theme="light"] .asset-sidebar .form-button.secondary,
body[data-theme="light"] .episode-batch-actions .form-button.secondary,
body[data-theme="light"] .asset-toolbar .form-button.secondary {
  border-color: #cfd6de;
  background: #ffffff;
  color: #344054;
}

body[data-theme="light"] .asset-sidebar .form-button.secondary:hover,
body[data-theme="light"] .episode-batch-actions .form-button.secondary:hover,
body[data-theme="light"] .asset-toolbar .form-button.secondary:hover {
  border-color: #aeb7c2;
  background: #f1f3f5;
}

body[data-theme="light"] .asset-panel .dialog-note:not(:empty),
body[data-theme="light"] .asset-runtime {
  border-color: #cddfd8;
  background: #edf7f3;
  color: #315f50;
}

body[data-theme="light"] .asset-toast {
  top: auto;
  right: 24px;
  bottom: 24px;
  left: auto;
  border-color: #d8dee7;
  background: rgba(255, 255, 255, 0.97);
  color: #202733;
  box-shadow: 0 10px 28px rgba(34, 44, 58, 0.14);
  transform: translateY(6px);
}

body[data-theme="light"] .asset-toast.show {
  transform: translateY(0);
}

body[data-theme="light"] .asset-toast.error {
  border-color: #efb8bd;
  background: #fff5f5;
  color: #a32632;
}

body[data-theme="light"] .asset-episode-check,
body[data-theme="light"] .asset-episode-item {
  border-color: #d8dde3;
  background: #ffffff;
  color: #202733;
}

body[data-theme="light"] .asset-episode-choice.is-active .asset-episode-item,
body[data-theme="light"] .asset-episode-choice:hover .asset-episode-item,
body[data-theme="light"] .asset-episode-item.is-active,
body[data-theme="light"] .asset-episode-item:hover {
  border-color: #e5bd77;
  background: #fff4e2;
}

body[data-theme="light"] .asset-workspace {
  background: #ffffff;
}

body[data-theme="light"] .asset-overview {
  background: #f7f8fa;
}

body[data-theme="light"] .asset-tab {
  color: #687180;
}

body[data-theme="light"] .asset-tab:hover {
  background: #e9edf1;
  color: #202733;
}

body[data-theme="light"] .asset-tab.is-active {
  background: #fff1da;
  color: #9a5a00;
}

body[data-theme="light"] .asset-status-chip {
  color: #596373;
}

body[data-theme="light"] .asset-status-chip:hover {
  color: #202733;
}

body[data-theme="light"] .asset-page-number,
body[data-theme="light"] .asset-page-jump {
  border-color: #d8dde3;
  background: #ffffff;
  color: #596373;
}

body[data-theme="light"] .asset-page-number.is-active {
  background: #fff4e2;
}

body[data-theme="light"] .asset-overview-card {
  border-color: #d8dde3;
  background: #ffffff;
}

body[data-theme="light"] .asset-overview-card:hover {
  border-color: #aeb7c2;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(34, 44, 58, 0.08);
}

body[data-theme="light"] .asset-overview-thumb,
body[data-theme="light"] .asset-overview-thumb-scenes,
body[data-theme="light"] .asset-overview-thumb-props {
  background: #eef1f4;
}

body[data-theme="light"] .asset-overview-thumb .asset-image-placeholder {
  color: #7a8493;
}

body[data-theme="light"] .asset-overview-info em,
body[data-theme="light"] .asset-mini-status.pending,
body[data-theme="light"] .asset-pager-summary {
  color: #687180;
}

body[data-theme="light"] .asset-card-actions {
  background: #ffffff;
}

body[data-theme="light"] .asset-empty,
body[data-theme="light"] .asset-detail-dialog-card {
  border-color: #d8dde3;
  background: #ffffff;
  color: #202733;
}

body[data-theme="light"] .asset-empty-featured > span {
  border-color: #d6dde2;
  background: #edf2ef;
}

body[data-theme="light"] .asset-detail-dialog::backdrop {
  background: rgba(45, 54, 66, 0.34);
}

body[data-theme="light"] .asset-detail-dialog-close {
  border-color: #d8dde3;
  background: #f1f3f5;
  color: #4f5968;
}

body[data-theme="light"] .asset-detail-dialog-close:hover {
  background: #e5e9ed;
  color: #202733;
}

body[data-theme="light"] .asset-style-dialog .dialog-card,
body[data-theme="light"] .episode-doc-dialog .dialog-card,
body[data-theme="light"] #assetResetDialog .dialog-card,
body[data-theme="light"] .asset-style-option {
  border-color: #d8dde3;
  background: #ffffff;
  color: #202733;
}

body[data-theme="light"] .asset-style-option span,
body[data-theme="light"] .asset-style-option small {
  color: #667085;
}
