:root {
  --bg: #070a0b;
  --panel: #111719;
  --panel-2: #151d20;
  --line: #273237;
  --line-soft: #1b2428;
  --text: #edf3f0;
  --muted: #8d9b9a;
  --muted-2: #647270;
  --cyan: #43d7c6;
  --green: #71d66f;
  --amber: #e6b75a;
  --red: #e76565;
  --blue: #69a7ff;
  --violet: #a986ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  color-scheme: dark;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 32px 32px;
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.auth-screen,
.workspace-screen,
.view,
.auth-form {
  display: none;
}

.auth-screen.is-active,
.workspace-screen.is-active {
  display: grid;
}

html.is-restoring-saved-session .auth-screen {
  display: none !important;
}

html.is-restoring-saved-session .workspace-screen {
  display: grid;
}

.view.is-active,
.auth-form.is-active {
  display: block;
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(115deg, rgba(67, 215, 198, 0.18), transparent 34%),
    linear-gradient(245deg, rgba(113, 214, 111, 0.14), transparent 40%),
    linear-gradient(180deg, #071011 0%, #060809 100%);
  padding: 32px;
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(67, 215, 198, 0.08) 49%, transparent 52%),
    linear-gradient(135deg, transparent 0 42%, rgba(230, 183, 90, 0.08) 47%, transparent 54%),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 520px 520px, 620px 620px, 44px 44px, 44px 44px;
  animation: auth-background-flow 18s linear infinite;
}

.auth-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 5, 7, 0.18), rgba(3, 5, 7, 0.72)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
}

@keyframes auth-background-flow {
  from {
    background-position: 0 0, 0 0, 0 0, 0 0;
  }

  to {
    background-position: 520px 0, -620px 0, 44px 44px, 44px 44px;
  }
}

.auth-left {
  display: flex;
  position: absolute;
  inset: 0;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 36px;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}

.auth-left::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05), transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04), transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup.compact {
  padding: 20px 18px 16px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(67, 215, 198, 0.55);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(67, 215, 198, 0.24), rgba(113, 214, 111, 0.08));
  color: #c8fff5;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 0 26px rgba(67, 215, 198, 0.18);
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.auth-copy {
  position: absolute;
  left: 36px;
  bottom: 34px;
  z-index: 1;
  width: min(430px, calc(100vw - 72px));
  margin: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 520px;
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.22;
  letter-spacing: 0;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.auth-copy p {
  max-width: 410px;
  margin-top: 12px;
  color: #a8b7b4;
  font-size: 14px;
  line-height: 1.65;
}

.auth-preview {
  display: none;
}

.auth-preview img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.preview-topline,
.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  color: #cbd8d5;
  font-size: 12px;
}

.preview-topline strong {
  color: var(--green);
}

.preview-meta {
  color: var(--muted);
}

.auth-panel {
  display: flex;
  position: relative;
  z-index: 2;
  min-height: auto;
  width: min(390px, calc(100vw - 32px));
  flex-direction: column;
  justify-content: center;
  padding: 26px;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 10px;
  background: rgba(8, 14, 15, 0.86);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
}

.auth-tabs,
.segmented {
  display: flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a0f10;
}

.auth-tab,
.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.auth-tab.is-active,
.segmented button.is-active {
  background: #172225;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(67, 215, 198, 0.18);
}

.auth-form {
  margin-top: 24px;
}

.auth-form [hidden] {
  display: none !important;
}

.registration-type-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.registration-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.registration-type-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0a0f10;
  cursor: pointer;
}

.registration-type-options label:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.65);
  background: rgba(67, 215, 198, 0.12);
  color: var(--text);
}

.registration-type-options input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.registration-type-field + label {
  margin-top: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0a0f10;
  color: var(--text);
  outline: 0;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

.auth-form label + label,
.auth-form .form-row,
.auth-form button {
  margin-top: 16px;
}

.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.captcha-image-button {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 0;
  overflow: hidden;
}

.captcha-image-button img {
  display: block;
  width: 128px;
  height: 48px;
}

.auth-help,
.auth-status {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-status[data-tone="error"] {
  color: #fca5a5;
}

.auth-status[data-tone="success"] {
  color: #7dd3fc;
}

.auth-status[data-tone="working"] {
  color: #facc15;
}

.form-row,
.button-row,
.top-actions,
.project-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
}

.check-line {
  display: flex;
  grid-template-columns: auto 1fr;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.check-line input {
  width: 15px;
  height: 15px;
}

.text-button,
.ghost-button,
.secondary-button,
.primary-button,
.icon-button,
.approve-button,
.revise-button,
.reject-button {
  border-radius: 7px;
  transition: 140ms ease;
}

.text-button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--cyan);
}

.primary-button {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(67, 215, 198, 0.5);
  background: linear-gradient(135deg, #28c8b8, #71d66f);
  color: #06100f;
  font-weight: 800;
}

.compact-button {
  width: auto;
  padding: 0 16px;
}

.secondary-button,
.ghost-button,
.icon-button {
  border: 1px solid var(--line);
  background: #11191b;
  color: var(--text);
}

.secondary-button {
  min-height: 36px;
  padding: 0 13px;
}

.ghost-button {
  min-height: 36px;
  width: 100%;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--amber);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.auth-tab:hover,
.nav-item:hover {
  transform: translateY(-1px);
}

.auth-note {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid rgba(230, 183, 90, 0.24);
  border-radius: 8px;
  background: rgba(230, 183, 90, 0.07);
  color: #c9d5d2;
  font-size: 13px;
  line-height: 1.6;
}

.auth-note strong,
.auth-note span {
  display: block;
}

.auth-note span {
  color: var(--muted);
}

.workspace-screen {
  min-height: 100vh;
  grid-template-columns: 186px minmax(0, 1fr);
  transition: grid-template-columns 0.2s ease;
}

.workspace-screen.is-sidebar-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: rgba(8, 12, 13, 0.96);
  overflow: hidden;
}

.sidebar-toggle-button {
  position: absolute;
  top: 58px;
  right: -13px;
  z-index: 3;
  display: grid;
  width: 32px;
  height: 160px;
  place-items: center;
  border: 1px solid rgba(67, 215, 198, 0.32);
  border-radius: 7px;
  background: #10191b;
  color: var(--cyan);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.workspace-screen.is-sidebar-collapsed .brand-lockup.compact {
  justify-content: center;
  padding-right: 8px;
  padding-left: 8px;
}

.workspace-screen.is-sidebar-collapsed .brand-lockup.compact > div:not(.brand-mark),
.workspace-screen.is-sidebar-collapsed .sidebar-foot {
  display: none;
}

.workspace-screen.is-sidebar-collapsed .main-nav {
  padding: 10px 6px;
}

.workspace-screen.is-sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.workspace-screen.is-sidebar-collapsed .nav-item span {
  color: var(--cyan);
  font-size: 13px;
}

.main-nav {
  display: grid;
  min-height: 0;
  align-content: start;
  gap: 5px;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(67, 215, 198, 0.28) transparent;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #9ba9a6;
  padding: 0 12px;
  font-weight: 800;
  text-align: left;
}

.nav-item[data-admin-only] {
  display: none !important;
}

body[data-role="super_admin"] .nav-item[data-admin-only]:not([hidden]),
body[data-role="company_admin"] .nav-item[data-admin-only][data-view="credits"]:not([hidden]),
body[data-role="company_admin"] .nav-item[data-admin-only][data-view="settings"]:not([hidden]) {
  display: flex !important;
}

.nav-item span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: #121a1c;
  color: var(--cyan);
  font-size: 13px;
}

.nav-item.is-active {
  border-color: rgba(67, 215, 198, 0.22);
  background: #121d20;
  color: var(--text);
}

.sidebar-foot {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line-soft);
}

.server-status-card {
  margin: 0 0 13px;
  border: 1px solid rgba(67, 215, 198, 0.14);
  border-radius: 9px;
  background: rgba(67, 215, 198, 0.045);
  color: var(--text);
  padding: 10px;
}

.server-status-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.server-status-heading > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #d7e6e3;
  font-size: 13px;
  font-weight: 800;
}

.server-status-heading > span > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(67, 215, 198, 0.12);
}

.server-status-card.is-error .server-status-heading > span > i {
  background: #ff8c83;
  box-shadow: 0 0 0 3px rgba(255, 140, 131, 0.12);
}

.server-status-heading > button {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 6px;
  background: rgba(67, 215, 198, 0.07);
  color: var(--cyan);
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

.server-status-heading > button:hover:not(:disabled) {
  background: rgba(67, 215, 198, 0.14);
  color: #e3fffb;
}

.server-status-heading > button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.server-status-heading > button.is-loading {
  animation: server-status-spin 0.8s linear infinite;
}

@keyframes server-status-spin {
  to { transform: rotate(360deg); }
}

.server-status-metrics {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.server-status-metric p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
}

.server-status-metric p strong {
  min-width: 0;
  overflow: hidden;
  color: #c8d7d4;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-status-metric > i {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
}

.server-status-metric > i > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
  transition: width 0.25s ease;
}

.server-status-card > small {
  display: block;
  margin-top: 9px;
  overflow: hidden;
  color: #667572;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quota-line {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.quota-line strong {
  color: var(--text);
}

.meter {
  height: 6px;
  margin: 9px 0 13px;
  overflow: hidden;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3b4447;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 10, 11, 0.92);
  backdrop-filter: blur(14px);
}

.project-switcher select {
  width: auto;
  min-width: 160px;
}

.project-switcher {
  flex-wrap: wrap;
}

#companySelect {
  min-width: 168px;
}

#projectGroupSelect {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}

#projectSelect {
  min-width: 230px;
}

#companySelect:disabled {
  cursor: default;
  opacity: 1;
  color: var(--text);
}

#roleSwitcher {
  min-width: 124px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.user-chip {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(105, 167, 255, 0.28);
  border-radius: 99px;
  background: rgba(105, 167, 255, 0.08);
  color: #dbe8ff;
  padding: 0 13px;
  font-size: 13px;
}

.view {
  padding: 24px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  white-space: nowrap;
}

.status-pill {
  min-height: 34px;
  border: 1px solid rgba(67, 215, 198, 0.28);
  background: rgba(67, 215, 198, 0.1);
  color: #c9fff7;
  padding: 0 12px;
  font-size: 13px;
}

.status-pill.live::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric,
.panel,
.asset-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), var(--panel);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
}

.metric {
  padding: 16px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin: 9px 0 4px;
  font-size: 25px;
  letter-spacing: 0;
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.step {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0e1416;
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
}

.step span {
  color: var(--muted-2);
  font-weight: 800;
}

.step.done {
  border-color: rgba(113, 214, 111, 0.22);
  color: #d8f6d7;
}

.step.done span {
  color: var(--green);
}

.step.active {
  border-color: rgba(67, 215, 198, 0.38);
  background: rgba(67, 215, 198, 0.08);
  color: #d5fffa;
}

.project-stage-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stage-card {
  display: grid;
  min-height: 132px;
  align-content: space-between;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1314;
  padding: 14px;
  color: var(--muted);
}

.stage-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: center;
}

.stage-card-head span {
  grid-row: 1 / 3;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-2);
  font-weight: 900;
}

.stage-card-head strong {
  color: var(--text);
  font-size: 14px;
}

.stage-card-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.stage-count {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stage-count strong {
  color: var(--text);
  font-size: 24px;
}

.stage-count span {
  color: var(--muted);
  font-size: 12px;
}

.stage-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.stage-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--line);
}

.button-progress {
  flex-basis: 100%;
  width: min(240px, 100%);
  margin-top: 6px;
  display: grid;
  gap: 4px;
}

.button-progress[hidden] {
  display: none;
}

.button-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(116, 132, 158, 0.22);
  border: 1px solid rgba(116, 132, 158, 0.22);
}

.button-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.2s ease;
}

.button-progress strong {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.banner-actions .batch-progress {
  flex: 1 0 100%;
  width: 100%;
  margin-top: 2px;
}

.batch-generate-button {
  min-width: 136px;
}

.production-card .prompt-tools .button-progress {
  grid-column: 1 / -1;
  width: 100%;
}

.stage-card.stage-done {
  border-color: rgba(113, 214, 111, 0.32);
  background: linear-gradient(180deg, rgba(113, 214, 111, 0.12), rgba(113, 214, 111, 0.03)), #0d1314;
}

.stage-card.stage-done .stage-card-head span,
.stage-card.stage-done .stage-progress span {
  background: var(--green);
}

.stage-card.stage-done .stage-card-head em {
  color: #bdf4bb;
}

.stage-card.stage-active {
  border-color: rgba(250, 204, 21, 0.42);
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.16), rgba(67, 215, 198, 0.05)), #0d1314;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.06), 0 12px 34px rgba(250, 204, 21, 0.08);
}

.stage-card.stage-active .stage-card-head span,
.stage-card.stage-active .stage-progress span {
  background: linear-gradient(90deg, #facc15, var(--cyan));
}

.stage-card.stage-active .stage-card-head em {
  color: #f9e38f;
}

.stage-card.stage-idle {
  border-color: rgba(148, 163, 184, 0.14);
  background: #0b0f10;
  color: #87949a;
  opacity: 0.82;
}

.stage-card.stage-idle .stage-card-head strong,
.stage-card.stage-idle .stage-count strong {
  color: #9aa7ad;
}

.dashboard-layout,
.video-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.ai-assistant-shell {
  display: grid;
  width: 100%;
  max-width: 1380px;
  height: calc(100vh - 150px);
  min-height: 620px;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.ai-assistant-history {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
  padding: 16px;
  border-right: 1px solid var(--line-soft);
  background: rgba(6, 12, 13, 0.72);
}

.ai-assistant-history input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #080e0f;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

.ai-assistant-history-list-shell {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
}

.ai-assistant-conversation-list {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 7px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-color: rgba(67, 215, 198, 0.52) rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
}

.ai-assistant-conversation-list::-webkit-scrollbar {
  width: 7px;
}

.ai-assistant-conversation-list::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.ai-assistant-conversation-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(67, 215, 198, 0.46);
}

.ai-assistant-history-toggle {
  width: 100%;
  min-height: 32px;
  flex: 0 0 auto;
  font-size: 12px;
}

.ai-conversation-button {
  display: grid;
  width: 100%;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
}

.ai-conversation-button:hover,
.ai-conversation-button.is-active {
  border-color: rgba(67, 215, 198, 0.3);
  background: rgba(67, 215, 198, 0.1);
}

.ai-conversation-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.ai-conversation-button span,
.ai-assistant-empty {
  color: var(--muted);
  font-size: 11px;
}

.ai-assistant-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
}

.ai-assistant-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.ai-assistant-current-heading {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ai-assistant-current-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.ai-assistant-current-heading span {
  color: var(--muted);
  font-size: 12px;
}

.ai-assistant-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-assistant-model-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.ai-assistant-model-field select {
  min-width: 180px;
  border: 1px solid rgba(67, 215, 198, 0.32);
  border-radius: 7px;
  background: #0b1112;
  color: var(--text);
  padding: 9px 12px;
  outline: none;
}

.ai-assistant-messages {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 4px 8px 4px 0;
}

.ai-message {
  display: grid;
  max-width: 82%;
  gap: 6px;
}

.ai-message span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.ai-message p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 15px;
}

.ai-message-status {
  color: var(--muted);
  font-size: 12px;
}

.ai-message.failed p {
  border-color: rgba(255, 99, 99, 0.45);
  color: #ffb1b1;
}

.ai-message.thinking p {
  border-color: rgba(67, 215, 198, 0.34);
  color: #9be8df;
  animation: ai-assistant-thinking 1.4s ease-in-out infinite;
}

@keyframes ai-assistant-thinking {
  0%, 100% { opacity: 0.58; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-message.thinking p { animation: none; }
}

.ai-message-image-card {
  position: relative;
  display: grid;
  gap: 9px;
  width: min(420px, 68vw);
  max-width: 100%;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 10px;
  background: #0b1214;
  padding: 10px;
}

.ai-message-image-card img {
  display: block;
  width: 100%;
  height: 360px;
  max-height: 48vh;
  border-radius: 7px;
  object-fit: contain;
  background: #050808;
  cursor: zoom-in;
}

.ai-message-image-card.is-live-full-image {
  width: min(680px, 78vw);
}

.ai-message-image-card.is-live-full-image img {
  height: auto;
  max-height: 72vh;
}

.ai-message-reference-card {
  position: relative;
  display: grid;
  width: min(280px, 60vw);
  gap: 6px;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 9px;
  background: #0b1214;
  padding: 8px;
}

.ai-message-image-number {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(3, 8, 9, 0.82);
  color: #f2fbf9;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.ai-message-reference-card img {
  display: block;
  width: 100%;
  height: 210px;
  border-radius: 6px;
  object-fit: contain;
  background: #050808;
  cursor: zoom-in;
}

.ai-message-reference-card span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.ai-message-image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-message-image-actions a,
.ai-message-image-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0b1112;
  color: var(--text);
  padding: 7px 10px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.ai-message-reference-actions {
  margin-top: 2px;
}

.ai-message-document-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(360px, 68vw);
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 9px;
  background: #0b1214;
  padding: 9px;
}

.ai-message-document-card > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.ai-message-document-card strong,
.ai-message-document-card > div span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-message-document-card strong {
  font-size: 12px;
}

.ai-message-document-card > div span {
  color: var(--muted);
  font-size: 10px;
}

.ai-message.assistant {
  align-self: flex-start;
}

.ai-message.assistant p {
  background: #0b1214;
  border-color: rgba(67, 215, 198, 0.22);
}

.ai-message.user {
  align-self: flex-end;
}

.ai-message.user span {
  text-align: right;
}

.ai-message.user p {
  background: rgba(67, 215, 198, 0.13);
  border-color: rgba(67, 215, 198, 0.38);
}

.ai-assistant-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: end;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.ai-assistant-input-wrap {
  display: grid;
  gap: 6px;
}

.ai-assistant-reference-draft {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  width: min(420px, 100%);
  border: 1px solid rgba(67, 215, 198, 0.34);
  border-radius: 8px;
  background: rgba(67, 215, 198, 0.08);
  padding: 7px;
}

.ai-assistant-reference-draft[hidden] {
  display: none;
}

.ai-assistant-reference-draft img {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: #050808;
}

.ai-assistant-document-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(67, 215, 198, 0.38);
  border-radius: 7px;
  background: rgba(67, 215, 198, 0.12);
  color: #8ff2e6;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.ai-assistant-document-draft {
  grid-template-columns: 54px minmax(0, 1fr) 28px;
}

.ai-assistant-document-draft .ai-assistant-document-icon {
  width: 54px;
  height: 54px;
}

.ai-assistant-reference-draft > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ai-assistant-reference-draft strong,
.ai-assistant-reference-draft span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-assistant-reference-draft strong {
  font-size: 12px;
}

.ai-assistant-reference-draft span {
  color: var(--muted);
  font-size: 10px;
}

.ai-assistant-reference-draft button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #0b1112;
  color: var(--muted);
  cursor: pointer;
}

.ai-assistant-composer-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-assistant-composer-meta small {
  min-width: 0;
}

.ai-assistant-input-wrap small {
  color: var(--muted);
  font-size: 11px;
}

.ai-assistant-composer textarea {
  min-height: 86px;
  max-height: 180px;
  resize: vertical;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 8px;
  background: #070c0d;
  color: var(--text);
  padding: 12px;
  outline: none;
}

.ai-assistant-composer textarea:focus {
  border-color: rgba(67, 215, 198, 0.64);
  box-shadow: 0 0 0 2px rgba(67, 215, 198, 0.1);
}

@media (max-width: 900px) {
  .ai-assistant-shell {
    height: auto;
    min-height: 720px;
    grid-template-columns: 1fr;
    grid-template-rows: 220px minmax(620px, 1fr);
  }

  .ai-assistant-history {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .ai-assistant-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-assistant-topbar-actions {
    justify-content: flex-start;
  }
}

.script-section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}

.script-section-actions .primary-button,
.script-section-actions .secondary-button {
  width: auto;
  white-space: nowrap;
}

.script-editor-head {
  align-items: center;
}

.script-editor-upload {
  width: auto;
  flex: 0 0 auto;
  margin-right: 2px;
  white-space: nowrap;
}

.quick-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #c8d3d1;
  font-size: 12px;
  user-select: none;
}

.quick-mode-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.quick-mode-switch-track {
  position: relative;
  width: 38px;
  height: 21px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 99px;
  background: #1a2325;
  transition: 160ms ease;
}

.quick-mode-switch-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #839196;
  transition: 160ms ease;
}

.quick-mode-switch input:checked + .quick-mode-switch-track {
  border-color: rgba(67, 215, 198, 0.66);
  background: rgba(67, 215, 198, 0.2);
}

.quick-mode-switch input:checked + .quick-mode-switch-track i {
  left: 20px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(67, 215, 198, 0.55);
}

.quick-mode-switch input:focus-visible + .quick-mode-switch-track {
  outline: 2px solid rgba(67, 215, 198, 0.55);
  outline-offset: 2px;
}

.quick-mode-progress-panel {
  display: grid;
  gap: 20px;
  margin: 4px 0 20px;
  border: 1px solid rgba(67, 215, 198, 0.25);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(67, 215, 198, 0.07), rgba(6, 12, 13, 0.88));
  padding: 22px 24px;
}

.quick-mode-progress-panel[hidden] {
  display: none;
}

.quick-mode-manual-gate {
  display: grid;
  gap: 18px;
  border: 1px solid rgba(250, 204, 21, 0.5);
  border-radius: 8px;
  background: rgba(250, 204, 21, 0.09);
  padding: 17px 18px;
}

.quick-mode-manual-gate[hidden] {
  display: none;
}

.quick-mode-manual-gate > div:first-child {
  display: grid;
  gap: 3px;
}

.quick-mode-manual-gate strong {
  color: #fde68a;
  font-size: 16px;
}

.quick-mode-manual-gate span {
  color: #cbd5d1;
  font-size: 14px;
  line-height: 1.65;
}

.quick-mode-manual-gate .primary-button {
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}

.quick-mode-progress-head,
.quick-mode-progress-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.quick-mode-progress-head span,
.quick-mode-progress-item span {
  color: var(--muted);
  font-size: 13px;
}

.quick-mode-progress-head > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quick-mode-config {
  display: grid;
  grid-template-columns: 185px 210px 470px 470px 225px 215px 250px;
  grid-auto-flow: column;
  gap: 10px;
  align-items: center;
  justify-content: start;
  overflow-x: auto;
  padding-bottom: 2px;
}

.quick-mode-config-group {
  min-width: 0;
  min-height: 78px;
  margin: 0;
  border: 1px solid rgba(98, 210, 177, 0.24);
  border-radius: 10px;
  background: rgba(5, 10, 11, 0.78);
  padding: 7px 10px 9px;
  box-shadow: inset 3px 0 0 rgba(98, 210, 177, 0.58);
}

.quick-mode-config-group-prompts {
  border-color: rgba(96, 165, 250, 0.24);
  box-shadow: inset 3px 0 0 rgba(96, 165, 250, 0.58);
}

