:root {
  color-scheme: light;
  --ink: #121515;
  --muted: #66706d;
  --line: #d9dfdc;
  --paper: #f4f6f3;
  --surface: #ffffff;
  --dark: #111514;
  --teal: #0e8d87;
  --teal-dark: #086762;
  --coral: #f06449;
  --lime: #c8ef58;
  --yellow: #f1c94b;
  --danger: #b43c32;
  --radius: 6px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  color: #fff;
  background: var(--dark);
}

.brand {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
  color: #fff;
  text-decoration: none;
}

.brand img { width: 34px; height: 34px; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 16px; }
.brand small { color: #aeb9b5; font-size: 9px; }

.primary-nav { display: grid; gap: 6px; margin-top: 38px; }

.nav-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #b9c2bf;
  background: transparent;
  text-decoration: none;
  text-align: left;
}

.nav-button:hover { color: #fff; background: #202624; }
.nav-button.active { color: #0d1614; background: var(--lime); }
.nav-icon { width: 20px; text-align: center; font-size: 18px; }

.sidebar-foot { display: grid; gap: 10px; margin-top: auto; padding: 16px 10px 4px; }
.sidebar-foot a { color: #9da9a5; font-size: 13px; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }

.main { min-width: 0; padding: 30px 36px 48px; }

.topbar, .workbench-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar h1, .workbench-header h1 { margin: 3px 0 0; font-size: 28px; line-height: 1.2; }
.eyebrow { margin: 0; color: var(--teal-dark); font-size: 11px; font-weight: 800; }

.topbar-actions, .workbench-actions { display: flex; align-items: center; gap: 12px; }
.account-state, .save-state { color: var(--muted); font-size: 13px; }

.primary-button, .secondary-button, .back-button, .icon-button {
  min-height: 38px;
  border-radius: var(--radius);
  font-weight: 700;
}

.primary-button {
  padding: 0 17px;
  border: 1px solid var(--teal);
  color: #fff;
  background: var(--teal);
}
.primary-button:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }

.secondary-button {
  padding: 0 15px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}
.secondary-button:hover { border-color: #98a49f; }

.automation-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0 20px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
}

.automation-copy { display: grid; gap: 3px; min-width: 0; }
.automation-copy strong { font-size: 14px; }
.automation-copy span { color: var(--teal-dark); font-size: 13px; font-weight: 700; }
.automation-copy small { color: var(--muted); font-size: 12px; }
.automation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

@media (max-width: 680px) {
  .automation-panel { align-items: stretch; flex-direction: column; }
  .automation-actions { justify-content: flex-start; }
}

.icon-button, .back-button {
  width: 38px;
  padding: 0;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
  font-size: 20px;
}

.project-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.project-toolbar-actions { display: flex; align-items: center; gap: 10px; }
.archive-directory-status { max-width: 220px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: #e9eeeb; }
.segmented button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgb(13 25 21 / 8%); }

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

.project-card {
  position: relative;
  height: 330px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #17201d;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}
.project-card:hover { transform: translateY(-2px); border-color: #aab6b1; box-shadow: 0 12px 24px rgb(23 37 32 / 8%); }
.project-cover { position: absolute; inset: 0; overflow: hidden; background: #dfe5e2; }
.project-cover img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 50%; }
.project-card-open { position: absolute; inset: 0; z-index: 2; padding: 0; border: 0; background: transparent; }
.project-card-open:focus-visible { outline: 3px solid var(--lime); outline-offset: -4px; }
.project-title-edit { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; padding: 0; border: 1px solid rgb(255 255 255 / 42%); border-radius: 4px; color: #fff; background: rgb(10 24 20 / 78%); font-size: 20px; line-height: 1; }
.project-title-edit:hover { background: rgb(10 24 20 / 94%); }
.project-next-episode { position: absolute; top: 12px; right: 56px; z-index: 3; min-height: 36px; padding: 0 12px; border: 1px solid rgb(255 255 255 / 42%); border-radius: 4px; color: #102018; background: var(--lime); font-size: 12px; font-weight: 800; }
.project-next-episode:hover { background: #d1ff65; }
.local-archive-badge { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 5px 8px; border-radius: 4px; color: #fff; background: rgb(12 33 29 / 86%); font-size: 10px; font-weight: 800; }
.project-card-body { position: absolute; right: 0; bottom: 0; left: 0; z-index: 1; min-height: 142px; display: flex; flex-direction: column; padding: 14px 18px 16px; color: #fff; background: rgb(8 20 17 / 78%); pointer-events: none; }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.project-type { overflow: hidden; color: #d5fff4; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.project-status { flex: 0 0 auto; padding: 4px 7px; border-radius: 4px; color: #332900; background: #fff2b8; font-size: 11px; }
.project-card h2 { margin: 11px 0 5px; color: #fff; font-size: 25px; line-height: 1.2; overflow-wrap: anywhere; text-shadow: 0 2px 4px rgb(0 0 0 / 72%); }
.project-card p { margin: 0; color: rgb(255 255 255 / 76%); font-size: 13px; }
.project-card-foot { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.mini-progress { flex: 1; height: 5px; overflow: hidden; border-radius: 3px; background: rgb(255 255 255 / 28%); }
.mini-progress span { display: block; height: 100%; background: var(--coral); }
.project-card-foot small { color: rgb(255 255 255 / 76%); }

.empty-state {
  min-height: 360px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--dark);
}
.empty-state img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .48; }
.empty-state::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(10 15 14 / 88%), rgb(10 15 14 / 18%)); }
.empty-state div { position: relative; z-index: 1; max-width: 420px; padding: 78px 54px; color: #fff; }
.empty-state h2 { margin: 0 0 24px; font-size: 31px; }

.workbench-header { justify-content: flex-start; }
.workbench-title { min-width: 0; flex: 1; }
.workbench-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workbench-actions { margin-left: auto; }

.progress-strip { display: flex; align-items: center; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.progress-bar { flex: 1; height: 4px; border-radius: 3px; background: #dfe5e2; overflow: hidden; }
.progress-bar span { display: block; width: 0; height: 100%; background: var(--teal); transition: width 220ms ease; }
.progress-strip > span { min-width: 40px; color: var(--muted); font-size: 12px; }

.workbench-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - 190px); }
.step-rail { padding: 28px 24px 28px 0; border-right: 1px solid var(--line); }
.step-rail ol { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.step-button { width: 100%; min-height: 62px; display: grid; grid-template-columns: 31px 1fr 10px; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; text-align: left; }
.step-button:hover:not(:disabled), .step-button.active { border-color: var(--line); background: var(--surface); }
.step-button:disabled { cursor: default; }
.step-index { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: #e4e9e6; font-size: 11px; font-weight: 800; }
.step-copy { min-width: 0; display: grid; gap: 3px; }
.step-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.step-copy small { color: var(--muted); font-size: 11px; }
.step-dot { width: 7px; height: 7px; border-radius: 50%; background: #bbc4c0; }
.step-button[data-status="approved"] .step-index { color: #fff; background: var(--teal); }
.step-button[data-status="approved"] .step-dot { background: var(--teal); }
.step-button[data-status="in_progress"] .step-dot, .step-button[data-status="needs_review"] .step-dot { background: var(--coral); }
.step-button[data-status="failed"] .step-dot { background: var(--danger); }

.stage { min-width: 0; padding: 32px 0 32px 34px; }
.stage-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding-bottom: 23px; }
.stage-number { margin: 0 0 5px; color: var(--coral); font-size: 11px; font-weight: 800; }
.stage h2 { margin: 0; font-size: 24px; }
.status-badge { padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: var(--surface); font-size: 12px; }

.source-stage { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; }
.source-toolbar, .source-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.source-toolbar { margin-bottom: 11px; }
.source-toolbar label { font-weight: 750; }
.source-toolbar span, .source-footer span { color: var(--muted); font-size: 12px; }
.source-stage textarea { width: 100%; min-height: 390px; resize: vertical; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fbfcfa; line-height: 1.75; outline: none; }
.source-stage textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(14 141 135 / 10%); }
.source-footer { margin-top: 12px; }
.source-review-panel { display: grid; gap: 16px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.series-planning-panel { display: grid; gap: 14px; margin-top: 22px; padding: 18px; border: 1px solid var(--line); background: #f8faf8; }
.series-planning-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.series-planning-panel h3 { margin: 2px 0 0; font-size: 18px; }
.series-plan-config { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(120px, .7fr) minmax(140px, .8fr) minmax(220px, 1.3fr); gap: 12px; align-items: end; }
.series-plan-config label { display: grid; gap: 6px; }
.series-plan-config label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.series-plan-config select, .series-plan-config input { width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); font: inherit; }
.series-plan-capacity { min-height: 42px; display: flex; align-items: center; padding: 0 13px; border-left: 3px solid var(--teal); background: #edf5f1; color: #284b3e; font-size: 12px; font-weight: 700; }
.series-plan-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.series-plan-message { padding: 11px 13px; border-left: 3px solid #d8b33b; background: #fff9e7; color: #5f5126; font-size: 12px; line-height: 1.6; }
.series-plan-result { display: grid; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.series-plan-result[hidden] { display: none; }
.series-plan-result > header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.series-plan-result > header div { display: grid; gap: 4px; }
.series-plan-result > header strong { font-size: 15px; }
.series-plan-result > header span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.series-plan-result > header em { color: var(--teal-dark); font-size: 10px; font-style: normal; font-weight: 800; white-space: nowrap; }
.series-plan-list { max-height: 520px; overflow-y: auto; display: grid; border-top: 1px solid var(--line); }
.series-plan-list article { display: grid; grid-template-columns: minmax(170px, 220px) minmax(0, 1fr); gap: 14px; padding: 13px 8px; border-bottom: 1px solid var(--line); }
.series-plan-list article[data-current="true"] { border-left: 3px solid var(--teal); background: #f1f7f4; }
.series-plan-list article > header { display: grid; align-content: start; gap: 4px; }
.series-plan-list article > header span { color: var(--coral); font-size: 10px; font-weight: 800; }
.series-plan-list article > header strong { font-size: 12px; line-height: 1.5; }
.series-plan-list article > header em { width: fit-content; padding: 2px 5px; background: #e9f2ee; color: var(--teal-dark); font-size: 9px; font-style: normal; }
.series-plan-list dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin: 0; }
.series-plan-list dt { color: var(--muted); font-size: 9px; font-weight: 800; }
.series-plan-list dd { margin: 3px 0 0; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.adaptation-episode-context { display: grid; grid-template-columns: minmax(170px, .6fr) minmax(0, 2fr); gap: 18px; padding: 16px 18px; border-left: 4px solid var(--teal); background: #edf5f1; }
.adaptation-episode-context[hidden] { display: none; }
.adaptation-episode-context > div { display: grid; align-content: start; gap: 5px; }
.adaptation-episode-context > div span { color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.adaptation-episode-context > div strong { font-size: 17px; line-height: 1.4; }
.adaptation-episode-context dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; }
.adaptation-episode-context dt { color: var(--muted); font-size: 9px; font-weight: 800; }
.adaptation-episode-context dd { margin: 4px 0 0; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.source-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.source-review-heading h3 { margin: 0; font-size: 18px; }
.source-review-empty { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--line); gap: 1px; }
.source-review-empty[hidden] { display: none; }
.source-review-empty span { padding: 13px 14px; color: var(--muted); background: var(--surface); font-size: 11px; font-weight: 700; text-align: center; }
.source-review-running { min-height: 88px; display: flex; align-items: center; gap: 15px; padding: 17px 18px; border: 1px solid var(--line); background: var(--surface); }
.source-review-running[hidden], .source-review-error[hidden], .source-review-result[hidden] { display: none; }
.source-review-running strong { display: block; margin-bottom: 5px; font-size: 13px; }
.source-review-running p, .source-review-error p { margin: 0; color: var(--muted); font-size: 12px; }
.source-review-error { padding: 15px 17px; border: 1px solid #e5b8b2; background: #fff7f5; }
.source-review-error strong { display: block; margin-bottom: 5px; font-size: 13px; }
.source-review-error[data-uncertain="true"] { border-color: #e7d184; background: #fffbeb; }
.source-review-result { display: grid; gap: 20px; }
.source-review-result > header { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; padding: 17px 18px; border-left: 4px solid var(--coral); background: #f7f9f7; }
.source-review-result > header > div { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 8px; }
.source-review-result > header span { grid-column: 1 / -1; color: var(--coral); font-size: 11px; font-weight: 800; }
.source-review-result[data-verdict="pass"] > header { border-left-color: var(--teal); }
.source-review-result[data-verdict="pass"] > header span { color: var(--teal-dark); }
.source-review-result > header strong { font-size: 34px; line-height: 1; }
.source-review-result > header small { padding-bottom: 3px; color: var(--muted); font-size: 10px; }
.source-review-result > header p { margin: 0; color: #39423f; font-size: 13px; line-height: 1.7; }
.source-review-artifact { display: grid; grid-template-columns: minmax(180px, 28%) minmax(0, 1fr); gap: 18px; align-items: center; padding: 14px 16px; border-left: 3px solid var(--teal); background: #eef5f1; }
.source-review-artifact[hidden], .source-review-dimensions[hidden], .source-review-roles[hidden] { display: none; }
.source-review-artifact div { display: grid; gap: 4px; }
.source-review-artifact span { color: var(--teal-dark); font-size: 10px; font-weight: 800; }
.source-review-artifact strong { font-size: 15px; }
.source-review-artifact p { margin: 0; color: #3d514a; font-size: 12px; line-height: 1.65; }
.source-review-dimensions { display: grid; gap: 10px; }
.source-review-dimensions > div { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.source-review-dimensions article { min-width: 0; padding: 12px; background: #fff; }
.source-review-dimensions article[data-applicable="false"] { background: #f4f6f5; }
.source-review-dimensions span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.source-review-dimensions strong { display: block; margin-top: 5px; font-size: 23px; }
.source-review-dimensions article[data-applicable="false"] strong { color: var(--muted); font-size: 14px; }
.source-review-dimensions p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.source-review-roles { display: grid; gap: 10px; }
.source-review-roles > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.source-review-roles > header h4 { margin: 0; }
.source-review-roles > header span { color: #206548; font-size: 11px; font-weight: 800; }
.source-review-roles > div { display: grid; border-top: 1px solid var(--line); }
.source-review-roles article { display: grid; gap: 10px; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.source-review-roles article > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-review-roles article > header strong { font-size: 13px; }
.source-review-roles article > header span { padding: 3px 6px; border-radius: 3px; color: #206548; background: #e7f3ed; font-size: 9px; font-weight: 800; }
.source-review-roles article[data-status="partial"] > header span { color: #7c5c00; background: #fff5cc; }
.source-review-roles article[data-status="mentioned"] > header span { color: var(--muted); background: #eef1ef; }
.source-review-roles dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; margin: 0; }
.source-review-roles dl div { min-width: 0; }
.source-review-roles dt { color: var(--muted); font-size: 9px; font-weight: 800; }
.source-review-roles dd { margin: 3px 0 0; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.source-review-roles article > small { color: #718079; font-size: 9px; line-height: 1.5; }
.source-review-profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.source-review-profile div { min-width: 0; padding: 12px 14px; background: #fff; }
.source-review-profile dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.source-review-profile dd { margin: 5px 0 0; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.source-review-result h4 { margin: 0 0 10px; font-size: 13px; }
.source-review-checks, .source-review-issues { display: grid; gap: 8px; }
.source-review-checks article { display: grid; grid-template-columns: 70px minmax(110px, 170px) minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.source-review-checks span { color: #206548; font-size: 10px; font-weight: 800; }
.source-review-checks article[data-status="warning"] span { color: #8b6200; }
.source-review-checks article[data-status="fail"] span { color: #a42d25; }
.source-review-checks p { margin: 0; color: var(--muted); line-height: 1.55; }
.source-review-check-copy { display: grid; gap: 5px; }
.source-review-check-copy small { color: #5f6d67; font-size: 9px; font-weight: 750; }
.source-review-check-copy em { color: #718079; font-size: 9px; font-style: normal; line-height: 1.45; }
.source-review-check-action { min-width: 72px; padding: 5px 8px; border: 1px solid #9baca5; border-radius: 4px; color: #245f4e; background: #fff; font: inherit; font-weight: 750; cursor: pointer; }
.source-review-check-action:hover { border-color: var(--teal); background: #edf6f2; }
.source-review-assist { grid-column: 2 / -1; display: grid; gap: 12px; margin-top: 2px; padding: 14px; border-left: 3px solid #d9c66b; background: #fffcf1; }
.source-review-assist[hidden] { display: none; }
.source-review-assist-question { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; }
.source-review-assist-question strong { color: #6e5200; font-size: 11px; }
.source-review-assist label { display: grid; gap: 7px; color: #39423f; font-size: 11px; font-weight: 750; }
.source-review-assist textarea { width: 100%; min-height: 110px; padding: 10px 11px; resize: vertical; border: 1px solid #ccd5d1; border-radius: 4px; color: var(--ink); background: #fff; font: 12px/1.65 "Microsoft YaHei", sans-serif; }
.source-review-assist textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgb(14 141 135 / 10%); }
.source-review-assist-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.source-review-assist-actions span { color: var(--muted); font-size: 10px; font-weight: 500; }
.source-review-assist-actions button { flex: none; }
.source-review-later-task { padding: 11px 12px; border: 1px solid #d7dfdb; background: #fff; }
.source-review-later-task strong { display: block; margin-bottom: 5px; color: #36574b; font-size: 11px; }
.source-review-later-task p { margin: 0; }
.source-review-issues article { padding: 12px 14px; border-left: 3px solid #d9c66b; background: #fffbeb; }
.source-review-issues article[data-severity="high"] { border-left-color: #bd3f37; background: #fff6f4; }
.source-review-issues article[data-severity="low"] { border-left-color: #8ca8a0; background: #f5f8f7; }
.source-review-issues strong { display: block; font-size: 12px; }
.source-review-issues p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.source-review-issues small { display: block; margin-top: 6px; color: #718079; font-size: 9px; }
.source-review-draft { border: 1px solid var(--line); background: var(--surface); }
.source-review-draft summary { cursor: pointer; padding: 13px 15px; font-size: 12px; font-weight: 750; }
.source-review-draft pre { max-height: 430px; margin: 0; overflow: auto; padding: 16px; border-top: 1px solid var(--line); background: #fff; font: 12px/1.75 "Microsoft YaHei", sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-review-draft > div { display: flex; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); }
.source-review-billing { background: #fff; }

.future-stage { min-height: 430px; display: grid; place-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.future-stage[hidden] { display: none; }
.future-output { display: flex; align-items: center; gap: 17px; color: var(--muted); }
.output-mark { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #adb8b3; border-radius: 50%; font-size: 25px; }
.future-output h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }
.future-output p { margin: 0; font-size: 13px; }

.adaptation-stage { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.adaptation-stage[hidden] { display: none; }
.storyboard-stage { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.storyboard-stage[hidden] { display: none; }
.prompt-design-stage { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.prompt-design-stage[hidden] { display: none; }
.visual-generation-stage { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.visual-generation-stage[hidden] { display: none; }
.video-generation-stage { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.video-generation-stage[hidden] { display: none; }
.voice-timeline-stage { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.voice-timeline-stage[hidden] { display: none; }
.adaptation-config { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.config-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.config-heading h3 { margin: 0 0 5px; font-size: 17px; }
.config-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.billing-chip { flex: 0 0 auto; padding: 5px 8px; border-radius: 4px; color: #4e4200; background: #f8e68e; font-size: 11px; font-weight: 800; }
.config-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.config-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.config-grid .config-wide { grid-column: 1 / -1; }
.config-grid input, .config-grid select { width: 100%; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fbfcfa; outline: none; }
.config-grid input:focus, .config-grid select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgb(14 141 135 / 10%); }
.storyboard-config-grid { grid-template-columns: repeat(2, minmax(0, 260px)); }
.storyboard-readiness { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border-left: 3px solid #bd3f37; background: #fff6f4; }
.storyboard-readiness[hidden] { display: none; }
.storyboard-readiness[data-ready="true"] { border-left-color: var(--teal); background: #f1f8f6; }
.storyboard-readiness span { display: block; margin-bottom: 4px; color: #a52f29; font-size: 10px; font-weight: 800; }
.storyboard-readiness[data-ready="true"] span { color: #146b61; }
.storyboard-readiness strong { display: block; font-size: 13px; }
.storyboard-readiness p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }

.run-state, .adaptation-error { min-height: 92px; display: flex; align-items: center; gap: 15px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.run-state[hidden], .adaptation-error[hidden] { display: none; }
.run-state strong, .adaptation-error strong { display: block; margin-bottom: 5px; font-size: 14px; }
.run-state p, .adaptation-error p { margin: 0; color: var(--muted); font-size: 12px; }
.run-spinner { width: 28px; height: 28px; flex: 0 0 auto; border: 3px solid #d9e3df; border-top-color: var(--teal); border-radius: 50%; animation: spin 850ms linear infinite; }
.adaptation-error { display: block; border-color: #e5b8b2; background: #fff7f5; }
.adaptation-error p { line-height: 1.7; }
.adaptation-error[data-uncertain="true"] { border-color: #e7d184; background: #fffbeb; }
.storyboard-error-diagnostics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(177, 92, 82, .22); }
.storyboard-error-diagnostics div { min-width: 0; }
.storyboard-error-diagnostics dt { color: #8e514b; font-size: 10px; font-weight: 800; }
.storyboard-error-diagnostics dd { margin: 3px 0 0; color: #573c38; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.storyboard-quality-summary { margin: 16px 0 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.storyboard-quality-summary h4, .storyboard-quality-summary p { margin: 0; }
.storyboard-quality-summary h4 { font-size: 13px; }
.storyboard-quality-summary p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.storyboard-quality-issues { display: grid; gap: 7px; margin-top: 10px; }
.storyboard-quality-issues[hidden] { display: none; }
.storyboard-quality-issue { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; padding: 9px 10px; border-left: 3px solid #d2a329; background: #fffbed; }
.storyboard-quality-issue[data-severity="blocking"] { border-left-color: #c9453d; background: #fff4f2; }
.storyboard-quality-issue > strong { color: #8b6410; font-size: 10px; white-space: nowrap; }
.storyboard-quality-issue[data-severity="blocking"] > strong { color: #a92e28; }
.storyboard-quality-issue-copy { min-width: 0; }
.storyboard-quality-issue-copy strong, .storyboard-quality-issue-copy p, .storyboard-quality-issue-copy small { display: block; margin: 0; }
.storyboard-quality-issue-copy strong { font-size: 11px; }
.storyboard-quality-issue-copy p { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.storyboard-quality-issue-copy small { margin-top: 4px; color: #806b3b; font-size: 10px; }
.storyboard-quality-issue[data-severity="blocking"] .storyboard-quality-issue-copy small { color: #a92e28; }
.adaptation-error[data-recovery="cover"] { border-color: #d9c66b; background: #fffbed; }
.adaptation-error[data-recovery="image"] { border-color: #d9c66b; background: #fffbed; }
@keyframes spin { to { transform: rotate(360deg); } }

.delivery-resolution-note { display: block; max-width: 360px; color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.5; }

.archive-progress-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgb(10 15 14 / 64%); }
.archive-progress-overlay[hidden] { display: none; }
.archive-progress-panel { width: min(520px, calc(100vw - 40px)); display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 18px; align-items: start; padding: 24px; border: 1px solid rgb(255 255 255 / 14%); border-radius: 6px; color: #fff; background: #101916; box-shadow: 0 24px 80px rgb(0 0 0 / 35%); }
.archive-progress-spinner { width: 42px; height: 42px; border-width: 4px; border-color: rgb(255 255 255 / 22%); border-top-color: var(--lime); }
.archive-progress-overlay[data-state="success"] .archive-progress-spinner { border-color: var(--lime); animation: none; }
.archive-progress-overlay[data-state="error"] .archive-progress-spinner { border-color: var(--danger); animation: none; }
.archive-progress-copy { min-width: 0; }
.archive-progress-copy .eyebrow { margin: 0 0 4px; color: var(--lime); }
.archive-progress-copy h2 { margin: 0; font-size: 21px; }
.archive-progress-copy > p:not(.eyebrow) { min-height: 21px; margin: 7px 0 13px; overflow: hidden; color: rgb(255 255 255 / 72%); font-size: 12px; line-height: 1.6; text-overflow: ellipsis; white-space: nowrap; }
.archive-progress-copy progress { width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 4px; background: rgb(255 255 255 / 18%); accent-color: var(--lime); }
.archive-progress-copy progress::-webkit-progress-bar { background: rgb(255 255 255 / 18%); }
.archive-progress-copy progress::-webkit-progress-value { background: var(--lime); }
.archive-progress-meta { display: flex; justify-content: space-between; gap: 14px; margin-top: 9px; font-size: 11px; }
.archive-progress-meta strong { color: #fff; }
.archive-progress-meta span { color: rgb(255 255 255 / 64%); }

.adaptation-result { display: grid; gap: 24px; }
.adaptation-result[hidden] { display: none; }
.storyboard-result { display: grid; gap: 24px; }
.storyboard-result[hidden] { display: none; }
.prompt-design-result { display: grid; gap: 24px; }
.prompt-design-result[hidden] { display: none; }
.visual-generation-result { display: grid; gap: 24px; }
.visual-generation-result[hidden] { display: none; }
.visual-extension-notice { display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 14px 16px; border-left: 3px solid var(--teal); background: #f1f8f6; }
.visual-extension-notice[hidden] { display: none; }
.visual-extension-notice strong { display: block; margin-bottom: 4px; font-size: 13px; }
.visual-extension-notice p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.visual-extension-notice > span { flex: 0 0 auto; padding: 5px 7px; color: #146b61; background: #d8efea; font-size: 10px; font-weight: 800; }
.video-generation-result { display: grid; gap: 24px; }
.video-generation-result[hidden] { display: none; }
.video-completeness { display: grid; gap: 15px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.video-completeness[hidden] { display: none; }
.video-completeness > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.video-completeness h4 { margin: 3px 0 0; font-size: 17px; }
.video-completeness-state { flex: 0 0 auto; padding: 6px 9px; border-radius: 4px; color: #84413a; background: #fbe2dd; font-size: 11px; font-weight: 800; }
.video-completeness[data-complete="true"] .video-completeness-state { color: #125c51; background: #dcefeb; }
.video-completeness-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.video-completeness-metrics div { min-width: 0; padding: 11px 12px; background: var(--surface); }
.video-completeness-metrics dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.video-completeness-metrics dd { margin: 5px 0 0; font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.video-duration-editor { margin-top: 16px; border: 1px solid var(--line); background: var(--surface); }
.video-duration-editor > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.video-duration-editor h4, .video-duration-editor p { margin: 0; }
.video-duration-editor p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.video-duration-editor > header strong { color: var(--green); font-size: 12px; }
.video-duration-editor[data-valid="false"] > header strong { color: var(--danger); }
.video-duration-editor-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); max-height: 310px; overflow-y: auto; }
.video-duration-shot { display: grid; grid-template-columns: minmax(0, 1fr) 82px; align-items: center; gap: 10px; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.video-duration-shot div { min-width: 0; }
.video-duration-shot strong, .video-duration-shot small { display: block; }
.video-duration-shot small { margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-duration-shot select { width: 100%; min-width: 0; }
.video-duration-editor-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; background: var(--line); gap: 1px; }
.video-duration-editor-metrics div { padding: 11px 12px; background: var(--surface); }
.video-duration-editor-metrics dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.video-duration-editor-metrics dd { margin: 4px 0 0; font-size: 13px; font-weight: 800; }
.prompt-shot-replan { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto; align-items: end; gap: 16px; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--surface); }
.prompt-shot-replan h4, .prompt-shot-replan p { margin: 0; }
.prompt-shot-replan > div > p:last-child { margin-top: 5px; color: var(--muted); font-size: 12px; }
.prompt-shot-replan label span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.prompt-shot-replan select, .prompt-shot-replan input { width: 100%; }
.prompt-shot-replan button { min-height: 42px; }
.prompt-shot-duration-editor { border: 1px solid var(--line); background: var(--surface); }
.prompt-shot-duration-editor[hidden] { display: none; }
.prompt-shot-duration-editor > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.prompt-shot-duration-editor h4, .prompt-shot-duration-editor p { margin: 0; }
.prompt-shot-duration-editor p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.prompt-shot-duration-editor > header strong { color: var(--green); font-size: 12px; white-space: nowrap; }
.prompt-shot-duration-editor[data-valid="false"] > header strong { color: var(--danger); }
.prompt-shot-duration-editor-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); max-height: 320px; overflow-y: auto; }
.prompt-shot-duration-item { display: grid; grid-template-columns: minmax(0, 1fr) 82px; align-items: center; gap: 10px; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prompt-shot-duration-item div { min-width: 0; }
.prompt-shot-duration-item strong, .prompt-shot-duration-item small { display: block; }
.prompt-shot-duration-item small { margin-top: 3px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prompt-shot-duration-item select { width: 100%; min-width: 0; }
.prompt-shot-duration-editor-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; background: var(--line); gap: 1px; }
.prompt-shot-duration-editor-metrics div { padding: 11px 12px; background: var(--surface); }
.prompt-shot-duration-editor-metrics dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.prompt-shot-duration-editor-metrics dd { margin: 4px 0 0; font-size: 13px; font-weight: 800; }
.video-completeness-list { display: grid; gap: 7px; }
.video-completeness-list div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-left: 3px solid var(--coral); background: #fff7f5; font-size: 11px; }
.video-completeness-list span { color: var(--muted); text-align: right; }
.video-extension-panel { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); background: #f7faf8; }
.video-extension-panel[hidden] { display: none; }
.video-extension-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.video-extension-panel h4 { margin: 3px 0 0; font-size: 17px; }
.video-extension-summary { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.video-extension-shot-list { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.video-extension-shot-list > div { display: grid; grid-template-columns: 70px 70px minmax(0, 1fr); gap: 12px; padding: 11px 12px; background: var(--surface); font-size: 11px; }
.video-extension-shot-list span { color: var(--muted); }
.video-extension-visuals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.video-extension-visuals article { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.video-extension-visuals img { width: 100%; aspect-ratio: 9 / 16; display: block; object-fit: cover; }
.video-extension-visuals .visual-number { position: absolute; left: 7px; top: 7px; padding: 3px 5px; color: #fff; background: rgb(0 0 0 / 72%); font-size: 10px; font-weight: 800; }
.video-extension-visuals .reference-evidence { display: block; min-height: 36px; padding: 7px 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.video-extension-visuals .is-unsynced { border-color: #c9453d; }
.video-extension-visuals .is-unsynced .reference-evidence { color: #a92e28; background: #fff4f2; }
.video-plan-hint { margin: 14px 0 0; padding-left: 10px; border-left: 3px solid var(--teal); color: var(--muted); font-size: 12px; line-height: 1.7; }
.video-plan-hint.is-error { border-left-color: #c9453d; color: #a92e28; }
.video-comparison { display: grid; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.video-comparison[hidden] { display: none; }
.video-comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.video-comparison-item { min-width: 0; display: grid; grid-template-columns: minmax(120px, 180px) 1fr; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.video-comparison-item video { width: 100%; height: 100%; min-height: 220px; display: block; object-fit: contain; background: #090b0b; }
.video-comparison-copy { display: grid; align-content: center; gap: 7px; padding: 16px; }
.video-comparison-copy strong { font-size: 14px; }
.video-comparison-copy span, .video-comparison-copy small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.storyboard-result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.storyboard-result-head h3 { margin: 0; font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; }
.storyboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(86px, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); }
.storyboard-metrics div { min-width: 86px; padding: 10px 12px; background: var(--surface); }
.storyboard-metrics dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.storyboard-metrics dd { margin: 4px 0 0; font-size: 13px; font-weight: 800; }
.continuity-panel { padding: 17px 19px; border-left: 3px solid var(--teal); background: #f2f8f6; }
.continuity-panel h4, .shot-section h4 { margin: 0 0 8px; font-size: 14px; }
.continuity-panel p { margin: 0; color: #39423f; line-height: 1.75; }
.production-story-structure, .runtime-contract { display: grid; gap: 14px; padding: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.production-story-structure[hidden], .runtime-contract[hidden] { display: none; }
.production-story-structure > header, .runtime-contract > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.production-story-structure h4, .runtime-contract h4 { margin: 3px 0 0; font-size: 16px; }
.production-story-structure > header > span, .runtime-contract > header > span { color: var(--muted); font-size: 10px; font-weight: 800; }
.production-beat-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.production-beat-list article { min-width: 0; padding: 13px; background: var(--surface); }
.production-beat-list span, .production-beat-list small { display: block; color: var(--muted); font-size: 10px; }
.production-beat-list strong { display: block; margin: 6px 0; font-size: 13px; }
.production-beat-list p { min-height: 3.2em; margin: 0 0 8px; font-size: 11px; line-height: 1.6; }
.runtime-contract dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.runtime-contract dl div { min-width: 0; padding: 11px 12px; background: var(--surface); }
.runtime-contract dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.runtime-contract dd { margin: 5px 0 0; font-size: 13px; font-weight: 800; }
.runtime-contract > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.shot-section { min-width: 0; }
.shot-section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.shot-section-head span { color: var(--muted); font-size: 11px; }
.shot-table-wrap { overflow-x: auto; border: 1px solid var(--line); }
.shot-table { width: 100%; min-width: 1120px; border-collapse: collapse; font-size: 12px; }
.shot-table th { padding: 10px 12px; color: var(--muted); background: #f4f6f4; text-align: left; font-size: 10px; }
.shot-table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.55; }
.shot-table td:nth-child(1) { width: 64px; }
.shot-table td:nth-child(2) { width: 72px; white-space: nowrap; }
.shot-table td:nth-child(3) { width: 120px; }
.shot-table td:nth-child(6) { width: 68px; }
.shot-table td p { margin: 0 0 4px; }
.shot-table td small { display: block; color: var(--muted); }
.shot-table .asset-reference { margin-top: 7px; padding-top: 6px; border-top: 1px dashed var(--line); color: #146b61; overflow-wrap: anywhere; }
.storyboard-shot-table { min-width: 1480px; }
.storyboard-shot-table td:nth-child(1) { width: 92px; white-space: nowrap; }
.storyboard-shot-table td:nth-child(2) { width: 112px; }
.storyboard-shot-table td:nth-child(3) { width: 92px; white-space: nowrap; }
.storyboard-shot-table td:nth-child(4) { width: 72px; white-space: nowrap; }
.storyboard-shot-table td:nth-child(7) { width: 128px; }
.storyboard-shot-table td:nth-child(9) { min-width: 230px; }
.storyboard-shot-table td:nth-child(9) p { white-space: normal; writing-mode: horizontal-tb; word-break: normal; overflow-wrap: anywhere; }
.prompt-guides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.prompt-edit-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.prompt-edit-toolbar > div:first-child { display: grid; gap: 3px; }
.prompt-edit-toolbar strong { font-size: 12px; }
.prompt-edit-toolbar span { color: var(--muted); font-size: 10px; }
.prompt-edit-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.prompt-edit-actions button { min-height: 34px; padding: 7px 12px; }
.prompt-guides section { padding: 16px 18px; border-left: 3px solid var(--teal); background: #f2f8f6; }
.prompt-guides h4, .prompt-list-section h4 { margin: 0 0 8px; font-size: 14px; }
.prompt-guides p { margin: 0; color: #39423f; line-height: 1.7; }
.prompt-guides textarea, .prompt-item textarea { width: 100%; min-height: 116px; resize: vertical; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface); font: inherit; font-size: 12px; line-height: 1.65; }
.prompt-guides textarea:focus, .prompt-item textarea:focus { outline: 2px solid rgb(27 120 106 / 18%); border-color: var(--teal); }
.prompt-character-count { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; text-align: right; }
.prompt-list { display: grid; gap: 12px; }
.prompt-item { border: 1px solid var(--line); background: var(--surface); }
.prompt-item > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; border-bottom: 1px solid var(--line); background: #f6f8f6; }
.prompt-item > header div { display: flex; align-items: baseline; gap: 10px; }
.prompt-item > header span, .prompt-item > header small { color: var(--muted); font-size: 11px; }
.prompt-item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prompt-item-grid section { min-width: 0; padding: 15px; }
.prompt-item-grid section + section { border-left: 1px solid var(--line); }
.prompt-item h5 { margin: 0 0 8px; color: var(--coral); font-size: 11px; }
.prompt-item p { margin: 0; color: #39423f; line-height: 1.7; overflow-wrap: anywhere; }
.prompt-item > footer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 15px; border-top: 1px solid var(--line); background: #fbfcfa; }
.prompt-item > footer p { font-size: 11px; }
.prompt-item > footer strong { margin-right: 8px; color: var(--ink); }
.prompt-item > footer label { display: grid; gap: 7px; min-width: 0; color: var(--ink); font-size: 11px; font-weight: 800; }
.prompt-item > footer textarea { min-height: 92px; font-weight: 400; }
.visual-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.visual-item { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.visual-item.is-extension { border-color: #4fa99c; }
.visual-frame { position: relative; width: 100%; overflow: hidden; background: #e3e8e5; aspect-ratio: 9 / 16; }
.visual-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.visual-pending { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); background: #e8eeeb; font-size: 11px; }
.visual-number { position: absolute; top: 8px; left: 8px; min-width: 32px; padding: 5px 7px; border-radius: 4px; color: #fff; background: rgb(13 24 21 / 78%); font-size: 10px; font-weight: 800; text-align: center; }
.visual-copy { display: grid; gap: 5px; padding: 11px 12px; }
.visual-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.visual-copy span { color: var(--muted); font-size: 10px; }
.visual-copy .visual-sync-evidence { color: #247d71; font-size: 10px; line-height: 1.5; }
.visual-item.is-pending .visual-sync-evidence { color: var(--muted); }
.animatic-panel { display: grid; gap: 15px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.animatic-panel[hidden] { display: none; }
.animatic-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.animatic-panel h4 { margin: 0; font-size: 17px; }
.animatic-panel > header > span { flex: 0 0 auto; padding: 6px 9px; color: #84413a; background: #fbe2dd; font-size: 10px; font-weight: 800; }
.animatic-panel[data-approved="true"] > header > span { color: #125c51; background: #dcefeb; }
.animatic-intro { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.animatic-panel video { width: min(100%, 420px); max-height: 520px; display: block; background: #090b0b; }
.animatic-panel video[hidden] { display: none; }
.animatic-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.animatic-metrics div { min-width: 0; padding: 11px 12px; background: var(--surface); }
.animatic-metrics dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.animatic-metrics dd { margin: 5px 0 0; font-size: 13px; font-weight: 800; }
.animatic-shot-list { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.animatic-shot-row { display: grid; grid-template-columns: 64px 76px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 12px; background: var(--surface); }
.animatic-shot-row > span, .animatic-shot-row small { color: var(--muted); font-size: 10px; }
.animatic-shot-copy { min-width: 0; }
.animatic-shot-copy strong { display: block; margin-bottom: 4px; font-size: 11px; }
.animatic-shot-copy small { display: block; line-height: 1.5; overflow-wrap: anywhere; }
.animatic-shot-actions { display: flex; gap: 6px; }
.animatic-shot-actions button { min-height: 30px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface); font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.animatic-shot-actions button:disabled { cursor: default; opacity: .45; }
.video-shot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.take-production-panel { display: grid; gap: 15px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.take-production-panel[hidden] { display: none; }
.take-production-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.take-production-panel h4 { margin: 0; font-size: 17px; }
.take-production-panel > header > span { padding: 6px 9px; color: #84413a; background: #fbe2dd; font-size: 10px; font-weight: 800; }
.take-production-panel[data-ready="true"] > header > span { color: #125c51; background: #dcefeb; }
.take-production-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.take-production-metrics div { padding: 11px 12px; background: var(--surface); }
.take-production-metrics dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.take-production-metrics dd { margin: 5px 0 0; font-size: 13px; font-weight: 800; }
.take-shot-groups { display: grid; gap: 14px; }
.take-shot-group { display: grid; gap: 10px; }
.take-shot-group > header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.take-shot-group > header strong { font-size: 12px; }
.take-shot-group > header span { color: var(--muted); font-size: 10px; }
.take-candidates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.take-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.take-card.is-selected { border-color: #247d71; box-shadow: inset 0 0 0 1px #247d71; }
.take-card video, .take-card .video-shot-pending { width: 100%; aspect-ratio: 9 / 16; display: block; object-fit: contain; background: #090b0b; }
.take-card-copy { display: grid; gap: 5px; padding: 10px 11px; }
.take-card-copy strong { font-size: 11px; }
.take-card-copy span, .take-card-copy small { color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.take-card-actions { display: flex; gap: 6px; padding: 0 11px 11px; }
.take-card-actions button { flex: 1; min-height: 30px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--ink); background: var(--surface); font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; }
.take-card-actions .select-take { color: #fff; border-color: var(--teal); background: var(--teal); }
.take-card-actions button:disabled { cursor: default; opacity: .5; }
.video-shot-item { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.video-shot-frame { position: relative; width: 100%; overflow: hidden; background: #090b0b; aspect-ratio: 9 / 16; }
.video-shot-frame video { width: 100%; height: 100%; display: block; object-fit: contain; }
.video-shot-pending { width: 100%; height: 100%; display: grid; place-items: center; padding: 18px; color: #d8dfdc; font-size: 11px; text-align: center; }
.video-shot-progress-copy { width: min(100%, 220px); display: grid; gap: 8px; }
.video-shot-progress-copy strong { color: #fff; font-size: 22px; }
.video-shot-progress-copy span { color: #d8dfdc; font-size: 11px; font-weight: 800; }
.video-shot-progress-copy small { min-height: 30px; color: #9faaa6; font-size: 10px; line-height: 1.5; }
.video-shot-progress-copy progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 3px; background: #303735; accent-color: #45a697; }
.video-shot-progress-copy progress::-webkit-progress-bar { background: #303735; }
.video-shot-progress-copy progress::-webkit-progress-value { background: #45a697; }
.video-shot-pending[data-stalled="true"] .video-shot-progress-copy progress { accent-color: #d46b5f; }
.video-shot-pending[data-stalled="true"] .video-shot-progress-copy small { color: #f0a79f; }
.video-shot-copy { display: grid; gap: 5px; padding: 11px 12px; }
.video-shot-copy strong { font-size: 12px; }
.video-shot-copy span { color: var(--muted); font-size: 10px; }
.result-hero { display: grid; grid-template-columns: minmax(180px, 30%) minmax(0, 1fr); gap: 28px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.cover-frame { width: 100%; max-height: 460px; margin: 0; overflow: hidden; border-radius: var(--radius); background: #dfe5e2; aspect-ratio: 9 / 16; }
.cover-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.result-kicker { margin: 0 0 10px; color: var(--coral); font-size: 11px; font-weight: 800; }
.result-overview h3 { margin: 0 0 12px; font-size: 28px; line-height: 1.3; overflow-wrap: anywhere; }
.result-logline { margin: 0; color: #3d4744; font-size: 15px; line-height: 1.75; }
.result-facts { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 22px 0 0; }
.result-facts div { display: grid; gap: 3px; }
.result-facts dt { color: var(--muted); font-size: 10px; font-weight: 800; }
.result-facts dd { margin: 0; font-size: 12px; }
.result-section h4, .result-columns h4 { margin: 0 0 11px; font-size: 14px; }
.result-section > p { margin: 0; color: #39423f; line-height: 1.75; }
.result-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.entity-list { display: grid; gap: 8px; }
.entity-list article { min-height: 76px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.entity-list strong { font-size: 13px; }
.entity-list span { margin-left: 8px; color: var(--teal-dark); font-size: 11px; }
.entity-list p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.script-section pre { max-height: 680px; margin: 0; overflow: auto; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); color: #28302e; background: #fbfcfa; font: 13px/1.85 "Microsoft YaHei", sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.delivery-evidence { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.delivery-evidence summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 750; }
.delivery-evidence > div { display: grid; gap: 8px; margin-top: 14px; }
.delivery-evidence > div > div { display: grid; grid-template-columns: 48px minmax(120px, 1fr) minmax(180px, 2fr) auto; gap: 10px; align-items: center; font-size: 11px; }
.delivery-evidence code { min-width: 0; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }

.voice-map-config { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.voice-map-config label { display: grid; gap: 7px; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.voice-map-config select { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; }
.voice-speed-config { margin-top: 12px; }
.voice-timeline-result { display: grid; gap: 24px; }
.voice-timeline-result[hidden] { display: none; }
.audio-verification-panel { display: grid; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.audio-verification-panel[hidden] { display: none; }
.audio-verification-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.audio-verification-panel h4 { margin: 2px 0 0; font-size: 17px; }
.audio-verification-panel > header > span { padding: 6px 9px; color: #84413a; background: #fbe2dd; font-size: 10px; font-weight: 800; }
.audio-verification-panel[data-ready="true"] > header > span { color: #125c51; background: #dcefeb; }
.audio-verification-panel > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.audio-verification-list { display: grid; gap: 10px; }
.audio-verification-item { display: grid; grid-template-columns: minmax(180px, 230px) minmax(0, 1fr) 150px; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.audio-verification-item[data-result="passed"], .audio-verification-item[data-result="human_verified"] { border-left: 3px solid #2b766b; }
.audio-verification-media { display: grid; gap: 8px; }
.audio-verification-media strong { font-size: 11px; }
.audio-verification-media video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #111; }
.audio-verification-copy { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.audio-verification-copy div { min-width: 0; }
.audio-verification-copy span, .audio-verification-copy small { color: var(--muted); font-size: 10px; }
.audio-verification-copy strong { display: block; margin-top: 4px; font-size: 11px; }
.audio-verification-copy p { margin: 3px 0 0; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.audio-verification-copy small { grid-column: 1 / -1; }
.audio-verification-action { display: grid; gap: 7px; justify-items: stretch; }
.audio-verification-action button { min-height: 34px; border: 1px solid #176f63; background: #fff; color: #176f63; font-size: 11px; font-weight: 800; cursor: pointer; }
.audio-verification-action select { width: 100%; min-width: 0; height: 34px; border: 1px solid var(--line); background: #fff; font-size: 10px; }
.audio-verification-action audio { width: 100%; height: 32px; }
.audio-verification-action span { color: #176f63; font-size: 11px; font-weight: 800; }
.audio-verification-editor { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(160px, .45fr) minmax(280px, 1fr) auto; gap: 12px; align-items: end; padding: 12px; border-top: 1px solid var(--line); background: #f7f9f8; }
.audio-verification-editor[hidden] { display: none; }
.audio-verification-editor label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.audio-verification-editor input, .audio-verification-editor textarea { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); font: inherit; }
.audio-verification-editor input { min-height: 38px; padding: 0 10px; }
.audio-verification-editor textarea { min-height: 72px; padding: 9px 10px; resize: vertical; }
.audio-verification-editor > div { display: flex; gap: 8px; }
.voice-map-summary { display: grid; gap: 10px; }
.voice-map-summary h4, .voice-list-section h4, .timeline-section h4 { margin: 0; font-size: 14px; }
.voice-map-summary > div { display: flex; flex-wrap: wrap; gap: 8px; }
.voice-map-summary span { padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius); color: #39423f; background: var(--surface); font-size: 11px; }
.voice-utterance-list { display: grid; gap: 10px; margin-top: 12px; }
.voice-utterance { display: grid; grid-template-columns: 76px minmax(0, 1fr) minmax(220px, 300px); gap: 14px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.voice-utterance-meta { display: grid; gap: 3px; }
.voice-utterance-meta strong { font-size: 12px; }
.voice-utterance-meta span, .voice-utterance-copy span { color: var(--muted); font-size: 10px; }
.voice-utterance-copy { min-width: 0; display: grid; gap: 5px; }
.voice-utterance-copy p { margin: 0; color: #28302e; font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.voice-utterance audio { width: 100%; height: 34px; }
.timeline-section { display: grid; gap: 12px; }
.timeline-table td:nth-child(2), .timeline-table td:nth-child(4) { white-space: nowrap; }
.timeline-edit-button { min-height: 32px; padding: 0 12px; white-space: nowrap; }
.native-timeline-editor-row td { padding: 0; background: #f7f9f8; }
.native-timeline-editor { display: grid; grid-template-columns: minmax(130px, .5fr) minmax(220px, 1fr) 150px 150px; gap: 12px; align-items: end; padding: 14px; border-left: 3px solid var(--teal); }
.native-timeline-editor label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; }
.native-timeline-editor input, .native-timeline-editor textarea { width: 100%; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); font: inherit; }
.native-timeline-editor input { min-height: 38px; padding: 0 10px; }
.native-timeline-editor textarea { min-height: 72px; padding: 9px 10px; resize: vertical; }
.native-timeline-text, .native-timeline-sound { grid-column: span 2; }
.native-timeline-editor-actions { display: flex; justify-content: flex-end; gap: 8px; grid-column: 1 / -1; }

.delivery-stage { display: grid; gap: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.delivery-stage[hidden], .delivery-result[hidden] { display: none; }
.delivery-config-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.local-chip { color: #225a35; background: #e5f4e8; }
.delivery-toggle { min-height: 66px; display: flex !important; flex-direction: row !important; align-items: center; gap: 10px !important; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.delivery-toggle input { width: 18px !important; height: 18px; margin: 0; accent-color: var(--teal); }
.delivery-result { display: grid; gap: 22px; }
.delivery-preview { width: min(100%, 520px); margin: 0 auto; overflow: hidden; border: 1px solid #252b29; border-radius: var(--radius); background: #090b0b; }
.delivery-preview video { display: block; width: 100%; max-height: 72vh; aspect-ratio: 9 / 16; background: #090b0b; object-fit: contain; }
.delivery-downloads { display: flex; justify-content: center; gap: 10px; }
.delivery-downloads a { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.delivery-evidence code { overflow-wrap: anywhere; }
.edit-timeline-panel { display: grid; gap: 16px; }
.edit-track-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.edit-track-strip span { min-height: 34px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: #eef1ef; font-size: 11px; font-weight: 750; }
.edit-track-strip span.active { border-color: #76aaa5; color: #075f5b; background: #e1f2ef; }
.edit-timeline-state { min-width: 0; display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-left: 3px solid var(--teal); background: #edf6f4; }
.edit-timeline-state span { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.edit-clip-list { display: grid; gap: 8px; }
.edit-clip-row { min-width: 0; display: grid; grid-template-columns: 76px minmax(110px, 1fr) repeat(2, minmax(88px, .72fr)) minmax(100px, .9fr) minmax(105px, .9fr) 72px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.edit-clip-id { align-self: center; display: grid; gap: 2px; }
.edit-clip-id strong { font-size: 13px; }
.edit-clip-id small { color: var(--muted); font-size: 10px; }
.edit-clip-row label { min-width: 0; display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
.edit-clip-row input, .edit-clip-row select { width: 100%; min-width: 0; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); font-size: 12px; }
.edit-clip-move { display: grid; grid-template-columns: repeat(2, 32px); gap: 4px; }
.edit-clip-move button { width: 32px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); }
.edit-clip-move button:disabled { cursor: default; opacity: .35; }
.edit-version-history > div > div { grid-template-columns: 72px 80px 90px minmax(0, 1fr); }

.stage-actions { min-height: 70px; display: flex; justify-content: flex-end; align-items: end; gap: 10px; }

.project-dialog { width: min(620px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 24px 80px rgb(0 0 0 / 25%); }
.project-dialog::backdrop { background: rgb(10 15 14 / 62%); }
.project-dialog form { display: grid; gap: 17px; padding: 24px; }
.project-dialog header, .project-dialog footer, .dialog-row { display: flex; gap: 14px; }
.project-dialog header { justify-content: space-between; align-items: start; }
.project-dialog h2 { margin: 3px 0 0; font-size: 22px; }
.project-dialog label { flex: 1; display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.project-dialog input, .project-dialog select, .project-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; color: var(--ink); background: #fff; outline: none; }
.project-dialog textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.project-dialog input:focus, .project-dialog select:focus, .project-dialog textarea:focus { border-color: var(--teal); }
.genre-control { flex: 1; min-width: 0; display: grid; align-content: start; gap: 10px; }
.genre-control label { flex: none; }
.genre-control [hidden] { display: none !important; }
.project-dialog footer { justify-content: flex-end; }
.dialog-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 380px; padding: 12px 15px; border-radius: var(--radius); color: #fff; background: var(--dark); box-shadow: 0 10px 35px rgb(0 0 0 / 22%); font-size: 13px; }

.project-mode-tabs { display: inline-flex; gap: 2px; margin: 18px 0 0; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: #e8edeb; }
.project-mode-tabs button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 750; }
.project-mode-tabs button.active { color: #fff; background: var(--dark); }

.production-board { min-width: 0; margin-top: 20px; }
.production-board.is-loading { opacity: .65; pointer-events: none; }
.production-bootstrap { min-height: 420px; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 54px clamp(24px, 6vw, 76px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.production-bootstrap h2 { margin: 8px 0 12px; font-size: 28px; }
.production-bootstrap p:last-child { max-width: 620px; margin: 0; color: var(--muted); line-height: 1.75; }
.production-board-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 24px 0 18px; border-bottom: 1px solid var(--line); }
.production-board-header h2 { margin: 6px 0 0; font-size: 24px; }
.production-readiness { display: grid; justify-items: end; gap: 4px; text-align: right; }
.production-readiness span { padding: 5px 8px; border-radius: 4px; font-size: 11px; font-weight: 800; }
.production-readiness small { color: var(--muted); font-size: 10px; }
.production-ready { color: #166b3d; background: #e3f4e8; }
.production-not-ready { color: #9a3e2f; background: #fff0ec; }

.series-bible-editor { display: grid; grid-template-columns: minmax(180px, .65fr) repeat(2, minmax(240px, 1fr)) auto; gap: 12px; align-items: end; padding: 18px 0; border-bottom: 1px solid var(--line); }
.series-bible-editor label, .production-inspector label, .reference-manager label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.series-bible-editor input, .series-bible-editor textarea, .production-inspector input, .production-inspector select, .production-inspector textarea, .reference-manager select { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; outline: none; }
.series-bible-editor input, .production-inspector input, .production-inspector select, .reference-manager select { min-height: 40px; padding: 9px 10px; }
.series-bible-editor textarea { height: 76px; padding: 9px 10px; resize: vertical; line-height: 1.5; }
.series-bible-editor input:focus, .series-bible-editor textarea:focus, .production-inspector input:focus, .production-inspector select:focus, .production-inspector textarea:focus { border-color: var(--teal); }

.production-tool-layout { min-width: 0; display: grid; grid-template-columns: 224px minmax(420px, 1fr) 300px; min-height: 650px; border-bottom: 1px solid var(--line); background: #fff; }
.production-library { min-width: 0; padding: 16px 12px 20px 0; border-right: 1px solid var(--line); }
.production-kind-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
.production-kind-tabs button { min-height: 34px; border: 1px solid transparent; border-radius: 4px; color: var(--muted); background: #f1f4f2; font-size: 11px; font-weight: 750; }
.production-kind-tabs button.active { border-color: #a8bbb5; color: var(--teal-dark); background: #e5f4f0; }
.production-library-heading { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px 7px; }
.production-library-heading strong { font-size: 13px; }
.production-library-heading .icon-button { width: 32px; min-height: 32px; font-size: 17px; }
.production-item-list { display: grid; gap: 5px; }
.production-list-item { width: 100%; min-width: 0; min-height: 58px; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 9px; align-items: center; padding: 7px; border: 1px solid transparent; border-radius: 4px; color: var(--ink); background: transparent; text-align: left; }
.production-list-item:hover { background: #f2f5f3; }
.production-list-item.active { border-color: #9eb5ae; background: #eaf4f1; }
.production-list-thumb { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 4px; color: #fff; background: var(--asset-color); font-size: 12px; font-weight: 800; }
.production-list-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.production-list-item > span:last-child { min-width: 0; display: grid; gap: 3px; }
.production-list-item strong, .production-list-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.production-list-item strong { font-size: 11px; }
.production-list-item small { color: var(--muted); font-size: 9px; }
.production-list-empty { margin: 16px 4px; color: var(--muted); font-size: 11px; }

.production-canvas-panel { position: relative; min-width: 0; padding: 0 14px 20px; background: #f5f7f5; }
.production-canvas-panel > header { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.production-canvas-panel > header div { display: grid; gap: 3px; }
.production-canvas-panel > header strong { font-size: 13px; }
.production-canvas-panel > header span { color: var(--muted); font-size: 10px; }
.production-canvas { position: relative; width: 100%; min-height: 520px; overflow: auto; border: 1px solid #d4dbd7; background-color: #fbfcfb; background-image: linear-gradient(#e8edea 1px, transparent 1px), linear-gradient(90deg, #e8edea 1px, transparent 1px); background-size: 24px 24px; }
.production-canvas canvas { display: block; }
.production-canvas-empty { position: absolute; inset: 96px 28px 28px; display: grid; place-items: center; color: var(--muted); font-size: 11px; pointer-events: none; }
.production-canvas-empty[hidden] { display: none; }

.production-inspector { min-width: 0; padding: 16px 0 22px 16px; border-left: 1px solid var(--line); }
.production-inspector-empty { min-height: 300px; display: grid; align-content: center; justify-items: center; gap: 6px; color: var(--muted); text-align: center; }
.production-inspector-empty strong { color: var(--ink); font-size: 13px; }
.production-inspector-empty span { font-size: 10px; }
.production-inspector form { display: grid; gap: 12px; }
.production-inspector textarea { min-height: 84px; padding: 9px 10px; resize: vertical; line-height: 1.55; }
.production-form-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.production-form-actions button { min-width: 0; padding-inline: 8px; font-size: 11px; }
.reference-manager, .project-asset-picker { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.reference-manager > header, .project-asset-picker > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.reference-manager > header strong, .project-asset-picker > header strong { font-size: 12px; }
.reference-manager > header span, .project-asset-picker > header span { color: var(--muted); font-size: 9px; text-align: right; }
.reference-upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.reference-upload-row input { min-width: 0; padding: 7px; font-size: 10px; }
.reference-upload-row button { padding-inline: 11px; font-size: 11px; }
.reference-grid, .project-asset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.reference-grid figure { min-width: 0; margin: 0; border: 1px solid var(--line); background: #fff; }
.reference-grid img, .project-asset-grid img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; }
.reference-grid figcaption { padding: 5px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.reference-grid p, .project-asset-grid p { grid-column: 1 / -1; margin: 5px 0; color: var(--muted); font-size: 10px; }
.project-asset-grid button { min-width: 0; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 4px; background: #e9eeeb; }
.project-asset-grid button:hover { border-color: var(--teal); }

.quality-gate-result { display: grid; gap: 18px; }
.quality-gate-notice { margin: 0; padding: 12px 14px; border-left: 3px solid #2f7a62; background: #eef5f1; color: #27443a; font-size: 13px; line-height: 1.65; }
.quality-gate-reconcile-warning { display: block; margin-top: 6px; color: #8c3e26; }
.quality-gate-reconcile-button { margin-top: 10px; }
.quality-shot-list { display: grid; gap: 16px; }
.quality-shot { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.quality-shot > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quality-shot > header div { display: flex; align-items: baseline; gap: 10px; }
.quality-shot > header span { color: var(--muted); font-size: 11px; }
.quality-shot > header strong { font-size: 14px; }
.quality-shot > header em { padding: 4px 8px; border-radius: 4px; background: #f0f2f1; color: var(--muted); font-size: 11px; font-style: normal; }
.quality-shot > header em[data-result="human_verified"] { background: #e7f3ed; color: #206548; }
.quality-shot > header em[data-result="failed"] { background: #fbe9e6; color: #9a3026; }
.quality-shot > video { width: min(100%, 420px); aspect-ratio: 9 / 16; max-height: 540px; background: #111; object-fit: contain; }
.quality-evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quality-evidence-grid figure { min-width: 0; margin: 0; border: 1px solid var(--line); background: #f4f6f5; }
.quality-evidence-grid img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: contain; background: #151918; }
.quality-evidence-grid figcaption { padding: 6px 8px; color: var(--muted); font-size: 10px; }
.quality-technical-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.quality-technical-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); font-size: 11px; }
.quality-technical-list li strong { color: #206548; }
.quality-technical-list li[data-result="failed"] strong { color: #a42d25; }
.quality-review-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; margin: 0; padding: 12px; border: 1px solid var(--line); }
.quality-review-checks legend { padding: 0 6px; color: var(--muted); font-size: 11px; }
.quality-review-checks label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 7px; align-items: start; font-size: 12px; line-height: 1.45; }
.quality-review-checks input { margin: 2px 0 0; }
.quality-review-note { margin: 0; padding: 10px 12px; background: #fbe9e6; color: #7b2d27; font-size: 12px; }
.quality-review-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

@media (max-width: 980px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .take-candidates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .take-production-metrics { grid-template-columns: 1fr; }
  .video-extension-visuals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-comparison-grid { grid-template-columns: 1fr; }
  .series-bible-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-bible-editor button { justify-self: start; }
  .production-tool-layout { grid-template-columns: 190px minmax(360px, 1fr); }
  .production-inspector { grid-column: 1 / -1; padding: 18px 0; border-top: 1px solid var(--line); border-left: 0; }
  .production-inspector form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-form-actions, .reference-manager, .project-asset-picker { align-self: start; }
}

@media (max-width: 760px) {
  .animatic-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .animatic-shot-row { grid-template-columns: 42px 64px minmax(0, 1fr); }
  .animatic-shot-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 14px; }
  .brand small, .sidebar-foot { display: none; }
  .primary-nav { display: flex; margin: 0 0 0 auto; }
  .nav-button { width: auto; padding: 0 10px; }
  .main { padding: 22px 16px 36px; }
  .topbar, .workbench-header { align-items: flex-start; }
  .topbar-actions { align-items: flex-end; flex-direction: column-reverse; }
  .project-toolbar { align-items: flex-start; }
  .project-toolbar-actions { justify-content: flex-end; flex-wrap: wrap; }
  .archive-directory-status { order: 3; width: 100%; max-width: 100%; text-align: right; }
  .project-grid { grid-template-columns: 1fr; }
  .workbench-layout { display: block; }
  .step-rail { overflow-x: auto; padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .step-rail ol { display: flex; min-width: max-content; }
  .step-button { width: 180px; }
  .stage { padding: 24px 0 0; }
  .source-stage textarea { min-height: 320px; }
  .series-plan-config { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-plan-capacity { grid-column: 1 / -1; }
  .series-plan-list article { grid-template-columns: 1fr; }
  .adaptation-episode-context { grid-template-columns: 1fr; }
  .source-review-result > header, .source-review-profile { grid-template-columns: 1fr; }
  .source-review-dimensions > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-review-checks article { grid-template-columns: 62px minmax(0, 1fr) auto; }
  .source-review-checks p { grid-column: 1 / -1; }
  .source-review-check-action { grid-column: 3; grid-row: 1; }
  .source-review-assist { grid-column: 1 / -1; }
  .config-grid, .storyboard-config-grid, .result-columns, .prompt-guides, .voice-map-config, .delivery-config-grid { grid-template-columns: 1fr; }
  .prompt-edit-toolbar { align-items: flex-start; flex-direction: column; }
  .prompt-edit-actions { width: 100%; }
  .prompt-edit-actions button { flex: 1; }
  .prompt-item-grid, .prompt-item > footer { grid-template-columns: 1fr; }
  .prompt-item-grid section + section { border-top: 1px solid var(--line); border-left: 0; }
  .result-hero { grid-template-columns: minmax(140px, 34%) minmax(0, 1fr); }
  .storyboard-result-head { align-items: flex-start; flex-direction: column; }
  .storyboard-metrics { width: 100%; }
  .storyboard-error-diagnostics { grid-template-columns: 1fr; }
  .production-beat-list { grid-template-columns: 1fr; }
  .runtime-contract dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-completeness-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-duration-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prompt-shot-replan { grid-template-columns: 1fr 160px; }
  .prompt-shot-replan > div { grid-column: 1 / -1; }
  .prompt-shot-duration-editor-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .video-completeness-list div { align-items: flex-start; flex-direction: column; }
  .video-completeness-list span { text-align: left; }
  .visual-extension-notice { align-items: flex-start; flex-direction: column; }
  .dialog-row { flex-direction: column; }
  .workbench-actions .save-state { display: none; }
  .visual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-comparison-item { grid-template-columns: minmax(100px, 42%) 1fr; }
  .voice-utterance { grid-template-columns: 70px minmax(0, 1fr); }
  .voice-utterance audio { grid-column: 1 / -1; }
  .audio-verification-item { grid-template-columns: 1fr; }
  .audio-verification-copy { grid-template-columns: 1fr; }
  .audio-verification-action { justify-content: stretch; }
  .audio-verification-action button { width: 100%; }
  .audio-verification-editor { grid-template-columns: 1fr; }
  .native-timeline-editor { grid-template-columns: 1fr; }
  .native-timeline-text, .native-timeline-sound { grid-column: auto; }
  .quality-technical-list, .quality-review-checks { grid-template-columns: 1fr; }
  .delivery-preview { width: min(100%, 420px); }
  .edit-clip-row { grid-template-columns: 64px repeat(2, minmax(84px, 1fr)); }
  .edit-clip-row label:nth-of-type(1), .edit-clip-row label:nth-of-type(4) { grid-column: span 2; }
  .edit-clip-move { align-self: end; }
  .stage-actions { flex-wrap: wrap; align-items: stretch; }
  .project-mode-tabs { width: 100%; }
  .project-mode-tabs button { flex: 1; }
  .production-bootstrap { min-height: 340px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .production-board-header { align-items: flex-start; }
  .series-bible-editor { grid-template-columns: 1fr; }
  .production-tool-layout { display: block; }
  .production-library { padding: 14px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .production-kind-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .production-item-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .production-canvas-panel { padding: 0 0 16px; }
  .production-canvas { min-height: 440px; }
  .production-inspector { padding: 18px 0; }
  .production-inspector form { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .take-candidates { grid-template-columns: 1fr; }
  .brand strong { font-size: 14px; }
  .nav-button span:last-child { display: none; }
  .topbar h1, .workbench-header h1 { font-size: 22px; }
  .workbench-header { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px 12px; align-items: start; }
  .workbench-title { min-width: 0; }
  .workbench-title .eyebrow { overflow-wrap: anywhere; }
  .workbench-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .workbench-actions button { min-width: 0; min-height: 42px; padding: 5px 7px; line-height: 1.25; white-space: normal; }
  .account-state { display: none; }
  .empty-state div { padding: 56px 28px; }
  .source-review-empty { grid-template-columns: 1fr; }
  .series-planning-panel { padding: 14px; }
  .series-plan-config, .series-plan-list dl, .adaptation-episode-context dl { grid-template-columns: 1fr; }
  .series-plan-actions button { width: 100%; }
  .series-plan-result > header { flex-direction: column; }
  .source-review-artifact { grid-template-columns: 1fr; gap: 7px; }
  .source-review-dimensions > div { grid-template-columns: 1fr; }
  .source-review-roles dl { grid-template-columns: 1fr; }
  .source-review-checks article { grid-template-columns: 56px minmax(0, 1fr); }
  .source-review-check-action { grid-column: 1 / -1; grid-row: auto; justify-self: start; }
  .source-review-assist-question { grid-template-columns: 1fr; gap: 4px; }
  .source-review-assist-actions { align-items: stretch; flex-direction: column; }
  .source-review-assist-actions button { width: 100%; }
  .result-hero { grid-template-columns: 1fr; align-items: start; }
  .storyboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-duration-editor > header { flex-direction: column; }
  .video-duration-editor-grid, .video-duration-editor-metrics { grid-template-columns: 1fr; }
  .prompt-shot-replan { grid-template-columns: 1fr; }
  .prompt-shot-replan > div { grid-column: auto; }
  .prompt-shot-duration-editor > header { flex-direction: column; }
  .prompt-shot-duration-editor-grid, .prompt-shot-duration-editor-metrics { grid-template-columns: 1fr; }
  .storyboard-readiness { align-items: flex-start; flex-direction: column; }
  .video-completeness > header { flex-direction: column; }
  .video-extension-panel > header { flex-direction: column; }
  .video-extension-shot-list > div { grid-template-columns: 1fr; gap: 4px; }
  .prompt-item-grid, .prompt-item > footer { grid-template-columns: 1fr; }
  .prompt-item-grid section + section { border-left: 0; border-top: 1px solid var(--line); }
  .cover-frame { width: min(70vw, 270px); }
  .result-overview h3 { font-size: 22px; }
  .delivery-evidence > div > div { grid-template-columns: 1fr; gap: 3px; }
  .delivery-downloads { flex-direction: column; }
  .edit-track-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .edit-timeline-state { align-items: flex-start; flex-direction: column; }
  .edit-clip-row { grid-template-columns: 1fr 1fr; }
  .edit-clip-id { grid-column: 1 / -1; }
  .edit-clip-row label:nth-of-type(1), .edit-clip-row label:nth-of-type(4) { grid-column: auto; }
  .quality-shot { padding: 12px; }
  .quality-shot > header { align-items: flex-start; flex-direction: column; }
  .quality-evidence-grid { grid-template-columns: 1fr; }
  .quality-review-actions button { width: 100%; }
  .stage-actions > button { width: 100%; }
  .production-board-header { flex-direction: column; }
  .production-readiness { justify-items: start; text-align: left; }
  .production-item-list { grid-template-columns: 1fr; }
  .production-canvas-panel > header { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .production-canvas { min-height: 390px; }
  .reference-grid, .project-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.context-ir-status {
  display: block;
  margin-top: 4px;
  color: #13715b;
  font-size: 12px;
  line-height: 1.4;
}

.context-ir-status[data-state="failed"],
.context-ir-status[data-state="fallback"] {
  color: #a34631;
}
