:root {
  --bg: #f7f7f2;
  --paper: #fff;
  --ink: #263d35;
  --muted: #858c83;
  --green: #284f42;
  --line: #e6e8df;
  --soft: #edf1e8;
  --gold: #b9915c;
  --red: #a64131;
  --orange: #bc7851;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.7px;
  font-weight: 650;
}
h2 {
  font-size: 19px;
  font-weight: 600;
}
h3 {
  font-size: 16px;
}
h4 {
  font-size: 13px;
}
small,
.subtle {
  color: var(--muted);
}
small {
  font-size: 12px;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #c19d65;
  outline-offset: 3px;
}
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #aabda4;
  outline-offset: 1px;
}
input,
textarea,
select {
  min-width: 0;
  border: 1px solid #dce1d6;
  background: white;
  color: var(--ink);
  border-radius: 7px;
  padding: 11px 12px;
  width: 100%;
  line-height: 1.5;
}
textarea {
  resize: vertical;
  font-family: inherit;
}
input[type="checkbox"] {
  width: auto;
  accent-color: var(--green);
}
select {
  cursor: pointer;
  padding-right: 28px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  font-weight: 550;
}
label small {
  font-weight: 400;
  line-height: 1.65;
}
button {
  white-space: nowrap;
}
.primary,
.secondary,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 7px;
  padding: 11px 18px;
  font-weight: 550;
  min-height: 40px;
}
.primary {
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
}
.primary:hover {
  background: #193d30;
}
.secondary {
  background: #fff;
  border: 1px solid #dce1d6;
  color: var(--ink);
}
.secondary:hover {
  background: #f1f4ed;
}
.text-button,
.danger-text {
  background: transparent;
  padding: 7px 0;
  color: var(--green);
  font-size: 12px;
}
.danger-text {
  color: var(--red);
}
.icon-button {
  background: none;
  color: var(--muted);
  font-size: 22px;
  border-radius: 5px;
  padding: 4px 8px;
}
.icon-button:hover {
  background: var(--soft);
}
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wide {
  width: 100%;
}
.layout {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: #fdfdf9;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 650;
}
.brandmark {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #f1e9d6;
  border-radius: 10px;
  width: 38px;
  height: 42px;
  font-family: serif;
  font-size: 26px;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.6px;
  font-weight: 450;
  margin-top: 5px;
}
.workspace-tag {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 8px;
  margin: 35px 0 23px;
  font-size: 11px;
}
.workspace-tag span {
  font-size: 8px;
  margin-left: auto;
  color: var(--muted);
  letter-spacing: 0.4px;
}
i:not(.steps i),
.top-status i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 100%;
  background: #668365;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  color: #778378;
  font-size: 16px;
  border-radius: 7px;
}
.sidebar nav a span {
  font-size: 13px;
}
.sidebar nav a b {
  margin-left: auto;
  font-size: 10px;
  color: #8c968c;
  font-weight: 400;
}
.sidebar nav a.active {
  color: var(--green);
  background: #eaf0e5;
  font-weight: 600;
}
.sidebar-note {
  margin-top: auto;
  padding: 50px 8px 36px;
}
.sidebar-note span {
  font-size: 12px;
  color: #9c9e90;
}
.sidebar-note strong {
  display: block;
  font-family: serif;
  font-size: 15px;
  font-weight: 500;
  margin: 9px 0 12px;
}
.sidebar-note p {
  font-size: 11px;
  line-height: 1.9;
  color: #a3a69b;
}
.note-lines {
  width: 90px;
  height: 35px;
  margin-top: 20px;
  border-top: 1px solid #d4dac9;
  border-bottom: 1px solid #d4dac9;
  transform: skewY(-8deg);
}
.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  font-size: 12px;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: #ecebdc;
  color: #6d7054;
  border-radius: 50%;
  font-size: 12px;
}
.avatar.small {
  width: 28px;
  height: 28px;
}
.sidebar-bottom small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
}
.sidebar-bottom button {
  margin-left: auto;
}
.main {
  min-width: 0;
}
.topbar {
  height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #7f897e;
  background: #fdfdf9;
}
.slash {
  margin: 0 12px;
  color: #c5c9c0;
}
.top-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
}
.divider {
  height: 18px;
  width: 1px;
  background: var(--line);
  margin: 0 12px;
}
.page {
  max-width: 1520px;
  margin: auto;
  padding: 38px 42px;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.eyebrow {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: #8c998b;
  margin-bottom: 12px;
}
.page-heading h1 {
  display: flex;
  align-items: center;
  gap: 13px;
}
.count {
  font-size: 12px;
  color: #9a9e91;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: 0;
}
.page-heading p,
.project-heading p {
  color: #949b90;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 11px;
}
.intro-banner {
  background: #eaf0e4;
  border: 1px solid #e0e7d8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 27px 30px;
  margin-bottom: 32px;
  overflow: hidden;
}
.tag {
  font-size: 10px;
  color: #779174;
  display: inline-block;
  border: 1px solid #cad7c1;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.intro-banner h2 {
  font-family: serif;
  font-size: 24px;
  letter-spacing: 1px;
  font-weight: 500;
}
.intro-banner p {
  color: #8c9884;
  font-size: 11px;
  margin-top: 10px;
}
.steps {
  display: flex;
  align-items: center;
  gap: 20px;
}
.steps div {
  min-width: 65px;
}
.steps div span {
  display: block;
  font-family: Georgia, serif;
  font-size: 22px;
  color: #a9b69d;
  margin-bottom: 12px;
  font-style: italic;
}
.steps b {
  display: block;
  font-size: 12px;
  font-weight: 550;
}
.steps small {
  display: block;
  font-size: 10px;
  margin-top: 7px;
  color: #94a08a;
}
.steps i {
  color: #aebaa3;
  font-size: 12px;
  font-style: normal;
}
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-toolbar h2 {
  font-size: 15px;
}
.section-toolbar h2 span {
  color: #a2a798;
  font-size: 11px;
  margin-left: 6px;
}
.search {
  flex-direction: row;
  align-items: center;
  width: 230px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding-left: 11px;
}
.search span {
  font-size: 21px;
  color: #9fa799;
}
.search input {
  border: 0;
  background: none;
  font-size: 11px;
  padding: 9px;
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.project-card {
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px #203b3010;
}
.cover {
  height: 205px;
  position: relative;
  padding: 26px;
  overflow: hidden;
  color: #eeead9;
  background: #526452;
}
.cover-1 {
  background: #9c8066;
  color: #fff3df;
}
.cover-2 {
  background: #5c6d79;
  color: #e8eef2;
}
.cover-3 {
  background: #786777;
  color: #eee1ea;
}
.cover > span {
  font-size: 9px;
  letter-spacing: 2px;
  opacity: 0.65;
}
.cover-title {
  font-family: serif;
  font-size: 24px;
  line-height: 1.6;
  max-width: 88%;
  margin-top: 17px;
  position: relative;
  z-index: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover-line {
  height: 1px;
  width: 45px;
  background: currentColor;
  opacity: 0.5;
  margin: 15px 0;
}
.cover > small {
  color: inherit;
  font-size: 7px;
  letter-spacing: 2px;
  opacity: 0.5;
}
.cover-symbol {
  font-family: serif;
  position: absolute;
  right: -10px;
  bottom: -30px;
  font-size: 165px;
  opacity: 0.07;
  font-weight: 400;
  transform: rotate(-10deg);
}
.card-content {
  padding: 20px;
}
.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-title h3 {
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.card-title > span {
  color: #9fa695;
}
.card-content p {
  font-size: 10px;
  color: #a1a597;
  margin-top: 11px;
}
.card-content p span {
  margin: 0 8px;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f0f1eb;
  margin-top: 20px;
  padding-top: 14px;
  gap: 6px;
}
.card-bottom small {
  font-size: 9px;
  color: #a9ad9f;
}
.quiet-dot {
  font-size: 10px;
  color: #8d9a82;
}
.quiet-dot:before {
  content: "•";
  color: #9daf8d;
  margin-right: 5px;
}
.add-card {
  border: 1px dashed #d7ddce;
  border-radius: 9px;
  min-height: 340px;
  background: #f4f5ee;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: #9ca590;
}
.add-card > span {
  font-size: 28px;
  border: 1px solid #d7ddce;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  line-height: 42px;
  font-weight: 300;
}
.add-card b {
  font-size: 12px;
  font-weight: 500;
}
.add-card small {
  font-size: 10px;
  color: #b0b6a7;
}
.bottom-hint {
  font-size: 10px;
  color: #a5ab9e;
  text-align: center;
  margin-top: 40px;
  line-height: 1.8;
}
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  padding: 50px 25px;
  color: var(--muted);
  gap: 14px;
}
.empty h2,
.empty h3 {
  color: var(--ink);
}
.empty p {
  font-size: 12px;
  line-height: 1.9;
  max-width: 500px;
}
.empty.large {
  min-height: 310px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 17px;
  font-size: 29px;
  color: #7b9272;
  background: #eff3e9;
  margin-bottom: 6px;
}
.empty .actions {
  justify-content: center;
  margin-top: 8px;
}
.notice {
  border: 1px solid #dce5d3;
  background: #eff4e9;
  color: #64775b;
  border-radius: 8px;
  padding: 17px 20px;
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 25px;
}
.notice p {
  font-size: 11px;
  margin-top: 3px;
  color: #7f8d73;
}
.notice.compact {
  margin: 10px 0 0;
  font-size: 11px;
  padding: 12px;
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.skill-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 24px;
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 19px;
}
.skill-icon {
  font-size: 24px;
  background: #edf1e7;
  color: #6c8163;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
}
.pill {
  display: inline-block;
  padding: 4px 8px;
  font-size: 10px;
  color: #89937e;
  background: #f2f4ec;
  border-radius: 4px;
  font-weight: 400;
  line-height: 1.5;
}
.skill-card h3 {
  font-size: 15px;
}
.skill-card > p {
  font-size: 11px;
  color: #92998c;
  line-height: 1.9;
  margin: 12px 0;
  min-height: 42px;
}
.skill-meta {
  display: flex;
  gap: 15px;
  font-size: 10px;
  color: #a2aa98;
  margin-top: 18px;
}
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}
.card-actions .secondary {
  font-size: 11px;
  padding: 8px 12px;
  min-height: 32px;
}
.card-actions .text-button {
  font-size: 10px;
}
.narrow {
  max-width: 950px;
  margin-left: 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 26px;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.panel-heading h2 {
  font-size: 17px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 10px;
}
.form-footer > span {
  font-size: 11px;
  color: var(--muted);
}
.badge {
  display: inline-block;
  white-space: nowrap;
  font-size: 10px;
  border-radius: 4px;
  padding: 4px 8px;
  background: #f0f0e8;
  color: #8e9683;
  line-height: 1.5;
}
.badge.succeeded,
.badge.approved {
  background: #e8f0e2;
  color: #56744c;
}
.badge.running,
.badge.queued {
  background: #e6efef;
  color: #487b79;
}
.badge.failed,
.badge.interrupted,
.badge.changes_requested {
  background: #f7e9dd;
  color: #aa6d45;
}
.project-page {
  padding: 28px 32px;
  max-width: 1850px;
  margin: auto;
}
.project-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.project-heading h1 {
  font-size: 27px;
  margin-top: 15px;
}
.back {
  font-size: 11px;
  color: #9aa48f;
}
.project-heading p span {
  margin: 0 9px;
}
.project-toolbar {
  margin-top: 25px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.run-picker {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  max-width: 65%;
}
.run-picker label {
  font-size: 11px;
  color: #8e9787;
  white-space: nowrap;
}
.run-picker select {
  font-size: 11px;
  max-width: 450px;
}
.project-toolbar .secondary {
  font-size: 11px;
  padding: 8px 12px;
  min-height: 35px;
}
.run-strip {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 18px 0;
  font-size: 11px;
  color: #8e9984;
  flex-wrap: wrap;
}
.run-strip progress {
  width: 110px;
  height: 4px;
  accent-color: var(--green);
}
.run-strip .text-button {
  margin-left: auto;
  font-size: 10px;
}
.workbench {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  min-height: 540px;
  align-items: stretch;
}
.workbench.with-source {
  grid-template-columns: 145px minmax(240px, 1fr) minmax(280px, 0.7fr);
}
.batch-panel {
  background: #fcfdf9;
  border-right: 1px solid var(--line);
}
.batch-panel .panel-heading {
  padding: 20px 16px;
}
.batch-panel h3 {
  font-size: 12px;
}
.batch-panel small {
  font-size: 10px;
}
.batch-list {
  max-height: 730px;
  overflow: auto;
  padding: 0 8px;
}
.batch-item {
  display: block;
  width: 100%;
  background: transparent;
  text-align: left;
  padding: 15px 11px;
  border-radius: 6px;
  margin-bottom: 4px;
  color: #88937e;
}
.batch-item > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.batch-item b {
  font-size: 11px;
  font-weight: 500;
}
.batch-item small {
  display: block;
  margin-top: 8px;
  font-size: 9px;
  color: #abb1a0;
}
.batch-item.selected {
  background: #edf2e5;
  color: var(--green);
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d4dacd;
}
.status-dot.succeeded {
  background: #89a477;
}
.status-dot.running {
  background: #598d90;
  box-shadow: 0 0 0 3px #598d9019;
}
.status-dot.failed,
.status-dot.interrupted {
  background: #c98c59;
}
.results-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.result-heading {
  padding: 25px 28px 19px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.result-heading h2 {
  font-size: 18px;
}
.result-heading .eyebrow {
  font-size: 8px;
  margin-bottom: 9px;
}
.result-tabs {
  display: flex;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  overflow: auto;
}
.result-tabs button {
  padding: 10px 0 13px;
  background: none;
  color: #9aa38f;
  font-size: 11px;
  border-bottom: 2px solid transparent;
}
.result-tabs button.active {
  color: var(--green);
  border-color: var(--green);
}
.result-tabs span {
  font-size: 9px;
  border-radius: 8px;
  padding: 1px 4px;
  background: #f3e9dc;
  color: #b38d58;
}
.result-body {
  padding: 25px 28px;
  min-height: 380px;
}
.chapter-result + .chapter-result {
  border-top: 1px solid var(--line);
  margin-top: 28px;
  padding-top: 28px;
}
.chapter-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.chapter-label > span {
  font-size: 9px;
  letter-spacing: 1px;
  color: #a4af96;
}
.chapter-label button {
  font-size: 10px;
}
.chapter-result h3 {
  font-size: 18px;
  font-family: serif;
}
.story-text {
  line-height: 2.1;
  font-size: 13px;
  color: #63715e;
  margin-top: 15px;
  white-space: pre-wrap;
}
.fact-section {
  margin-top: 24px;
}
.fact-section h4 {
  font-size: 11px;
  color: #8b947e;
  margin-bottom: 12px;
  font-weight: 500;
}
.orange-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #c58a5b;
  border-radius: 50%;
  margin: 0 5px 1px 0;
}
.hotpoint {
  padding: 15px;
  background: #faf7f0;
  border: 1px solid #eee9db;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.9;
}
.hotpoint b {
  font-size: 11px;
  font-weight: 500;
  margin: 0 8px;
}
.hotpoint small {
  font-size: 10px;
}
.pill.warm {
  background: #f0e5d5;
  color: #ab8757;
}
.hotpoint p {
  margin-top: 9px;
  color: #908774;
}
.moment {
  display: flex;
  gap: 12px;
  background: #f2f5ed;
  border-radius: 6px;
  padding: 16px;
  margin-top: 10px;
}
.moment-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 27px;
  padding: 4px;
  background: #e4ebda;
  color: #7b8a66;
  font-size: 9px;
  border-radius: 3px;
}
.moment p {
  font-size: 12px;
  color: #6d7b61;
  line-height: 1.9;
}
.moment small {
  display: block;
  font-size: 10px;
  color: #a0a88f;
  line-height: 1.8;
  margin-top: 8px;
}
.review-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 25px;
  border-top: 1px solid var(--line);
  margin-top: auto;
  background: #fdfdfb;
}
.review-bar > span {
  font-size: 9px;
  color: #a4ad98;
}
.review-bar button {
  font-size: 10px;
  min-height: 33px;
  padding: 7px 12px;
}
.source-panel {
  background: #fbfcf7;
  border-left: 1px solid var(--line);
  min-width: 0;
  max-height: 880px;
  display: flex;
  flex-direction: column;
}
.source-panel .panel-heading {
  padding: 18px 20px 10px;
}
.source-panel h3 {
  font-size: 12px;
}
.source-select {
  padding: 0 18px;
}
.source-select select {
  font-size: 10px;
  background: #fcfdf9;
}
.source-meta {
  font-size: 9px;
  color: #a5ad98;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.source-body {
  font-family: serif;
  font-size: 13px;
  color: #7a846d;
  line-height: 2.3;
  white-space: pre-wrap;
  overflow: auto;
  margin: 0;
  padding: 20px 24px;
  overflow-wrap: anywhere;
}
.character-card {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}
.character-card:first-child {
  padding-top: 0;
}
.character-avatar {
  width: 39px;
  height: 39px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: #edf1e7;
  color: #8c9d7c;
  border-radius: 9px;
  font-family: serif;
  font-size: 21px;
}
.character-card h3 {
  font-size: 15px;
}
.character-card small {
  font-size: 10px;
  display: block;
  margin-top: 5px;
}
.character-card p,
.event-card p {
  font-size: 12px;
  line-height: 2;
  color: #758169;
  margin-top: 13px;
}
.relations {
  margin-top: 15px;
  font-size: 11px;
}
.relations > div {
  border-top: 1px solid #f0f1eb;
  padding: 12px 0;
}
.relations b {
  margin-right: 10px;
  font-weight: 500;
}
.relations blockquote {
  margin: 10px 0 0;
  border-left: 2px solid #d8dfcd;
  padding-left: 10px;
  color: #9ca58f;
  line-height: 1.8;
  font-size: 11px;
}
.inline-note {
  background: #faf6eb;
  color: #9e8a5e;
  border-radius: 5px;
  padding: 12px;
  line-height: 1.9;
  font-size: 11px;
  margin-top: 13px;
}
.inline-note b {
  font-weight: 500;
  margin-right: 7px;
}
.inline-note.payoff {
  background: #f0f4e9;
  color: #7c8c65;
}
.event-card {
  display: flex;
  gap: 16px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
}
.event-card:first-child {
  padding-top: 0;
}
.event-index {
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
  color: #bdc6ac;
  min-width: 25px;
}
.event-card h3 {
  margin-top: 10px;
  font-size: 15px;
}
.review-content > p {
  font-size: 12px;
  line-height: 1.9;
  color: #929c85;
  margin: 12px 0 15px;
}
.review-content label {
  margin: 22px 0 12px;
}
.review-content details {
  margin-top: 25px;
}
.output-section {
  margin-bottom: 27px;
}
.output-section h3 {
  font-size: 14px;
  margin-bottom: 13px;
}
.output-section > p {
  font-size: 13px;
  line-height: 2;
}
.fact-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 13px;
  font-size: 12px;
  line-height: 2;
  margin-bottom: 10px;
}
.prose {
  font-family: inherit;
  font-size: 13px;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.first-run {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 25px;
  min-height: 380px;
}
.first-run-notes {
  display: flex;
  gap: 20px;
  font-size: 10px;
  margin-top: 20px;
  color: #a5af97;
}
.error-banner {
  padding: 16px 20px;
  border: 1px solid #ead7c0;
  border-radius: 7px;
  background: #fbf4e9;
  margin-bottom: 18px;
  color: #a08056;
  font-size: 12px;
}
.error-banner p {
  font-size: 11px;
  line-height: 1.8;
  margin-top: 7px;
}
details {
  width: 100%;
  text-align: left;
  color: #849574;
  font-size: 11px;
}
summary {
  cursor: pointer;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: left;
  line-height: 1.8;
}
details pre {
  padding: 12px;
  background: #f5f6f1;
  border-radius: 5px;
  max-height: 400px;
  overflow: auto;
  color: #7b856e;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  width: min(580px, calc(100% - 24px));
  max-height: 90vh;
  color: var(--ink);
  box-shadow: 0 20px 80px #17352625;
}
dialog::backdrop {
  background: #1c30284a;
  backdrop-filter: blur(2px);
}
dialog.wide-modal {
  width: min(880px, calc(100% - 24px));
}
.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 24px;
}
.modal-heading h2 {
  font-size: 21px;
}
.modal-heading p {
  font-size: 11px;
  color: #99a18e;
  line-height: 1.8;
  margin-top: 9px;
}
dialog form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.file-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7ef;
  border: 1px dashed #c8d3ba;
  border-radius: 8px;
  min-height: 155px;
  text-align: center;
  color: #8b9e7a;
  font-size: 25px;
  padding: 15px;
}
.file-zone strong {
  font-size: 13px;
  font-weight: 500;
}
.file-zone > span {
  font-size: 10px;
}
.file-zone input {
  font-size: 10px;
  width: 85%;
  padding: 5px;
  background: none;
  border: 0;
}
.file-zone small {
  font-size: 9px;
}
.history-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}
.history-row label {
  max-width: 70%;
  font-size: 11px;
}
.history-row select {
  font-size: 11px;
}
.check {
  flex-direction: row;
  align-items: center;
  font-size: 11px;
  font-weight: 400;
}
.skill-snapshot {
  padding: 18px;
  background: #f7f8f3;
  font-size: 12px;
  max-height: 60vh;
  overflow: auto;
}
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 40px;
  background: #f4f5ee;
}
.login-art {
  background: #2f4b3e;
  border-radius: 15px;
  padding: 60px;
  position: relative;
  overflow: hidden;
  color: #e8e7d5;
  display: flex;
  flex-direction: column;
}
.login-art .eyebrow {
  color: #9ead8d;
  font-size: 9px;
  letter-spacing: 2.5px;
}
.login-art h1 {
  font-family: serif;
  font-size: 46px;
  font-weight: 400;
  line-height: 1.65;
  margin-top: 55px;
  letter-spacing: 4px;
}
.login-art p {
  font-size: 13px;
  line-height: 2.2;
  color: #a4b29a;
  margin-top: 25px;
}
.login-art > small {
  margin-top: auto;
  color: #9aab8e;
  font-size: 10px;
  letter-spacing: 5px;
  padding-top: 40px;
}
.book-art {
  display: flex;
  align-self: flex-end;
  transform: rotate(-17deg);
  margin-top: 20px;
  margin-right: 15px;
  opacity: 0.35;
}
.book-art div {
  border: 1px solid #a4b48e;
  width: 70px;
  height: 150px;
  transform: skewY(15deg);
}
.book-art div:nth-child(2) {
  background: #687e59;
  height: 170px;
}
.login-form {
  max-width: 400px;
  width: 100%;
  align-self: center;
  justify-self: center;
  padding: 30px;
}
.login-form h2 {
  font-size: 23px;
  margin-top: 27px;
}
.login-form > p {
  font-size: 12px;
  color: #969e8c;
  margin: 15px 0 34px;
  line-height: 1.8;
}
.login-form button {
  margin-top: 23px;
  justify-content: space-between;
}
.login-form > small {
  display: block;
  font-size: 10px;
  color: #adb3a3;
  margin-top: 20px;
  text-align: center;
}
.form-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 14px;
}
.boot {
  height: 100vh;
  display: grid;
  place-items: center;
  color: #95a28a;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 10px);
  background: #284d40;
  color: white;
  border-radius: 8px;
  box-shadow: 0 8px 30px #0002;
  padding: 13px 22px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 10;
  max-width: 90vw;
  line-height: 1.8;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.error {
  background: #934c38;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  .project-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sidebar {
    padding: 25px 15px 18px;
  }
  .brand {
    font-size: 15px;
  }
  .brandmark {
    width: 33px;
    height: 37px;
  }
  .page {
    padding: 30px 28px;
  }
  .topbar {
    padding: 0 28px;
  }
  .intro-banner {
    gap: 25px;
    flex-direction: column;
    align-items: flex-start;
  }
  .steps {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
  .steps div {
    min-width: 60px;
  }
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-page {
    padding: 25px 22px;
  }
  .workbench.with-source {
    grid-template-columns: 130px minmax(220px, 1fr);
  }
  .with-source .source-panel {
    grid-column: 1/-1;
    max-height: 500px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .skill-card {
    padding: 20px;
  }
  .card-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
@media (max-width: 760px) {
  h1 {
    font-size: 25px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 15px 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 16px;
  }
  .brandmark {
    width: 31px;
    height: 34px;
  }
  .brand small {
    font-size: 7px;
  }
  .workspace-tag,
  .sidebar-note,
  .sidebar-bottom {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    gap: 5px;
    justify-content: space-between;
    margin-top: 18px;
  }
  .sidebar nav a {
    gap: 6px;
    padding: 10px 9px;
    border-radius: 5px 5px 0 0;
  }
  .sidebar nav a span {
    font-size: 11px;
  }
  .sidebar nav a b {
    display: none;
  }
  .topbar {
    height: 45px;
    padding: 0 20px;
    font-size: 10px;
  }
  .top-status {
    font-size: 9px;
  }
  .top-status .divider,
  .top-status .avatar {
    display: none;
  }
  .page {
    padding: 26px 20px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 15px;
  }
  .page-heading p {
    font-size: 11px;
  }
  .page-heading .primary {
    padding: 9px 12px;
    font-size: 11px;
  }
  .page-heading .actions {
    justify-content: flex-end;
  }
  .page-heading .secondary {
    padding: 8px;
    font-size: 10px;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .intro-banner {
    padding: 22px;
    gap: 22px;
  }
  .intro-banner h2 {
    font-size: 22px;
  }
  .steps b {
    font-size: 10px;
  }
  .steps small {
    font-size: 8px;
  }
  .steps div span {
    font-size: 19px;
    margin-bottom: 8px;
  }
  .steps i {
    display: none;
  }
  .steps div {
    min-width: 0;
  }
  .section-toolbar h2 {
    font-size: 13px;
  }
  .search {
    width: 175px;
  }
  .search input {
    font-size: 10px;
  }
  .project-grid {
    gap: 13px;
  }
  .cover {
    height: 170px;
    padding: 18px;
  }
  .cover-title {
    font-size: 19px;
  }
  .cover > span {
    font-size: 7px;
    letter-spacing: 1px;
  }
  .cover > small {
    font-size: 6px;
    letter-spacing: 0.5px;
  }
  .cover-symbol {
    font-size: 130px;
  }
  .card-content {
    padding: 14px;
  }
  .card-title h3 {
    font-size: 11px;
  }
  .card-content p {
    font-size: 9px;
  }
  .card-bottom {
    flex-direction: column;
    align-items: flex-start;
    margin-top: 13px;
    padding-top: 11px;
    gap: 8px;
  }
  .add-card {
    min-height: 290px;
  }
  .add-card b {
    font-size: 11px;
  }
  .add-card small {
    font-size: 8px;
  }
  .skill-grid {
    grid-template-columns: 1fr;
  }
  .card-actions {
    flex-direction: row;
    align-items: center;
  }
  .narrow {
    max-width: none;
  }
  .settings-form {
    padding: 20px;
  }
  .field-row {
    gap: 12px;
  }
  .form-footer {
    flex-wrap: wrap;
  }
  .project-page {
    padding: 22px 14px;
  }
  .project-heading {
    align-items: flex-start;
  }
  .project-heading h1 {
    font-size: 21px;
    line-height: 1.5;
  }
  .project-heading > .actions {
    flex-direction: column;
    align-items: stretch;
  }
  .project-heading button {
    font-size: 10px;
    padding: 8px 10px;
    min-height: 33px;
  }
  .project-heading p {
    font-size: 9px;
  }
  .project-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .run-picker {
    max-width: 100%;
  }
  .run-picker select {
    max-width: none;
  }
  .run-picker label {
    font-size: 10px;
  }
  .project-toolbar > .actions {
    justify-content: flex-end;
  }
  .run-strip {
    gap: 10px;
    font-size: 9px;
  }
  .run-strip .subtle {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .run-strip progress {
    width: 60px;
  }
  .workbench,
  .workbench.with-source {
    display: flex;
    flex-direction: column;
    min-height: 450px;
  }
  .batch-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .batch-panel .panel-heading {
    padding: 12px 15px;
  }
  .batch-list {
    display: flex;
    max-height: none;
    overflow: auto;
    padding: 0 10px 8px;
    gap: 5px;
  }
  .batch-item {
    min-width: 110px;
    width: auto;
    margin: 0;
    padding: 10px;
  }
  .batch-item b {
    font-size: 10px;
  }
  .batch-item small {
    font-size: 8px;
  }
  .result-heading {
    padding: 20px;
  }
  .result-heading h2 {
    font-size: 16px;
  }
  .result-tabs {
    padding: 0 20px;
    gap: 19px;
  }
  .result-tabs button {
    font-size: 10px;
  }
  .result-body {
    padding: 20px;
  }
  .story-text {
    font-size: 12px;
  }
  .review-bar {
    padding: 13px 15px;
    flex-wrap: wrap;
  }
  .review-bar .actions {
    margin-left: auto;
  }
  .source-panel {
    max-height: 450px !important;
    border-top: 1px solid var(--line);
  }
  .first-run h2 {
    font-size: 18px;
  }
  .first-run-notes {
    font-size: 8px;
    gap: 10px;
  }
  .first-run {
    min-height: 370px;
  }
  .login-page {
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 100vh;
  }
  .login-art {
    min-height: 240px;
    padding: 30px;
  }
  .login-art h1 {
    font-size: 30px;
    margin-top: 22px;
    line-height: 1.5;
  }
  .login-art p {
    font-size: 11px;
    margin-top: 12px;
  }
  .login-art > small,
  .book-art {
    display: none;
  }
  .login-form {
    padding: 30px 15px;
    max-width: 450px;
  }
  .login-form > .brandmark {
    display: none;
  }
  .login-form h2 {
    font-size: 21px;
    margin-top: 0;
  }
  .login-form > p {
    margin: 12px 0 23px;
  }
  .history-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .history-row label {
    max-width: 100%;
  }
  dialog {
    padding: 20px;
  }
  .modal-heading h2 {
    font-size: 19px;
  }
  .empty.large {
    padding: 35px 20px;
  }
  .empty h2 {
    font-size: 18px;
  }
  .empty .actions button {
    font-size: 11px;
  }
  .source-body {
    font-size: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Compact operational layout: no decorative slogan panels. */
.sidebar-bottom {
  margin-top: auto;
}
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 36px;
}
.login-form h2 {
  margin-bottom: 28px;
}
@media (max-width: 760px) {
  .login-page {
    padding: 24px;
  }
  .login-form {
    padding: 26px;
  }
}
body.sidebar-collapsed .sidebar {
  display: none;
}
body.sidebar-collapsed .layout {
  grid-template-columns: minmax(0, 1fr);
}
mark {
  background: #ffe39a;
  color: #29231a;
}
.flash {
  outline: 3px solid #b88242;
  animation: flash-card 2s ease-out;
}
@keyframes flash-card {
  from {
    background: #ffebc2;
  }
  to {
    background: transparent;
  }
}
.source-panel form {
  padding: 0 16px;
}
.event-chapters {
  margin-top: 12px;
}
[hidden] {
  display: none !important;
}
/* Creative process workspace */
.creative-workspace {
  max-width: 1550px;
  margin: auto;
  padding: 32px;
}
.creative-header,
.creative-stage-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.creative-header h1 {
  font-size: 26px;
  margin: 12px 0;
}
.creative-header p,
.creative-stage-heading p {
  color: var(--muted, #74776f);
}
.creative-steps {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1px solid #dedfd7;
  padding-bottom: 22px;
  margin-bottom: 30px;
}
.creative-steps button {
  text-align: left;
  padding: 14px 10px;
  background: #f3f4ef;
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.creative-steps button.selected {
  background: #e4eddf;
  border-color: #6c835c;
  color: #294322;
}
.creative-steps span {
  font-size: 12px;
  color: #737969;
}
.creative-steps small {
  font-size: 11px;
  color: #737969;
}
.creative-tools {
  display: flex;
  gap: 16px;
  align-items: end;
  margin-bottom: 22px;
}
.creative-tools label {
  max-width: 340px;
  flex: 1;
}
.creative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.creative-card {
  background: white;
  border: 1px solid #e0e3d9;
  border-radius: 12px;
  padding: 22px;
  min-width: 0;
}
.creative-card p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.7;
}
.creative-card h3 {
  font-size: 19px;
  margin: 18px 0 8px;
}
.creative-card .card-actions {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.creative-jobs {
  background: #f5f6f0;
  margin-top: 24px;
  padding: 20px;
  border-radius: 10px;
}
.creative-job {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid #dce0d2;
}
.creative-job small {
  display: block;
  color: #7d8174;
  margin-top: 8px;
}
.creative-source {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}
.creative-source aside {
  min-width: 0;
}
.creative-source article {
  background: white;
  border: 1px solid #e1e4da;
  padding: 24px;
  border-radius: 12px;
  min-width: 0;
}
.chapter-list {
  max-height: 65vh;
  overflow: auto;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.chapter-list button {
  text-align: left;
  padding: 12px;
  background: #f1f3ec;
  border: 0;
  border-radius: 6px;
  line-height: 1.5;
}
.chapter-list .selected {
  background: #dfead6;
}
.creative-original {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.9;
}
.creative-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.creative-fields .full {
  grid-column: 1/-1;
}
#creative-dialog {
  max-height: 90vh;
  overflow: auto;
  width: min(900px, 94vw);
  padding: 30px;
  border: 1px solid #dedfd4;
  border-radius: 16px;
}
#creative-dialog h2 {
  margin-top: 0;
}
#creative-dialog label {
  margin-top: 16px;
}
#creative-dialog select[multiple] {
  min-height: 120px;
}
.creative-close {
  float: right;
}
.creative-ai {
  margin-top: 28px;
  border-top: 1px solid #ddd;
  padding-top: 18px;
}
.history-entry {
  border-bottom: 1px solid #e1e4da;
  padding: 15px 0;
}
.media-preview img,
.media-preview video {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
}
.media-preview audio {
  max-width: 100%;
}
.media-preview a {
  display: block;
  overflow-wrap: anywhere;
  margin: 8px 0;
}
.creative-steps button:focus-visible {
  outline: 2px solid #416b32;
  outline-offset: 3px;
}
@media (max-width: 900px) {
  .creative-workspace {
    padding: 20px;
  }
  .creative-steps {
    display: flex;
    overflow-x: auto;
  }
  .creative-steps button {
    min-width: 130px;
  }
  .creative-header,
  .creative-stage-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .creative-source {
    grid-template-columns: 1fr;
  }
  .chapter-list {
    max-height: 200px;
  }
  .creative-fields {
    grid-template-columns: 1fr;
  }
  .creative-fields .full {
    grid-column: auto;
  }
  .creative-grid {
    grid-template-columns: 1fr;
  }
  .creative-job {
    flex-direction: column;
  }
  .creative-tools {
    flex-wrap: wrap;
  }
  .creative-source article {
    padding: 16px;
  }
}
.batch-row {
  border: 1px solid #d8dfd2;
  border-radius: 10px;
  padding: 18px;
  margin: 18px 0;
  background: #f9faf7;
}
.batch-row .actions {
  flex-wrap: wrap;
}
.batch-rows {
  max-height: 60vh;
  overflow: auto;
  padding-right: 8px;
}
#batch-edit-form fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}
.creative-stage-heading .actions {
  flex-wrap: wrap;
}

/* Destructive actions stay visibly distinct, including links inside cards. */
button[data-creative="archive"],
button[data-creative="trash-candidate"],
button[data-creative="batch-remove"],
button[data-action="archive-project"],
button[data-action="archive-skill"] {
  color: var(--red);
}
button[data-creative="archive"]:hover,
button[data-creative="trash-candidate"]:hover {
  color: #a01d27;
  background: #fff1f2;
}

.prep-binding {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border, #ddd);
}
.prep-thumb {
  max-width: 160px;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
}
.prep-materials,
.prep-generation,
.prep-delivery {
  padding: 20px 0;
  border-top: 1px solid var(--border, #ddd);
  margin-top: 20px;
}
.prep-result {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}
#prep-dialog .creative-fields {
  margin-bottom: 16px;
}
#prep-model-params {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#prep-dialog details {
  margin: 16px 0;
}
#prep-dialog .dialog-close {
  float: right;
}
@media (max-width: 600px) {
  .prep-binding {
    grid-template-columns: 1fr;
  }
  .prep-delivery .actions {
    align-items: stretch;
  }
  #prep-model-params {
    grid-template-columns: 1fr;
  }
}
.prep-review {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #d4dfd1;
  border-radius: 8px;
}
.prep-review-image {
  display: block;
  width: 100%;
  max-height: 600px;
  object-fit: contain;
}
.prep-review input[type="checkbox"] {
  width: auto;
}

/* Production workspace: neutral canvas, semantic color, predictable actions. */
:root {
  --bg: #f3f5f8;
  --ink: #202c3d;
  --muted: #647184;
  --green: #315dd1;
  --line: #dde3ec;
  --soft: #edf2fc;
  --red: #b52d3d;
}
.creative-workspace {
  max-width: 1600px;
  margin: auto;
}
.creative-header h1 {
  font-size: 24px;
  letter-spacing: 0;
}
.creative-header p {
  color: var(--muted);
  margin-top: 6px;
}
.creative-steps {
  gap: 6px;
  padding: 8px;
  background: #e9edf4;
  border-radius: 12px;
}
.creative-steps button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  min-width: 0;
}
.creative-steps button.selected {
  background: white;
  color: #234ab2;
  border-color: #c5d4f4;
  box-shadow: 0 2px 6px #25395b0c;
}
.creative-steps button span {
  font-family: ui-monospace, monospace;
}
.creative-stage-heading {
  padding: 22px 0 16px;
  align-items: flex-start;
}
.creative-stage-heading h2 {
  font-size: 22px;
}
.creative-stage-heading p {
  line-height: 1.7;
  color: var(--muted);
}
.creative-tools,
.asset-toolbar {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.creative-tools label {
  flex: 1;
  min-width: 200px;
}
.creative-tools input,
.creative-tools select {
  background: white;
}
.creative-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 2px 5px #24355305;
  overflow-wrap: anywhere;
  min-width: 0;
}
.creative-card h3 {
  line-height: 1.5;
}
.creative-card .card-actions {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: auto;
  gap: 8px;
}
.creative-card p {
  line-height: 1.7;
}
.creative-card p b {
  color: #253b57;
}
.creative-grid {
  align-items: stretch;
}
.creative-workspace[data-stage="5"] .creative-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
}
.creative-workspace[data-stage="7"] .creative-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
}
.creative-workspace[data-stage="7"] .media-preview video {
  max-height: 360px;
  background: #121923;
}
.creative-source aside {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.creative-source article {
  min-width: 0;
  background: white;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.creative-original {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  line-height: 1.95;
  max-width: 80ch;
}
.creative-fields label,
.asset-toolbar label,
#prep-dialog label {
  font-weight: 600;
  color: #34445d;
}
.creative-fields input,
.creative-fields textarea,
.creative-fields select,
#prep-dialog input,
#prep-dialog textarea,
#prep-dialog select {
  font-weight: 400;
  color: var(--ink);
}
.workflow-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  margin: 0 0 16px;
  border: 1px solid #cedaf3;
  background: #eef3fd;
  border-radius: 8px;
}
.workflow-strip span + span::before {
  content: "›";
  margin-right: 12px;
  color: #6d7b94;
}
.asset-toolbar label {
  min-width: 180px;
}
.asset-toolbar p {
  flex: 1;
  min-width: 220px;
  line-height: 1.7;
}
.asset-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}
.asset-preview {
  width: 100%;
  height: 220px;
  background: #edf0f5;
  border-radius: 8px;
  padding: 8px;
  color: var(--muted);
}
.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.asset-card .card-top {
  flex-wrap: wrap;
  gap: 8px;
}
.asset-card code {
  font-size: 12px;
  font-weight: 650;
  color: #52617b;
}
.asset-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.type-tag,
.state-tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
}
.type-tag {
  color: #3d4b64;
  background: #eef1f6;
}
.type-tag[data-type="人物"] {
  color: #64418c;
  background: #f0eafa;
}
.type-tag[data-type="场景"] {
  color: #17625b;
  background: #e4f3ef;
}
.type-tag[data-type="道具"] {
  color: #875115;
  background: #fcf0df;
}
.asset-readiness {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.state-tag.good {
  color: #176043;
  background: #e8f4ec;
}
.state-tag.attention {
  color: #875115;
  background: #fcf3e5;
}
.card-more {
  position: relative;
  margin-left: auto;
}
.card-more summary {
  cursor: pointer;
  padding: 10px;
  color: var(--muted);
}
.card-more[open] {
  flex-basis: 100%;
}
#prep-dialog {
  width: min(1180px, 96vw);
  max-height: 94vh;
  padding: 28px;
}
#prep-dialog h2 {
  padding-right: 35px;
}
.prep-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: #edf0f6;
  border-radius: 8px;
  padding: 5px;
  margin: 20px 0;
}
.prep-tabs button {
  flex: 1;
  min-width: 145px;
  padding: 12px;
  border-radius: 6px;
  color: #52617b;
  background: transparent;
  font-weight: 600;
}
.prep-tabs button.selected {
  background: white;
  color: #234ab2;
  box-shadow: 0 1px 4px #24355314;
}
[hidden] {
  display: none !important;
}
.prep-save-bar {
  position: sticky;
  bottom: -28px;
  z-index: 2;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  background: white;
  border-top: 1px solid var(--line);
}
.prep-binding {
  grid-template-columns: minmax(200px, 0.85fr) minmax(0, 1.15fr);
  padding: 20px;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 16px;
}
.prep-binding > a {
  align-self: start;
  position: sticky;
  top: 0;
}
.prep-binding .prep-thumb {
  max-width: 100%;
  max-height: 500px;
  width: 100%;
  object-fit: contain;
}
.prep-review {
  background: white;
  border-color: #cdd8ed;
}
.prep-review label {
  margin: 14px 0;
}
.prep-review input[type="checkbox"] {
  margin-right: 8px;
}
.prep-review-image {
  background: #edf0f5;
}
.review-finding {
  padding: 12px 16px;
  margin: 12px 0;
  border-left: 3px solid #b6762b;
  background: #fbf5ed;
  line-height: 1.8;
}
#prep-dialog blockquote {
  margin: 12px 0;
  border-left: 3px solid #c5d4f4;
  padding: 12px 16px;
  background: #f7f9fd;
}
#prep-dialog .notice p,
#prep-dialog details p {
  line-height: 1.8;
  margin: 8px 0;
}
.prep-delivery {
  background: white;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
}
button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #7297ee;
  outline-offset: 3px;
}
button:disabled {
  cursor: not-allowed;
}
@media (max-width: 700px) {
  .creative-header,
  .creative-stage-heading {
    gap: 14px;
    flex-direction: column;
  }
  .creative-steps {
    overflow-x: auto;
    display: flex;
  }
  .creative-steps button {
    min-width: 125px;
    flex: none;
  }
  .creative-stage-heading .actions {
    width: 100%;
  }
  .creative-tools label,
  .asset-toolbar label {
    min-width: 0;
    flex: 1 1 140px;
  }
  .creative-source article {
    padding: 16px;
  }
  #prep-dialog {
    padding: 16px;
    width: 96vw;
  }
  .prep-binding {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .prep-binding > a {
    position: static;
  }
  .prep-save-bar {
    bottom: -16px;
    flex-wrap: wrap;
  }
  .prep-tabs button {
    min-width: 0;
    font-size: 12px;
    padding: 10px 4px;
  }
  .prep-delivery {
    padding: 14px;
  }
}
.creative-workspace[data-stage="6"] .creative-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  align-items: start;
}
.asset-card h3 {
  margin: 0;
}
.asset-card .card-top {
  margin: 0;
}
.asset-card .card-actions {
  justify-content: flex-start;
}
.asset-card .card-more {
  margin: 0;
}
.creative-card .card-actions .text-button {
  font-size: 12px;
}
.notice {
  background: #edf2fb;
  color: #3e5274;
  border: 1px solid #d5dfef;
}
.sidebar .nav-item.active {
  background: #edf2fb;
}
.creative-steps {
  margin-bottom: 12px;
}
.creative-stage-heading {
  margin-bottom: 12px;
}
.creative-workspace .notice,
.creative-workspace .notice p,
#prep-dialog .notice,
#prep-dialog .notice p {
  font-size: 14px;
  color: #465a76;
}
.creative-jobs {
  background: white;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
}
.creative-jobs h4 {
  margin-top: 14px;
  font-size: 15px;
}
.creative-jobs summary {
  font-weight: 600;
  cursor: pointer;
}
.creative-workspace[data-stage="2"] .creative-tools {
  display: none;
}
.creative-source .chapter-list .selected {
  background: #e5edfc;
  color: #234ab2;
}
.stage-collection {
  margin: 24px 0;
}
.stage-collection > h3 {
  margin-bottom: 16px;
  font-size: 18px;
}
.candidate-shelf {
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  padding: 16px;
}
.candidate-shelf > summary {
  cursor: pointer;
  font-weight: 600;
  color: #52617b;
}
.candidate-shelf[open] > summary {
  margin-bottom: 16px;
}
.delivery-issues {
  padding: 10px 0;
}
.delivery-issues summary {
  color: #875115;
  cursor: pointer;
  font-weight: 600;
}
.prep-delivery .creative-grid {
  margin-top: 18px;
}
.prep-delivery .creative-card h3 {
  margin-top: 0;
  font-family: ui-monospace, monospace;
  font-size: 16px;
}
.creative-workspace[data-stage="7"] .stage-collection .creative-grid {
  grid-template-columns: 1fr;
}
#prep-source-dialog {
  width: min(900px, 94vw);
  padding: 24px;
  max-height: 90vh;
}
#prep-source-dialog .source-close {
  float: right;
}
#prep-source-dialog .creative-original {
  margin-top: 20px;
}
.character-timeline {
  border: 1px solid var(--line);
  background: white;
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
}
.character-timeline > header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.character-timeline h3 {
  margin: 8px 0;
}
.character-timeline > header p {
  color: var(--muted);
  line-height: 1.7;
}
/* Asset mentions: explicit ID-backed chips, legacy names remain visibly unbound. */
.asset-mention {
  color: #2755b3;
  text-decoration: underline;
  text-decoration-color: #89a6df;
  text-underline-offset: 3px;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 2px;
  overflow-wrap: anywhere;
}
.asset-mention:hover,
.asset-mention:focus-visible {
  background: #e8f0ff;
  outline: 2px solid #a6bde9;
}
.asset-mention.unbound {
  color: #52617b;
  text-decoration-style: dotted;
}
.asset-mention.invalid {
  color: #b52d3d;
  background: #fff0f1;
}
.mention-field {
  min-width: 0;
  font-weight: 400;
}
.mention-editor {
  min-height: 120px;
  max-height: 440px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  line-height: 1.8;
  color: var(--ink);
  font-weight: 400;
  cursor: text;
}
.mention-editor:focus {
  outline: 2px solid #8baaf0;
  outline-offset: 1px;
}
.mention-editor [data-asset-mention] {
  display: inline;
  padding: 2px 5px;
  background: #eaf0fc;
  box-decoration-break: clone;
  font-weight: 600;
}
.mention-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.6;
}
.mention-associate {
  font-size: 12px;
  padding: 6px 0;
}
.mention-menu,
.mention-popover {
  position: fixed;
  z-index: 10000;
  box-shadow: 0 8px 32px #1b2b4b30;
  border: 1px solid #cbd6e8;
  border-radius: 10px;
  padding: 12px;
  background: white;
  color: var(--ink);
  font-weight: 400;
  max-height: min(460px, 75vh);
  overflow: auto;
}
.mention-menu {
  max-height: 290px;
}
.mention-menu > p {
  font-size: 12px;
  margin: 0 0 8px;
}
.mention-menu [role="option"] {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  background: white;
}
.mention-menu [role="option"][aria-selected="true"],
.mention-menu [role="option"]:hover {
  background: #eaf0fc;
}
.mention-menu [role="option"] small {
  display: block;
  margin-top: 4px;
}
.mention-menu img {
  width: 42px;
  height: 48px;
  object-fit: contain;
  background: #f2f4f8;
}
.mention-popover p {
  margin: 8px 0;
  line-height: 1.6;
  font-size: 13px;
}
.mention-preview {
  display: block;
  width: 100%;
  max-height: 190px;
  object-fit: contain;
  background: #eef1f6;
  border-radius: 6px;
  margin-bottom: 12px;
}
.mention-dismiss {
  float: right;
}
#mention-detail-dialog {
  width: min(680px, 94vw);
  padding: 24px;
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: 12px;
}
#mention-detail-dialog > button {
  float: right;
}
#mention-detail-dialog p {
  margin: 12px 0;
  white-space: pre-wrap;
  line-height: 1.8;
}
#mention-detail-dialog .mention-preview {
  max-height: 400px;
}

#prep-dialog {
  scroll-padding-block: 40px 150px;
}