.quick-mode-config-group-title {
  display: flex;
  align-items: center;
  min-height: 18px;
  margin: 0 0 5px;
  color: #dff9ef;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.quick-mode-config-group-prompts .quick-mode-config-group-title {
  color: #dbeafe;
}

.quick-mode-config-group-fields {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) repeat(2, minmax(125px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.quick-mode-config-group .quick-mode-choice,
.quick-mode-config-group .quick-mode-prompt-profile {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: rgba(20, 31, 32, 0.72);
  padding: 5px 8px;
}

.quick-mode-choice {
  gap: 8px;
}

.quick-mode-choice-title {
  display: inline-flex;
  align-items: center;
  align-self: center;
  max-width: none;
  line-height: 20px;
  white-space: nowrap;
}

.quick-mode-config.is-locked {
  opacity: 0.72;
}

.quick-mode-choice,
.quick-mode-prompt-profile,
.quick-mode-range,
.quick-mode-priority {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 58px;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(5, 10, 11, 0.68);
  padding: 9px 10px;
}

.quick-mode-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  gap: 4px 6px;
}

.quick-mode-prompt-profile {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.quick-mode-prompt-profile select {
  width: 100%;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #0d1516;
  color: var(--text);
  padding: 0 8px;
}

.quick-mode-choice-title {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  padding: 0;
}

.quick-mode-choice label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #d5dedc;
  justify-content: center;
  font-size: 13px;
  white-space: nowrap;
}

.quick-mode-choice input {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  accent-color: #62d2b1;
}

.quick-mode-execution-choice {
  min-width: 0;
  grid-template-columns: 1fr;
}

.high-agent-entry[hidden] {
  display: none !important;
}

.quick-mode-execution-choice select {
  width: 92px;
  height: 34px;
  border: 1px solid rgba(98, 210, 177, 0.28);
  border-radius: 6px;
  background: #0d1516;
  color: var(--text);
  padding: 0 7px;
}

.quick-mode-range {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
}

.quick-mode-range > span:first-child {
  white-space: nowrap;
}

.quick-mode-range > span:last-child {
  display: grid;
  grid-template-columns: 58px 10px 58px;
  gap: 5px;
  align-items: center;
  justify-content: start;
}

.quick-mode-range input {
  box-sizing: border-box;
  width: 58px;
  max-width: 58px;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #0d1516;
  color: var(--text);
  min-height: 30px;
  padding: 4px 6px;
  font-size: 14px;
  text-align: center;
}

.quick-mode-range b {
  color: var(--muted);
  font-weight: 400;
}

.quick-mode-priority {
  justify-content: space-between;
  gap: 6px;
  color: #d5dedc;
  font-size: 12px;
  padding-inline: 8px;
}

.quick-mode-priority > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.quick-mode-priority input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #62d2b1;
}

.quick-mode-priority select {
  flex: 0 0 124px;
  width: 124px;
  min-width: 124px;
  height: 30px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #0d1516;
  color: var(--text);
  padding: 0 7px;
}

.quick-mode-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.quick-mode-progress-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px 10px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  background: rgba(5, 10, 11, 0.76);
  min-height: 108px;
  padding: 15px;
}

.quick-mode-video-settings {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.13);
  padding-top: 10px;
}

.quick-mode-video-progresses {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.quick-mode-video-progress-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.quick-mode-video-progress-row > span {
  font-size: 12px;
  white-space: nowrap;
}

.quick-mode-video-settings label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.quick-mode-video-settings label > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.quick-mode-video-settings select,
.quick-mode-video-settings input {
  width: 100%;
  min-width: 0;
  height: 31px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #0d1516;
  color: var(--text);
  padding: 0 7px;
}

.quick-mode-video-episode-range,
.quick-mode-video-model {
  grid-column: 1 / -1;
}

.quick-mode-narrator-reference-audio {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 7px;
  background: rgba(13, 32, 31, 0.56);
  padding: 9px 10px;
}

.quick-mode-narrator-reference-audio > div:first-child {
  display: grid;
  gap: 3px;
}

.quick-mode-narrator-reference-audio strong {
  font-size: 12px;
}

.quick-mode-narrator-reference-audio small,
.quick-mode-narrator-reference-audio p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.quick-mode-narrator-reference-audio p {
  grid-column: 1 / -1;
  margin: 0;
}

.quick-mode-narrator-reference-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.quick-mode-video-episode-range {
  grid-template-columns: 66px minmax(72px, 92px) 14px minmax(72px, 92px);
  gap: 8px;
  align-items: center;
  justify-content: start;
}

.quick-mode-video-episode-range select {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.quick-mode-video-episode-range b {
  color: var(--muted);
  font-weight: 400;
  text-align: center;
}

.quick-mode-batch-video-button {
  width: 100%;
  min-height: 36px;
  grid-column: 1 / -1;
}

.quick-mode-batch-video-hint {
  grid-column: 1 / -1;
  color: #8fa19d !important;
  font-size: 12px !important;
  line-height: 1.45;
}

.quick-mode-progress-item > div:first-child {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.quick-mode-stage-heading {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.quick-mode-stage-rebuild {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 6px;
  background: rgba(127, 29, 29, 0.2);
  color: #ffd5d5;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.quick-mode-stage-rebuild:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.8);
  background: rgba(153, 27, 27, 0.35);
}

.quick-mode-stage-rebuild:disabled {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(71, 85, 105, 0.12);
  color: rgba(203, 213, 225, 0.42);
  cursor: not-allowed;
}

.quick-mode-detail-banners {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-top: 14px;
  border-bottom: 1px solid rgba(45, 212, 191, 0.38);
}

.quick-mode-detail-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 52px;
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #081012;
  color: #d9e5e2;
  padding: 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.quick-mode-detail-banner:hover {
  border-color: rgba(94, 234, 212, 0.42);
  background: #0d1718;
}

.quick-mode-detail-banner.is-completed {
  border-color: rgba(45, 212, 191, 0.24);
}

.quick-mode-detail-banner.is-running {
  border-color: rgba(45, 212, 191, 0.28);
}

.quick-mode-detail-banner.is-failed {
  border-color: rgba(45, 212, 191, 0.24);
}

.quick-mode-detail-banner.is-active {
  border-color: rgba(45, 212, 191, 0.82);
  background: rgba(26, 119, 111, 0.3);
  color: #effffc;
  box-shadow: inset 0 2px 0 rgba(94, 234, 212, 0.12);
}

.quick-mode-detail-banner > span,
.quick-mode-detail-banner > b,
.quick-mode-detail-banner > em {
  display: none;
}

.quick-mode-detail-banner > strong {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-mode-stage-detail-panel {
  display: grid;
  gap: 10px;
  min-height: 120px;
  margin-top: 10px;
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 9px;
  background: rgba(5, 13, 14, 0.88);
  padding: 13px 14px;
}

.quick-mode-stage-detail-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.quick-mode-stage-detail-panel-head > div {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.quick-mode-stage-detail-panel-head span {
  color: #7f918d;
  font-size: 12px;
}

.quick-mode-stage-detail-panel-head strong {
  color: #e1eeeb;
  font-size: 16px;
}

.quick-mode-stage-detail-panel-head > b {
  color: #9edfcf;
  font-size: 13px;
}

.quick-mode-stage-details-body {
  display: grid;
  gap: 8px;
  max-height: 380px;
  margin-top: 7px;
  overflow: auto;
  color: #b8c7c4;
  font-size: 13px;
  line-height: 1.55;
}

.quick-mode-detail-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-mode-detail-overview span,
.quick-mode-detail-status {
  border: 1px solid rgba(98, 210, 177, 0.22);
  border-radius: 99px;
  background: rgba(20, 83, 68, 0.18);
  color: #c8eee2;
  padding: 2px 8px;
}

.quick-mode-detail-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-mode-detail-item {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 7px;
  background: rgba(15, 26, 28, 0.72);
  padding: 8px 9px;
}

.quick-mode-detail-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quick-mode-detail-item-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quick-mode-detail-meta {
  color: #8fa19d;
  font-size: 12px;
}

.quick-mode-detail-prompt {
  margin: 0;
  color: #c9d5d2;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.quick-mode-detail-images {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-mode-detail-images a {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 128px;
  color: #b9cbc6;
  text-decoration: none;
}

.quick-mode-detail-images img {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 5px;
  background: #091011;
  object-fit: cover;
}

.quick-mode-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.quick-mode-detail-links a {
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 5px;
  background: rgba(13, 74, 67, 0.22);
  color: #aee9dc;
  padding: 4px 9px;
  text-decoration: none;
}

.quick-mode-detail-empty,
.quick-mode-detail-error {
  margin: 0;
  border-radius: 6px;
  background: rgba(71, 85, 105, 0.14);
  padding: 9px;
}

.quick-mode-detail-error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.18);
}

.quick-mode-progress-item em {
  color: #c8d3d1;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.quick-mode-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.16);
}

.quick-mode-progress-head > strong {
  font-size: 20px;
}

.quick-mode-progress-item strong {
  font-size: 15px;
}

.quick-mode-gate-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

#scriptImportView .editor-panel.is-script-collapsed > .script-input {
  display: none;
}

#scriptImportView .editor-panel.is-script-collapsed .quick-mode-progress-panel {
  margin-bottom: 0;
}

.quick-mode-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #facc15, var(--cyan));
  transition: width 220ms ease;
}

.quick-mode-progress-item.is-completed {
  border-color: rgba(113, 214, 111, 0.3);
}

.quick-mode-progress-item.is-completed .quick-mode-progress-track i {
  background: var(--green);
}

.quick-mode-progress-item.is-failed {
  border-color: rgba(231, 101, 101, 0.4);
}

.quick-mode-progress-item.is-failed .quick-mode-progress-track i {
  background: #e76565;
}

@media (max-width: 980px) {
  .quick-mode-progress-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .quick-mode-detail-banner {
    min-height: 48px;
    padding-inline: 6px;
  }

  .quick-mode-detail-banner > strong {
    font-size: 14px;
  }

  .quick-mode-stage-detail-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

.shot-table {
  display: grid;
  gap: 6px;
}

.shot-row {
  display: grid;
  grid-template-columns: 1.3fr 1.2fr 0.8fr 0.8fr 1fr;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0d1314;
  padding: 0 12px;
  color: #cbd7d4;
  font-size: 12px;
}

.shot-row.head {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.stage-task-table {
  display: grid;
  gap: 7px;
}

.stage-task-row {
  display: grid;
  grid-template-columns: 1fr 110px 110px 110px 1.1fr;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0d1314;
  padding: 0 12px;
  color: #cbd7d4;
  font-size: 12px;
}

.stage-task-row.head {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.stage-task-row.done {
  border-color: rgba(113, 214, 111, 0.22);
}

.stage-task-row.active {
  border-color: rgba(250, 204, 21, 0.36);
  background: rgba(250, 204, 21, 0.07);
}

.stage-task-row.idle {
  border-color: rgba(148, 163, 184, 0.12);
  background: #0a0e0f;
  color: #8d9aa0;
}

.tag {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.tag.green {
  background: rgba(113, 214, 111, 0.11);
  color: #bdf4bb;
}

.tag.amber {
  background: rgba(230, 183, 90, 0.13);
  color: #f4d99c;
}

.tag.blue {
  background: rgba(105, 167, 255, 0.13);
  color: #c9ddff;
}

.tag.red {
  background: rgba(231, 101, 101, 0.13);
  color: #ffc2c2;
}

.tag.muted-tag {
  background: rgba(148, 163, 184, 0.12);
  color: #a9b5ba;
}

.focus-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 7px;
  object-fit: cover;
}

.detail-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.detail-list strong {
  color: var(--text);
  text-align: right;
}

.split-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 14px;
}

.script-block {
  display: grid;
  gap: 14px;
  color: #d7e2df;
  line-height: 1.8;
}

.script-input {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 8px;
  background: #080f10;
  color: #d7e2df;
  padding: 16px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.8;
  outline: none;
}

.script-input:focus {
  border-color: rgba(67, 215, 198, 0.62);
  box-shadow: 0 0 0 2px rgba(67, 215, 198, 0.12);
}

.extract-grid {
  display: grid;
  gap: 10px;
}

.extract-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0c1213;
  padding: 13px;
}

.extract-grid strong,
.extract-grid span {
  display: block;
}

.extract-grid span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.asset-card {
  overflow: hidden;
}

.asset-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.asset-card div {
  padding: 14px;
}

.asset-card h3 {
  margin-top: 10px;
}

.asset-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.script-processor-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.script-entry-tabs {
  display: grid;
  width: min(720px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(45, 212, 191, 0.34);
}

.script-entry-tab {
  position: relative;
  display: grid;
  min-height: 58px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
  background: #081011;
  color: #92a39f;
  padding: 0 18px;
  font: inherit;
  cursor: pointer;
}

.script-entry-tab + .script-entry-tab {
  margin-left: 4px;
}

.script-entry-tab span {
  color: #6f827e;
  font-size: 12px;
  font-weight: 800;
}

.script-entry-tab strong {
  color: #c7d3d0;
  font-size: 16px;
}

.script-entry-tab em {
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.1);
  color: #71d9cb;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.script-entry-tab.is-active {
  border-color: rgba(45, 212, 191, 0.72);
  background: linear-gradient(180deg, rgba(20, 72, 68, 0.66), rgba(8, 29, 28, 0.92));
  box-shadow: inset 0 2px 0 rgba(77, 229, 211, 0.26);
}

.script-entry-tab.is-active span,
.script-entry-tab.is-active strong {
  color: #effcf9;
}

.reference-video-script-panel {
  width: 100%;
  max-width: 1580px;
  margin-bottom: 14px;
  border-color: rgba(45, 212, 191, 0.32);
  background:
    radial-gradient(circle at 92% 0, rgba(45, 212, 191, 0.13), transparent 32%),
    linear-gradient(145deg, #081112, #0a1516 54%, #071011);
  padding: 24px;
}

.reference-video-script-panel[hidden] {
  display: none;
}

.reference-video-script-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
}

.reference-video-script-kicker {
  display: block;
  margin-bottom: 7px;
  color: #4dd7c6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.reference-video-script-head h3 {
  margin: 0;
  color: #f0f8f6;
  font-size: 22px;
}

.reference-video-script-head p {
  max-width: 780px;
  margin: 8px 0 0;
  color: #8fa29e;
  font-size: 13px;
  line-height: 1.65;
}

.reference-video-remote-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.08);
  color: #f2d66f;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 900;
}

.reference-video-script-form {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) 190px 190px 116px 142px;
  align-items: end;
  gap: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  background: rgba(4, 11, 12, 0.7);
  padding: 16px;
}

.reference-video-script-form label {
  display: grid;
  gap: 7px;
}

.reference-video-script-form label > span,
.reference-video-episode-preview > span {
  color: #8fa29e;
  font-size: 12px;
  font-weight: 800;
}

.reference-video-script-form input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 7px;
  background: #071011;
  color: #e6f0ee;
  padding: 0 12px;
  font: inherit;
  outline: none;
}

.reference-video-script-form input:focus {
  border-color: rgba(67, 215, 198, 0.68);
  box-shadow: 0 0 0 2px rgba(67, 215, 198, 0.1);
}

.reference-video-episode-preview {
  display: grid;
  min-height: 68px;
  align-content: end;
  gap: 7px;
}

.reference-video-episode-preview strong {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(45, 212, 191, 0.2);
  border-radius: 7px;
  background: rgba(45, 212, 191, 0.07);
  color: #a9f0e5;
  font-size: 18px;
}

.reference-video-script-start {
  height: 44px;
  margin: 0;
}

.reference-video-script-start:disabled {
  border-color: rgba(148, 163, 184, 0.16);
  background: #1b2929;
  color: #71817e;
  cursor: not-allowed;
  opacity: 1;
}

.reference-video-script-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  border-left: 3px solid rgba(250, 204, 21, 0.7);
  background: rgba(250, 204, 21, 0.055);
  padding: 11px 13px;
}

.reference-video-script-status > span {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(250, 204, 21, 0.34);
  border-radius: 50%;
  color: #efd56e;
  font-size: 12px;
  font-weight: 900;
}

.reference-video-script-status p {
  margin: 0;
  color: #899a97;
  font-size: 12px;
  line-height: 1.55;
}

.reference-video-script-status strong {
  display: block;
  margin-bottom: 2px;
  color: #e7efe9;
}

#assetExtractionView .script-processor-layout,
#videoPromptView .script-processor-layout {
  width: 66.666%;
  max-width: 1180px;
}

#scriptImportView .script-processor-layout {
  width: 100%;
  max-width: 1580px;
}

#scriptImportView .script-input {
  height: 860px;
}

.script-note {
  margin-top: 18px;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: rgba(67, 215, 198, 0.07);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.script-note strong,
.script-note span {
  display: block;
}

.script-note strong {
  margin-bottom: 5px;
  color: var(--text);
}

.extraction-panel {
  display: grid;
  gap: 14px;
}

.workflow-status-panel {
  display: grid;
  gap: 10px;
}

.workflow-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workflow-status-grid.is-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stage-subview-status-panel {
  margin: 0 0 14px;
}

#scriptImportView > .stage-subview-status-panel {
  width: 66.666%;
  max-width: 1180px;
}

.asset-production-status-panel {
  margin-top: 10px;
}

.workflow-status-card {
  display: grid;
  min-height: 96px;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #081011;
  padding: 13px 14px;
}

.workflow-status-card span,
.workflow-status-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-status-card strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.workflow-status-card.is-completed {
  border-color: rgba(113, 214, 111, 0.24);
  background: rgba(113, 214, 111, 0.055);
}

.workflow-status-card.is-processing {
  border-color: rgba(255, 184, 76, 0.28);
  background: rgba(255, 184, 76, 0.055);
}

.workflow-status-card.is-pending {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.045);
}

.workflow-status-card[data-stage-metric] {
  --stage-progress-color: #77878b;
}

.workflow-status-card.is-completed[data-stage-metric] {
  --stage-progress-color: #71d66f;
}

.workflow-status-card.is-processing[data-stage-metric] {
  --stage-progress-color: #facc15;
}

.workflow-status-card[data-stage-metric]::after {
  content: "";
  display: block;
  height: 8px;
  margin-top: 3px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--stage-progress-color) 0%,
    var(--stage-progress-color) var(--stage-progress, 0%),
    rgba(255, 255, 255, 0.09) var(--stage-progress, 0%),
    rgba(255, 255, 255, 0.09) 100%
  );
}

.extraction-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.extraction-summary-card {
  display: grid;
  min-height: 190px;
  gap: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)), #0d1314;
  padding: 14px;
}

.summary-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.summary-state {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.08);
  color: #aab6bb;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.extraction-summary-card.is-extracted {
  border-color: rgba(67, 215, 198, 0.28);
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.08), rgba(255, 255, 255, 0.012)), #0d1314;
}

.extraction-summary-card.is-extracted .summary-state {
  border-color: rgba(113, 214, 111, 0.24);
  background: rgba(113, 214, 111, 0.1);
  color: #bdf4bb;
}

.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 12px;
}

.summary-total strong {
  color: var(--text);
  font-size: 34px;
}

.summary-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.asset-category-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.asset-category-status-grid div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #091011;
  padding: 10px;
}

.asset-category-status-grid [data-status-metric]::after {
  content: "";
  display: block;
  height: 6px;
  border-radius: 99px;
  background: linear-gradient(
    90deg,
    var(--status-progress-color, #77878b) 0%,
    var(--status-progress-color, #77878b) var(--status-progress, 0%),
    rgba(255, 255, 255, 0.09) var(--status-progress, 0%),
    rgba(255, 255, 255, 0.09) 100%
  );
}

.asset-category-status-grid [data-status-metric="completed"] {
  --status-progress-color: #71d66f;
}

.asset-category-status-grid [data-status-metric="inProduction"] {
  --status-progress-color: #facc15;
}

.asset-category-status-grid span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.asset-category-status-grid strong {
  color: var(--text);
  font-size: 20px;
}

.summary-levels div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #091011;
  padding: 10px;
}

.summary-levels span {
  color: var(--muted);
  font-size: 12px;
}

.video-prompt-summary-panel {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.06), rgba(255, 255, 255, 0.012)), #0c1213;
  padding: 14px;
}

.video-prompt-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.video-prompt-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.video-prompt-summary-grid div {
  display: grid;
  gap: 7px;
  min-height: 68px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #081011;
  padding: 11px;
}

.video-prompt-summary-grid span,
#videoPromptHint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.video-prompt-summary-grid strong {
  color: var(--text);
  font-size: 18px;
}

#videoPromptHint {
  margin: 0;
  line-height: 1.55;
}

.summary-levels strong {
  color: var(--text);
  font-size: 20px;
}

.asset-banner {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0d1314;
}

.asset-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 14px;
}

.asset-banner-head .eyebrow {
  margin-bottom: 4px;
}

.asset-target-table {
  display: grid;
  gap: 6px;
  overflow-x: auto;
  padding: 10px;
}

.asset-target-row {
  display: grid;
  grid-template-columns: 84px 54px minmax(180px, 1.05fr) minmax(120px, 0.62fr) minmax(260px, 1.38fr) 86px;
  gap: 10px;
  align-items: start;
  min-width: 980px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0a1011;
  padding: 10px;
  color: #cfd9d6;
  font-size: 12px;
  line-height: 1.55;
}

.asset-target-row.table-head {
  min-height: 30px;
  align-items: center;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
  padding-top: 0;
  padding-bottom: 0;
}

.asset-target-row.pending-delete {
  border-color: rgba(231, 101, 101, 0.35);
  background: rgba(231, 101, 101, 0.08);
  opacity: 0.72;
}

.asset-target-row.pending-delete .asset-no::after {
  content: " 待删";
  color: var(--red);
  font-weight: 800;
}

.asset-no {
  color: #e9f3ef;
  font-weight: 800;
}

.level-badge {
  display: inline-grid;
  width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  font-weight: 900;
}

.level-s {
  background: rgba(230, 183, 90, 0.18);
  color: #ffd88d;
}

.level-a {
  background: rgba(67, 215, 198, 0.15);
  color: #b8fff6;
}

.level-b {
  background: rgba(105, 167, 255, 0.14);
  color: #c6dcff;
}

.prompt-pair {
  display: grid;
  gap: 5px;
  color: #aebbb8;
}

.prompt-pair strong {
  color: var(--cyan);
}

.prompt-switcher {
  display: grid;
  gap: 8px;
}

.prompt-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.prompt-lang-label {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 99px;
  background: rgba(67, 215, 198, 0.11);
  color: #c9fff7;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.prompt-toggle-button,
.prompt-save-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11191b;
  color: var(--text);
  padding: 0 10px;
}

.prompt-save-button {
  border-color: rgba(113, 214, 111, 0.3);
  color: #c9ffc7;
}

.prompt-textarea {
  min-height: 74px;
  font-size: 12px;
}

.soft-delete-button {
  min-height: 30px;
  border: 1px solid rgba(231, 101, 101, 0.3);
  border-radius: 6px;
  background: rgba(231, 101, 101, 0.08);
  color: #ffc8c8;
}

.asset-page-sticky-head,
.video-episode-sticky-head {
  z-index: 40;
  background:
    linear-gradient(180deg, rgba(7, 10, 11, 0.98) 0%, rgba(7, 10, 11, 0.96) 86%, rgba(7, 10, 11, 0.78) 100%),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
  backdrop-filter: blur(12px);
}

.asset-page-sticky-head {
  position: sticky;
  top: 0;
  display: flow-root;
  margin-top: -1px;
  padding-top: 1px;
  padding-bottom: 1px;
}

.asset-library-scroll {
  position: relative;
  z-index: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  padding-bottom: 4px;
}

.asset-library-layout {
  display: grid;
  grid-template-columns: 1000px 1058px;
  gap: 14px;
  align-items: start;
  width: 2072px;
  min-width: 2072px;
}

#assetsView {
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 64px);
  overflow: hidden;
}

#assetsView.is-active {
  display: grid;
}

#assetsView .asset-page-sticky-head {
  position: relative;
  top: auto;
}

.asset-filter-tabs {
  display: flex;
  align-items: end;
  gap: 3px;
  margin-bottom: 14px;
  width: fit-content;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.05), rgba(7, 12, 13, 0.2));
}

.asset-filter-tabs button {
  min-width: 124px;
  min-height: 42px;
  border: 1px solid rgba(67, 215, 198, 0.16);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.045), rgba(255, 255, 255, 0.01)), #0b1112;
  color: #aebcba;
  font-size: 14px;
  font-weight: 900;
}

.asset-filter-tabs button.is-active {
  border-color: rgba(67, 215, 198, 0.68);
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.22), rgba(67, 215, 198, 0.08)), #0b1516;
  color: #eafffb;
  box-shadow: none;
  transform: translateY(1px);
}

.episode-range-control {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.episode-range-control select {
  min-width: 82px;
  height: 34px;
  padding: 0 24px 0 9px;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 6px;
  background: #0a1112;
  color: var(--text);
}

.episode-range-control b {
  color: var(--accent);
  font-size: 15px;
}

.asset-library-range-control {
  align-self: flex-end;
  margin: 0 0 4px 8px;
}

.extraction-range-control {
  margin-right: 4px;
}

@media (max-width: 1180px) {
  .asset-filter-tabs {
    flex-wrap: wrap;
  }

  .asset-library-range-control {
    margin: 6px 0 4px 8px;
  }
}

.asset-extraction-range-modal {
  padding: 12px;
}

.project-modal-panel.asset-extraction-range-panel {
  display: flex;
  flex-direction: column;
  width: min(1360px, calc(100vw - 24px));
  height: min(960px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  overflow: hidden;
}

.asset-extraction-range-panel .background-task-section {
  flex: 1 1 auto;
  min-height: 260px;
  grid-template-rows: auto minmax(0, 1fr);
}

.asset-extraction-range-panel .background-task-list {
  max-height: none;
  min-height: 0;
}

.asset-extraction-range-panel .background-task-episodes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.asset-extraction-controls-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 250px)) minmax(120px, 145px) minmax(140px, 160px) minmax(260px, 320px) auto;
  align-items: stretch;
  justify-content: start;
  gap: 12px;
  margin-top: 10px;
}

.asset-extraction-control-group {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 8px;
  background: #081011;
}

.asset-extraction-group-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.asset-extraction-target-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.asset-extraction-group-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: rgba(67, 215, 198, 0.035);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.asset-extraction-group-choice:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.78);
  background: rgba(67, 215, 198, 0.16);
  color: var(--text);
}

.asset-extraction-group-choice:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.asset-extraction-group-choice input {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--cyan);
}

.asset-extraction-range-status,
.asset-extraction-range-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.asset-extraction-range-status {
  margin: 14px 0 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 196, 87, 0.2);
  border-radius: 7px;
  background: rgba(255, 196, 87, 0.07);
}

.asset-extraction-modal-range {
  width: 100%;
  max-width: 360px;
  justify-content: center;
  margin: 0;
  padding: 9px 14px;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 8px;
  background: #081011;
}

.asset-extraction-modal-range select {
  min-width: 110px;
}

.asset-extraction-skill-version,
.asset-extraction-text-model {
  width: 100%;
  justify-content: center;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 8px;
  background: #081011;
}

.asset-extraction-skill-version select,
.asset-extraction-text-model select {
  min-width: 0;
  width: 100%;
}

.asset-extraction-control-label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}

.asset-extraction-inline-start {
  width: auto;
  min-width: 118px;
  height: 100%;
  min-height: 48px;
  align-self: stretch;
  white-space: nowrap;
}

.asset-extraction-range-hint {
  margin: 8px 0 0;
  text-align: center;
}

.asset-extraction-range-hint.is-error {
  color: #ff8d85;
}

@media (max-width: 640px) {
  .project-modal-panel.asset-extraction-range-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }

  .asset-extraction-mode-options {
    grid-template-columns: 1fr;
  }

  .asset-extraction-target-options {
    grid-template-columns: 1fr;
  }

  .asset-extraction-controls-row {
    grid-template-columns: 1fr;
  }

  .asset-extraction-modal-range select {
    min-width: 96px;
  }

  .asset-extraction-inline-start {
    width: 100%;
    min-height: 42px;
  }
}

@media (min-width: 641px) and (max-width: 860px) {
  .asset-extraction-controls-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .asset-extraction-range-panel .background-task-episodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .asset-extraction-range-panel .background-task-episodes {
    grid-template-columns: 1fr;
  }
}

.upload-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
}

.upload-toolbar .secondary-button {
  flex: 0 0 auto;
}

.asset-banner.is-hidden {
  display: none;
}

.script-asset-banner.is-hidden {
  display: none;
}

.asset-library-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.production-banner {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #091012;
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.banner-actions label {
  min-width: 178px;
}

.banner-actions select {
  height: 34px;
}

.accent-add-button {
  min-height: 34px;
  border: 1px solid rgba(250, 204, 21, 0.62);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.18), rgba(161, 98, 7, 0.12));
  color: #fff3bd;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.accent-add-button:hover {
  border-color: #fde047;
  background: linear-gradient(180deg, rgba(250, 204, 21, 0.25), rgba(161, 98, 7, 0.16));
}

.production-card {
  display: grid;
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px 124px 160px;
  grid-template-rows: 92px 104px;
  gap: 0;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-top: 1px solid var(--line-soft);
  padding: 0;
  background: #0a1011;
  color: var(--text);
}

.production-row-head {
  display: grid;
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px 124px 160px;
  gap: 0;
  align-items: stretch;
  border-top: 0;
  background: #0d1517;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
  font-weight: 800;
}

.asset-character-kind-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 0 14px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(90deg, rgba(42, 134, 126, 0.18), rgba(10, 16, 17, 0.92));
  color: #d9fffa;
}

.asset-logical-thumbnail-grid > .asset-character-kind-heading {
  grid-column: 1 / -1;
  margin: 2px -2px 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.asset-character-kind-heading.is-animal {
  background: linear-gradient(90deg, rgba(181, 126, 45, 0.2), rgba(10, 16, 17, 0.92));
  color: #ffe5ad;
}

.asset-character-kind-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-character-kind-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-left: 7px;
  padding: 0 6px;
  border: 1px solid rgba(71, 211, 196, 0.34);
  border-radius: 999px;
  background: rgba(40, 149, 137, 0.12);
  color: #aef3ea;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  vertical-align: middle;
}

.asset-character-kind-badge.is-animal {
  border-color: rgba(236, 181, 88, 0.42);
  background: rgba(185, 125, 36, 0.14);
  color: #ffd89a;
}

.production-row-head span,
.production-card > .asset-check,
.production-card > .asset-no-cell,
.production-card > .asset-no,
.production-card > .level-badge,
.production-card > .asset-name-cell,
.production-card > .episode-cell,
.production-card > .asset-status-column,
.production-card > .manual-review-cell,
.production-card > .review-suggestion-cell,
.production-card > .asset-action-cell,
.production-card > .thumb-cell,
.production-card > .thumb-button,
.production-card > .prompt-row-label,
.production-card .prompt-tools,
.production-card .prompt-textarea {
  box-sizing: border-box;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: #0a1011;
  color: var(--text);
}

.production-row-head span {
  display: grid;
  place-items: center;
  min-height: 32px;
  padding: 4px 3px;
  line-height: 1.15;
  text-align: center;
}

.production-card > .asset-check {
  grid-column: 1;
  grid-row: 1;
}

.production-card > .asset-no-cell,
.production-card > .asset-no {
  grid-column: 2;
  grid-row: 1;
  padding: 10px 5px 4px;
  font-size: 12px;
}

.production-card > .asset-no-cell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.asset-no-cell .asset-no {
  padding: 0;
  overflow-wrap: anywhere;
  text-align: center;
}

.asset-no-cell .delete-asset-button {
  min-width: 44px;
  min-height: 24px;
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.22);
  color: #ffd5d5;
  padding: 0 5px;
  font-size: 11px;
}

.production-card > .asset-name-cell {
  grid-column: 3;
  grid-row: 1;
  padding: 10px 5px 4px;
}

.production-card > .level-badge {
  grid-column: 4;
  grid-row: 1;
  display: grid;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  place-items: center;
  border-radius: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

.production-card > .level-badge.level-s {
  background: rgba(230, 183, 90, 0.26);
  color: #ffe2a6;
}

.production-card > .level-badge.level-a {
  background: rgba(67, 215, 198, 0.2);
  color: #c9fff7;
}

.production-card > .level-badge.level-b {
  background: rgba(105, 167, 255, 0.18);
  color: #d7e5ff;
}

.production-card > .episode-cell {
  grid-column: 5;
  grid-row: 1;
  padding: 10px 5px 4px;
}

.production-card > .asset-status-column {
  grid-column: 6;
  grid-row: 1;
}

.production-card > .manual-review-cell {
  grid-column: 7;
  grid-row: 1;
}

.production-card > .review-suggestion-cell {
  grid-column: 8;
  grid-row: 1;
}

.production-card > .asset-action-cell {
  grid-column: 9;
  grid-row: 1;
}

.production-card > .thumb-cell,
.production-card > .thumb-button {
  grid-column: 10;
  grid-row: 1 / 3;
}

.asset-check {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding-top: 10px;
  font-size: 11px;
  color: var(--muted);
}

.asset-check input {
  width: 16px;
  height: 16px;
}

.production-main {
  display: grid;
  gap: 10px;
}

.asset-name-cell,
.episode-cell,
.review-suggestion-cell {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.episode-cell {
  color: #b9c7c3;
}

.manual-review-cell,
.review-suggestion-cell {
  min-height: 0;
  padding: 10px 6px 4px;
  font-size: 12px;
  line-height: 1.35;
}

.manual-review-cell {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.manual-review-text {
  display: block;
  width: 100%;
  overflow-wrap: anywhere;
}

.review-suggestion-cell {
  color: #c9d6d2;
  width: 100%;
  height: 100%;
  resize: none;
  font-family: inherit;
}

.production-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.production-main p {
  color: #b7c4c1;
  font-size: 13px;
  line-height: 1.6;
}

.review-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.review-note {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0a1011;
  padding: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.review-note strong,
.review-note span {
  display: block;
}

.review-note strong {
  margin-bottom: 4px;
  color: #f1d18d;
}

.asset-status-column {
  display: grid;
  align-content: start;
  gap: 0;
  min-height: 0;
  padding: 10px 6px 4px;
  font-size: 12px;
  line-height: 1.4;
}

.status-label {
  color: var(--muted-2);
  font-weight: 800;
}

.status-current {
  display: inline;
  width: auto;
  min-height: 0;
  border-radius: 0;
  padding: 0;
  font-size: 12px;
}

.status-approved {
  background: transparent;
  color: #bdf4bb;
}

.status-review {
  background: transparent;
  color: #f4d99c;
}

.status-pending {
  background: transparent;
  color: #c9ddff;
}

.production-card > .prompt-editor {
  display: contents;
}

.production-card .prompt-switcher {
  display: contents;
}

.prompt-row-label {
  display: grid;
  grid-column: 3;
  grid-row: 2;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  gap: 7px;
  padding: 8px 7px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.prompt-row-label > span {
  display: block;
  text-align: center;
}

.prompt-row-label .prompt-toggle-button {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 0 5px;
  white-space: nowrap;
}

.production-card .prompt-tools {
  display: grid;
  grid-column: 9 / 10;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(3, minmax(24px, 1fr));
  align-content: start;
  gap: 5px;
  padding: 8px;
  font-size: 12px;
  line-height: 1.35;
}

.production-card .prompt-tools button {
  width: 100%;
  min-width: 0;
}

.production-card .prompt-editor textarea {
  grid-column: 4 / 9;
  grid-row: 2;
  width: 100%;
  min-height: 76px;
  height: 100%;
  resize: none;
  padding: 8px 10px;
  border-radius: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
}

.asset-action-cell {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 10px 6px 4px;
  font-size: 12px;
  line-height: 1.35;
}

.asset-action-cell .secondary-button,
.manual-review-cell .role-review-button,
.production-card .prompt-tools button {
  min-height: 24px;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 5px;
  background: rgba(67, 215, 198, 0.08);
  color: #d9fffb;
  padding: 0 6px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

.asset-action-cell .secondary-button,
.manual-review-cell .role-review-button {
  min-width: 72px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
}

.asset-action-cell .delete-asset-button {
  border-color: rgba(248, 113, 113, 0.42);
  color: #ffd5d5;
  background: rgba(127, 29, 29, 0.22);
}

body[data-role="staff"] .role-review-button,
body[data-role="staff"] .role-manager-visible,
body[data-role="staff"] .role-admin-visible,
body[data-role="project_manager"] .role-admin-visible {
  display: none !important;
}

body[data-role="staff"] .asset-action-cell {
  align-content: center;
}

.production-card .prompt-lang-label {
  display: block;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cyan);
  padding: 0;
  font-size: 12px;
  font-weight: 800;
}

.production-card.asset-ready > :not(.prompt-editor):not(.thumb-cell):not(.thumb-button),
.production-card.asset-ready .prompt-tools {
  background: linear-gradient(180deg, #0b3a2d 0%, #06281f 100%);
}

.production-card.asset-pending > :not(.prompt-editor):not(.thumb-cell):not(.thumb-button),
.production-card.asset-pending .prompt-tools {
  background: linear-gradient(180deg, #7a6116 0%, #51420f 100%);
}

.production-card.asset-ready > .asset-check {
  border-left: 4px solid #22c55e;
}

.production-card.asset-pending > .asset-check {
  border-left: 4px solid #fde047;
}

.production-card > textarea.review-suggestion-cell,
.production-card .prompt-editor textarea {
  background: #ffffff;
  color: #111817;
  border: 1px solid #94a3a0;
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(67, 215, 198, 0.08), 0 0 0 1px rgba(2, 7, 8, 0.18);
}

.production-card.asset-ready > textarea.review-suggestion-cell,
.production-card.asset-pending > textarea.review-suggestion-cell {
  background: #ffffff;
  color: #111817;
}

#assetsView .production-card.asset-ready > textarea.review-suggestion-cell,
#assetsView .production-card.asset-pending > textarea.review-suggestion-cell {
  background: #ffffff;
  color: #111817;
  border: 1px solid #94a3a0;
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(67, 215, 198, 0.08), 0 0 0 1px rgba(2, 7, 8, 0.18);
}

.production-card > textarea.review-suggestion-cell:focus,
.production-card .prompt-editor textarea:focus {
  border-color: var(--cyan);
  border-left-color: #2db9ff;
  box-shadow: inset 0 0 0 1px rgba(67, 215, 198, 0.32), 0 0 0 2px rgba(67, 215, 198, 0.18);
}

.thumb-cell {
  position: relative;
  width: 160px;
  height: 160px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: #070a0b;
}

.thumb-button {
  position: relative;
  display: block;
  width: 160px;
  height: 160px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  outline: 0;
  background: #070a0b;
  padding: 0;
  cursor: pointer;
}

.asset-thumb {
  width: 160px;
  height: 160px;
  object-fit: cover;
}

.thumb-multiview {
  position: absolute;
  inset: 0;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  background: #050707;
  padding: 2px;
}

.thumb-multiview span {
  position: relative;
  display: grid;
  place-items: end start;
  overflow: hidden;
  background-image: var(--thumb-image);
  background-position: center;
  background-size: cover;
  color: #f8fafc;
  font-size: 10px;
  font-weight: 900;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  padding: 4px;
}

.thumb-multiview span:nth-child(2) {
  background-position: 42% center;
}

.thumb-multiview span:nth-child(3) {
  background-position: 58% center;
}

.thumb-multiview span:nth-child(4) {
  background-position: center 38%;
}

.thumb-button.is-multiview .asset-thumb {
  opacity: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050707;
}

.thumb-button.is-multiview .thumb-multiview {
  display: none;
}

.thumb-view-toggle {
  grid-column: 12;
  grid-row: 1 / 3;
  align-self: end;
  justify-self: end;
  margin: 0 6px 6px 0;
  z-index: 2;
  min-height: 24px;
  border: 1px solid rgba(67, 215, 198, 0.58);
  border-radius: 5px;
  background: rgba(5, 15, 16, 0.86);
  color: #d9fffb;
  padding: 0 7px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.thumb-view-toggle:hover {
  border-color: var(--cyan);
  background: rgba(67, 215, 198, 0.18);
}

.asset-preview-panel {
  position: sticky;
  top: 88px;
  z-index: 45;
  width: 1058px;
}

.asset-preview-head-actions {
  display: flex;
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  flex: 0 0 auto;
}

.asset-preview-save-button {
  min-width: 106px;
  padding-inline: 14px;
  white-space: nowrap;
}

.large-preview-frame {
  position: relative;
  width: 1024px;
  height: 576px;
  background: #050707;
}

.large-preview-frame.is-loading .large-preview-image {
  opacity: 0;
  pointer-events: none;
}

.large-preview-frame.is-loading::after {
  content: "图片加载中";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 8px;
  color: #94a3b8;
  font-size: 15px;
  background: #050707;
}

.large-preview-frame.is-multiview {
  height: 576px;
}

.asset-preview-panel .large-preview-image {
  width: 1024px;
  height: 576px;
  max-width: none;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 8px;
  object-fit: contain;
  cursor: zoom-in;
}

.large-preview-multiview {
  display: none;
  width: 1024px;
  height: 576px;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 8px;
  background: #050707;
  padding: 6px;
}

.large-preview-multiview span {
  position: relative;
  display: grid;
  place-items: end start;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background-image: var(--large-preview-image);
  background-position: center;
  background-size: cover;
  color: #f8fafc;
  font-size: 22px;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.88);
  padding: 18px;
}

.large-preview-multiview span:nth-child(2) {
  background-position: 42% center;
}

.large-preview-multiview span:nth-child(3) {
  background-position: 58% center;
}

.large-preview-multiview span:nth-child(4) {
  background-position: center 38%;
}

.large-preview-frame.is-multiview .large-preview-image {
  display: block;
  width: 1024px;
  height: 576px;
  object-fit: contain;
}

.large-preview-frame.is-multiview .large-preview-multiview {
  display: none;
}

.image-tool-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.image-tool-workbench {
  display: grid;
  grid-template-columns: 400px 260px minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - 154px);
  min-height: 620px;
}

.image-tool-side-panel {
  min-height: 0;
  overflow-y: auto;
}

.is-general-tool #imageToolModeTitle {
  display: none;
}

.image-tool-workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(67, 215, 198, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.03), rgba(255, 255, 255, 0.01)), var(--panel);
  overflow: hidden;
}

.image-tool-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
}

.image-tool-toolbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.image-tool-toolbar strong,
.image-tool-toolbar span {
  display: block;
}

.image-tool-toolbar strong {
  color: var(--text);
  font-size: 15px;
}

.image-tool-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.image-tool-toolbar-main .secondary-button {
  min-height: 30px;
  padding: 0 12px;
  white-space: nowrap;
}

.image-tool-viewer {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.image-tool-canvas {
  display: inline-flex;
  min-width: 100%;
  min-height: 100%;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 12px;
}

.image-tool-field em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-align: right;
}

.image-tool-model-section,
.image-tool-reference-section,
.image-tool-quick-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.image-tool-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-tool-section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mini-tool-button {
  height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #091011;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.image-tool-model-list {
  display: grid;
  gap: 8px;
}

.image-tool-model {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #091011;
  cursor: pointer;
  padding: 10px 12px;
}

.image-tool-model.is-selected {
  border-color: rgba(67, 215, 198, 0.68);
  background: rgba(67, 215, 198, 0.1);
}

.image-tool-model input {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
}

.image-tool-model strong,
.image-tool-model em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-tool-model strong {
  color: var(--text);
  font-size: 13px;
}

.image-tool-model em {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.image-tool-reference-actions {
  display: flex;
  gap: 8px;
}

.image-tool-reference-actions .secondary-button {
  flex: 1 1 0;
}

.image-tool-reference-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.image-tool-reference-box {
  display: none;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #091011;
  padding: 8px;
}

.image-tool-reference-box.is-active {
  display: block;
}

.image-tool-reference-list {
  display: grid;
  gap: 7px;
}

.image-tool-reference-item {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(137, 166, 164, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
  padding: 7px;
}

.image-tool-reference-item.is-primary {
  border-color: rgba(67, 215, 198, 0.52);
  background: rgba(67, 215, 198, 0.075);
}

.image-tool-reference-item img {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
}

.image-tool-reference-copy {
  min-width: 0;
}

.image-tool-reference-copy strong,
.image-tool-reference-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-tool-reference-copy strong {
  color: var(--text);
  font-size: 12px;
}

.image-tool-reference-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.image-tool-reference-primary-badge {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 3px;
  border-radius: 999px;
  background: rgba(67, 215, 198, 0.16);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 6px;
}

.image-tool-reference-remove {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: #071011;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  padding: 0;
}

.image-tool-reference-remove:hover {
  border-color: rgba(255, 112, 112, 0.5);
  color: #ff9d9d;
}

.image-tool-asset-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(1, 6, 7, 0.68);
  padding: 24px;
}

.image-tool-asset-picker-modal.is-open {
  display: flex;
}

.image-tool-asset-picker-panel {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 48px));
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 8px;
  background: #081011;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.image-tool-asset-picker-panel .modal-head,
.image-tool-asset-picker-panel .modal-actions {
  padding: 14px 16px;
}

.image-tool-asset-picker-project {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line-soft);
  padding: 10px 16px;
  background: #0a1314;
}

.image-tool-asset-picker-project[hidden] {
  display: none;
}

.image-tool-asset-picker-project span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.image-tool-asset-picker-project select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(67, 215, 198, 0.32);
  border-radius: 7px;
  background: #071011;
  color: var(--text);
  padding: 0 10px;
}

.image-tool-asset-picker-stage {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  padding: 10px 16px;
  background: #0a1314;
}

.image-tool-asset-picker-stage[hidden] {
  display: none;
}

.image-tool-asset-picker-stage legend {
  float: left;
  width: 76px;
  margin: 0 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.image-tool-asset-picker-stage label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.image-tool-asset-picker-stage input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--cyan);
}

.image-tool-asset-picker-tabs {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 16px;
  background: #0b1516;
}

.image-tool-asset-picker-tabs button {
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #091011;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  padding: 0 14px;
}

.image-tool-asset-picker-tabs button.is-active {
  border-color: rgba(67, 215, 198, 0.72);
  background: rgba(67, 215, 198, 0.12);
  color: #d7fffa;
}

.image-tool-asset-picker-list {
  display: grid;
  flex: 1 1 auto;
  min-height: 180px;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding: 14px 16px;
}

.image-tool-asset-picker-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0b1314;
  cursor: pointer;
  padding: 10px 12px;
}

.image-tool-asset-picker-option:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.72);
  background: rgba(67, 215, 198, 0.1);
}

.image-tool-asset-picker-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.image-tool-asset-picker-option strong,
.image-tool-asset-picker-option em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-tool-asset-picker-option strong {
  color: var(--text);
  font-size: 14px;
}

.image-tool-asset-picker-option em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.image-tool-asset-picker-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.image-tool-quick-actions .primary-button,
.image-tool-quick-actions .secondary-button {
  width: 100%;
}

.image-tool-quick-actions .image-tool-action-button {
  border-color: rgba(67, 215, 198, 0.5);
  background: linear-gradient(135deg, #28c8b8, #71d66f);
  color: #06100f;
}

#imageToolView.is-general-tool .image-tool-general-shell {
  display: none;
}

#imageToolView.is-asset-tool .image-tool-general-shell {
  display: none;
}

#imageToolView.is-general-tool .image-tool-asset-shell,
#imageToolView.is-asset-tool .image-tool-asset-shell {
  display: block;
}

.image-tool-general-shell {
  min-height: calc(100vh - 112px);
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(67, 215, 198, 0.14);
  border-radius: 8px;
  background: #070b0c;
}

.image-tool-console,
.image-tool-results-panel {
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.035), rgba(255, 255, 255, 0.01)), var(--panel);
}

.image-tool-context {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.image-tool-context div {
  min-height: 58px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #091011;
  padding: 9px 10px;
}

.image-tool-context span,
.image-tool-field span,
.image-tool-controls span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-tool-context strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-tool-field {
  display: grid;
  gap: 8px;
}

.image-tool-field-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.image-tool-field-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.image-tool-prompt-expand-button {
  height: 28px;
}

.image-tool-field.is-expanded {
  position: fixed;
  z-index: 120;
  top: 50%;
  left: 50%;
  width: min(920px, calc(100vw - 64px));
  height: min(680px, calc(100vh - 64px));
  transform: translate(-50%, -50%);
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid rgba(67, 215, 198, 0.58);
  border-radius: 10px;
  background: #081011;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7), 0 28px 80px rgba(0, 0, 0, 0.72);
  padding: 18px;
}

.image-tool-field.is-expanded textarea {
  min-height: 0;
  height: 100%;
  resize: none;
  font-size: 16px;
  line-height: 1.75;
}

.image-tool-field textarea {
  min-height: 178px;
  resize: vertical;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 8px;
  background: #080f10;
  color: #d7e2df;
  padding: 14px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  outline: none;
}

.image-tool-field textarea:focus {
  border-color: rgba(67, 215, 198, 0.62);
  box-shadow: 0 0 0 2px rgba(67, 215, 198, 0.12);
}

.image-tool-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.image-tool-controls label {
  display: grid;
  gap: 8px;
}

.image-tool-controls select,
.image-tool-controls input {
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #091011;
  color: var(--text);
  padding: 0 10px;
  font-family: inherit;
}

.image-tool-output-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.image-tool-output-options fieldset {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
}

.image-tool-output-options legend {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 0 4px;
}

.image-tool-radio-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.image-tool-radio-group label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 32px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #091011;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.image-tool-radio-group label:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.72);
  background: rgba(67, 215, 198, 0.13);
  color: #d7fffa;
}

.image-tool-radio-group input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.image-tool-history-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(67, 215, 198, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.03), rgba(255, 255, 255, 0.01)), var(--panel);
  overflow: hidden;
}

.image-tool-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 12px;
}

.image-tool-history-head strong,
.image-tool-history-head span {
  display: block;
}

.image-tool-history-head strong {
  color: var(--text);
  font-size: 14px;
}

.image-tool-history-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.image-tool-history-list {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.image-tool-history-card {
  display: grid;
  width: 100%;
  max-width: 240px;
  gap: 6px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #091011;
  color: var(--text);
  cursor: pointer;
  padding: 7px;
  text-align: left;
}

.image-tool-history-card:hover,
.image-tool-history-card:focus-visible {
  border-color: rgba(67, 215, 198, 0.7);
  outline: none;
}

.image-tool-history-card img {
  display: block;
  width: 100%;
  max-height: 240px;
  border-radius: 5px;
  background: #0f172a;
  object-fit: contain;
}

.image-tool-history-card.is-landscape img {
  aspect-ratio: 2 / 1;
}

.image-tool-history-card.is-portrait {
  max-width: 176px;
}

.image-tool-history-card.is-portrait img {
  aspect-ratio: 2 / 3;
}

.image-tool-history-card.is-square img {
  aspect-ratio: 1 / 1;
}

.image-tool-history-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-tool-history-empty {
  display: grid;
  width: 100%;
  min-height: 160px;
  place-items: center;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.image-tool-history-menu {
  position: fixed;
  z-index: 140;
  display: none;
  min-width: 132px;
  border: 1px solid rgba(67, 215, 198, 0.38);
  border-radius: 8px;
  background: #081011;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  padding: 5px;
}

.image-tool-history-menu.is-open {
  display: block;
}

.image-tool-history-menu button {
  width: 100%;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  padding: 0 10px;
}

.image-tool-history-menu button:hover {
  background: rgba(67, 215, 198, 0.13);
  color: #d7fffa;
}

.image-tool-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 310px;
}

.image-tool-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 310px;
  place-content: center;
  gap: 8px;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #080d0e;
  color: var(--muted);
  text-align: center;
}

.image-tool-empty strong {
  color: var(--text);
}

.image-result-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #091011;
  padding: 10px;
}

.image-result-card.is-selected {
  border-color: rgba(67, 215, 198, 0.72);
  box-shadow: 0 0 0 2px rgba(67, 215, 198, 0.12);
}

.image-result-card button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.image-result-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
}

.image-result-card strong,
.image-result-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-result-card strong {
  color: var(--text);
  font-size: 13px;
}

.image-result-card span {
  color: var(--muted);
  font-size: 12px;
}

.image-tool-canvas .image-result-card {
  width: min(520px, calc(100vw - 48px), calc(62vh * var(--image-result-ratio, 1.777778)));
  min-height: 0;
  flex: 0 0 auto;
  grid-template-rows: auto auto auto auto;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.image-result-head,
.image-result-info,
.image-result-actions {
  padding: 12px 14px;
}

.image-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.image-result-head strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-result-image-button,
.image-result-body {
  display: grid;
  min-height: 320px;
  place-items: center;
  background: #050809;
  padding: 12px;
}

.image-result-image-button img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  background: #ffffff;
}

.image-tool-canvas .image-result-image-button {
  min-height: 0;
  padding: 0;
  align-self: start;
  background: #ffffff;
}

.image-result-info {
  border-top: 1px solid var(--line-soft);
}

.image-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
}

.image-result-error {
  color: #ffb4a8;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  word-break: break-word;
}

#assetsView.hide-thumbnails .thumb-cell,
#assetsView.hide-thumbnails .thumb-button,
#assetsView.hide-thumbnails .thumb-view-toggle {
  display: none;
}

#assetsView.hide-thumbnails .production-card {
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px minmax(124px, 1fr);
  min-width: 0;
}

#assetsView.hide-thumbnails .production-row-head {
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px minmax(124px, 1fr);
}

#assetsView.hide-thumbnails .production-row-head span:last-child {
  display: none;
}

.image-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: none;
  place-items: center;
  overflow: auto;
  background: rgba(0, 0, 0, 0.82);
  padding: 40px;
}

.image-modal.is-open {
  display: grid;
}

.image-modal img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1920px, calc(100vw - 80px));
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border: 1px solid rgba(67, 215, 198, 0.34);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.image-modal-close {
  position: fixed;
  top: 18px;
  right: 18px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #11191b;
  color: var(--text);
  padding: 0 14px;
}

.image-modal-caption {
  color: #dce8e5;
  font-size: 13px;
}

.video-playback-modal {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.84);
  padding: 34px;
}

.video-playback-modal.is-open {
  display: grid;
}

.video-playback-panel {
  position: relative;
  display: grid;
  width: min(760px, calc(100vw - 68px));
  max-height: calc(100vh - 68px);
  border: 1px solid rgba(67, 215, 198, 0.3);
  border-radius: 8px;
  background: #071011;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-playback-modal.is-landscape .video-playback-panel {
  width: min(1120px, calc(100vw - 68px));
}

.video-playback-panel .modal-head {
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 170px 14px 16px;
}

.video-playback-download {
  position: absolute;
  top: 10px;
  right: 54px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.video-playback-download[hidden] {
  display: none;
}

#videoPlaybackModalClose {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.video-playback-stage {
  display: grid;
  max-height: calc(100vh - 180px);
  place-items: center;
  background: #020404;
  padding: 14px;
}

.video-playback-stage video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 210px);
  object-fit: contain;
  background: #000;
}

.project-modal {
  position: fixed;
  z-index: 35;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(1, 5, 7, 0.72);
  backdrop-filter: blur(12px);
  padding: 24px;
}

.project-modal.is-open {
  display: grid;
}

.system-dialog {
  position: fixed;
  z-index: 220;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(1, 5, 7, 0.76);
  backdrop-filter: blur(10px);
  padding: 20px;
}

.system-dialog.is-open {
  display: grid;
}

.system-dialog-panel {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  width: min(460px, calc(100vw - 40px));
  max-height: min(520px, calc(100vh - 40px));
  border: 1px solid rgba(67, 215, 198, 0.3);
  border-radius: 8px;
  outline: none;
  background: #091112;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(67, 215, 198, 0.04) inset;
  padding: 22px;
}

.system-dialog-panel:focus-visible {
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 0 2px rgba(67, 215, 198, 0.35);
}

.system-dialog-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(67, 215, 198, 0.42);
  border-radius: 50%;
  background: rgba(67, 215, 198, 0.1);
  color: #66e7d8;
  font-size: 20px;
  font-weight: 900;
}

.system-dialog-copy {
  min-width: 0;
  padding-right: 24px;
}

.system-dialog-copy h3 {
  margin: 1px 0 8px;
  color: var(--text);
  font-size: 17px;
  letter-spacing: 0;
}

.system-dialog-copy p {
  max-height: 300px;
  margin: 0;
  overflow: auto;
  color: #b8c8c5;
  font-size: 14px;
  line-height: 1.65;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.system-dialog-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 196, 82, 0.34);
  border-radius: 10px;
  background: rgba(255, 196, 82, 0.08);
  color: var(--text-primary);
  line-height: 1.55;
  cursor: pointer;
}

.system-dialog-checkbox[hidden] {
  display: none;
}

.system-dialog-choice-groups {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.system-dialog:has(.system-dialog-choice-groups:not([hidden])) .system-dialog-panel {
  width: min(680px, calc(100vw - 40px));
  max-height: min(680px, calc(100vh - 40px));
}

.system-dialog-choice-groups[hidden] {
  display: none;
}

.system-dialog-choice-group {
  min-width: 0;
  margin: 0;
  padding: 11px 12px 12px;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 10px;
  background: rgba(12, 35, 34, 0.58);
}

.system-dialog-choice-group legend {
  padding: 0 5px;
  color: #a9bab7;
  font-size: 12px;
}

.system-dialog-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.system-dialog-choice-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid rgba(118, 154, 149, 0.24);
  border-radius: 8px;
  background: rgba(4, 18, 18, 0.7);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  cursor: pointer;
}

.system-dialog-choice-options label:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.68);
  background: rgba(39, 150, 137, 0.2);
}

.system-dialog-choice-options label.has-thumbnail {
  min-height: 88px;
  align-items: center;
}

.system-dialog-choice-thumbnail {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid rgba(118, 154, 149, 0.28);
  border-radius: 8px;
  background: #071110;
  object-fit: cover;
}

.system-dialog-choice-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.system-dialog-choice-copy strong,
.system-dialog-choice-copy small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.system-dialog-choice-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.system-dialog-choice-options input {
  width: 16px;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.system-dialog-choice-options span {
  min-width: 0;
  overflow-wrap: normal;
  word-break: keep-all;
}

@media (max-width: 640px) {
  .system-dialog-choice-options {
    grid-template-columns: 1fr;
  }
}

.system-dialog-checkbox input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.system-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}

.system-dialog-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.system-dialog-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 5px;
}

.system-dialog-actions button {
  width: auto;
  min-width: 88px;
}

.system-dialog.is-success .system-dialog-icon {
  border-color: rgba(72, 209, 142, 0.48);
  background: rgba(72, 209, 142, 0.11);
  color: #66dda0;
}

.system-dialog.is-warning .system-dialog-panel,
.system-dialog.is-danger .system-dialog-panel {
  border-color: rgba(245, 190, 76, 0.34);
}

.system-dialog.is-warning .system-dialog-icon,
.system-dialog.is-danger .system-dialog-icon {
  border-color: rgba(245, 190, 76, 0.5);
  background: rgba(245, 190, 76, 0.1);
  color: #f5c45f;
}

.system-dialog.is-error .system-dialog-panel {
  border-color: rgba(245, 104, 104, 0.38);
}

.system-dialog.is-error .system-dialog-icon {
  border-color: rgba(245, 104, 104, 0.54);
  background: rgba(245, 104, 104, 0.1);
  color: #ff8d8d;
}

.system-dialog-confirm-danger {
  border-color: rgba(244, 94, 94, 0.62) !important;
  background: #b83c3c !important;
  color: #fff !important;
}

@media (max-width: 560px) {
  .system-dialog-panel {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
  }

  .system-dialog-icon {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
}

.project-modal-panel {
  width: min(760px, 100%);
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.055), rgba(255, 255, 255, 0.012)), #0a1011;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  padding: 18px;
}

.new-project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.new-project-grid label {
  display: grid;
  gap: 8px;
}

.new-project-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.new-project-grid input,
.new-project-grid select,
.new-project-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: #080f10;
  color: var(--text);
  padding: 0 12px;
  font-family: inherit;
}

.new-project-grid input,
.new-project-grid select {
  height: 38px;
}

.new-project-grid textarea {
  min-height: 112px;
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}

.new-project-wide {
  grid-column: 1 / -1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  width: auto;
}

.work-log-credit-grant-panel {
  width: min(620px, 100%);
}

.work-log-credit-grant-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.work-log-credit-grant-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(150px, 0.5fr);
  gap: 14px;
  margin-top: 18px;
}

.work-log-credit-grant-form label {
  display: grid;
  gap: 8px;
}

.work-log-credit-grant-form label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.work-log-credit-grant-form select,
.work-log-credit-grant-form input {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 7px;
  background: #080f10;
  color: var(--text);
  padding: 0 12px;
  font-family: inherit;
}

.work-log-credit-grant-wide {
  grid-column: 1 / -1;
}

.work-log-credit-grant-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.work-log-credit-grant-status[data-tone="error"] {
  color: #ff9d9d;
}

.work-log-credit-grant-status[data-tone="success"] {
  color: #8cf0c7;
}

.work-log-credit-grant-actions {
  justify-content: space-between;
}

@media (max-width: 620px) {
  .work-log-credit-grant-form {
    grid-template-columns: 1fr;
  }

  .work-log-credit-grant-wide {
    grid-column: auto;
  }
}

.video-prompt-generation-panel {
  display: flex;
  flex-direction: column;
  width: min(1360px, calc(100vw - 20px));
  height: min(940px, calc(100vh - 20px));
  max-height: calc(100vh - 20px);
  overflow-x: hidden;
  overflow-y: auto;
}

.video-prompt-generation-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.video-prompt-generation-panel .background-task-section {
  flex: 1 1 auto;
  min-height: 180px;
  grid-template-rows: auto minmax(0, 1fr);
}

.video-prompt-generation-panel > .modal-actions {
  position: sticky;
  z-index: 4;
  bottom: -18px;
  flex: 0 0 auto;
  margin: 12px -18px -18px;
  border-top: 1px solid rgba(67, 215, 198, 0.2);
  background: linear-gradient(180deg, rgba(10, 16, 17, 0.94), #0a1011 34%);
  padding: 12px 18px 18px;
}

.video-prompt-generation-panel .background-task-list {
  min-height: 0;
  max-height: none;
}

.video-prompt-generation-panel .background-task-episodes {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.video-prompt-range-form {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  margin-top: 18px;
}

.video-prompt-range-form label {
  display: grid;
  gap: 8px;
}

.video-prompt-range-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.video-prompt-range-form select {
  height: 38px;
  width: 100%;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: #080f10;
  color: var(--text);
  padding: 0 12px;
  font-family: inherit;
}

.video-prompt-contract-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 9px;
  background: rgba(6, 14, 15, 0.72);
  padding: 12px;
}

.video-prompt-contract-title,
.video-prompt-contract-grid,
.video-prompt-priority-option,
.video-prompt-priority-option > span,
.video-prompt-duration-pair {
  display: flex;
  align-items: center;
}

.video-prompt-contract-title {
  justify-content: space-between;
  gap: 14px;
}

.video-prompt-contract-title strong {
  font-size: 13px;
}

.video-prompt-contract-title span,
.video-prompt-contract-grid label > span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.video-prompt-execution-row {
  display: grid;
  grid-template-columns: minmax(280px, 330px) minmax(420px, 1fr) minmax(150px, 190px);
  align-items: stretch;
  gap: 12px;
}

.video-prompt-control-group,
.video-prompt-profile-field,
.video-prompt-text-model-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 8px;
  background: #081011;
  padding: 8px 10px;
}

.video-prompt-control-label,
.video-prompt-execution-row > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.video-prompt-text-model-field select {
  width: 100%;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #0d1516;
  color: var(--text);
  padding: 0 9px;
}

.video-prompt-group-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.video-prompt-group-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: rgba(67, 215, 198, 0.035);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.video-prompt-group-choice span,
.video-prompt-profile-choice strong,
.video-prompt-profile-choice small {
  white-space: nowrap;
}

.video-prompt-group-choice:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.78);
  background: rgba(67, 215, 198, 0.16);
  color: var(--text);
}

.video-prompt-group-choice:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.video-prompt-group-choice input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.video-prompt-execution-row > small {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(5, 10, 11, 0.68);
  white-space: normal;
  grid-column: 1 / -1;
}

.video-prompt-profile-field {
  padding: 10px;
}

.video-prompt-profile-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.video-prompt-profile-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(5, 10, 11, 0.68);
  padding: 10px 12px;
  cursor: pointer;
}

.video-prompt-profile-choice:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.55);
  background: rgba(22, 88, 82, 0.22);
  box-shadow: inset 3px 0 0 var(--accent);
}

.video-prompt-profile-choice input {
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--accent);
}

.video-prompt-profile-choice > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.video-prompt-profile-choice strong {
  color: var(--text);
  font-size: 13px;
}

.video-prompt-profile-choice small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.video-prompt-contract-grid {
  gap: 12px;
}

.video-prompt-contract-grid > label {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 7px;
  padding: 8px 10px;
}

.video-prompt-duration-pair {
  gap: 7px;
}

.video-prompt-duration-pair input,
.video-prompt-priority-option select {
  height: 32px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  background: #0d1516;
  color: var(--text);
  padding: 0 8px;
}

.video-prompt-duration-pair input {
  width: 92px;
}

.video-prompt-duration-pair b {
  color: var(--muted);
  font-weight: 400;
}

.video-prompt-priority-option {
  gap: 10px;
}

.video-prompt-priority-option > span {
  gap: 7px;
}

.video-prompt-priority-option input {
  width: 15px;
  height: 15px;
  margin: 0;
}

.video-prompt-priority-option select {
  min-width: 122px;
}

.video-segment-modal-panel {
  width: min(540px, calc(100vw - 36px));
}

.video-segment-modal-panel .panel-head p,
.video-segment-delete-warning {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.video-segment-modal-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.video-segment-modal-form label {
  display: grid;
  gap: 8px;
}

.video-segment-modal-form label.is-wide,
.video-segment-modal-form label:only-child {
  grid-column: 1 / -1;
}

.video-segment-modal-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.video-segment-modal-form select,
.video-segment-modal-form input {
  height: 38px;
  width: 100%;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: #080f10;
  color: var(--text);
  padding: 0 12px;
  font-family: inherit;
}

.video-reference-add-panel {
  width: min(560px, calc(100vw - 36px));
}

.video-reference-add-panel .panel-head p {
  max-width: 420px;
}

.video-reference-add-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.video-reference-add-form label {
  display: grid;
  gap: 8px;
}

.video-reference-type-radios {
  display: flex;
  gap: 10px;
  align-items: center;
}

.video-reference-type-radios label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 999px;
  background: rgba(67, 215, 198, 0.08);
  color: var(--text);
  font-weight: 900;
}

.video-reference-type-radios input {
  width: auto;
  height: auto;
  accent-color: var(--accent);
}

.video-reference-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.video-reference-search-row strong {
  display: grid;
  height: 38px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.video-reference-add-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.video-reference-add-form input,
.video-reference-add-form select {
  height: 38px;
  width: 100%;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: #080f10;
  color: var(--text);
  padding: 0 12px;
  font-family: inherit;
}

.danger-button {
  border-color: rgba(255, 132, 102, 0.45);
  background: rgba(255, 132, 102, 0.16);
  color: #ffd1c6;
}

.video-prompt-range-separator {
  display: grid;
  height: 38px;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.video-prompt-progress {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.video-prompt-progress[hidden] {
  display: none;
}

.video-prompt-progress-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 999px;
  background: rgba(116, 132, 158, 0.18);
}

.video-prompt-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  transition: width 0.2s ease;
}

.video-prompt-progress strong {
  color: var(--muted);
  font-size: 12px;
}

.asset-extraction-preview-panel {
  width: min(980px, calc(100vw - 36px));
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.asset-extraction-preview-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.asset-extraction-preview-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.asset-extraction-preview-summary span {
  display: grid;
  gap: 5px;
  min-height: 58px;
  border: 1px solid rgba(67, 215, 198, 0.16);
  border-radius: 7px;
  background: #0b1112;
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
  font-weight: 800;
}

.asset-extraction-preview-summary strong {
  color: var(--text);
  font-size: 18px;
}

.asset-extraction-preview-rule {
  margin: 12px 0 0;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 7px;
  background: rgba(67, 215, 198, 0.08);
  color: #cae5df;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.55;
}

.asset-extraction-draft-status {
  min-height: 18px;
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-extraction-draft-status[data-tone="saved"] {
  color: #86e6d7;
}

.asset-extraction-draft-status[data-tone="saving"] {
  color: #ffe7ae;
}

.asset-extraction-draft-status[data-tone="error"] {
  color: #ffb8a8;
}

.asset-extraction-preview-body {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.asset-extraction-preview-filter-tabs {
  margin: 14px 0 0;
}

.asset-extraction-preview-filter-tabs button {
  min-width: 108px;
}

.asset-extraction-preview-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.asset-extraction-preview-group.is-hidden {
  display: none;
}

.asset-extraction-preview-group h4 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
}

.asset-extraction-status-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.asset-extraction-status-group:last-child {
  border-bottom: 0;
}

.asset-extraction-status-title {
  min-height: 34px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  justify-content: space-between;
  gap: 12px;
}

.asset-extraction-status-bulk {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.asset-extraction-status-bulk label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.asset-extraction-status-bulk input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--cyan);
}

#extractAssetsButton {
  width: 124px;
  min-width: 124px;
  padding-inline: 22px;
}

.background-task-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(45, 212, 191, 0.38);
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.13);
  color: #8ff4df;
  font-size: 12px;
  white-space: nowrap;
}

.background-task-badge[data-tone="failed"] {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(185, 28, 28, 0.15);
  color: #fecaca;
}

.background-task-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.background-task-section-head,
.background-task-card-head,
.background-task-card-actions,
.background-task-episode {
  display: flex;
  align-items: center;
}

.background-task-section-head,
.background-task-card-head {
  justify-content: space-between;
  gap: 12px;
}

.background-task-card-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.background-task-section-head > div {
  display: grid;
  gap: 3px;
}

.background-task-refresh {
  display: inline-flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px !important;
}

.background-task-section-head small,
.background-task-card small,
.background-task-empty {
  color: var(--muted);
}

.background-task-list {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 3px;
}

.background-task-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(7, 17, 20, 0.72);
}

.background-task-card.is-active {
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.08);
}

.background-task-card.is-failed {
  border-color: rgba(248, 113, 113, 0.42);
}

#assetExtractionTaskList .background-task-card.is-pending-storage {
  border-color: rgba(250, 204, 21, 0.58);
  background: rgba(161, 98, 7, 0.16);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.08);
}

#assetExtractionTaskList .background-task-card.is-applied {
  border-color: rgba(74, 222, 128, 0.42);
  background: rgba(21, 128, 61, 0.12);
}

#videoPromptTaskList .background-task-card.is-pending-storage {
  border-color: rgba(250, 204, 21, 0.58);
  background: rgba(161, 98, 7, 0.16);
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, 0.08);
}

#videoPromptTaskList .background-task-card.is-applied {
  border-color: rgba(74, 222, 128, 0.42);
  background: rgba(21, 128, 61, 0.12);
}

.background-task-title {
  display: grid;
  gap: 3px;
}

.background-task-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.13);
  color: #dbe7e5;
  font-size: 12px;
}

.background-task-card.is-active .background-task-status {
  background: rgba(13, 148, 136, 0.18);
  color: #8ff4df;
}

.background-task-card.is-failed .background-task-status {
  background: rgba(185, 28, 28, 0.18);
  color: #fecaca;
}

#assetExtractionTaskList .background-task-card.is-pending-storage .background-task-status {
  background: rgba(202, 138, 4, 0.24);
  color: #fde68a;
}

#assetExtractionTaskList .background-task-card.is-applied .background-task-status {
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
}

#videoPromptTaskList .background-task-card.is-pending-storage .background-task-status {
  background: rgba(202, 138, 4, 0.24);
  color: #fde68a;
}

#videoPromptTaskList .background-task-card.is-applied .background-task-status {
  background: rgba(22, 163, 74, 0.2);
  color: #86efac;
}

.background-task-progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.13);
}

.background-task-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #13b89a, #49ddb9);
  transition: width 180ms ease;
}

.background-task-agent-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #c7d8d5;
  font-size: 12px;
}

.background-task-agent-progress > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.background-task-agent-progress strong {
  color: #7de8d2;
}

.background-task-agent-progress small {
  flex: 0 0 auto;
  color: #91a9a5;
  font-variant-numeric: tabular-nums;
}

.quick-mode-remote-timing {
  margin: 0;
  color: #91a9a5;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .background-task-agent-progress {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .background-task-agent-progress > span {
    white-space: normal;
  }
}

#assetExtractionTaskList .background-task-card.is-pending-storage .background-task-progress-track > span {
  background: linear-gradient(90deg, #d97706, #facc15);
}

#assetExtractionTaskList .background-task-card.is-applied .background-task-progress-track > span {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

#videoPromptTaskList .background-task-card.is-pending-storage .background-task-progress-track > span {
  background: linear-gradient(90deg, #d97706, #facc15);
}

#videoPromptTaskList .background-task-card.is-applied .background-task-progress-track > span {
  background: linear-gradient(90deg, #16a34a, #4ade80);
}

.background-task-episodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.background-task-episode {
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
  font-size: 12px;
}

.background-task-episode[data-status="processing"] {
  color: #8ff4df;
  background: rgba(13, 148, 136, 0.14);
}

.background-task-episode[data-status="extracted"] {
  color: #fcd34d;
  background: rgba(202, 138, 4, 0.13);
}

.background-task-episode[data-status="completed"],
.background-task-episode[data-status="applied"] {
  color: #86efac;
  background: rgba(22, 163, 74, 0.14);
}

#assetExtractionTaskList .background-task-episode[data-status="pending"],
#assetExtractionTaskList .background-task-episode[data-status="processing"],
#assetExtractionTaskList .background-task-episode[data-status="retrying"],
#assetExtractionTaskList .background-task-episode[data-status="extracted"],
#assetExtractionTaskList .background-task-episode[data-status="completed"] {
  color: #fde68a;
  background: rgba(202, 138, 4, 0.16);
}

#assetExtractionTaskList .background-task-episode[data-status="applied"] {
  color: #86efac;
  background: rgba(22, 163, 74, 0.16);
}

#videoPromptTaskList .background-task-episode[data-status="pending"],
#videoPromptTaskList .background-task-episode[data-status="processing"],
#videoPromptTaskList .background-task-episode[data-status="retrying"],
#videoPromptTaskList .background-task-episode[data-status="completed"] {
  color: #fde68a;
  background: rgba(202, 138, 4, 0.16);
}

#videoPromptTaskList .background-task-episode[data-status="applied"] {
  color: #86efac;
  background: rgba(22, 163, 74, 0.16);
}

.background-task-episode[data-status="pending"] {
  color: #cbd5e1;
}

.background-task-episode[data-status="retrying"] {
  color: #93c5fd;
  background: rgba(37, 99, 235, 0.13);
}

.background-task-episode[data-status="failed"] {
  color: #fecaca;
}

.background-task-episode-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.background-task-episode-actions .compact-button {
  min-height: 25px;
  padding: 3px 8px;
  font-size: 11px;
}

.background-task-card-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.video-prompt-task-result {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 10px;
  background: rgba(4, 12, 14, 0.72);
}

.video-prompt-task-result[hidden] {
  display: none;
}

.video-prompt-task-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-prompt-task-result-head > div {
  display: grid;
  gap: 3px;
}

.video-prompt-task-result-head small,
.video-prompt-task-prompt > p {
  color: var(--muted);
}

.video-prompt-task-prompt-list {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.video-prompt-task-prompt {
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.07);
}

.video-prompt-task-prompt summary {
  cursor: pointer;
  font-weight: 800;
}

.video-prompt-task-prompt pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #dce7e4;
  font: inherit;
  line-height: 1.65;
}

.background-task-error {
  margin: 0;
  color: #fecaca;
  font-size: 12px;
  line-height: 1.5;
}

.modal-action-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .background-task-episodes {
    grid-template-columns: 1fr;
  }

  .video-prompt-generation-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }

  .video-prompt-contract-grid,
  .video-prompt-contract-title,
  .video-prompt-execution-row,
  .video-prompt-profile-choices {
    align-items: stretch;
    flex-direction: column;
  }

  .video-prompt-profile-choices {
    grid-template-columns: 1fr;
  }

  .video-prompt-execution-row {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  .video-prompt-generation-panel .background-task-episodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.asset-extraction-diff-row {
  display: grid;
  grid-template-columns: 64px 96px minmax(120px, 1fr) 72px minmax(130px, 1.1fr) minmax(130px, 1.1fr) minmax(160px, 1.4fr);
  gap: 8px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  color: #dce7e4;
  font-size: 12px;
}

.asset-extraction-diff-row:last-child {
  border-bottom: 0;
}

.asset-extraction-diff-row.is-head {
  min-height: 36px;
  background: rgba(67, 215, 198, 0.07);
  color: var(--muted);
  font-weight: 900;
}

.asset-extraction-diff-row.status-existing {
  background: rgba(255, 255, 255, 0.018);
}

.asset-extraction-diff-row.status-episode_changed {
  background: rgba(255, 196, 87, 0.065);
}

.asset-extraction-diff-row.status-variant_changed {
  background: rgba(113, 159, 255, 0.09);
}

.asset-extraction-diff-row.status-possible_duplicate {
  background: rgba(255, 132, 102, 0.07);
}

.asset-extraction-diff-row.status-added {
  background: rgba(67, 215, 198, 0.055);
}

.asset-extraction-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.asset-extraction-select {
  width: 15px;
  height: 15px;
  accent-color: var(--cyan);
}

.asset-extraction-auto-selected {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-extraction-variant-name {
  display: block;
  margin-top: 3px;
  color: #9fbaff;
  font-weight: 800;
}

.asset-extraction-logical-name {
  display: block;
  color: var(--text);
}

.asset-extraction-locator-wrap {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.asset-extraction-locator-wrap small {
  color: #9fbaff;
  font-size: 11px;
}

.asset-extraction-locator-input {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(113, 159, 255, 0.38);
  border-radius: 5px;
  background: #091011;
  color: var(--text);
  padding: 5px 7px;
  font: inherit;
}

.asset-extraction-locator-input:focus {
  border-color: #719fff;
  outline: 2px solid rgba(113, 159, 255, 0.18);
}

.asset-extraction-feature-compare {
  display: grid;
  gap: 3px;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.45;
}

.asset-version-profile,
.asset-version-reason {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.asset-extraction-action-wrap {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.asset-extraction-action-wrap select {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 5px;
  background: #0a1112;
  color: var(--text);
}

.asset-extraction-action-wrap small {
  color: var(--muted);
  line-height: 1.45;
}

.diff-status {
  display: inline-grid;
  min-width: 72px;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 900;
}

.diff-status.existing {
  border-color: rgba(145, 168, 164, 0.35);
  background: rgba(145, 168, 164, 0.12);
}

.diff-status.episode_changed {
  border-color: rgba(255, 196, 87, 0.45);
  background: rgba(255, 196, 87, 0.18);
  color: #ffe7ae;
}

.diff-status.variant_changed {
  border-color: rgba(113, 159, 255, 0.5);
  background: rgba(113, 159, 255, 0.14);
}

.diff-status.added {
  border-color: rgba(67, 215, 198, 0.4);
  background: rgba(67, 215, 198, 0.14);
}

.diff-status.possible_duplicate {
  border-color: rgba(255, 132, 102, 0.42);
  background: rgba(255, 132, 102, 0.14);
  color: #ffd1c6;
}

.asset-extraction-preview-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 16px;
  text-align: center;
}

.asset-review-panel {
  width: min(520px, calc(100vw - 36px));
}

.asset-review-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.asset-review-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.asset-review-choice {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0b1112;
  color: var(--text);
  padding: 0 12px;
  font-weight: 800;
}

.asset-review-reject-fields {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.asset-review-reject-fields[hidden] {
  display: none;
}

.asset-review-reject-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.asset-review-reject-fields textarea {
  min-height: 82px;
  border: 1px solid #94a3a0;
  border-left: 3px solid var(--cyan);
  border-radius: 6px;
  background: #ffffff;
  color: #111817;
  padding: 8px 10px;
  font-family: inherit;
  resize: vertical;
}

.asset-review-error {
  min-height: 18px;
  margin-top: 10px;
  color: #ffc8c8;
  font-size: 12px;
  font-weight: 800;
}

.studio-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 320px;
  gap: 14px;
}

.shot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shot-pill,
.review-item {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0c1213;
  color: #b7c5c2;
  text-align: left;
}

.shot-pill {
  min-height: 38px;
  padding: 0 12px;
}

.shot-pill.is-active,
.review-item.is-active {
  border-color: rgba(67, 215, 198, 0.3);
  background: rgba(67, 215, 198, 0.08);
  color: var(--text);
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.candidate-grid img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  object-fit: cover;
}

.prompt-panel textarea {
  min-height: 280px;
}

.prompt-panel .button-row {
  margin-top: 12px;
}

.video-preview-panel img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  object-fit: cover;
}

.timeline-bar {
  position: relative;
  height: 44px;
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(67, 215, 198, 0.22), rgba(230, 183, 90, 0.22)),
    #0c1213;
}

.timeline-bar span {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #edf3f0;
  font-size: 12px;
}

.control-grid {
  display: grid;
  gap: 13px;
}

.video-workbench {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.video-mode-stage {
  min-width: 0;
}

.video-current-episode.is-hidden {
  display: none;
}

.video-workbench.is-hidden {
  display: none;
}

.video-page-head {
  align-items: center;
  justify-content: flex-start;
  gap: 180px;
}

.video-view-mode-switch {
  display: flex;
  align-items: end;
  gap: 3px;
  width: fit-content;
  margin-bottom: 0;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.05), rgba(7, 12, 13, 0.2));
}

.video-view-mode-switch button {
  min-height: 42px;
  min-width: 136px;
  border: 1px solid rgba(67, 215, 198, 0.16);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.045), rgba(255, 255, 255, 0.01)), #0b1112;
  color: #aebcba;
  padding: 0 18px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
}

.video-view-mode-switch button.is-active {
  border-color: rgba(67, 215, 198, 0.68);
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.22), rgba(67, 215, 198, 0.08)), #0b1516;
  color: #eafffb;
  box-shadow: none;
  transform: translateY(1px);
}

.video-management-panel.is-hidden {
  display: none;
}

.video-management-panel {
  display: grid;
  gap: 14px;
}

.video-management-split-layout {
  display: grid;
  grid-template-columns: 1028px minmax(48px, 1fr);
  align-items: start;
  gap: 12px;
  overflow-x: clip;
}

.video-management-split-layout.has-editor {
  grid-template-columns: 1028px minmax(48px, 1fr);
}

.video-management-list-column {
  display: grid;
  width: 1028px;
  height: max-content;
  max-width: 1028px;
  align-self: start;
  min-width: 0;
  gap: 14px;
}

.video-management-overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  align-items: stretch;
  gap: 10px;
  width: 1028px;
  min-width: 1028px;
}

.video-management-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.86fr) minmax(0, 0.72fr) minmax(0, 1.6fr);
  gap: 8px;
}

.video-management-summary article {
  display: grid;
  min-height: 112px;
  gap: 6px;
  align-content: center;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(67, 215, 198, 0.055), transparent 58%), #0a1112;
  padding: 16px 18px;
}

.video-management-list-column .video-management-summary article {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
}

.video-management-list-column .video-management-summary strong {
  font-size: 21px;
}

.video-management-summary span,
.video-management-summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.video-management-list-column .video-management-summary span {
  font-size: 12px;
  font-weight: 800;
}

.video-management-summary strong {
  color: var(--text);
  font-size: 27px;
  font-variant-numeric: tabular-nums;
}

.video-management-library {
  width: 1028px;
  height: auto;
  min-height: 420px;
}

.video-management-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: end;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #111719;
  padding: 9px 10px;
}

.video-management-overview-row .video-management-summary {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 0.86fr) minmax(0, 0.72fr) minmax(0, 1.6fr);
}

.video-management-list-column .video-management-summary article.video-management-episode-allocation {
  display: grid;
  grid-template-columns: max-content minmax(72px, 1fr) max-content;
  align-content: center;
  align-items: center;
  gap: 9px;
}

.video-management-episode-meta {
  display: contents;
}

.video-management-episode-meta em,
.video-management-episode-meta small {
  grid-row: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-management-episode-meta small {
  grid-column: 3;
  color: var(--text);
}

.video-management-budget-meter {
  display: block;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.video-management-budget-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #43d7c6, #7af0df);
  transition: width 180ms ease;
}

.video-management-overview-row .video-management-toolbar {
  grid-template-columns: 1fr;
}

.video-management-toolbar label {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.video-management-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.video-management-toolbar select,
.video-management-toolbar input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #081011;
  color: var(--text);
  padding: 0 11px;
  font-family: inherit;
}

.video-management-toolbar #videoManagementRefreshButton {
  min-height: 34px;
  padding: 0 9px;
}

.video-management-selection {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 12px;
}

.video-download-progress {
  display: grid;
  gap: 7px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(67, 215, 198, 0.3);
  border-radius: 8px;
  background: rgba(8, 25, 25, 0.86);
}

.video-download-progress[hidden] {
  display: none;
}

.video-download-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #d9f5f0;
  font-size: 12px;
}

.video-download-progress-head strong {
  font-weight: 800;
}

.video-download-progress-head span {
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

.video-download-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.video-download-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c9b7, #58e59c);
  box-shadow: 0 0 10px rgba(67, 215, 198, 0.32);
  transition: width 180ms ease;
}

.video-download-progress.is-indeterminate .video-download-progress-track span {
  width: 34% !important;
  animation: video-download-progress-flow 1.1s ease-in-out infinite;
}

@keyframes video-download-progress-flow {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}

.video-management-selection label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d7e6e3;
  font-size: 13px;
  font-weight: 900;
}

.video-management-selection .video-management-selection-control {
  display: inline-grid;
  grid-template-columns: auto 118px;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.video-management-selection-control > span {
  color: #d7e6e3;
  font-size: 13px;
  font-weight: 900;
}

.video-management-selection-control select {
  width: 118px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #081011;
  color: var(--text);
  padding: 0 10px;
  font-family: inherit;
  font-size: 11px;
}

.video-management-selection input,
.video-management-card-select input {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
}

.video-management-selected-count {
  margin-left: auto;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.video-management-sort-control {
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.video-management-sort-control > span {
  flex: 0 0 auto;
  color: #d7e6e3;
  font-size: 13px;
  font-weight: 900;
}

.video-management-sort-control select {
  width: 118px;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #081011;
  color: var(--text);
  padding: 0 7px;
  font-family: inherit;
  font-size: 11px;
}

.video-management-layout-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(67, 215, 198, 0.34);
  border-radius: 8px;
  background: #081011;
}

.video-management-layout-toggle button {
  min-width: 78px;
  height: 34px;
  border: 0;
  border-right: 1px solid rgba(67, 215, 198, 0.22);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.video-management-layout-toggle button:last-child {
  border-right: 0;
}

.video-management-layout-toggle button.is-active {
  background: rgba(67, 215, 198, 0.2);
  color: #dcfffa;
}

.video-management-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.video-management-orientation-group {
  display: grid;
  gap: 10px;
}

.video-management-orientation-group.is-unproduced {
  margin-top: 4px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.035);
  padding-top: 16px;
}

.video-management-orientation-group.is-unproduced .video-management-orientation-head h4 {
  color: #aab6b5;
}

.video-management-orientation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 8px;
}

.video-management-orientation-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.video-management-orientation-head span {
  color: var(--muted);
  font-size: 12px;
}

.video-management-items-grid {
  display: grid;
  align-items: flex-start;
  gap: 10px;
}

.video-management-items-grid.is-landscape,
.video-management-items-grid.is-other,
.video-management-items-grid.is-unproduced {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.video-management-items-grid.is-portrait {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.video-management-items-grid.is-segment {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}

.video-management-items-grid.is-segment .video-management-card.is-landscape,
.video-management-items-grid.is-segment .video-management-card.is-unknown {
  flex: 0 0 calc((100% - 30px) / 4);
  width: calc((100% - 30px) / 4);
}

.video-management-items-grid.is-segment .video-management-card.is-portrait {
  flex: 0 0 calc((100% - 40px) / 5);
  width: calc((100% - 40px) / 5);
}

.video-management-card {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 9px;
  overflow: visible;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #081011;
  box-sizing: border-box;
  padding: 9px;
}

.video-management-items-grid.is-landscape .video-management-card,
.video-management-items-grid.is-other .video-management-card {
  width: 100%;
  height: auto;
}

.video-management-items-grid.is-portrait .video-management-card {
  width: 100%;
  height: auto;
}

.video-management-card.is-selected {
  border-color: rgba(67, 215, 198, 0.72);
  box-shadow: 0 0 0 1px rgba(67, 215, 198, 0.2);
}

.video-management-card-select {
  position: absolute;
  z-index: 3;
  top: 15px;
  left: 15px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: rgba(3, 7, 8, 0.78);
}

.video-management-thumb {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: #020405;
  cursor: pointer;
}

.video-management-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020405;
}

.video-management-card.is-landscape .video-management-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.video-management-card.is-portrait .video-management-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
}

.video-management-card.is-unknown .video-management-thumb {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.video-management-thumb em {
  position: absolute;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(4, 8, 9, 0.7);
  color: #fff;
  font-style: normal;
  pointer-events: none;
  transition: opacity 160ms ease, background 160ms ease;
}

.video-management-thumb.is-playing em {
  opacity: 0.28;
  background: rgba(4, 8, 9, 0.48);
}

.video-management-thumb.is-playing:hover em,
.video-management-thumb.is-playing:focus-visible em {
  opacity: 1;
}

.video-management-thumb.is-placeholder {
  color: var(--muted);
  cursor: default;
  font-size: 13px;
}

.video-management-status {
  position: absolute;
  z-index: 3;
  top: 15px;
  right: 15px;
  border-radius: 999px;
  background: rgba(12, 19, 20, 0.9);
  color: #d7e5e2;
  padding: 4px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.video-management-status.completed { color: #7af0c9; }
.video-management-status.processing,
.video-management-status.pending { color: #f1c870; }
.video-management-status.failed { color: #ff9d96; }

.video-management-card-body {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.video-management-card-body strong,
.video-management-card-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-management-card-body strong {
  color: var(--text);
  font-size: 14px;
}

.video-management-card-body span {
  color: var(--muted);
  font-size: 12px;
}

.video-management-card-actions {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 7px;
}

.video-management-card-actions > button,
.video-management-card-actions > a,
.video-management-card-actions > .video-review-control {
  flex: 1 1 0;
  width: 0;
  max-width: 100%;
  min-width: 0;
}

.video-management-card-actions > button,
.video-management-card-actions > a,
.video-management-card-actions .video-review-toggle {
  min-height: 32px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding-inline: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  justify-content: center;
  font-size: 11px;
}

.video-management-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.video-list-editor {
  --video-list-editor-width: 814px;
  --video-list-editor-video-width: 720px;
  --video-list-editor-shift-x: 0px;
  position: sticky;
  top: 14px;
  display: grid;
  justify-self: end;
  width: min(var(--video-list-editor-width), calc(100vw - 220px));
  min-width: 0;
  height: calc(100vh - 112px);
  min-height: 620px;
  overflow: hidden;
  padding: 0;
  transform: translateX(calc(100% - 48px));
  transition: transform 360ms linear;
}

.video-management-split-layout.has-editor .video-list-editor {
  transform: translateX(calc(-1 * var(--video-list-editor-shift-x)));
}

.video-list-editor-collapse-button {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 8px;
  display: inline-flex;
  width: 32px;
  height: 88px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(67, 215, 198, 0.55);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.2), rgba(22, 101, 91, 0.3)), #0b1717;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  color: #dcfff9;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 120ms linear, border-color 120ms linear, background 120ms linear;
}

.video-list-editor-collapse-button em {
  font-size: 28px;
  font-style: normal;
  line-height: 1;
}

.video-management-split-layout.has-editor-item .video-list-editor-collapse-button {
  opacity: 1;
  pointer-events: auto;
}

.video-list-editor-collapse-button:hover,
.video-list-editor-collapse-button:focus-visible {
  border-color: rgba(67, 215, 198, 0.95);
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.32), rgba(22, 101, 91, 0.42)), #0b1717;
  outline: none;
}

.video-list-editor::before {
  position: absolute;
  z-index: 4;
  inset: 0 auto 0 0;
  display: grid;
  width: 48px;
  place-items: center;
  border-right: 1px solid rgba(67, 215, 198, 0.18);
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.1), rgba(67, 215, 198, 0.025)), #0a1112;
  color: var(--cyan);
  content: "";
  pointer-events: none;
  transition: opacity 120ms linear;
}

.video-management-split-layout.has-editor .video-list-editor::before {
  opacity: 0;
}

.video-list-editor-content {
  display: grid;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  grid-template-rows: auto;
  align-content: start;
  gap: 13px;
  overflow: hidden;
  box-sizing: border-box;
  isolation: isolate;
  padding: 16px 16px 16px 52px;
}

.video-list-editor-content[hidden] {
  display: none;
}

.video-list-editor-preview {
  display: grid;
  width: 100%;
  min-height: 0;
  justify-self: stretch;
  gap: 13px;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 10px;
  background: rgba(5, 13, 14, 0.96);
  box-sizing: border-box;
  padding: 13px;
}

.video-list-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.video-list-editor-head h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 18px;
}

.video-list-editor-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.video-list-editor-player {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(var(--video-list-editor-video-width), 100%);
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  place-items: center;
  justify-self: center;
  overflow: hidden;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 8px;
  background: #020405;
}

.video-list-editor-player.is-portrait {
  width: min(var(--video-list-editor-video-width), 100%);
  justify-self: center;
}

.video-list-editor-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020405;
}

.video-list-editor-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.video-list-editor-facts div {
  display: grid;
  min-width: 0;
  gap: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #081011;
  padding: 8px 9px;
}

.video-list-editor-facts span {
  color: var(--muted);
  font-size: 10px;
}

.video-list-editor-facts strong {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-list-editor-section {
  display: grid;
  gap: 9px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.video-list-editor-section-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.video-list-editor-section-head strong {
  color: var(--text);
  font-size: 13px;
}

.video-list-editor-section-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-list-editor-params {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.video-list-editor-params label {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 5px;
}

.video-list-editor-params label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.video-list-editor-params select,
.video-list-editor-params input {
  min-width: 0;
  width: 100%;
  height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #081011;
  color: var(--text);
  padding: 0 8px;
  font-family: inherit;
  font-size: 11px;
}

.video-list-editor-params label em {
  position: absolute;
  right: 8px;
  bottom: 9px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  pointer-events: none;
}

.video-list-editor-params input {
  padding-right: 24px;
}

.video-list-editor-assets {
  display: flex;
  min-height: 64px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px dashed rgba(67, 215, 198, 0.22);
  border-radius: 7px;
  background: rgba(67, 215, 198, 0.025);
  padding: 10px;
}

.video-list-editor-assets > span {
  color: var(--muted);
  font-size: 11px;
}

.video-list-editor-asset-chip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  max-width: 170px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #081011;
  padding: 5px;
}

.video-list-editor-asset-chip img {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  object-fit: cover;
}

.video-list-editor-asset-chip strong,
.video-list-editor-asset-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-list-editor-asset-chip strong {
  color: var(--text);
  font-size: 11px;
}

.video-list-editor-asset-chip small {
  color: var(--muted);
  font-size: 9px;
}

.video-list-editor-prompt-section textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #071011;
  color: var(--text);
  padding: 11px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.65;
}

.video-list-editor-progress {
  position: relative;
  height: 30px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #071011;
}

.video-list-editor-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(67, 215, 198, 0.38), rgba(67, 215, 198, 0.12));
}

.video-list-editor-progress strong {
  position: relative;
  z-index: 1;
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}

.video-list-editor-actions {
  position: sticky;
  z-index: 4;
  bottom: -16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 0.82fr)) repeat(2, minmax(0, 1.15fr));
  gap: 7px;
  margin: 0 -16px -16px;
  border-top: 1px solid rgba(67, 215, 198, 0.2);
  background: rgba(7, 16, 17, 0.97);
  padding: 12px 16px 16px;
  backdrop-filter: blur(10px);
}

.video-list-editor-actions button {
  min-width: 0;
  min-height: 36px;
  padding: 5px 7px;
  font-size: 10px;
  white-space: nowrap;
}

.video-list-editor-operation {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  scrollbar-gutter: stable;
  width: 100%;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 10px;
  background: rgba(5, 13, 14, 0.96);
  box-sizing: border-box;
  padding: 14px 16px;
}

.video-list-editor-operation[hidden] {
  display: none !important;
}

.video-list-editor-operation .video-param-row {
  grid-template-columns: minmax(150px, 1.05fr) minmax(90px, 0.68fr) minmax(100px, 0.72fr) minmax(190px, 1.25fr);
  gap: 8px;
}

.video-list-editor-operation .video-param-row .video-duration-control {
  grid-template-columns: auto minmax(92px, 1fr) 48px;
}

.video-list-editor-operation .video-reference-and-prompt {
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 12px;
}

.video-list-editor-operation .video-prompt-box {
  grid-column: 1;
  grid-row: 1;
}

.video-list-editor-operation .video-reference-assets {
  grid-column: 2;
  grid-row: 1;
}

.video-list-editor-operation .video-prompt-box,
.video-list-editor-operation .video-prompt-box textarea {
  width: 100%;
}

.video-list-editor-operation .video-prompt-box textarea {
  height: 420px;
  min-height: 320px;
}

.video-list-editor-operation #videoListEditorMatchAssetsButton {
  width: 160px;
  min-width: 160px;
}

.video-list-editor-operation #videoListEditorReuseAttemptButton {
  width: 132px;
  min-width: 132px;
}

.video-attempt-reuse-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, calc(100vw - 48px));
  max-height: min(780px, calc(100vh - 48px));
  min-height: min(620px, calc(100vh - 48px));
}

.video-attempt-reuse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
  gap: 14px;
  min-height: 0;
  margin-top: 14px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding: 2px 7px 10px 2px;
}

.video-attempt-reuse-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 8px;
  background: #091112;
  padding: 10px;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.video-attempt-reuse-card.is-selected {
  border-color: rgba(93, 235, 161, 0.92);
  background: rgba(48, 170, 105, 0.22);
  box-shadow: 0 0 0 2px rgba(93, 235, 161, 0.16);
}

.video-attempt-reuse-apply {
  display: none;
  width: 100%;
  min-height: 34px;
}

.video-attempt-reuse-card.is-selected .video-attempt-reuse-apply {
  display: inline-flex;
}

.video-attempt-reuse-select {
  position: relative;
  display: grid;
  width: 100%;
  height: 190px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: #020404;
  padding: 0;
  cursor: pointer;
}

.video-attempt-reuse-select video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.video-attempt-reuse-select em {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 5px;
  background: rgba(2, 8, 9, 0.82);
  color: #d7fffa;
  padding: 4px 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.video-attempt-reuse-card strong,
.video-attempt-reuse-card span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-attempt-reuse-card strong {
  color: var(--text);
  font-size: 13px;
}

.video-attempt-reuse-card span {
  color: var(--muted);
  font-size: 11px;
}

.video-attempt-reuse-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 280px;
  place-items: center;
  border: 1px dashed rgba(67, 215, 198, 0.24);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.video-list-editor-operation #videoListEditorGenerateButton {
  width: 128px;
  min-width: 112px;
}

.video-list-editor-operation #videoListEditorSavePromptButton {
  width: 144px;
  min-width: 128px;
}

.video-list-reference-delete-button {
  position: absolute;
  z-index: 2;
  top: -6px;
  right: -6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255, 125, 125, 0.68);
  border-radius: 50%;
  background: rgba(71, 20, 20, 0.94);
  color: #ffd3d3;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.video-list-reference-delete-button:hover {
  border-color: rgba(255, 146, 146, 0.9);
  background: rgba(88, 24, 24, 0.92);
}

.video-management-card.is-editor-active {
  border-color: rgba(67, 215, 198, 0.9);
  box-shadow: 0 0 0 2px rgba(67, 215, 198, 0.18), 0 10px 28px rgba(0, 0, 0, 0.26);
}

.video-workbench.is-episode-collapsed {
  grid-template-columns: 48px minmax(0, 1fr);
}

.video-episode-rail {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.video-episode-toggle {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(67, 215, 198, 0.32);
  border-radius: 6px;
  background: rgba(67, 215, 198, 0.08);
  color: var(--cyan);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.video-episode-rail.is-episode-collapsed {
  padding: 10px 8px;
  overflow: hidden;
}

.video-episode-rail.is-episode-collapsed .panel-head {
  justify-content: center;
  margin-bottom: 0;
}

.video-episode-rail.is-episode-collapsed .panel-head > div,
.video-episode-rail.is-episode-collapsed .panel-head > .tag,
.video-episode-rail.is-episode-collapsed .video-view-mode-switch,
.video-episode-rail.is-episode-collapsed .video-episode-list {
  display: none;
}

.video-current-episode {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.video-episode-sticky-head {
  display: grid;
  gap: 14px;
  width: min(100%, 1100px);
  padding-bottom: 2px;
}

.video-workspace-tabbar {
  position: sticky;
  top: 0;
  z-index: 32;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  width: 1028px;
  max-width: 100%;
  min-height: 52px;
  padding: 7px 10px 0;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-bottom-color: rgba(67, 215, 198, 0.46);
  border-radius: 7px 7px 0 0;
  background: rgba(7, 13, 14, 0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

.video-segment-workspace-tabs {
  display: flex;
  flex: 1;
  gap: 3px;
  align-items: end;
  margin: 0;
  padding: 0;
}

.video-segment-workspace-tabs button {
  min-height: 44px;
  min-width: 190px;
  padding: 0 18px;
  border: 1px solid rgba(67, 215, 198, 0.16);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.045), rgba(255, 255, 255, 0.01)), #0b1112;
  color: #aebcba;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
}

.video-segment-workspace-tabs button.is-active {
  border-color: rgba(67, 215, 198, 0.68);
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.22), rgba(67, 215, 198, 0.08)), #0b1516;
  color: #eafffb;
  transform: translateY(1px);
}

.video-show-script-button,
.video-generated-reuse-attempt-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
  margin-bottom: 7px;
}

.video-generated-reuse-attempt-button {
  min-width: 132px;
}

.video-segment-detail {
  display: grid;
  grid-template-columns: 1028px minmax(48px, 1fr);
  gap: 12px;
  align-items: start;
  max-width: none;
  min-width: 0;
  overflow-x: clip;
  padding-bottom: 4px;
}

.video-compose-workspace-panel.is-hidden,
.video-generated-library.is-hidden {
  display: none;
}

.video-compose-workspace-panel {
  min-width: 0;
}

.video-compose-panel,
.video-output-panel {
  min-height: auto;
}

.video-compose-panel {
  width: 1028px;
  max-width: 1028px;
}

.video-output-panel {
  --video-list-editor-width: 814px;
  --video-list-editor-video-width: 720px;
  --video-list-editor-shift-x: 0px;
  position: sticky;
  top: 14px;
  display: grid;
  justify-self: end;
  width: min(var(--video-list-editor-width), calc(100vw - 220px));
  min-width: 0;
  height: max-content;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  transform: translateX(calc(100% - 48px));
  transition: transform 360ms linear, width 300ms ease;
}

.video-segment-detail.has-output .video-output-panel {
  transform: translateX(calc(-1 * var(--video-list-editor-shift-x)));
}

.video-segment-detail.has-output-item .video-output-collapse-button {
  opacity: 1;
  pointer-events: auto;
}

.video-segment-detail.has-output .video-output-panel::before {
  opacity: 0;
}

.video-output-content {
  height: auto;
}

.video-output-panel .video-list-editor-preview {
  gap: 13px;
}

.video-generated-library {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.video-generated-library .panel-head {
  align-items: end;
}

.video-generated-filter {
  display: grid;
  min-width: 220px;
  gap: 6px;
}

.video-generated-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.video-generated-filter select {
  height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #091011;
  color: var(--text);
  padding: 0 10px;
  font-family: inherit;
}

.video-generated-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.video-generated-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #091011;
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.video-generated-card:hover {
  border-color: rgba(67, 215, 198, 0.58);
}

.video-generated-thumb {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(67, 215, 198, 0.16);
  border-radius: 7px;
  background: #050808;
  color: inherit;
  cursor: pointer;
  padding: 0;
  width: 100%;
}

.video-generated-card.is-portrait .video-generated-thumb video {
  aspect-ratio: 9 / 16;
}

.video-generated-card.is-landscape .video-generated-thumb video {
  aspect-ratio: 16 / 9;
}

.video-generated-thumb video {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #020404;
}

.video-generated-thumb em {
  position: absolute;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(237, 243, 240, 0.34);
  border-radius: 50%;
  background: rgba(7, 10, 11, 0.66);
  color: var(--text);
  font-style: normal;
}

.video-generated-card > strong,
.video-generated-card > .video-generated-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-generated-card > strong {
  font-size: 14px;
}

.video-generated-card > .video-generated-meta {
  color: var(--muted);
  font-size: 12px;
}

.video-generated-card .video-generated-meta {
  color: #c8d9d6;
  font-variant-numeric: tabular-nums;
}

.video-generated-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
}

.video-generated-actions > button,
.video-generated-actions > .video-review-control {
  flex: 1;
  min-width: 0;
}

.video-generated-actions > button,
.video-generated-actions .video-review-toggle {
  min-height: 30px;
  min-width: 0;
  justify-content: center;
  font-size: 11px;
}

.video-generated-thumb.is-playing em {
  border-color: rgba(67, 215, 198, 0.76);
  background: rgba(5, 45, 41, 0.86);
  color: #d7fffa;
}

.video-generated-card.review-approved,
.video-management-card.review-approved {
  border-color: rgba(74, 222, 128, 0.82);
  background: linear-gradient(180deg, rgba(30, 122, 73, 0.58), rgba(9, 32, 22, 0.96));
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.12);
}

.video-generated-card.review-usable,
.video-management-card.review-usable {
  border-color: rgba(250, 204, 21, 0.82);
  background: linear-gradient(180deg, rgba(142, 112, 18, 0.56), rgba(35, 29, 9, 0.96));
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.12);
}

.video-generated-card.review-discarded,
.video-management-card.review-discarded {
  border-color: rgba(248, 113, 113, 0.88);
  background: linear-gradient(180deg, rgba(153, 27, 27, 0.7), rgba(48, 12, 14, 0.97));
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.16);
}

.video-review-control {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.video-review-control > .video-review-toggle {
  width: 100%;
}

.video-review-menu {
  position: absolute;
  z-index: 12;
  right: 0;
  bottom: calc(100% + 6px);
  display: grid;
  width: 92px;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: #101819;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
  padding: 6px;
}

.video-review-menu[hidden] {
  display: none;
}

.video-review-menu button {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #182223;
  color: #dbe9e6;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
}

.video-review-menu button:hover,
.video-review-menu button.is-current {
  border-color: rgba(67, 215, 198, 0.52);
  color: #7af0df;
}

.video-generated-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #080d0e;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1180px) {
  .video-management-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-management-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-management-items-grid.is-landscape,
  .video-management-items-grid.is-other,
  .video-management-items-grid.is-unproduced {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .video-management-items-grid.is-portrait {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .video-page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .video-view-mode-switch {
    width: fit-content;
    max-width: 100%;
  }

  .video-view-mode-switch button {
    min-width: 120px;
  }

  .video-management-summary,
  .video-management-toolbar {
    grid-template-columns: 1fr;
  }

  .video-management-items-grid.is-landscape,
  .video-management-items-grid.is-other {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .video-management-items-grid.is-portrait {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .video-episode-budget-summary,
  .video-episode-assignee-list,
  .video-episode-budget-allocation {
    grid-template-columns: 1fr;
  }

  .video-management-selection {
    flex-wrap: wrap;
  }

  .video-management-selected-count {
    width: 100%;
    margin-left: 0;
  }

  .video-playback-panel .modal-head {
    padding-right: 58px;
    padding-bottom: 56px;
  }

  .video-playback-download {
    top: auto;
    right: auto;
    bottom: 10px;
    left: 16px;
  }
}

.video-source-tabs,
.video-mode-tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.video-source-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-mode-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.video-source-tabs button,
.video-mode-tabs button,
.video-episode-list button,
.video-segment-list button {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0b1112;
  color: #aebcba;
  font-weight: 800;
}

.video-source-tabs button,
.video-mode-tabs button {
  min-height: 36px;
  padding: 0 10px;
}

.video-source-tabs button.is-active,
.video-mode-tabs button.is-active,
.video-episode-list button.is-active,
.video-segment-list button.is-active {
  border-color: rgba(67, 215, 198, 0.44);
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.18), rgba(67, 215, 198, 0.06));
  color: var(--text);
}

.video-script-floating-window {
  position: fixed;
  top: 90px;
  left: 50%;
  z-index: 180;
  display: none;
  width: min(900px, calc(100vw - 40px));
  height: min(600px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(67, 215, 198, 0.56);
  border-radius: 8px;
  background: #0b1112;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  transform: translateX(-50%);
}

.video-script-floating-window.is-open {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.video-script-floating-window.is-drag-positioned {
  transform: none;
}

.video-script-floating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid rgba(67, 215, 198, 0.24);
  background: #10191a;
  cursor: move;
  user-select: none;
}

.video-script-floating-head h3 {
  margin: 0;
  font-size: 15px;
}

.video-script-floating-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.video-script-floating-head .icon-button {
  flex: 0 0 auto;
  cursor: pointer;
}

.video-script-floating-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 18px;
  color: #d0ddda;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.video-segment-strip {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 1100px;
}

.video-segment-strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.video-segment-strip-head h3 {
  margin: 0;
}

.video-segment-strip-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.video-segment-strip-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.video-segment-strip-actions .compact-button {
  width: auto;
  min-width: 88px;
}

.video-episode-list,
.video-segment-list {
  gap: 8px;
}

.video-episode-list {
  display: grid;
}

.video-segment-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
  max-width: 1100px;
}

.video-episode-list {
  grid-template-columns: 1fr;
}

.video-episode-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #0b1112;
  padding: 6px;
}

.video-episode-item.is-active {
  border-color: rgba(67, 215, 198, 0.52);
  background: linear-gradient(145deg, rgba(67, 215, 198, 0.13), rgba(67, 215, 198, 0.035));
}

.video-episode-list .video-episode-main {
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 76px;
  border: 0;
  background: transparent;
  padding: 7px 5px;
  text-align: left;
}

.video-episode-row,
.video-episode-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
}

.video-episode-row strong {
  color: var(--text);
  font-size: 14px;
}

.video-episode-row b {
  color: var(--cyan);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.video-episode-meta em,
.video-episode-meta small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-episode-meta small {
  text-align: right;
}

.video-episode-budget-meter {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.15);
}

.video-episode-budget-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
}

.video-episode-list .video-episode-manage {
  align-self: center;
  min-height: 30px;
  border-color: rgba(230, 183, 90, 0.34);
  background: rgba(230, 183, 90, 0.08);
  color: #f0cb7f;
  padding: 0 8px;
  font-size: 11px;
  text-align: center;
}

.video-episode-list .video-episode-manage:hover {
  border-color: rgba(230, 183, 90, 0.72);
  background: rgba(230, 183, 90, 0.14);
}

.video-segment-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 7px 8px;
  text-align: left;
}

.video-episode-list strong,
.video-episode-list span,
.video-segment-list strong,
.video-segment-list span,
.video-segment-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-episode-list span,
.video-segment-list span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.video-episode-management-panel {
  width: min(760px, calc(100vw - 40px));
}

.video-episode-budget-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.video-episode-budget-summary article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(67, 215, 198, 0.045);
  padding: 12px;
}

.video-episode-budget-summary span,
.video-episode-assignee-head,
.video-episode-budget-input > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.video-episode-budget-summary strong {
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.video-episode-budget-input,
.video-episode-assignee-field {
  display: grid;
  gap: 7px;
}

.video-episode-budget-allocation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 9px;
  background: rgba(67, 215, 198, 0.045);
  padding: 12px;
}

.video-episode-budget-allocation > button {
  min-width: 132px;
  min-height: 40px;
}

.video-episode-budget-input > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.video-episode-budget-input input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #081011;
  color: var(--text);
  padding: 0 11px;
  font-family: inherit;
}

.video-episode-assignee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-episode-assignee-head small {
  color: var(--cyan);
}

.video-episode-assignee-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 310px;
  overflow: auto;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #081011;
  padding: 10px;
}

.video-episode-assignee-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 7px;
  padding: 9px;
}

.video-episode-assignee-item:has(input:checked) {
  border-color: rgba(67, 215, 198, 0.46);
  background: rgba(67, 215, 198, 0.08);
}

.video-episode-assignee-item input {
  width: 17px;
  height: 17px;
  accent-color: var(--cyan);
}

.video-episode-assignee-item span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.video-episode-assignee-item strong,
.video-episode-assignee-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-episode-assignee-item strong {
  color: var(--text);
  font-size: 13px;
}

.video-episode-assignee-item small,
.video-episode-assignee-empty,
.video-episode-management-status {
  color: var(--muted);
  font-size: 11px;
}

.video-episode-assignee-empty {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
}

.video-episode-management-status {
  min-height: 18px;
  margin: 0;
  color: var(--amber);
}

@media (max-width: 720px) {
  .video-episode-budget-summary,
  .video-episode-assignee-list,
  .video-episode-budget-allocation {
    grid-template-columns: 1fr;
  }

  .video-episode-budget-allocation > button {
    width: 100%;
  }
}

.video-segment-list em {
  color: var(--amber);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.video-asset-form {
  display: grid;
  gap: 12px;
}

.video-param-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(110px, 0.7fr) minmax(120px, 0.6fr) minmax(240px, 1.2fr);
  gap: 12px;
}

.video-h3-generation-mode-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(49, 209, 188, 0.26);
  border-radius: 9px;
  background: rgba(7, 16, 17, 0.72);
}

.video-h3-generation-mode-panel[hidden],
.video-h3-frame-control[hidden] {
  display: none;
}

.video-h3-generation-mode-panel label {
  display: grid;
  gap: 6px;
}

.video-h3-generation-mode-panel label > span {
  color: #dce7e4;
  font-size: 12px;
  font-weight: 800;
}

.video-h3-generation-mode-panel select,
.video-h3-generation-mode-panel input[type="file"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #071011;
  color: var(--text);
  padding: 6px 8px;
}

.video-h3-generation-mode-panel em,
.video-h3-generation-mode-panel small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.video-h3-generation-mode-panel small {
  grid-column: 1 / -1;
}

.video-param-row label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
}

.video-param-row .video-duration-control {
  grid-template-columns: auto 168px 52px;
}

.video-param-row span,
.video-prompt-head span,
.video-reference-title,
.video-reference-group h4 {
  color: #dce7e4;
  font-size: 13px;
  font-weight: 800;
}

.video-param-row span {
  display: grid;
  place-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 7px 0 0 7px;
  background: #0d1416;
  padding: 0 9px;
  white-space: nowrap;
}

.video-param-row select,
.video-param-row input[type="range"] {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 0 7px 7px 0;
  background: #071011;
  color: var(--text);
  padding: 0 8px;
}

.video-duration-control input[type="range"] {
  min-width: 0;
  border-radius: 0;
  accent-color: var(--cyan);
}

.video-duration-control em {
  display: grid;
  align-items: center;
  justify-content: end;
  min-height: 36px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  background: #071011;
  color: #c7fff7;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding-right: 9px;
}

.video-reference-and-prompt {
  display: grid;
  grid-template-columns: 260px 720px;
  gap: 16px;
  align-items: start;
  padding-bottom: 4px;
}

.video-reference-assets {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.video-reference-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
  align-items: stretch;
}

.video-reference-title {
  min-height: 34px;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(67, 215, 198, 0.18), rgba(16, 24, 27, 0.96));
  padding: 8px 10px;
  letter-spacing: 0;
}

.video-reference-toolbar .compact-button {
  width: 88px;
  min-width: 88px;
  padding: 0 8px;
  font-size: 12px;
}

.video-reference-group {
  display: grid;
  gap: 0;
}

.video-reference-group h4 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 32px;
  margin: 0;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background:
    linear-gradient(90deg, rgba(67, 215, 198, 0.22), rgba(236, 181, 68, 0.18), rgba(10, 17, 19, 0.98)),
    #0d1719;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 7px 10px;
  color: #f5fbf8;
}

.video-reference-group h4::before,
.video-reference-group h4::after {
  content: "";
  display: block;
}

.video-reference-group h4::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(67, 215, 198, 0.72);
}

.video-reference-group h4::after {
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, rgba(67, 215, 198, 0.72), transparent);
}

.video-reference-group:nth-of-type(2) h4::before {
  background: var(--blue);
  box-shadow: 0 0 14px rgba(105, 167, 255, 0.72);
}

.video-reference-group:nth-of-type(3) h4::before {
  background: var(--amber);
  box-shadow: 0 0 14px rgba(230, 183, 90, 0.72);
}

.video-reference-item {
  position: relative;
  min-height: 120px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #071011;
  overflow: hidden;
}

.video-reference-group > button,
.video-reference-image-button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 120px;
  border: 0;
  border-radius: 0;
  background: #071011;
  color: var(--text);
  padding: 0;
  text-align: left;
  overflow: hidden;
}

.video-reference-group > button {
  border: 1px solid var(--line);
  border-top: 0;
}

.video-reference-thumb {
  display: block;
  width: 100%;
  height: 120px;
  aspect-ratio: 16 / 9;
  border: 0;
  object-fit: contain;
  background: #05090a;
}

.video-reference-group > button:first-of-type,
.video-reference-group > .video-reference-item:first-of-type {
  border-top: 1px solid var(--line);
}

.video-reference-name {
  position: absolute;
  top: 7px;
  left: 7px;
  max-width: calc(100% - 14px);
  border: 1px solid rgba(237, 243, 240, 0.18);
  border-radius: 5px;
  background: rgba(6, 10, 12, 0.72);
  color: #edf3f0;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-reference-delete-button {
  position: absolute;
  right: 7px;
  top: 7px;
  z-index: 2;
  width: 28px;
  height: 28px;
  min-height: 0;
  border: 1px solid rgba(255, 111, 111, 0.55);
  border-radius: 6px;
  background: rgba(43, 12, 12, 0.84);
  color: #ffd9d9;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.video-reference-delete-button:hover {
  border-color: rgba(255, 146, 146, 0.9);
  background: rgba(88, 24, 24, 0.92);
}

.video-reference-asset-bind-button {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 2;
  min-height: 25px;
  border: 1px solid rgba(67, 215, 198, 0.62);
  border-radius: 5px;
  background: rgba(5, 54, 51, 0.9);
  color: #d9fffa;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.video-reference-asset-bind-button:hover {
  border-color: rgba(103, 235, 219, 0.94);
  background: rgba(7, 77, 72, 0.96);
}

.video-reference-asset-bind-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.video-prompt-box {
  display: grid;
  gap: 10px;
  width: 720px;
}

.video-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.video-prompt-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.video-prompt-head span,
.video-match-assets-button {
  min-height: 32px;
  border-radius: 7px;
}

.video-prompt-head span {
  display: flex;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
}

.video-asset-binding-display {
  display: block;
  width: 100%;
  min-height: 72px;
  tab-size: 4;
  overflow: auto;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 7px;
  background: #071011;
  color: #d7fffa;
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 800;
  line-height: 1.65;
  white-space: pre-wrap;
  resize: none;
  box-sizing: border-box;
}

.video-prompt-box textarea.video-asset-binding-display {
  height: 72px;
  min-height: 72px;
  max-height: 72px;
}

#videoAssetBindingDisplay {
  height: 144px;
  min-height: 144px;
  max-height: 144px;
}

.video-match-assets-button {
  width: auto;
  min-width: 128px;
  border: 1px solid rgba(67, 215, 198, 0.34);
  background: rgba(67, 215, 198, 0.1);
  color: #c7fff7;
}

.video-prompt-box textarea {
  width: 720px;
  max-width: 100%;
  height: 600px;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #071011;
  color: var(--text);
  padding: 12px;
  resize: vertical;
  line-height: 1.7;
}

.video-dual-prompt-editors {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.video-prompt-box.has-h3-prompt {
  width: 100%;
  max-width: 100%;
}

.video-dual-prompt-editors.is-h3-enabled {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
}

.video-prompt-format-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 10px;
}

.video-prompt-format-tabs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  border-bottom: 1px solid rgba(67, 215, 198, 0.34);
}

.video-prompt-format-tabs.is-h3-enabled {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.video-prompt-format-tab {
  min-height: 42px;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(5, 18, 19, 0.9);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.video-prompt-format-tab + .video-prompt-format-tab {
  margin-left: 4px;
}

.video-prompt-format-tab.is-active,
.video-prompt-format-tab[aria-selected="true"] {
  border-color: rgba(67, 215, 198, 0.72);
  background: linear-gradient(180deg, rgba(38, 114, 106, 0.5), rgba(13, 46, 45, 0.92));
  color: #effffc;
}

.video-prompt-editor-pane[hidden],
.video-prompt-format-tab[hidden] {
  display: none !important;
}

.video-prompt-editor-pane {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.video-prompt-editor-toolbar {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.video-prompt-editor-toolbar strong {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.video-h3-enable-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 7px;
  background: rgba(67, 215, 198, 0.07);
  color: #d7fffa;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.video-h3-enable-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--cyan);
}

.video-h3-sync-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.video-h3-prompt-toolbar {
  justify-content: flex-end;
}

.video-h3-sync-actions button {
  min-width: 128px;
  min-height: 32px;
  white-space: nowrap;
}

.video-prompt-box .video-prompt-editor-pane textarea {
  width: 100%;
  max-width: none;
}

.video-h3-source-storage {
  display: none !important;
}

.video-h3-structured-editor {
  display: grid;
  align-content: start;
  gap: 12px;
  width: 100%;
  height: auto;
  min-height: 600px;
  overflow: visible;
  border: 1px solid var(--line);
  background: #071011;
  padding: 12px;
}

.video-h3-empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed rgba(67, 215, 198, 0.25);
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.video-h3-editor-section {
  display: grid;
  gap: 9px;
}

.video-h3-editor-section > h5 {
  margin: 0;
  color: #bffaf1;
  font-size: 13px;
}

.video-h3-visual-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.video-h3-context-card {
  min-width: 0;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 8px;
  background: rgba(14, 31, 31, 0.82);
  padding: 10px;
}

.video-h3-shot-list,
.video-h3-dialogue-list {
  display: grid;
  gap: 10px;
}

.video-h3-shot-card,
.video-h3-dialogue-card {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 8px;
  background: rgba(14, 31, 31, 0.82);
  padding: 11px;
}

.video-h3-shot-card > header,
.video-h3-dialogue-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.video-h3-shot-card > header strong,
.video-h3-dialogue-card > header strong {
  color: var(--cyan);
  font-size: 13px;
}

.video-h3-shot-speech-group {
  display: grid;
  gap: 9px;
  margin-top: 3px;
  padding-top: 11px;
  border-top: 1px solid rgba(67, 215, 198, 0.2);
}

.video-h3-shot-speech-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.video-h3-shot-speech-group > header strong {
  color: #bffaf1;
  font-size: 12px;
}

.video-h3-shot-speech-group .video-h3-dialogue-card {
  border-color: rgba(116, 174, 230, 0.22);
  background: rgba(5, 20, 24, 0.84);
}

.video-h3-add-speech-button {
  min-height: 30px;
  white-space: nowrap;
}

.video-h3-remove-button {
  border: 0;
  background: transparent;
  color: #e49a9a;
  padding: 3px 5px;
  cursor: pointer;
  font-size: 11px;
}

.video-h3-form-grid {
  display: grid;
  gap: 8px;
}

.video-h3-timing-grid {
  grid-template-columns: 82px 82px 100px 100px minmax(240px, 1fr);
}

.video-h3-dialogue-grid {
  grid-template-columns: 86px minmax(100px, 1fr) minmax(120px, 1.2fr) 92px 92px minmax(100px, 1fr);
}

.video-h3-form-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.video-h3-form-field > span {
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}

.video-h3-form-field input,
.video-h3-form-field select,
.video-prompt-box .video-h3-form-field textarea,
.video-prompt-box .video-h3-sound-section textarea {
  width: 100%;
  height: auto;
  min-height: 36px;
  border: 1px solid rgba(138, 178, 173, 0.23);
  border-radius: 6px;
  background: rgba(4, 14, 15, 0.9);
  color: var(--text);
  padding: 8px 9px;
  resize: vertical;
  line-height: 1.5;
}

.video-h3-form-field select {
  appearance: auto;
  cursor: pointer;
}

.video-prompt-box .video-h3-form-field textarea {
  min-height: 74px;
}

.video-prompt-box .video-h3-constraint-section .video-h3-form-field textarea {
  min-height: 92px;
}

.video-prompt-box .video-h3-sound-section textarea {
  min-height: 68px;
}

.video-h3-editor-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
}

.video-h3-editor-actions button {
  min-width: 104px;
}

.video-h3-validation-status {
  min-height: 24px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  padding: 3px 0 3px 9px;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
}

.video-h3-validation-status[data-status="valid"] {
  border-left-color: #50d890;
  color: #8cf2b7;
}

.video-h3-validation-status[data-status="pending"],
.video-h3-validation-status[data-status="stale"] {
  border-left-color: var(--amber);
  color: #f3cf82;
}

.video-h3-validation-status[data-status="invalid"] {
  border-left-color: #ff7777;
  color: #ffaaaa;
}

.video-prompt-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 10px;
}

.video-generate-button,
#saveVideoPromptButton,
#videoMatchAssetsButton {
  width: 128px;
  justify-self: stretch;
}

.video-generate-progress {
  position: relative;
  display: grid;
  align-items: center;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #071011;
  padding: 0 10px;
}

.video-generate-progress span {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--amber));
}

.video-generate-progress.is-pending span {
  background: repeating-linear-gradient(
    120deg,
    var(--cyan) 0,
    var(--cyan) 12px,
    #7fd8aa 12px,
    #7fd8aa 24px,
    var(--amber) 24px,
    var(--amber) 36px
  );
  background-size: 72px 100%;
  animation: video-generate-progress-flow 900ms linear infinite;
}

@keyframes video-generate-progress-flow {
  from { background-position-x: 0; }
  to { background-position-x: 72px; }
}

.video-generate-progress strong {
  position: relative;
  z-index: 1;
  color: #edf3f0;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.56);
}

.video-reference-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.video-reference-card,
.video-reference-add {
  min-height: 142px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #0c1213;
  overflow: hidden;
}

.video-reference-card {
  display: grid;
  grid-template-rows: minmax(92px, 1fr) auto;
}

.video-reference-card.is-primary {
  border-color: rgba(230, 183, 90, 0.34);
}

.video-reference-card img {
  width: 100%;
  height: 100%;
  min-height: 92px;
  object-fit: cover;
}

.video-reference-card div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
}

.video-reference-card strong,
.video-reference-add strong {
  color: var(--text);
  font-size: 13px;
}

.video-reference-card span {
  color: var(--muted);
  font-size: 11px;
}

.video-reference-add {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #c7fff7;
}

.video-reference-add span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(67, 215, 198, 0.36);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 24px;
  line-height: 1;
}

.video-model-card {
  margin-top: 14px;
  border: 1px solid rgba(105, 167, 255, 0.18);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(105, 167, 255, 0.08), rgba(255, 255, 255, 0.012)), #0c1213;
  padding: 14px;
}

.video-model-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.video-model-head h3 {
  margin: 4px 0 0;
}

.video-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.video-control-grid label,
.video-prompt-editor {
  display: grid;
  gap: 6px;
}

.video-control-grid span,
.video-prompt-editor span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.video-control-grid select,
.video-control-grid input,
.video-prompt-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #070b0c;
  color: var(--text);
}

.video-control-grid select,
.video-control-grid input {
  min-height: 36px;
  padding: 0 10px;
}

.video-prompt-editor {
  margin-top: 14px;
}

.video-prompt-editor textarea {
  min-height: 180px;
  resize: vertical;
  padding: 12px;
  line-height: 1.7;
}

.video-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.video-prompt-box .video-prompt-actions {
  flex-wrap: nowrap;
  margin-top: 0;
}

.video-prompt-box .video-generate-button,
.video-prompt-box #saveVideoPromptButton,
.video-prompt-box #videoMatchAssetsButton {
  width: 128px;
  min-width: 112px;
  flex: 0 0 auto;
}

.video-prompt-box #videoMatchAssetsButton {
  width: 160px;
  min-width: 160px;
}

.video-prompt-box #videoReuseAttemptButton {
  width: 132px;
  min-width: 132px;
}

.video-prompt-box #saveVideoPromptButton {
  width: 144px;
  min-width: 144px;
}

.video-output-stage {
  aspect-ratio: 16 / 9;
}

.video-output-stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020405;
}

.video-output-stage.is-empty {
  background: #020405;
}

.review-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 300px;
  gap: 14px;
}

.review-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item {
  padding: 12px;
}

.review-item strong,
.review-item span {
  display: block;
}

.review-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.review-detail img {
  width: 100%;
  max-height: 390px;
  border-radius: 7px;
  object-fit: cover;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.approve-button,
.revise-button,
.reject-button {
  min-height: 38px;
  border: 1px solid transparent;
  color: #07100e;
  font-weight: 800;
}

.approve-button {
  background: var(--green);
}

.revise-button {
  background: var(--amber);
}

.reject-button {
  background: var(--red);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#settingsView .admin-grid {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  align-items: start;
}

#settingsView .admin-grid > .panel:first-child {
  grid-row: span 2;
  container: system-users / inline-size;
}

#settingsView .admin-grid > .panel:first-child > .panel-head {
  flex-direction: column;
  align-items: stretch;
}

#settingsView .system-user-toolbar {
  flex-wrap: wrap;
  min-width: 0;
}

#settingsView .system-user-toolbar label {
  flex: 1 1 220px;
  min-width: 0;
}

#settingsView .system-user-toolbar label > span,
#settingsView .system-user-toolbar button {
  flex-shrink: 0;
  white-space: nowrap;
}

#settingsView .system-user-toolbar select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

#settingsView .system-user-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px) 96px;
}

#settingsView .system-user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#settingsView .system-user-actions button {
  white-space: nowrap;
}

#settingsView .system-user-identity {
  min-width: 0;
  overflow-wrap: anywhere;
}

@container system-users (max-width: 640px) {
  #settingsView .system-user-row { grid-template-columns: minmax(0, 1fr) 96px; }
  #settingsView .system-user-badges { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}

@media (max-width: 1200px) {
  #settingsView .admin-grid { grid-template-columns: minmax(0, 1fr); }
  #settingsView .admin-grid > .panel:first-child { grid-row: auto; }
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.admin-row:first-of-type {
  border-top: 0;
}

.admin-row strong {
  color: var(--text);
}

.admin-row button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c1213;
  color: var(--text);
  padding: 0 10px;
}

.system-user-list {
  display: grid;
  gap: 8px;
}

.system-user-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-user-toolbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.system-user-toolbar select {
  width: 190px;
  height: 32px;
}

.system-user-row {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(280px, auto) 64px;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.system-user-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.system-user-identity strong,
.system-user-identity span {
  display: block;
}

.system-user-identity strong {
  color: var(--text);
  font-size: 14px;
}

.system-user-identity span,
.system-user-empty {
  color: var(--muted);
  font-size: 13px;
}

.system-user-badges {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.system-user-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  white-space: nowrap;
}

.system-user-badge.is-active {
  color: #66e2bd;
  border-color: rgba(102, 226, 189, 0.3);
  background: rgba(102, 226, 189, 0.08);
}

.system-user-badge.is-disabled {
  color: #ff9090;
  border-color: rgba(255, 144, 144, 0.3);
  background: rgba(255, 144, 144, 0.08);
}

.system-user-manage-button {
  min-height: 32px;
  justify-self: end;
  white-space: nowrap;
}

.system-user-management-panel {
  width: min(760px, calc(100vw - 32px));
}

.system-user-management-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.system-user-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.system-user-management-grid > label,
.system-user-new-company-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.system-user-management-grid select,
.system-user-management-grid input,
.system-user-new-company-field input {
  width: 100%;
  min-height: 40px;
}

.system-user-management-switch {
  grid-template-columns: auto 1fr;
  align-content: center;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.system-user-management-switch input {
  width: 18px;
  min-height: 18px;
  accent-color: #43d7c6;
}

.system-user-company-promotion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(67, 215, 198, 0.26);
  border-radius: 8px;
  background: rgba(67, 215, 198, 0.05);
}

.system-user-company-promotion strong,
.system-user-company-promotion span {
  display: block;
}

.system-user-company-promotion span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.system-user-new-company-field {
  margin-top: 14px;
}

.system-user-management-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 760px) {
  .system-user-toolbar {
    width: 100%;
    flex-wrap: wrap;
  }

  .system-user-toolbar label,
  .system-user-toolbar select {
    width: 100%;
  }

  .system-user-row {
    grid-template-columns: 1fr auto;
  }

  .system-user-badges {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .system-user-management-grid {
    grid-template-columns: 1fr;
  }

  .system-user-company-promotion {
    align-items: flex-start;
    flex-direction: column;
  }
}

.credit-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.credit-summary-card {
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.credit-summary-card > span,
.credit-summary-card > small {
  color: var(--muted);
}

.credit-summary-card > span {
  font-size: 13px;
}

.credit-summary-card > strong {
  color: var(--text);
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.credit-summary-card > small {
  min-height: 18px;
  font-size: 12px;
}

.credit-management-grid {
  display: grid;
  grid-template-columns: minmax(350px, 430px) minmax(620px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.credit-grant-panel,
.credit-accounts-panel {
  min-height: 390px;
}

.credit-accounts-panel {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 14px;
  align-items: start;
}

.credit-account-section + .credit-account-section {
  margin-top: 0;
  padding-top: 0;
  padding-left: 14px;
  border-top: 0;
  border-left: 1px solid var(--line-soft);
}

.credit-account-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  margin-bottom: 10px;
}

.credit-account-section-head .credit-compact-filters {
  width: 100%;
}

.credit-account-section-head .credit-compact-filters select,
.credit-account-section-head .credit-compact-filters input {
  min-width: 0;
  width: 50%;
}

.credit-episode-range-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
}

.credit-episode-range-fields select {
  min-width: 0;
  width: 100%;
}

.credit-episode-range-fields b {
  color: var(--muted);
  font-weight: 700;
}

.credit-budget-preview {
  margin: 2px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(81, 224, 192, 0.2);
  border-radius: 9px;
  color: #a7ead9;
  background: rgba(81, 224, 192, 0.055);
  font-size: 12px;
  line-height: 1.55;
}

.credit-management-company-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.credit-management-company-control select {
  width: 190px;
  height: 36px;
}

.credit-compact-filters,
.credit-filter-row,
.credit-ledger-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.credit-compact-filters select {
  width: 128px;
}

.credit-compact-filters input {
  width: 190px;
}

.credit-ledger-panel {
  margin-top: 14px;
  min-width: 0;
}

.credit-ledger-head {
  align-items: flex-end;
}

.credit-ledger-tabs {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.credit-ledger-tabs button {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.credit-ledger-tabs button.is-active {
  color: #071310;
  background: var(--accent);
  font-weight: 800;
}

.credit-filter-row {
  flex-wrap: wrap;
  padding: 2px 0 14px;
}

.credit-filter-row > select {
  width: 150px;
}

.credit-filter-row > label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.credit-filter-row input[type="date"] {
  width: 148px;
}

.credit-usage-statistics {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-height: 32px;
  margin-left: 4px;
  padding: 5px 12px;
  border: 1px solid rgba(49, 224, 177, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(49, 224, 177, 0.06);
  font-size: 12px;
  white-space: nowrap;
}

.credit-usage-statistics strong {
  color: var(--accent);
  font-size: 13px;
}

.work-log-panel {
  min-height: 560px;
}

.work-log-filter-row {
  align-items: center;
}

.work-log-table {
  min-width: 1240px;
}

.ledger-pagination {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.ledger-pagination span {
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}

.ledger-pagination button {
  min-width: 68px;
  height: 32px;
  border: 1px solid rgba(49, 224, 177, 0.24);
  border-radius: 7px;
  color: var(--text);
  background: rgba(49, 224, 177, 0.08);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.ledger-pagination button:hover:not(:disabled) {
  border-color: rgba(49, 224, 177, 0.52);
  background: rgba(49, 224, 177, 0.15);
}

.ledger-pagination button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.credit-transaction-filter-row {
  justify-content: flex-end;
}

.credit-table-shell {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.credit-account-table-shell {
  max-height: 250px;
}

.credit-employee-table-shell {
  max-height: 270px;
}

.credit-data-table.credit-employee-data-table {
  min-width: 470px;
  table-layout: fixed;
}

.credit-data-table.credit-organization-data-table {
  min-width: 560px;
  table-layout: fixed;
}

.credit-organization-data-table th:first-child {
  width: 28%;
}

.credit-organization-data-table th:last-child {
  width: 10%;
}

.credit-employee-data-table th:first-child {
  width: 28%;
}

.credit-employee-data-table th:last-child {
  width: 12%;
}

.credit-data-table.credit-organization-data-table th,
.credit-data-table.credit-organization-data-table td,
.credit-data-table.credit-employee-data-table th,
.credit-data-table.credit-employee-data-table td {
  padding-right: 7px;
  padding-left: 7px;
}

.credit-data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: var(--text);
  font-size: 13px;
}

.credit-usage-table {
  min-width: 1180px;
}

.credit-data-table th,
.credit-data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: middle;
}

.credit-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--panel-strong, #17201f);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.credit-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.credit-data-table tbody tr:hover td {
  background: rgba(81, 224, 192, 0.035);
}

.credit-table-empty {
  height: 110px;
  color: var(--muted);
  text-align: center !important;
}

.credit-entity-cell strong,
.credit-entity-cell span,
.credit-location-cell strong,
.credit-location-cell span {
  display: block;
}

.credit-entity-cell span,
.credit-location-cell span,
.credit-task-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.credit-value-positive {
  color: var(--accent);
  font-weight: 800;
}

.credit-value-negative {
  color: #ffbe70;
  font-weight: 800;
}

.credit-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.credit-status-pill.is-completed,
.credit-status-pill.is-active {
  color: #66e2bd;
  border-color: rgba(102, 226, 189, 0.3);
  background: rgba(102, 226, 189, 0.08);
}

.credit-status-pill.is-frozen {
  color: #ffd181;
  border-color: rgba(255, 209, 129, 0.3);
  background: rgba(255, 209, 129, 0.08);
}

.credit-status-pill.is-failed,
.credit-status-pill.is-disabled {
  color: #ff9090;
  border-color: rgba(255, 144, 144, 0.3);
  background: rgba(255, 144, 144, 0.08);
}

@media (max-width: 1180px) {
  .credit-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .credit-management-grid {
    grid-template-columns: 1fr;
  }

  .credit-accounts-panel {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  }
}

@media (max-width: 900px) {
  .credit-accounts-panel {
    grid-template-columns: 1fr;
  }

  .credit-account-section + .credit-account-section {
    margin-top: 14px;
    padding-top: 14px;
    padding-left: 0;
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .credit-summary-grid {
    grid-template-columns: 1fr;
  }

  .credit-compact-filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .credit-compact-filters select,
  .credit-compact-filters input {
    width: 100%;
  }

  .credit-ledger-head {
    align-items: flex-start;
    gap: 12px;
  }
}

.api-management-layout {
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(550px, 700px);
  gap: 14px;
  align-items: start;
  width: fit-content;
  max-width: 100%;
}

.api-title-row {
  display: flex;
  align-items: center;
  gap: 50px;
}

.api-provider-list,
.api-priority-list {
  display: grid;
  gap: 10px;
}

.api-provider-card,
.api-priority-row {
  border: 1px solid rgba(67, 215, 198, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(67, 215, 198, 0.045), rgba(255, 255, 255, 0.012)), #081011;
}

.api-provider-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.api-provider-main,
.api-provider-actions,
.api-provider-routes,
.api-key-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.api-provider-main {
  justify-content: space-between;
}

.api-provider-main div {
  display: grid;
  gap: 4px;
}

.api-provider-main strong {
  color: var(--text);
  font-size: 16px;
}

.api-provider-main span,
.api-purpose-fields span {
  color: var(--muted);
  font-size: 13px;
}

.api-route-chip {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 999px;
  padding: 0 9px;
  color: #d9f4ef;
  background: rgba(67, 215, 198, 0.08);
  font-size: 13px;
  font-weight: 800;
}

.api-route-chip.image {
  border-color: rgba(90, 150, 255, 0.28);
  background: rgba(90, 150, 255, 0.1);
}

.api-route-chip.text {
  border-color: rgba(248, 201, 93, 0.28);
  background: rgba(248, 201, 93, 0.1);
}

.api-route-chip.video {
  border-color: rgba(181, 128, 255, 0.3);
  background: rgba(181, 128, 255, 0.11);
}

.api-route-chip.muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.api-key-line {
  min-height: 34px;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  padding: 0 8px 0 11px;
}

.api-key-mask {
  color: #e6f5f1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.api-key-eye-button,
.api-provider-actions button,
.api-priority-row button {
  min-height: 28px;
  border: 1px solid rgba(67, 215, 198, 0.2);
  border-radius: 6px;
  background: #0c1213;
  color: var(--text);
  padding: 0 10px;
}

.api-key-eye-button {
  width: 32px;
  padding: 0;
  font-weight: 900;
}

.api-provider-actions {
  justify-content: flex-end;
}

.api-provider-test-button {
  color: #43d7c6 !important;
}

.api-provider-delete-button {
  color: #ff9b9b !important;
}

.api-priority-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.api-priority-panel {
  min-width: 0;
}

.api-priority-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 30px 30px;
  gap: 8px;
  align-items: center;
  padding: 10px;
}

.api-priority-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(67, 215, 198, 0.14);
  color: #bff8ef;
  font-weight: 900;
}

.api-priority-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.api-priority-row strong,
.api-priority-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-priority-row strong {
  color: var(--text);
  font-size: 14px;
}

.api-priority-row div span {
  color: var(--muted);
  font-size: 13px;
}

.api-priority-row em {
  font-style: normal;
  white-space: nowrap;
}

.api-priority-row button {
  width: 30px;
  padding: 0;
  font-weight: 900;
}

.api-priority-row button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.api-provider-modal-panel {
  width: min(780px, calc(100vw - 36px));
}

.api-provider-modal-panel .panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.api-provider-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.api-provider-form label,
.api-purpose-fields {
  display: grid;
  gap: 8px;
}

.api-provider-form label > span,
.api-purpose-fields strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.api-provider-form input {
  width: 100%;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(67, 215, 198, 0.18);
  border-radius: 7px;
  background: #080f10;
  color: var(--text);
  padding: 0 12px;
  font-family: inherit;
}

.api-provider-key-field,
.api-purpose-checks,
.api-purpose-fields {
  grid-column: 1 / -1;
}

.api-key-input-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
}

.api-purpose-checks {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.api-purpose-checks label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.api-purpose-checks input {
  width: 16px;
  height: 16px;
}

.api-purpose-fields {
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(67, 215, 198, 0.14);
  border-radius: 8px;
  background: rgba(67, 215, 198, 0.04);
  padding: 12px;
}

.api-purpose-fields[hidden] {
  display: none;
}

@media (max-width: 1280px) {
  .video-management-split-layout,
  .video-management-split-layout.has-editor {
    grid-template-columns: 1028px minmax(48px, 1fr);
  }

  .video-management-list-column {
    width: 1028px;
    min-width: 1028px;
    max-width: 1028px;
  }

  .video-list-editor {
    position: sticky;
    width: min(var(--video-list-editor-width), calc(100vw - 160px));
    height: calc(100vh - 112px);
    min-height: 620px;
  }

  .video-output-panel {
    height: max-content;
    min-height: 0;
  }

  .video-management-split-layout.has-editor .video-list-editor {
    transform: translateX(0);
  }

  .video-list-editor-content {
    max-height: 100%;
  }
}

@media (max-width: 1180px) {
  .metric-grid,
  .pipeline-strip,
  .project-stage-board,
  .extraction-summary-grid,
  .asset-grid,
  .admin-grid,
  .api-management-layout,
  .api-priority-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout,
  .script-processor-layout,
  .asset-library-layout,
  .video-board,
  .video-workbench,
  .video-segment-workspace,
  .studio-layout,
  .review-layout {
    grid-template-columns: 1fr;
  }

  #scriptImportView .script-processor-layout,
  #assetExtractionView .script-processor-layout,
  #videoPromptView .script-processor-layout {
    width: 100%;
    max-width: none;
  }

  .reference-video-script-form {
    grid-template-columns: minmax(300px, 1fr) repeat(2, 170px);
  }

  .reference-video-episode-preview,
  .reference-video-script-start {
    grid-column: span 1;
  }

  .video-episode-rail,
  .video-segment-panel,
  .video-compose-panel {
    position: static;
    max-height: none;
    min-height: auto;
  }

  .video-management-split-layout.has-editor {
    grid-template-columns: 1028px minmax(48px, 1fr);
  }

  .video-list-editor {
    position: sticky;
    width: min(var(--video-list-editor-width), 720px);
    height: calc(100vh - 112px);
    min-height: 620px;
  }

  .video-list-editor-content {
    max-height: 100%;
  }

  .video-compose-panel {
    width: 100%;
    max-width: none;
  }

  .video-output-panel {
    position: sticky;
    width: min(var(--video-list-editor-width), 720px);
    min-width: 0;
    height: max-content;
    min-height: 0;
  }

  .video-output-stage {
    width: min(var(--video-list-editor-video-width), 100%);
    height: auto;
  }

  .video-segment-detail {
    grid-template-columns: 1028px minmax(48px, 1fr);
  }

  .video-prompt-box,
  .video-prompt-box textarea {
    width: 100%;
  }

  .video-prompt-box.has-h3-prompt {
    width: 100%;
  }

  .video-dual-prompt-editors,
  .video-dual-prompt-editors.is-h3-enabled {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-h3-dialogue-grid,
  .video-h3-timing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-h3-assets-field {
    grid-column: 1 / -1;
  }

  .video-reference-and-prompt {
    grid-template-columns: 1fr;
  }

  .video-param-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .asset-preview-panel {
    position: static;
  }

  .production-card {
    grid-template-columns: auto minmax(260px, 1fr) 320px;
  }

  .prompt-editor {
    grid-column: 2 / -1;
  }

  .stage-task-row {
    grid-template-columns: 1fr 100px 100px 100px;
  }

  .stage-task-row span:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .script-entry-tabs {
    width: 100%;
  }

  .script-entry-tab {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 8px;
    text-align: center;
  }

  .script-entry-tab em {
    display: none;
  }

  .reference-video-script-panel {
    padding: 16px;
  }

  .reference-video-script-head {
    flex-direction: column;
    gap: 12px;
  }

  .reference-video-script-form {
    grid-template-columns: 1fr;
  }

  .reference-video-episode-preview,
  .reference-video-script-start {
    grid-column: auto;
  }

  .workflow-status-grid {
    grid-template-columns: 1fr;
  }

  .workflow-status-grid.is-three {
    grid-template-columns: 1fr;
  }

  #scriptImportView > .stage-subview-status-panel {
    width: 100%;
  }

  .auth-screen {
    grid-template-columns: 1fr;
  }

  .video-management-summary,
  .video-list-editor-facts,
  .video-list-editor-params,
  .video-list-editor-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-left {
    min-height: auto;
    padding: 26px;
  }

  .auth-panel {
    min-height: auto;
    padding: 26px;
  }

  .workspace-screen {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .page-head,
  .project-switcher,
  .top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .project-switcher select,
  .compact-button,
  .secondary-button {
    width: 100%;
  }

  .video-reference-grid,
  .video-mode-tabs,
  .video-param-row,
  .video-control-grid {
    grid-template-columns: 1fr;
  }

  .video-prompt-head {
    grid-template-columns: 1fr;
  }

  .video-prompt-head span {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .view {
    padding: 16px;
  }

  .metric-grid,
  .pipeline-strip,
  .project-stage-board,
  .extraction-summary-grid,
  .asset-grid,
  .split-workspace,
  .script-processor-layout,
  .asset-library-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .api-management-layout,
  .api-priority-board,
  .api-provider-form,
  .api-purpose-fields {
    grid-template-columns: 1fr;
  }

  .asset-banner-head,
  .banner-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .asset-target-row,
  .asset-target-row.table-head {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .asset-target-row.table-head {
    display: none;
  }

  .stage-task-row,
  .stage-task-row.head {
    grid-template-columns: 1fr;
  }

  .production-card,
  #assetsView.hide-thumbnails .production-card {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .prompt-editor {
    grid-column: auto;
  }

  .asset-check {
    flex-direction: row;
    justify-content: flex-start;
  }

  .thumb-button,
  .asset-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .shot-row {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .shot-row.head {
    display: none;
  }
}

#assetsView .asset-library-layout {
  grid-template-columns: 1152px 1058px;
  width: 2224px;
  min-width: 2224px;
}

#assetsView .production-card {
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px 152px 284px;
  width: 100%;
  min-width: 0;
}

#assetsView .production-row-head {
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px 152px 284px;
}

#assetsView.hide-thumbnails .production-card {
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px minmax(152px, 1fr);
  min-width: 0;
}

#assetsView.hide-thumbnails .production-row-head {
  grid-template-columns: 48px 58px 100px 36px 84px 70px 104px 216px minmax(152px, 1fr);
}

#assetsView .thumb-button,
#assetsView .asset-thumb {
  width: 284px;
  height: 160px;
  object-fit: contain;
  background: #050707;
}

#assetsView .production-banner[data-group="scenes"] .thumb-button,
#assetsView .production-banner[data-group="props"] .thumb-button,
#assetsView .production-banner[data-group="scenes"] .asset-thumb,
#assetsView .production-banner[data-group="props"] .asset-thumb {
  width: 284px;
  height: 160px;
  object-fit: contain;
  background: #050707;
}

#assetsView .thumb-button.is-multiview,
#assetsView .thumb-button.is-multiview .asset-thumb {
  width: 284px;
  height: 160px;
}

#assetsView .production-card > .thumb-button {
  justify-self: center;
  align-self: center;
  border: 0;
  outline: 1px solid rgba(67, 215, 198, 0.18);
  outline-offset: -1px;
}

#assetsView .production-card > .thumb-view-toggle {
  grid-column: 10;
  grid-row: 1 / 3;
  align-self: end;
  justify-self: center;
  margin: 0 0 6px;
  z-index: 3;
}

#assetsView .asset-preview-panel {
  position: relative;
  top: auto;
  z-index: 45;
  width: 1058px;
}

#assetsView .asset-preview-panel .large-preview-image {
  width: 1024px;
  height: 576px;
  max-width: none;
}

#assetsView .large-preview-frame.is-multiview {
  height: 576px;
}

#assetsView .large-preview-frame.is-multiview .large-preview-image {
  width: 1024px;
  height: 576px;
  object-fit: contain;
}


/* asset alias maintenance */
.video-reference-type-radios {
  flex-wrap: nowrap;
}

.video-reference-type-radios label {
  justify-content: center;
  flex: 0 0 auto;
  min-width: 76px;
  padding-left: 16px;
  padding-right: 16px;
  white-space: nowrap;
}

.video-reference-type-radios input {
  flex: 0 0 auto;
}

.asset-extraction-aliases {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
  color: #a6cfc8;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
}

.asset-extraction-alias-chip {
  display: inline-flex;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(67, 215, 198, 0.24);
  border-radius: 999px;
  background: rgba(67, 215, 198, 0.1);
  color: #bcece5;
  padding: 1px 6px;
  white-space: nowrap;
}

.asset-extraction-alias-chip.is-candidate {
  border-color: rgba(255, 196, 87, 0.28);
  background: rgba(255, 196, 87, 0.11);
  color: #ffe4a8;
}

.asset-name-cell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 4px;
  align-content: stretch;
  align-items: start;
}

.asset-name-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}

.asset-alias-list.is-empty {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.asset-alias-chip {
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 999px;
  background: rgba(67, 215, 198, 0.08);
  color: #a8ded6;
  padding: 1px 5px;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.asset-name-cell .asset-alias-button {
  align-self: end;
  justify-self: start;
  min-width: 64px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.asset-alias-panel {
  width: min(520px, calc(100vw - 36px));
}

.asset-alias-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.asset-alias-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.asset-alias-field textarea {
  min-height: 150px;
  resize: vertical;
  border: 1px solid rgba(67, 215, 198, 0.22);
  border-radius: 8px;
  background: #f8fbfa;
  color: #10201e;
  padding: 10px 12px;
  font: inherit;
  line-height: 1.55;
}

.asset-alias-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.asset-add-panel {
  width: min(520px, calc(100vw - 36px));
}

.asset-add-fields {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.asset-add-fields label {
  display: grid;
  gap: 8px;
}

.asset-add-fields span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.asset-add-fields input,
.asset-add-fields textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(67, 215, 198, 0.28);
  border-radius: 8px;
  background: #f8fbfa;
  color: #10201e;
  padding: 10px 12px;
  font: inherit;
}

.asset-add-fields input {
  height: 40px;
}

.asset-add-fields textarea {
  min-height: 118px;
  resize: vertical;
  line-height: 1.55;
}

.asset-add-error {
  min-height: 18px;
  margin-top: 10px;
  color: #ffc8c8;
  font-size: 12px;
  font-weight: 800;
}

/* 项目总览：五步工作流 */
#dashboardView .project-stage-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: 1320px;
  column-gap: 112px;
  row-gap: 94px;
  overflow: visible;
  padding: 10px 4px 18px;
}

#dashboardView .stage-card {
  position: relative;
  min-height: 172px;
  grid-template-columns: minmax(160px, 210px) 110px minmax(0, 1fr);
  grid-template-rows: minmax(58px, auto) auto;
  gap: 10px 16px;
  align-content: center;
  align-items: center;
  overflow: visible;
  padding: 14px 18px;
}

#dashboardView .stage-card:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 84px;
  height: 38px;
  background: linear-gradient(90deg, #28bfae, #73f0df);
  clip-path: polygon(0 36%, 70% 36%, 70% 0, 100% 50%, 70% 100%, 70% 64%, 0 64%);
  filter: drop-shadow(0 0 8px rgba(67, 215, 198, 0.72));
}

#dashboardView .stage-card:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

#dashboardView .stage-card:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

#dashboardView .stage-card:nth-child(3) {
  grid-column: 1 / -1;
  grid-row: 2;
}

#dashboardView .stage-card:nth-child(4) {
  grid-column: 1;
  grid-row: 3;
}

#dashboardView .stage-card:nth-child(5) {
  grid-column: 2;
  grid-row: 3;
}

#dashboardView .stage-card:nth-child(1)::after,
#dashboardView .stage-card:nth-child(4)::after {
  top: 50%;
  right: -98px;
  bottom: auto;
  transform: translateY(-50%);
}

#dashboardView .stage-card:nth-child(2)::after {
  top: auto;
  right: auto;
  bottom: -66px;
  left: 50%;
  transform: translateX(-50%) rotate(90deg);
}

#dashboardView .stage-card:nth-child(3)::after {
  top: auto;
  right: auto;
  bottom: -66px;
  left: 25%;
  transform: translateX(-50%) rotate(90deg);
}

#dashboardView .stage-card-head {
  grid-column: 1;
  grid-row: 1 / 3;
}

#dashboardView .stage-count {
  grid-column: 2;
  grid-row: 1;
}

#dashboardView .stage-status-details {
  display: grid;
  grid-column: 3;
  grid-row: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border: 0;
  padding: 0;
}

#dashboardView .stage-status-details span {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.16);
  color: #d6e1df;
  padding: 9px 11px;
  font-size: 12px;
  font-weight: 800;
}

#dashboardView .stage-progress-list {
  display: grid;
  grid-column: 2 / 4;
  grid-row: 2;
  gap: 4px;
}

#dashboardView .stage-progress-row {
  display: grid;
  grid-template-columns: 90px minmax(60px, 1fr) 34px;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

#dashboardView .stage-progress-row[hidden] {
  display: none;
}

#dashboardView .stage-progress-label,
#dashboardView .stage-progress-percent {
  color: #c8d3d1;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

#dashboardView .stage-progress-percent {
  color: var(--muted);
  text-align: right;
}

#dashboardView .stage-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.09);
}

#dashboardView .stage-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

#dashboardView .stage-progress-fill.is-completed {
  background: #71d66f;
}

#dashboardView .stage-progress-fill.is-in-progress {
  background: #facc15;
}

#dashboardView .stage-progress-fill.is-unprocessed {
  background: #77878b;
}

#dashboardView .stage-card.stage-done {
  border-color: rgba(113, 214, 111, 0.52);
  background: linear-gradient(145deg, rgba(113, 214, 111, 0.24), rgba(113, 214, 111, 0.08)), #0d1712;
}

#dashboardView .stage-card.stage-active,
#dashboardView .stage-card.stage-idle {
  border-color: rgba(250, 204, 21, 0.5);
  background: linear-gradient(145deg, rgba(250, 204, 21, 0.22), rgba(250, 204, 21, 0.07)), #17160d;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.06), 0 12px 34px rgba(250, 204, 21, 0.07);
  color: var(--muted);
  opacity: 1;
}

#dashboardView .stage-card.stage-idle .stage-card-head strong,
#dashboardView .stage-card.stage-idle .stage-count strong {
  color: var(--text);
}

#dashboardView .stage-card.stage-active .stage-card-head span,
#dashboardView .stage-card.stage-idle .stage-card-head span {
  background: linear-gradient(90deg, #facc15, #e8b928);
}

#dashboardView .stage-card.stage-idle .stage-card-head em,
#dashboardView .stage-card.stage-active .stage-card-head em {
  color: #f9e38f;
}

@media (max-width: 820px) {
  #dashboardView .project-stage-board {
    grid-template-columns: 1fr;
    gap: 38px;
    overflow: visible;
  }

  #dashboardView .stage-card:nth-child(n) {
    grid-column: 1;
    grid-row: auto;
  }

  #dashboardView .stage-card:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -66px;
    left: 50%;
    transform: translateX(-50%) rotate(90deg);
  }

  #dashboardView .stage-card {
    min-height: 190px;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 8px;
  }

  #dashboardView .stage-card-head,
  #dashboardView .stage-count,
  #dashboardView .stage-status-details,
  #dashboardView .stage-progress-list {
    grid-column: 1;
    grid-row: auto;
  }

  #dashboardView .stage-status-details {
    grid-template-columns: 1fr;
  }
}

/* v236: visible set-as-reference action for every general-image history card. */
.image-tool-history-image-button {
  display: grid;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 5px;
  background: #0f172a;
  cursor: zoom-in;
  padding: 0;
  overflow: hidden;
}

.image-tool-history-card:focus-within {
  border-color: rgba(67, 215, 198, 0.7);
}

.image-tool-history-reference-button {
  width: 100%;
  min-height: 30px;
  border-color: rgba(67, 215, 198, 0.36);
  color: #d7fffa;
  font-size: 12px;
}
:root { --video-layout-accent: #a4c8ae; }
.video-layout-panel { margin: 10px 0; padding: 12px; border: 1px solid rgba(164,200,174,.28); border-radius: 10px; background: rgba(164,200,174,.045); }
.video-layout-panel[hidden], .video-layout-panel [hidden] { display: none !important; }
.video-layout-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.video-layout-head strong { margin-right: auto; }
.video-layout-upload { cursor: pointer; position: relative; overflow: hidden; }
.video-layout-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.video-layout-comparison { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 10px 0; }
.video-layout-comparison figure { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 7px; align-items: flex-start; }
.video-layout-comparison figcaption { font-size: 12px; color: var(--video-layout-accent); }
.video-layout-comparison img, .video-layout-comparison video { width: auto; max-width: 100%; height: 110px; object-fit: contain; border-radius: 5px; background: #171b1c; }
.video-layout-preview { padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.video-layout-panel small, .video-layout-comparison figure > span { font-size: 11px; opacity: .72; }
.video-layout-use { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--video-layout-accent); }
.video-layout-use input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--video-layout-accent); }
.video-layout-use > span { width: auto; white-space: normal; }
.video-layout-badge { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 11px; color: var(--video-layout-accent); }
.video-layout-badge img { width: 25px; height: 34px; object-fit: contain; border-radius: 3px; }
@media (max-width: 600px) { .video-layout-head { gap: 6px; } .video-layout-comparison { gap: 8px; } .video-layout-use { flex-basis: 100%; } }
