:root {
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-surface-soft: #fafbfe;
  --color-border: #e7ebf2;
  --color-text: #1f2630;
  --color-text-muted: #7c8696;
  --color-accent-vision: #596bff;
  --color-accent-chat: #31a3d0;
  --color-accent-animation: #e69352;
  --color-accent-code: #2ca879;
  --radius-control: 12px;
  --radius-panel: 22px;
  --radius-shell: 26px;
  --motion-fast: 140ms;
  --motion-default: 220ms;
  --motion-panel: 300ms;
  --motion-page: 220ms;
  --motion-entry: 2200ms;
  --ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-panel: 0 18px 48px rgba(30, 44, 78, 0.08);
}

.global-asset-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, #e7e7e7);
  background: #fafafa;
}
.asset-scope-switch {
  display: flex;
  padding: 3px;
  background: #eee;
  border-radius: 10px;
}
.asset-scope-switch button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 8px;
}
.asset-scope-switch button.active {
  background: #fff;
  box-shadow: 0 1px 4px #0001;
}
.global-asset-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.global-asset-toolbar input {
  width: 100%;
  min-width: 160px;
}
.global-asset-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.global-asset-tags span {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f0f0f0;
}
.global-asset-card .drama-asset-actions {
  flex-wrap: wrap;
}
.global-asset-card .drama-asset-actions .danger {
  color: #a33;
}
.standalone-video-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fbfbfb;
}
.standalone-video-bar > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.standalone-video-bar span {
  color: #666;
  font-size: 12px;
}
.standalone-job-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.standalone-job-status em {
  color: #a33;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shot-override-section {
  border-color: #e6c98b !important;
  background: #fffdf7;
}
.shot-prop-overrides {
  display: grid;
  gap: 6px;
}
.shot-prop-overrides > div {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 100px 1fr 100px;
  gap: 6px;
  align-items: center;
}
@media (max-width: 780px) {
  .global-asset-toolbar,
  .standalone-video-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .shot-prop-overrides > div {
    grid-template-columns: 1fr;
  }
}

:root {
  --bg: #f4f6fa;
  --surface: #fff;
  --surface-2: #fafbfd;
  --text: #1d2330;
  --muted: #7a8596;
  --line: #e7ebf2;
  --line-strong: #dce2ec;
  --shadow: 0 18px 50px rgba(32, 44, 70, 0.08);
  --shadow-soft: 0 10px 28px rgba(32, 44, 70, 0.055);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --blue: #635bff;
  --cyan: #2ca7ce;
  --orange: #e58d4d;
  --green: #28a477;
  --rail: 76px;
  --history: 276px;
  --topbar: 64px;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
}
* {
  box-sizing: border-box;
}
html,
body {
  width: 100%;
  height: 100%;
}
body {
  margin: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #f8f9fc 0%, #f3f5f9 100%);
  color: var(--text);
  font-family: Inter, 'SF Pro Display', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
}
button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
input,
textarea {
  border: 0;
  outline: 0;
  background: none;
  color: inherit;
}
textarea {
  resize: none;
}
svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Entry animation: no text, only logo */
.entry-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #f7f8fb;
  display: grid;
  place-items: center;
  animation: entryLift 2.28s cubic-bezier(0.76, 0, 0.24, 1) forwards;
  will-change: transform, opacity;
}
.entry-logo {
  width: min(15vw, 148px);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  filter: blur(2px);
  animation:
    logoIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards,
    logoWake 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.58s forwards;
  will-change: transform, opacity, filter;
}
@keyframes logoIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes logoWake {
  to {
    transform: translateY(0) scale(1.025);
  }
}
@keyframes entryLift {
  0%,
  70% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0.96;
    visibility: hidden;
  }
}

.app {
  height: 100%;
  display: grid;
  grid-template-columns: var(--rail) var(--history) minmax(0, 1fr);
  padding: 12px;
  gap: 12px;
  transition: grid-template-columns 0.26s var(--ease);
}
.rail,
.history-pane,
.topbar,
.stage {
  border: 1px solid rgba(226, 231, 240, 0.92);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow-soft);
}
.rail {
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  min-height: 0;
}
.logo-button {
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(30, 40, 60, 0.04);
}
.logo-button img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.rail-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 18px;
}
.rail-item {
  height: 58px;
  width: 100%;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #8993a2;
  transition: 0.18s var(--ease);
}
.rail-item span {
  font-size: 11px;
  font-weight: 650;
}
.rail-item:hover {
  background: #f6f8fb;
  color: #495364;
}
.rail-item.active {
  background: #fff;
  color: #222b3a;
  box-shadow: 0 10px 24px rgba(35, 43, 58, 0.07);
  border: 1px solid var(--line);
}
.rail-item[data-mode='vision'].active svg {
  color: var(--blue);
}
.rail-item[data-mode='chat'].active svg {
  color: var(--cyan);
}
.rail-item[data-mode='animation'].active svg {
  color: var(--orange);
}
.rail-item[data-mode='code'].active svg {
  color: var(--green);
}
.rail-spacer {
  flex: 1;
}
.rail-control,
.avatar,
.icon-btn,
.mobile-history-btn {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: #5f6a79;
  transition: 0.18s var(--ease);
}
.rail-control {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  margin-bottom: 10px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #f1f4f8;
  font-weight: 750;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}
.icon-btn:hover,
.rail-control:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(35, 43, 58, 0.06);
}

.history-pane {
  border-radius: 24px;
  padding: 18px 16px 16px;
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  gap: 13px;
  min-height: 0;
  overflow: hidden;
  transition:
    transform 0.25s var(--ease),
    opacity 0.2s var(--ease);
}
.history-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.micro-label {
  display: block;
  color: #a0a8b6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.history-top strong {
  font-size: 21px;
  letter-spacing: -0.02em;
}
.new-task {
  height: 46px;
  border-radius: 15px;
  background: #1d2330;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  box-shadow: 0 14px 26px rgba(29, 35, 48, 0.14);
}
.new-task span {
  font-size: 14px;
  font-weight: 650;
}
.new-task kbd {
  margin-left: auto;
  color: #bfc5cf;
  font:
    11px ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.history-search {
  height: 44px;
  border: 1px solid var(--line);
  background: #f7f8fb;
  border-radius: 14px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  color: #8c96a5;
}
.history-search input {
  min-width: 0;
  font-size: 13px;
}
.history-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #6f7a8b;
  font-size: 12px;
  padding: 0 2px;
}
.history-section-head button {
  font-size: 12px;
  color: #9099a8;
}
.history-items {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 3px;
}
.history-item {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 9px;
  border-radius: 13px;
  color: #5c6675;
  transition: 0.16s var(--ease);
}
.history-item:hover,
.history-item.active {
  background: #f6f8fb;
  color: #202837;
}
.history-item strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.history-item small {
  display: block;
  color: #97a0ae;
  margin-top: 4px;
  font-size: 11px;
}
.task-thumb {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(20, 30, 45, 0.04);
}
.thumb-a {
  background: linear-gradient(145deg, #eaded5, #b7c8df);
}
.thumb-b {
  background: linear-gradient(145deg, #23262e, #aa836f);
}
.thumb-c {
  background: linear-gradient(145deg, #29374d, #896252);
}
.thumb-d {
  background: linear-gradient(145deg, #dbe8f4, #f3eee7);
}
.thumb-e {
  background: linear-gradient(145deg, #dff0e7, #f1f3f6);
}
.credits {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfcfe, #f6f8fc);
  padding: 13px;
  display: grid;
  gap: 9px;
}
.credits-line,
.credits-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.credits-line {
  font-size: 12px;
  color: #747f90;
}
.credits-line strong {
  font-size: 20px;
  color: #1f2734;
}
.credits-foot {
  font-size: 11px;
  color: #8b95a4;
}
.credits-foot button {
  color: #5661f6;
  font-weight: 700;
}
.credits-bar {
  height: 6px;
  background: #e7ebf3;
  border-radius: 999px;
  overflow: hidden;
}
.credits-bar i {
  display: block;
  width: 67%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6862ff, #9aa7ff);
}

.shell {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: var(--topbar) minmax(0, 1fr);
  gap: 12px;
}
.topbar {
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  min-width: 0;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-right {
  justify-content: flex-end;
  flex-wrap: wrap;
}
.project-name {
  min-width: 0;
}
.project-name strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-name span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #8a94a3;
  font-size: 11px;
  margin-top: 3px;
}
.project-name span i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #39bf7a;
}
.top-action,
.credit-pill,
.ghost-action {
  height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: #657081;
  font-size: 12px;
  white-space: nowrap;
}
.credit-pill {
  gap: 6px;
}
.credit-pill b {
  color: #222b38;
}
.credit-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #665fff;
}
.user-chip {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: #f1f4f8;
  border-radius: 11px;
  font-weight: 700;
}
.mobile-history-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
}
.stage {
  position: relative;
  border-radius: 24px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: rgba(249, 250, 252, 0.95);
}
.mode-page {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s;
}
.mode-page.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
.page-head h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.035em;
  line-height: 1;
}
.compact-head {
  align-items: center;
}
.page-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tab-switch {
  display: inline-flex;
  padding: 3px;
  background: #eef1f6;
  border-radius: 11px;
  border: 1px solid #e4e8ef;
}
.tab-switch button {
  height: 30px;
  padding: 0 13px;
  border-radius: 8px;
  color: #788394;
  font-size: 12px;
  font-weight: 650;
}
.tab-switch button.active {
  background: #fff;
  color: #202735;
  box-shadow: 0 5px 14px rgba(33, 43, 60, 0.05);
}

.vision-tab {
  display: none;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}
.vision-tab.active {
  display: grid;
}
.vision-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 33%);
  gap: 12px;
  min-height: 0;
}
.output-column,
.thread-column,
.split-stage,
.chat-shell,
.animation-chat-shell,
.code-agent-panel,
.ide-panel {
  min-width: 0;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}
.output-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.stream-head,
.thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
}
.stream-head strong,
.thread-head strong {
  font-size: 14px;
}
.stream-head span,
.thread-head span {
  display: block;
  color: #8b95a4;
  font-size: 11px;
  margin-top: 4px;
  line-height: 1.4;
}
.output-grid {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.image-result {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f1f3f6;
}
.product-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.product-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.72), transparent 36%);
}
.product-scene.warm {
  background: linear-gradient(160deg, #f3ece7 0%, #e9e2dd 55%, #cfc4bc 100%);
}
.product-scene.cool {
  background: linear-gradient(160deg, #edf2f6 0%, #dbe3ea 58%, #bec9d2 100%);
}
.product-scene.stone {
  background: linear-gradient(160deg, #f0eee9 0%, #dedbd5 58%, #bfb9af 100%);
}
.product-scene.pearl {
  background: linear-gradient(160deg, #f8f8f4 0%, #e8ece9 55%, #cbd4cf 100%);
}
.bottle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 45%;
  transform: translate(-50%, -49%);
  filter: drop-shadow(0 16px 15px rgba(45, 50, 60, 0.16));
}
.bottle.tall {
  height: 49%;
  width: 27%;
}
.bottle .cap {
  position: absolute;
  left: 20%;
  top: 0;
  width: 60%;
  height: 20%;
  background: linear-gradient(180deg, #d6d7d8, #aeb1b4);
  border-radius: 7px 7px 3px 3px;
}
.bottle .body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 84%;
  border-radius: 16% 16% 10% 10% / 10% 10% 8% 8%;
  background: linear-gradient(90deg, #f7f7f4 0%, #fff 46%, #e2e3df 100%);
  border: 1px solid rgba(90, 96, 104, 0.12);
  display: grid;
  place-items: center;
}
.bottle .body i {
  font-style: normal;
  font-size: clamp(7px, 0.7vw, 12px);
  letter-spacing: 0.14em;
  color: #878983;
  transform: rotate(-90deg);
}
.shadow {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 45%;
  height: 9%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(55, 59, 65, 0.13);
  filter: blur(9px);
}
.result-toolbar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(5px);
  transition: 0.18s var(--ease);
}
.image-result:hover .result-toolbar {
  opacity: 1;
  transform: translateY(0);
}
.result-toolbar button {
  height: 32px;
  min-width: 32px;
  border-radius: 9px;
  background: rgba(22, 28, 37, 0.84);
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  font-size: 11px;
}
.result-toolbar svg {
  width: 14px;
  height: 14px;
}
.thread-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.thread-scroll {
  min-height: 0;
  overflow: auto;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #cbd2dc transparent;
}
.thread-scroll::-webkit-scrollbar {
  width: 7px;
}
.thread-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.thread-scroll::-webkit-scrollbar-thumb {
  background: #ccd3de;
  border-radius: 999px;
  border: 2px solid #fff;
}
.turn {
  max-width: 94%;
  padding: 11px 12px;
  border-radius: 14px;
  background: #f7f8fb;
  border: 1px solid var(--line);
  align-self: flex-start;
}
.turn.user {
  align-self: flex-end;
  background: #1e2532;
  color: #fff;
  border-color: #1e2532;
}
.turn p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  word-break: break-word;
}
.turn time {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  opacity: 0.62;
}
.thread-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  border: 1px dashed #dce2eb;
  color: #788394;
  background: #fbfcfe;
  border-radius: 12px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.55;
}
.thread-note svg {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

.prompt-dock {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 14px 36px rgba(33, 43, 60, 0.08);
  border-radius: 18px;
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 0;
}
.prompt-dock.centered {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 2px;
}
.prompt-dock.wide {
  width: min(1040px, calc(100% - 24px));
}
.dock-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}
.dock-chip,
.select-trigger {
  height: 32px;
  border: 1px solid var(--line);
  background: #f8f9fb;
  border-radius: 9px;
  color: #5f6a79;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}
.dock-chip.active {
  background: #fff;
  color: #202735;
}
.dock-chip svg,
.select-trigger svg {
  width: 14px;
  height: 14px;
}
.select-control {
  position: relative;
  min-width: 0;
}
.select-trigger strong {
  font-size: 11px;
  color: #303846;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.select-popover {
  position: absolute;
  left: 0;
  z-index: 50;
  width: min(310px, 80vw);
  padding: 7px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(30, 40, 60, 0.14);
  display: none;
}
.select-popover.upward {
  bottom: calc(100% + 8px);
}
.select-control.open .select-popover {
  display: grid;
  gap: 5px;
}
.select-title {
  padding: 5px 7px;
  color: #9099a7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.select-option {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  text-align: left;
  border-radius: 10px;
  padding: 8px;
  color: #515b69;
}
.select-option:hover,
.select-option.active {
  background: #f5f7fa;
}
.select-option strong {
  display: block;
  font-size: 11px;
}
.select-option small {
  display: block;
  color: #8b95a4;
  font-size: 10px;
  margin-top: 2px;
  line-height: 1.35;
}
.select-option b {
  font-size: 10px;
  color: #808a99;
}
.compact-menu {
  width: min(260px, 80vw);
}
.model-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-block;
  flex: none;
}
.vision-model {
  background: linear-gradient(145deg, #111722, #58667b);
}
.flux-model {
  background: linear-gradient(145deg, #6c63ff, #b08cff);
}
.seed-model {
  background: linear-gradient(145deg, #f7c67d, #e98058);
}
.layer-model {
  background: linear-gradient(145deg, #7869ff, #9e9cff);
}
.instant-model {
  background: linear-gradient(145deg, #5ac2d5, #67a0d8);
}
.chat-model {
  background: linear-gradient(145deg, #38b6d8, #557fff);
}
.claude-model {
  background: linear-gradient(145deg, #c68e63, #efd5b2);
}
.video-model {
  background: linear-gradient(145deg, #d56a3c, #e9a75e);
}
.higgs-model {
  background: linear-gradient(145deg, #111722, #697282);
}
.code-model {
  background: linear-gradient(145deg, #2da477, #6fc7a1);
}
.v0-model {
  background: linear-gradient(145deg, #111, #666);
}
.tiny-method {
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 9px;
  color: #707b8b;
}
.dock-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: end;
}
.dock-input-row textarea {
  width: 100%;
  min-height: 52px;
  max-height: 150px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 13px;
  font-size: 12px;
  line-height: 1.55;
}
.send-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1d2330;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 20px rgba(29, 35, 48, 0.16);
  transition: 0.16s var(--ease);
}
.send-button.running {
  background: #e05252;
}
.send-button.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.send-button:hover {
  transform: translateY(-1px);
}

/* split */
.split-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 31%);
  gap: 12px;
  min-height: 0;
}
.split-stage {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(250px, 1.1fr) minmax(200px, 0.9fr);
  gap: 10px;
  overflow: auto;
}
.split-source-card,
.split-plan-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfd;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
.split-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
}
.split-label strong {
  font-size: 12px;
}
.split-label span {
  font-size: 10px;
  color: #8d97a5;
}
.split-art {
  margin: 10px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  min-height: 260px;
}
.source-art {
  background: linear-gradient(145deg, #f2e7de, #bacbdd);
}
.result-art {
  background: #fff;
}
.poster-shape {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 58%;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  background: linear-gradient(180deg, #f8f8f5, #d9d9d4);
  box-shadow: 0 16px 24px rgba(30, 40, 55, 0.16);
}
.poster-shape.isolated {
  z-index: 2;
  width: 30%;
  height: 52%;
}
.checker {
  position: absolute;
  inset: 0;
  background-color: #f7f7f7;
  background-image:
    linear-gradient(45deg, #e8e8e8 25%, transparent 25%), linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e8e8e8 75%), linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
  background-size: 18px 18px;
  background-position:
    0 0,
    0 9px,
    9px -9px,
    -9px 0;
}
.layer-stack {
  padding: 10px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.layer-stack > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
}
.layer-stack i {
  font-style: normal;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f1f4f8;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: #697486;
}
.layer-stack strong {
  display: block;
  font-size: 11px;
}
.layer-stack small {
  display: block;
  color: #929baa;
  font-size: 9px;
  margin-top: 3px;
}

/* chat */
.chat-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 0 10px;
}
.conversation {
  width: min(880px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 0;
  overflow: auto;
  padding: 26px 2px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.assistant-mark {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #6a7483;
}
.brand-dot {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(145deg, #4aa2d9, #6c63ff);
}
.brand-dot.orange {
  background: linear-gradient(145deg, #e26f45, #e8ae61);
}
.chat-message {
  max-width: 80%;
  font-size: 13px;
  line-height: 1.7;
}
.chat-message p {
  margin: 0;
}
.chat-message.user {
  align-self: flex-end;
  background: #1f2632;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 11px 13px;
}
.chat-message.assistant {
  align-self: flex-start;
  color: #2c3441;
  padding: 2px 0;
}

/* animation */
.animation-chat-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding-bottom: 10px;
}
.animation-conversation {
  width: min(1020px, calc(100% - 28px));
  margin: 0 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.animation-turn {
  max-width: 92%;
  align-self: flex-start;
}
.animation-turn.user {
  align-self: flex-end;
}
.animation-turn.user .turn-text {
  background: #1f2632;
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}
.turn-text {
  font-size: 12px;
  line-height: 1.65;
  padding: 11px 13px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.animation-turn.assistant {
  width: min(820px, 100%);
}
.animation-turn.assistant .assistant-mark {
  margin-bottom: 7px;
}
.storyboard-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.shot-card {
  aspect-ratio: 16/9;
  border-radius: 12px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
}
.shot-one {
  background: linear-gradient(145deg, #34425b, #8a655c);
}
.shot-two {
  background: linear-gradient(145deg, #253142, #705352);
}
.shot-three {
  background: linear-gradient(145deg, #4e566d, #8a6d5a);
}
.shot-card span {
  font-size: 14px;
  font-weight: 800;
}
.shot-card small {
  font-size: 9px;
  margin-top: 2px;
  opacity: 0.88;
}
.video-result {
  margin-top: 9px;
}
.cinema-frame {
  height: 190px;
  border-radius: 14px;
  background: linear-gradient(145deg, #2d3543, #7a625b);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.play-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
}
.play-btn svg {
  color: #232a35;
}
.video-badge {
  position: absolute;
  left: 9px;
  bottom: 9px;
  background: rgba(255, 255, 255, 0.88);
  color: #303846;
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 700;
}

/* code */
.code-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 28%) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}
.code-agent-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.code-agent-head {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.code-agent-head strong {
  font-size: 13px;
}
.code-agent-head span {
  font-size: 10px;
  color: #8d96a5;
}
.code-agent-thread {
  min-height: 0;
  overflow: auto;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.code-turn {
  padding: 9px 10px;
  border-radius: 11px;
  background: #f7f8fa;
  border: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.55;
}
.code-turn.user {
  background: #1f2632;
  color: #fff;
  border-color: #1f2632;
  align-self: flex-end;
}
.code-turn p {
  margin: 0;
}
.agent-composer {
  border-top: 1px solid var(--line);
  padding: 9px;
  display: grid;
  gap: 7px;
}
.agent-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 7px;
  align-items: end;
}
.agent-input textarea {
  min-height: 56px;
  max-height: 100px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 11px;
  line-height: 1.5;
}
.small-trigger {
  height: 28px;
  padding: 0 7px;
}
.ide-panel {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(230px, 32%);
  min-height: 0;
}
.file-tree {
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  min-height: 0;
  overflow: auto;
}
.file-tree-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 9px;
  color: #7c8796;
  font-size: 9px;
}
.file-tree-head button {
  display: grid;
  place-items: center;
}
.file-tree-head svg {
  width: 13px;
}
.file-group {
  padding: 0 6px 10px;
}
.file-group > span {
  display: block;
  padding: 7px 7px 5px;
  color: #87919f;
  font-size: 10px;
}
.file {
  width: 100%;
  height: 30px;
  padding: 0 7px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #657080;
  font-size: 10px;
}
.file svg {
  width: 13px;
}
.file.active {
  background: #eef2f7;
  color: #222a37;
}
.editor-area {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
}
.editor-tabs {
  height: 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: end;
  padding: 0 7px;
  gap: 3px;
}
.editor-tabs button {
  height: 28px;
  padding: 0 8px;
  font-size: 10px;
  color: #7d8796;
  border-radius: 7px 7px 0 0;
}
.editor-tabs button.active {
  background: #f6f8fb;
  color: #242c38;
}
.editor-code {
  margin: 0;
  min-height: 0;
  overflow: auto;
  padding: 13px;
  background: #fbfcfd;
  color: #4b5564;
  font:
    10.5px/1.75 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  white-space: pre;
}
.editor-code .ln {
  display: inline-block;
  width: 24px;
  color: #b0b8c4;
}
.kw {
  color: #7454b5;
}
.fn {
  color: #206e9d;
}
.str {
  color: #ab673b;
}
.tag {
  color: #2a846b;
}
.terminal {
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  background: #fafbfd;
  font:
    9.5px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.terminal-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  color: #727d8c;
}
.terminal-title span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.terminal-title svg {
  width: 12px;
}
.terminal p {
  margin: 2px 0;
  color: #606a79;
}
.terminal b {
  color: #24936a;
}
.preview-pane {
  min-width: 0;
  border-left: 1px solid var(--line);
  background: #f5f7fa;
  padding: 9px;
  overflow: auto;
}
.preview-bar {
  height: 28px;
  border-radius: 9px 9px 0 0;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: #8c95a4;
  font-size: 9px;
}
.browser-dots {
  display: flex;
  gap: 3px;
}
.browser-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #d6dce4;
}
.preview-canvas {
  min-height: 250px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  padding: 8px;
  display: grid;
  grid-template-rows: 22px 120px 72px;
  gap: 7px;
}
.mock-nav {
  border-radius: 6px;
  background: #f0f3f7;
}
.mock-hero {
  border: 1px solid #edf0f4;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff, #eef3fb);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.mock-hero div {
  width: 44%;
  height: 15px;
  border-radius: 5px;
  background: #dfe5ef;
}
.mock-hero i {
  display: block;
  width: 72%;
  height: 7px;
  border-radius: 4px;
  background: #e9edf3;
}
.mock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.mock-grid i {
  display: block;
  border-radius: 8px;
  background: #eef2f6;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 34, 45, 0.16);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  z-index: 110;
  transition: 0.2s;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1000;
  transform: translate(-50%, 14px);
  background: #1d2330;
  color: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 11px;
  box-shadow: 0 12px 28px rgba(28, 34, 44, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.thread-close {
  display: none;
  font:
    400 22px/1 system-ui,
    sans-serif;
  color: #667085;
  transition:
    color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}
.thread-close:hover {
  color: #172033;
  background: #f1f4f8;
  transform: scale(1.04);
}
.task-thread-button {
  display: none;
}

/* Responsive: compress → fold → drawer. No destructive hiding of core content. */
@media (max-width: 1480px) {
  :root {
    --history: 250px;
  }
  .vision-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(285px, 31%);
  }
  .code-workspace {
    grid-template-columns: minmax(235px, 27%) minmax(0, 1fr);
  }
  .ide-panel {
    grid-template-columns: 135px minmax(0, 1fr) minmax(210px, 30%);
  }
  .output-grid {
    gap: 8px;
    padding: 10px;
  }
  .mode-page {
    padding: 15px;
  }
  .page-head h1 {
    font-size: 27px;
  }
}
@media (max-width: 1240px) {
  .app {
    grid-template-columns: var(--rail) minmax(0, 1fr);
  }
  .history-pane {
    position: fixed;
    left: 100px;
    top: 12px;
    bottom: 12px;
    width: min(300px, calc(100vw - 124px));
    z-index: 120;
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 26px 70px rgba(32, 44, 70, 0.16);
  }
  .app.history-open .history-pane {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .app.history-open + .drawer-backdrop,
  .drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
  }
  .mobile-history-btn {
    display: grid;
  }
  .vision-workspace,
  .split-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .thread-column {
    position: fixed;
    right: 12px;
    top: 88px;
    bottom: 12px;
    width: min(360px, calc(100vw - 110px));
    z-index: 115;
    transform: translateX(115%);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 26px 70px rgba(32, 44, 70, 0.18);
    transition: 0.25s var(--ease);
  }
  .thread-column.drawer-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .thread-close {
    display: grid;
  }
  .task-thread-button {
    display: flex;
  }
  .split-stage {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
  .ide-panel {
    grid-template-columns: 130px minmax(0, 1fr);
  }
  .preview-pane {
    display: none;
  }
  .code-workspace {
    grid-template-columns: minmax(230px, 30%) minmax(0, 1fr);
  }
}
@media (max-width: 980px) {
  :root {
    --rail: 68px;
    --topbar: 58px;
  }
  .app {
    padding: 9px;
    gap: 9px;
  }
  .shell {
    gap: 9px;
  }
  .rail,
  .topbar,
  .stage {
    border-radius: 20px;
  }
  .history-pane {
    left: 86px;
    top: 9px;
    bottom: 9px;
  }
  .rail-item {
    height: 54px;
  }
  .rail-item span {
    font-size: 10px;
  }
  .logo-button {
    width: 46px;
    height: 46px;
  }
  .topbar {
    padding: 0 11px;
  }
  .top-action span,
  .credit-pill span:last-child {
    display: none;
  }
  .credit-pill {
    padding: 0 9px;
  }
  .page-head h1 {
    font-size: 24px;
  }
  .mode-page {
    padding: 12px;
    gap: 9px;
  }
  .output-grid {
    grid-template-columns: 1fr;
  }
  .image-result {
    aspect-ratio: 16/10;
  }
  .result-toolbar {
    opacity: 1;
    transform: none;
  }
  .split-stage {
    grid-template-columns: minmax(200px, 1fr);
    overflow: auto;
  }
  .split-source-card,
  .split-plan-card {
    min-height: 300px;
  }
  .storyboard-row {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    overflow-x: auto;
  }
  .animation-turn.assistant {
    width: 100%;
  }
  .code-workspace {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .code-agent-panel {
    min-height: 290px;
  }
  .ide-panel {
    min-height: 460px;
  }
}
@media (max-width: 720px) {
  :root {
    --rail: 58px;
  }
  .app {
    grid-template-columns: var(--rail) minmax(0, 1fr);
    padding: 6px;
    gap: 6px;
  }
  .rail {
    border-radius: 17px;
    padding: 8px 5px;
  }
  .logo-button {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .logo-button img {
    width: 24px;
  }
  .rail-item {
    height: 48px;
    border-radius: 13px;
  }
  .rail-item span {
    display: none;
  }
  .rail-control,
  .avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .topbar {
    border-radius: 17px;
  }
  .top-action {
    display: none;
  }
  .credit-pill {
    height: 32px;
  }
  .user-chip,
  .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .mobile-history-btn {
    width: 32px;
    height: 32px;
  }
  .project-name strong {
    font-size: 12px;
  }
  .project-name span {
    font-size: 10px;
  }
  .stage {
    border-radius: 17px;
  }
  .mode-page {
    padding: 9px;
  }
  .page-head {
    gap: 8px;
  }
  .page-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .page-title-row {
    gap: 8px;
  }
  .tab-switch button {
    padding: 0 9px;
  }
  .page-head h1 {
    font-size: 22px;
  }
  .micro-label {
    font-size: 9px;
  }
  .prompt-dock.centered,
  .prompt-dock.wide {
    width: 100%;
  }
  .dock-top {
    gap: 5px;
  }
  .dock-chip,
  .select-trigger {
    height: 30px;
    padding: 0 7px;
  }
  .dock-input-row {
    grid-template-columns: minmax(0, 1fr) 38px;
  }
  .send-button {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }
  .dock-input-row textarea {
    min-height: 50px;
  }
  .conversation,
  .animation-conversation {
    width: 100%;
    padding-left: 1px;
    padding-right: 1px;
  }
  .chat-message {
    max-width: 92%;
  }
  .history-pane {
    left: 70px;
    top: 6px;
    bottom: 6px;
    width: calc(100vw - 76px);
  }
  .thread-column {
    right: 6px;
    top: 72px;
    bottom: 6px;
    width: calc(100vw - 76px);
  }
  .ide-panel {
    grid-template-columns: 1fr;
  }
  .file-tree {
    max-height: 150px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .editor-code {
    font-size: 9.5px;
  }
  .preview-pane {
    display: none;
  }
  .cinema-frame {
    height: 150px;
  }
}
@media (max-height: 720px) {
  .page-head {
    padding-bottom: 0;
  }
  .mode-page {
    gap: 8px;
  }
  .prompt-dock {
    padding: 8px;
  }
  .dock-input-row textarea {
    min-height: 44px;
  }
  .cinema-frame {
    height: 145px;
  }
  .code-agent-panel {
    min-height: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .entry-screen {
    animation: entryReduced 0.8s linear forwards;
  }
  .entry-logo {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }
  @keyframes entryReduced {
    to {
      opacity: 0;
      visibility: hidden;
    }
  }
}
.mode-page.slide-forward {
  animation: modeSlideForward 0.24s var(--ease);
}
.mode-page.slide-backward {
  animation: modeSlideBackward 0.24s var(--ease);
}
@keyframes modeSlideForward {
  from {
    opacity: 0.45;
    transform: translateX(14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes modeSlideBackward {
  from {
    opacity: 0.45;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Production dynamic content */
.workspace-empty {
  min-height: 160px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  background: #fbfcfe;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: #7d8796;
}
.workspace-empty strong {
  color: #313947;
  font-size: 14px;
}
.workspace-empty p {
  margin: 7px 0 0;
  font-size: 11px;
  line-height: 1.55;
}
.generation-group {
  grid-column: 1/-1;
  display: grid;
  gap: 9px;
  margin-bottom: 4px;
  scroll-margin-top: 10px;
}
.generation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #7f8997;
  font-size: 10px;
  padding: 0 2px;
}
.generation-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.generation-head strong {
  font-size: 11px;
  color: #303946;
}
.generation-head small {
  font-size: 10px;
}
.generation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.api-image-frame {
  position: absolute;
  inset: 0;
  background: #f2f4f7;
  display: grid;
  place-items: center;
}
.api-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f5f6f8;
}
.image-missing {
  color: #8b95a4;
  font-size: 11px;
  text-align: center;
  padding: 18px;
}
.result-toolbar {
  flex-wrap: wrap;
}
.result-toolbar .send-split {
  margin-left: auto;
}
.result-toolbar .active-like {
  background: #8d5661;
}
.clickable-turn {
  cursor: pointer;
  transition: 0.18s var(--ease);
}
.clickable-turn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(40, 50, 70, 0.06);
}
.flash-highlight {
  animation: flashHighlight 1.15s ease;
}
@keyframes flashHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 91, 255, 0);
  }
  45% {
    box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.22);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 91, 255, 0);
  }
}
.prompt-dock.has-edit-source {
  box-shadow:
    0 0 0 2px rgba(99, 91, 255, 0.14),
    var(--shadow-soft);
}
.message-attachments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.message-attachments a {
  font-size: 10px;
  color: #5264e7;
  background: #f2f4ff;
  border: 1px solid #e3e6ff;
  border-radius: 8px;
  padding: 5px 7px;
  text-decoration: none;
}
.video-result video {
  width: 100%;
  max-height: 380px;
  border-radius: 14px;
  background: #111;
  display: block;
}
.pending-video {
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
}
.pending-video span {
  font-size: 14px;
  font-weight: 700;
}
.pending-video small {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
}
.layer-result-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  height: 100%;
  overflow: auto;
}
.layer-result-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 9px;
  background-image:
    linear-gradient(45deg, #e7e7e7 25%, transparent 25%), linear-gradient(-45deg, #e7e7e7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e7e7e7 75%), linear-gradient(-45deg, transparent 75%, #e7e7e7 75%);
  background-size: 12px 12px;
  background-position:
    0 0,
    0 6px,
    6px -6px,
    -6px 0;
}
.source-art img,
.result-art > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.source-art .product-scene,
.result-art .product-scene {
  position: relative;
  height: 100%;
}
.editor-code[contenteditable='true'] {
  outline: none;
  cursor: text;
}
.code-preview-frame {
  width: 100%;
  height: calc(100% - 28px);
  min-height: 350px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: #fff;
}
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: rgba(28, 35, 48, 0.18);
  backdrop-filter: blur(4px);
  padding: 16px;
  animation: modal-backdrop-in 160ms ease-out both;
}
.modal-dialog {
  width: min(560px, 100%);
  max-height: min(82vh, 760px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(30, 42, 66, 0.18);
  animation: modal-dialog-in 190ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: center;
}
.modal-dialog.modal-wide {
  width: min(980px, 100%);
}
.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head strong {
  font-size: 14px;
}
.modal-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  color: #667085;
  font:
    400 24px/1 system-ui,
    sans-serif;
  transition:
    color 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}
.modal-close:hover {
  color: #172033;
  background: #f1f4f8;
  border-color: #dce2ea;
  transform: scale(1.04);
}
.modal-close:focus-visible {
  outline: 3px solid rgba(98, 91, 235, 0.2);
  outline-offset: 2px;
}
.app-modal.modal-close-confirm .modal-close {
  color: #b42318;
  background: #fff1f0;
  border-color: #f4b4ae;
}
@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modal-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-modal,
  .modal-dialog {
    animation: none;
  }
}
.modal-body {
  padding: 14px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.gallery-item {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 7px;
  background: #fbfcfd;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: contain;
  border-radius: 9px;
  background: #f1f3f6;
}
.gallery-item button {
  height: 28px;
  padding: 0 9px;
  margin-top: 7px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 10px;
}
.asset-row,
.notice-row,
.credit-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfd;
  padding: 11px;
}
.asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
}
.asset-row + .asset-row,
.notice-row + .notice-row {
  margin-top: 8px;
}
.asset-row strong {
  font-size: 12px;
}
.asset-row small {
  color: #8892a1;
  font-size: 10px;
}
.asset-row a {
  grid-column: 2;
  grid-row: 1/3;
  color: #5763ed;
  font-size: 10px;
  text-decoration: none;
}
.empty-state {
  padding: 20px;
  text-align: center;
  color: #86909f;
  font-size: 11px;
}
.video-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.video-library-item {
  display: grid;
  gap: 7px;
}
.video-library-item video {
  width: 100%;
  border-radius: 12px;
  background: #111;
}
.video-library-item strong {
  font-size: 11px;
}
.select-popover .empty-state {
  padding: 10px;
}
.history-item .task-thumb.thumb-vision {
  background: linear-gradient(145deg, #eaded5, #b7c8df);
}
.history-item .task-thumb.thumb-chat {
  background: linear-gradient(145deg, #dbe8f4, #f3eee7);
}
.history-item .task-thumb.thumb-animation {
  background: linear-gradient(145deg, #29374d, #896252);
}
.history-item .task-thumb.thumb-code {
  background: linear-gradient(145deg, #dff0e7, #f1f3f6);
}
@media (max-width: 980px) {
  .generation-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .result-toolbar .send-split {
    margin-left: 0;
  }
}
@media (max-width: 720px) {
  .gallery-grid,
  .video-library {
    grid-template-columns: 1fr;
  }
  .result-toolbar button span {
    display: none;
  }
  .result-toolbar .send-split span {
    display: inline;
  }
}

/* V7: V3 visual lock — only additive functional states */
.mode-switch {
  position: relative;
  height: 32px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  background: #f1f4f8;
  border-radius: 10px;
  min-width: 148px;
  isolation: isolate;
  overflow: hidden;
}
.mode-switch-thumb {
  position: absolute;
  z-index: 0;
  left: 3px;
  top: 3px;
  bottom: 3px;
  width: calc(50% - 3px);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 5px 14px rgba(33, 43, 60, 0.06);
  transition:
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms ease;
}
.mode-switch[data-value='pro'] .mode-switch-thumb {
  transform: translateX(100%);
  background: #f1efff;
}
.mode-switch button {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border-radius: 7px;
  color: #818b9a;
  font-size: 10px;
  font-weight: 700;
  transition: color 180ms ease;
}
.mode-switch button i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c9d0da;
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease;
}
.mode-switch button.active {
  color: #545ff1;
}
.mode-switch button.active i {
  background: #665fff;
  box-shadow: 0 0 0 3px rgba(102, 95, 255, 0.1);
}
.compact-count .select-trigger {
  min-width: 66px;
}
.count-popover {
  width: 190px;
}
.toggle-chip.active {
  background: #fff;
  color: #4f5bf0;
  box-shadow: inset 0 0 0 1px rgba(99, 91, 255, 0.12);
}
.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c7cdd6;
}
.toggle-chip.active .chip-dot {
  background: #665fff;
  box-shadow: 0 0 0 3px rgba(102, 95, 255, 0.1);
}
.split-plan-label {
  align-items: center;
}
.split-plan-label > div {
  min-width: 0;
}
.split-download-all {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: #5f6a79;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.split-download-all svg {
  width: 13px;
  height: 13px;
}
.layer-stack > button.layer-row {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  transition: 0.16s var(--ease);
}
.layer-stack > button.layer-row:hover,
.layer-stack > button.layer-row.active {
  background: #f7f8ff;
  border-color: #dcdfff;
  box-shadow: 0 5px 14px rgba(33, 43, 60, 0.04);
}
.layer-stack .layer-download {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: #697486;
  background: #fff;
}
.layer-stack .layer-download svg {
  width: 13px;
  height: 13px;
}
.layer-preview-label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer-preview-single {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.split-source-size {
  font-variant-numeric: tabular-nums;
}
.api-image-frame {
  cursor: zoom-in;
}
.preview-image-shell {
  display: grid;
  gap: 12px;
}
.preview-art {
  background: #f3f5f8;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
  max-height: 72vh;
}
.preview-art img {
  max-width: 100%;
  max-height: 72vh;
  display: block;
  object-fit: contain;
  background: #fff;
}
.preview-meta {
  display: grid;
  gap: 4px;
}
.preview-meta strong {
  font-size: 13px;
}
.preview-meta small {
  font-size: 11px;
  color: #7f8997;
  line-height: 1.55;
}
.preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preview-actions .menu-action {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  color: #4f5a69;
  font-size: 11px;
  font-weight: 700;
}
.preview-actions .menu-action.primary {
  background: #1d2330;
  color: #fff;
  border-color: #1d2330;
}
.preview-send-panel {
  position: relative;
}
.preview-send-toggle span {
  display: inline-block;
  margin-left: 5px;
  transition: transform 0.18s ease;
}
.preview-send-panel.open .preview-send-toggle span {
  transform: rotate(180deg);
}
.preview-send-drawer {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: 260px;
  max-height: min(430px, 60vh);
  overflow: auto;
  display: none;
  padding: 8px;
  border: 1px solid #dfe3e9;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 50px rgba(25, 32, 45, 0.18);
}
.preview-send-panel.open .preview-send-drawer {
  display: grid;
  gap: 5px;
  animation: previewSendUp 0.18s ease-out;
}
.preview-send-head {
  display: grid;
  gap: 3px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid #eceff3;
}
.preview-send-head strong {
  font-size: 11px;
  color: #252d39;
}
.preview-send-head span {
  font-size: 9px;
  line-height: 1.55;
  color: #7b8491;
}
.preview-send-drawer > button,
.preview-send-sub button {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f7f8fa;
  text-align: left;
  font-size: 11px;
  color: #303846;
}
.preview-send-drawer > button:hover,
.preview-send-sub button:hover {
  background: #eeebff;
  color: #4c39b7;
}
.preview-send-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 7px;
  border: 1px solid #ebeef3;
  border-radius: 10px;
}
.preview-send-sub span {
  grid-column: 1 / -1;
  font-size: 10px;
  color: #77808d;
}
@keyframes previewSendUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.mode-page.page-enter-forward {
  animation: v7PageForward 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.mode-page.page-enter-backward {
  animation: v7PageBackward 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes v7PageForward {
  from {
    opacity: 0.35;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes v7PageBackward {
  from {
    opacity: 0.35;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.vision-tab.tab-enter {
  animation: v7TabIn 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes v7TabIn {
  from {
    opacity: 0.35;
    transform: translateX(7px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@media (max-width: 720px) {
  .mode-switch {
    min-width: 132px;
    height: 30px;
  }
  .mode-switch button {
    font-size: 9px;
    padding: 0 6px;
  }
  .split-download-all {
    height: 26px;
    padding: 0 6px;
  }
}

/* ===== Workspace refinements ===== */

/* 1) Workspace entry: center fade -> pause -> more visible wake -> reveal */
.entry-screen {
  animation: v8EntryLift 2.58s cubic-bezier(0.76, 0, 0.24, 1) forwards;
  background: #f7f8fb;
}
.entry-logo {
  opacity: 0;
  transform: scale(0.985);
  filter: blur(2px);
  animation:
    v8LogoFade 0.46s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards,
    v8LogoWake 0.38s cubic-bezier(0.22, 1, 0.36, 1) 0.88s forwards;
  transform-origin: center center;
}
@keyframes v8LogoFade {
  0% {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}
@keyframes v8LogoWake {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.055);
  }
}
@keyframes v8EntryLift {
  0%,
  72% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0.965;
    visibility: hidden;
  }
}

/* 2) history sidebar: GPT-like row controls */
.history-brand-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.history-brand-title > div {
  min-width: 0;
}
.history-brand-title .workspace-menu-trigger {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  margin-top: 12px;
}
.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  padding: 5px 5px 5px 7px;
  align-items: center;
}
.history-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 4px 2px;
  border-radius: 10px;
}
.history-copy {
  min-width: 0;
}
.history-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transform: translateX(3px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}
.history-item:hover .history-actions,
.history-item.active .history-actions {
  opacity: 1;
  transform: translateX(0);
}
.history-pin,
.history-more {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #8791a0;
  transition: 0.14s ease;
}
.history-pin svg,
.history-more svg {
  width: 13px;
  height: 13px;
}
.history-pin:hover,
.history-more:hover {
  background: #fff;
  color: #4c5666;
}
.history-pin.active {
  opacity: 1;
  color: #5e61ee;
  background: #f0efff;
}
.history-item:has(.history-pin.active) .history-actions {
  opacity: 1;
}
.context-menu {
  position: fixed;
  z-index: 1000;
  width: 178px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 20px 52px rgba(25, 35, 55, 0.16);
  animation: v8ContextIn 0.14s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes v8ContextIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.context-item {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: #4b5666;
  font-size: 12px;
  text-align: left;
}
.context-item:hover {
  background: #f6f7fa;
  color: #222b37;
}
.context-item svg {
  width: 15px;
  height: 15px;
}
.context-item.danger {
  color: #e04456;
}
.context-item.danger:hover {
  background: #fff3f4;
}
.context-separator {
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}

/* 3) actual desktop history collapse */
.app.history-collapsed {
  grid-template-columns: var(--rail) 0 minmax(0, 1fr);
}
.app.history-collapsed .history-pane {
  opacity: 0;
  transform: translateX(-16px);
  pointer-events: none;
  padding-left: 0;
  padding-right: 0;
  border-width: 0;
  box-shadow: none;
}
.app.history-collapsed .rail-control {
  background: #f1f0ff;
  color: #5d5ef0;
  border-color: #dfdfff;
}

/* 4) credits realtime motion */
.credits-bar i {
  transition:
    width 420ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms ease;
  will-change: width;
}

/* 5) fast/pro palette switch — preserve V3 geometry; final professional colors are defined in the locked release section below. */
.mode-page[data-page='vision'] {
  --vision-surface: #fff;
  --vision-surface-soft: #fbfcfe;
  --vision-line: var(--line);
  --vision-text: var(--text);
  --vision-muted: #8b95a4;
  --vision-stage: rgba(249, 250, 252, 0.95);
  transition:
    background-color 380ms cubic-bezier(0.22, 1, 0.36, 1),
    color 320ms ease,
    border-color 320ms ease;
}

/* 6) drag/drop reference image overlay */
.vision-workspace,
.split-workspace {
  position: relative;
}
.vision-drop-overlay {
  position: absolute;
  inset: 8px;
  z-index: 25;
  border: 1.5px dashed #8a88ff;
  border-radius: 18px;
  background: rgba(246, 246, 255, 0.94);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.995);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    visibility 0.16s;
  pointer-events: none;
}
.vision-drop-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.vision-drop-overlay > div {
  text-align: center;
  color: #5d60e8;
}
.vision-drop-overlay svg {
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
}
.vision-drop-overlay strong {
  display: block;
  font-size: 12px;
}
.vision-drop-overlay small {
  display: block;
  margin-top: 5px;
  color: #7f8998;
  font-size: 10px;
}
.reference-tray {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  overflow: auto;
}
.reference-pill {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 10px;
  color: #647082;
}
.reference-pill i {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: #eef1f8;
  display: grid;
  place-items: center;
}
.reference-pill button {
  color: #9aa3b0;
}

/* 7) Gallery richer actions */
.gallery-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.gallery-actions button {
  margin-top: 7px !important;
}
.gallery-actions .primary-mini {
  background: #1d2330;
  color: #fff;
  border-color: #1d2330;
}

/* 8) Chat: GPT-like wrapping, long-paste docs and model reply actions */
.chat-shell {
  position: relative;
}
.conversation {
  overflow-x: hidden !important;
}
.chat-message {
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}
.chat-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 0;
}
.prompt-dock[data-composer='chat'] textarea {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-message.assistant {
  position: relative;
}
.assistant-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  opacity: 0.62;
  transition: opacity 0.14s ease;
}
.chat-message.assistant:hover .assistant-actions {
  opacity: 1;
}
.assistant-actions button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #687486;
  display: grid;
  place-items: center;
}
.assistant-actions button:hover {
  background: #f3f5f8;
  color: #242d3a;
}
.assistant-actions svg {
  width: 14px;
  height: 14px;
}
.assistant-actions .liked {
  color: #5277df;
  background: #f0f4ff;
}
.assistant-actions .disliked {
  color: #d66a72;
  background: #fff1f2;
}
.chat-transfer-actions .ghost-action {
  height: 32px;
  font-size: 10px;
}
.chat-doc-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: #f7f9fc;
  border-radius: 10px;
  font-size: 10px;
  color: #5d6878;
}
.chat-doc-chip svg {
  width: 13px;
  height: 13px;
}
.paste-converted-note {
  font-size: 10px;
  color: #707b8b;
  margin-top: 6px;
}

/* 9) global search */
.global-search-shell {
  display: grid;
  gap: 10px;
}
.global-search-input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8f9fc;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}
.global-search-input input {
  min-width: 0;
}
.global-search-results {
  max-height: 56vh;
  overflow: auto;
  display: grid;
  gap: 5px;
}
.global-task-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 11px;
  text-align: left;
}
.global-task-result:hover {
  background: #f5f7fa;
}
.global-task-result strong {
  display: block;
  font-size: 12px;
}
.global-task-result small {
  display: block;
  color: #8a95a4;
  margin-top: 2px;
  font-size: 10px;
}
.global-task-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.global-task-icon svg {
  width: 15px;
  height: 15px;
}
.mode-vision {
  background: #efefff;
  color: #635bff;
}
.mode-chat {
  background: #edf8fc;
  color: #2ca7ce;
}
.mode-animation {
  background: #fff4eb;
  color: #e58d4d;
}
.mode-code {
  background: #edf8f4;
  color: #28a477;
}

/* 10) Asset library */
.asset-library-shell {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 270px;
  gap: 12px;
  min-height: 520px;
}
.asset-modes {
  border-right: 1px solid var(--line);
  padding-right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.asset-modes button {
  height: 34px;
  border-radius: 9px;
  padding: 0 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #697486;
  font-size: 11px;
}
.asset-modes button.active,
.asset-modes button:hover {
  background: #f4f6fa;
  color: #252e3b;
}
.asset-modes b {
  font-size: 9px;
  color: #9aa3b1;
}
.asset-browser {
  min-width: 0;
  overflow: auto;
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.asset-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  text-align: left;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.asset-card:hover {
  border-color: #d5daf0;
  box-shadow: 0 5px 14px rgba(30, 40, 60, 0.04);
}
.asset-preview {
  width: 48px;
  height: 48px;
  border-radius: 9px;
  background: #f3f5f8;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.asset-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-preview svg {
  width: 18px;
  height: 18px;
}
.asset-card strong {
  display: block;
  font-size: 11px;
}
.asset-card small {
  display: block;
  color: #8d96a4;
  font-size: 9px;
  margin-top: 3px;
}
.asset-detail {
  border-left: 1px solid var(--line);
  padding-left: 12px;
  overflow: auto;
}
.asset-detail-preview {
  height: 150px;
  border-radius: 12px;
  background: #f5f7fa;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 10px;
}
.asset-detail-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.asset-detail-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}
.asset-detail > strong {
  font-size: 13px;
}
.asset-detail dl {
  margin: 10px 0;
  display: grid;
  gap: 6px;
}
.asset-detail dl div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}
.asset-detail dt {
  color: #8a94a3;
}
.asset-detail dd {
  margin: 0;
  text-align: right;
}
.asset-ops {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.asset-ops > span {
  font-size: 10px;
  color: #85909f;
}
.asset-ops p {
  margin: 6px 0 0;
  font-size: 10px;
}
.asset-ops p small {
  display: block;
  color: #9aa3b1;
  margin-top: 2px;
}
.menu-action.primary {
  background: #1d2330;
  color: #fff;
  border-color: #1d2330;
}

/* 11) Credits center */
.credits-center {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
}
.credits-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(145deg, #f7f7ff, #f3f6fb);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.credits-summary span,
.credits-summary small {
  color: #858f9f;
  font-size: 10px;
}
.credits-summary strong {
  font-size: 30px;
  margin: 5px 0;
}
.recharge-panel,
.ledger-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
}
.recharge-panel strong,
.ledger-panel strong {
  font-size: 12px;
}
.recharge-panel small {
  display: block;
  color: #8c96a5;
  font-size: 9px;
  margin-top: 8px;
}
.recharge-options {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}
.recharge-options button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  font-size: 10px;
}
.recharge-options button:hover {
  border-color: #cfd3ff;
  color: #5a5fe8;
}
.ledger-panel {
  grid-column: 1/-1;
}
.ledger-list {
  max-height: 320px;
  overflow: auto;
  margin-top: 8px;
  display: grid;
  gap: 5px;
}
.ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 60px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 9px;
  background: #f8f9fb;
  font-size: 10px;
}
.ledger-row span b {
  display: block;
}
.ledger-row span small {
  display: block;
  color: #979fad;
  margin-top: 2px;
}
.ledger-row > strong {
  font-size: 11px;
}
.ledger-row.recharge > strong {
  color: #2a9a70;
}
.ledger-row.consume > strong {
  color: #d4666e;
}
.ledger-row em {
  font-style: normal;
  color: #8b94a2;
  text-align: right;
}

/* 12) Profile */
.profile-card {
  display: flex;
  align-items: center;
  gap: 11px;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #f0f2f7;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 800;
}
.profile-card strong {
  display: block;
}
.profile-card small {
  display: block;
  color: #8a95a4;
  margin-top: 4px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.profile-stats div {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px;
  background: #fafbfd;
}
.profile-stats span {
  display: block;
  color: #8a94a3;
  font-size: 9px;
}
.profile-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

/* 13) AI short-drama production workspace */
.drama-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) auto;
  gap: 9px;
}
.drama-pipeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  background: #f7f8fb;
  border-radius: 12px;
}
.drama-pipeline button {
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #7d8796;
  font-size: 10px;
  font-weight: 700;
  transition: 0.18s var(--ease);
}
.drama-pipeline button svg {
  width: 13px;
  height: 13px;
}
.drama-pipeline button.active {
  background: #fff;
  color: #d4773d;
  box-shadow: 0 5px 12px rgba(45, 40, 35, 0.05);
}
.drama-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 220px;
  gap: 9px;
}
.drama-project-panel,
.drama-main-panel,
.drama-inspector {
  min-height: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
}
.drama-panel-head,
.drama-main-head {
  min-height: 50px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.drama-panel-head strong,
.drama-main-head strong {
  display: block;
  font-size: 12px;
}
.drama-panel-head span,
.drama-main-head span {
  display: block;
  color: #8c96a5;
  font-size: 9px;
  margin-top: 3px;
}
.drama-project-list,
.drama-main-content,
.drama-inspector-content {
  min-height: 0;
  height: calc(100% - 50px);
  overflow: auto;
  padding: 9px;
}
.drama-project-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drama-project-item {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  text-align: left;
}
.drama-project-item.active {
  border-color: #f0d1bd;
  background: #fff8f2;
}
.drama-project-item strong {
  display: block;
  font-size: 10px;
}
.drama-project-item small {
  display: block;
  color: #8f98a6;
  margin-top: 2px;
  font-size: 9px;
}
.drama-main-actions {
  display: flex;
  gap: 5px;
}
.drama-main-actions .ghost-action {
  height: 28px;
  font-size: 9px;
  padding: 0 7px;
}
.drama-storyboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.drama-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfe;
  overflow: hidden;
}
.drama-card-visual {
  aspect-ratio: 16/9;
  background: linear-gradient(145deg, #34425b, #896252);
  position: relative;
}
.drama-card-visual span {
  position: absolute;
  left: 7px;
  bottom: 6px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}
.drama-card-copy {
  padding: 7px;
}
.drama-card-copy strong {
  display: block;
  font-size: 10px;
}
.drama-card-copy small {
  display: block;
  color: #8c95a3;
  font-size: 8px;
  margin-top: 2px;
}
.drama-script {
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.7;
  padding: 2px;
}
.drama-character-grid,
.drama-scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.drama-character-card,
.drama-scene-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fbfcfe;
}
.drama-character-card strong,
.drama-scene-card strong {
  font-size: 10px;
}
.drama-character-card p,
.drama-scene-card p {
  font-size: 9px;
  line-height: 1.5;
  color: #7d8795;
}
.drama-timeline {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  min-height: 170px;
  padding: 8px 2px;
}
.timeline-clip {
  min-width: 130px;
  height: 100px;
  border-radius: 10px;
  background: linear-gradient(145deg, #39465d, #7d5d54);
  padding: 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.timeline-clip strong {
  font-size: 10px;
}
.timeline-clip small {
  font-size: 8px;
  opacity: 0.8;
}
.inspector-stat {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
}
.inspector-stat span {
  color: #7c8796;
}
.inspector-stat b {
  font-size: 10px;
}
.inspector-progress {
  height: 5px;
  border-radius: 999px;
  background: #eceff4;
  grid-column: 1/-1;
}
.inspector-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #e58d4d;
}
.drama-empty {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #8791a0;
  font-size: 10px;
}
.drama-empty strong {
  display: block;
  color: #343d49;
  font-size: 12px;
  margin-bottom: 5px;
}

/* 14) code usability improvements */
.code-global-actions .ghost-action {
  height: 32px;
  font-size: 10px;
}
.code-branch {
  display: flex;
  align-items: center;
  gap: 5px;
}
.code-branch i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3dbb7f;
}
.terminal.testing {
  box-shadow: inset 3px 0 0 #e8ad4e;
}
.terminal.success {
  box-shadow: inset 3px 0 0 #36ac76;
}
.terminal.failure {
  box-shadow: inset 3px 0 0 #d45b67;
}

@media (max-width: 1200px) {
  .asset-library-shell {
    grid-template-columns: 110px minmax(0, 1fr);
  }
  .asset-detail {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 10px 0 0;
  }
  .drama-workspace {
    grid-template-columns: 170px minmax(0, 1fr);
  }
  .drama-inspector {
    display: none;
  }
}
@media (max-width: 900px) {
  .credits-center {
    grid-template-columns: 1fr;
  }
  .ledger-panel {
    grid-column: 1;
  }
  .drama-pipeline {
    grid-template-columns: repeat(3, 1fr);
  }
  .drama-workspace {
    grid-template-columns: 1fr;
  }
  .drama-project-panel {
    display: none;
  }
  .drama-storyboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .history-actions {
    opacity: 1;
  }
  .asset-library-shell {
    grid-template-columns: 1fr;
  }
  .asset-modes {
    flex-direction: row;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 8px;
  }
  .asset-modes button {
    min-width: 70px;
  }
  .drama-storyboard-grid,
  .drama-character-grid,
  .drama-scene-grid {
    grid-template-columns: 1fr;
  }
  .chat-transfer-actions {
    display: none;
  }
}

/* ===== Locked workspace behavior ===== */

/* Entry: centered fade -> visible pause -> clearer wake -> reveal */
.entry-screen {
  animation: v81EntryLift 2.78s cubic-bezier(0.76, 0, 0.24, 1) forwards !important;
}
.entry-logo {
  opacity: 0;
  transform: scale(0.985);
  filter: blur(2.5px);
  animation:
    v81LogoFade 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards,
    v81LogoWake 0.42s cubic-bezier(0.22, 1, 0.36, 1) 1.08s forwards !important;
  transform-origin: center center;
}
@keyframes v81LogoFade {
  0% {
    opacity: 0;
    transform: scale(0.985);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}
@keyframes v81LogoWake {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.07);
  }
}
@keyframes v81EntryLift {
  0%,
  75% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100%);
    opacity: 0.965;
    visibility: hidden;
  }
}

/* V3 mode switch: keep compact, add smooth colored selection */
.mode-switch {
  transition:
    background-color 300ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 300ms ease;
}
.mode-switch[data-value='fast'] .mode-switch-thumb {
  background: #fff;
}
.mode-switch[data-value='fast'] button[data-value='fast'].active {
  color: #5360ec;
}
.mode-switch[data-value='pro'] button[data-value='pro'].active {
  color: #7b72ff;
}
.mode-switch[data-value='pro'] button[data-value='pro'].active i {
  background: #7c74ff;
  box-shadow: 0 0 0 3px rgba(124, 116, 255, 0.12);
}

/* Reference trays */
.reference-mini-tray,
.chat-attachment-tray,
.animation-reference-tray {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 300px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.reference-mini-tray::-webkit-scrollbar,
.chat-attachment-tray::-webkit-scrollbar,
.animation-reference-tray::-webkit-scrollbar {
  display: none;
}
.reference-mini,
.split-reference-pill,
.animation-reference-chip {
  height: 28px;
  max-width: 170px;
  padding: 0 7px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #657183;
  font-size: 9px;
  white-space: nowrap;
}
.reference-mini img,
.reference-thumb img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: cover;
}
.reference-mini span,
.split-reference-pill span,
.animation-reference-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.reference-mini b,
.split-reference-pill b,
.animation-reference-chip b {
  font-size: 9px;
  color: #9aa4b2;
}
.split-reference-pill {
  margin-left: auto;
}

/* Drag UI */
.vision-drop-overlay > div span {
  display: block;
  margin-top: 5px;
  color: #7f8998;
  font-size: 10px;
}
.vision-drop-overlay.active svg {
  animation: v81DropPulse 0.8s ease-in-out infinite alternate;
}
@keyframes v81DropPulse {
  to {
    transform: translateY(-3px);
  }
}

/* Gallery */
.gallery-item {
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: contain;
  background: #f4f6f9;
  border-radius: 10px;
}
.gallery-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.gallery-actions button {
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  font-size: 9px;
  color: #556171;
}

/* Chat: ChatGPT-like width, wrapping and actions */
.conversation {
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.chat-message {
  width: min(780px, calc(100% - 28px));
  margin-inline: auto;
  overflow-x: hidden !important;
}
.chat-message.user {
  width: min(680px, calc(100% - 28px));
  margin-left: auto;
  margin-right: max(14px, calc((100% - 780px) / 2));
}
.chat-message-copy {
  font-size: 12px;
  line-height: 1.75;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}
.chat-message.user .chat-message-copy {
  background: #eef1f5;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 13px;
}
.chat-message.assistant .chat-message-copy {
  padding: 3px 1px;
}
.assistant-actions {
  min-height: 30px;
}
.assistant-actions button.active {
  background: #eef2ff;
  color: #5967df;
}
.message-attachments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.message-attachments a {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7f9fc;
  color: #5b6778;
  font-size: 9px;
  text-decoration: none;
}
.message-attachments svg {
  width: 12px;
  height: 12px;
}
.chat-attachment-tray {
  max-width: 360px;
}
.chat-doc-chip {
  margin-top: 0;
  max-width: 220px;
}
.chat-doc-chip b {
  color: #9aa3b1;
}
.prompt-dock[data-composer='chat'] textarea {
  min-height: 44px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden !important;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Short drama production additions */
.character-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 800;
}
.scene-strip {
  height: 58px;
  margin: -8px -8px 8px;
  border-radius: 9px 9px 4px 4px;
}
.scene-1 {
  background: linear-gradient(145deg, #33455a, #a7755c);
}
.scene-2 {
  background: linear-gradient(145deg, #46515f, #7e8b92);
}
.scene-3 {
  background: linear-gradient(145deg, #463d50, #9d6c7c);
}
.drama-character-card small,
.drama-scene-card small {
  font-size: 8px;
  color: #979fad;
}
.drama-card-copy p {
  margin: 5px 0 0;
  font-size: 8.5px;
  line-height: 1.45;
  color: #6f7a8b;
}
.visual-2 {
  background: linear-gradient(145deg, #2c394a, #7f6873);
}
.visual-3 {
  background: linear-gradient(145deg, #354b54, #8f745d);
}
.visual-4 {
  background: linear-gradient(145deg, #3d3a50, #80606a);
}
.shot-production-list {
  display: grid;
  gap: 6px;
}
.shot-production-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 60px auto auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
}
.shot-index {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #fff3e9;
  color: #d4773d;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
}
.shot-description strong {
  display: block;
  font-size: 10px;
}
.shot-description small {
  display: block;
  margin-top: 2px;
  color: #8a94a3;
  font-size: 8.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shot-status {
  font-size: 8.5px;
  color: #8b95a3;
}
.shot-status.running {
  color: #c88032;
}
.shot-status.succeeded {
  color: #27926e;
}
.shot-status.failed {
  color: #d45d6a;
}
.shot-production-row .ghost-action {
  height: 27px;
  padding: 0 7px;
  font-size: 8.5px;
}
.timeline-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.timeline-actions button {
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 8px;
}
.production-note {
  margin-top: 10px;
  padding: 9px;
  border-radius: 10px;
  background: #fff8f2;
  border: 1px solid #f1dfd3;
}
.production-note strong {
  font-size: 9px;
}
.production-note p {
  font-size: 8.5px;
  line-height: 1.5;
  color: #7d716c;
  margin: 4px 0 0;
}
.drama-custom-textarea {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}
.form-field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}
.form-field span {
  font-size: 10px;
  color: #768193;
}
.form-field input,
.form-field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafc;
  padding: 9px 10px;
}
.form-field textarea {
  min-height: 120px;
  resize: vertical;
}
.drama-video-preview {
  width: 100%;
  max-height: 72vh;
  background: #111;
  border-radius: 12px;
}
.animation-reference-tray {
  max-width: 260px;
}
.drama-main-actions .working:after {
  content: '';
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Programmer-oriented code mode */
.editor-code {
  tab-size: 2;
  outline: none;
  caret-color: #4356e7;
  white-space: pre;
  overflow: auto;
}
.code-global-actions {
  gap: 5px;
}
.code-global-actions .ghost-action svg {
  width: 13px;
  height: 13px;
}
.terminal {
  transition:
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}
.code-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 0;
  background: #fff;
}
.preview-pane {
  overflow: auto;
}

/* Compact responsive refinements */
@media (max-width: 1180px) {
  .shot-production-row {
    grid-template-columns: 32px minmax(0, 1fr) 56px auto;
  }
  .shot-production-row [data-preview-shot] {
    display: none;
  }
}
@media (max-width: 720px) {
  .gallery-actions {
    grid-template-columns: 1fr;
  }
  .chat-message,
  .chat-message.user {
    width: calc(100% - 20px);
    margin-inline: 10px;
  }
  .shot-production-row {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 6px;
  }
  .shot-status,
  .shot-production-row .ghost-action {
    grid-column: 2;
  }
  .reference-mini-tray,
  .chat-attachment-tray,
  .animation-reference-tray {
    max-width: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-screen {
    animation: v81EntryReduced 0.8s linear forwards !important;
  }
  .entry-logo {
    opacity: 1;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }
  @keyframes v81EntryReduced {
    to {
      opacity: 0;
      visibility: hidden;
    }
  }
}

/* =========================================================
   V9 — locked V3 visual baseline, additive behavior only
   ========================================================= */
:root {
  --v9-purple: #655cf4;
  --v9-purple-strong: #574ee9;
  --v9-purple-soft: #f1efff;
  --v9-purple-line: #dcd8ff;
  --v9-green: #24b27a;
  --v9-amber: #e59a46;
}

/* ---------- model selector ---------- */
.select-control.open .select-popover {
  display: grid !important;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.select-option {
  cursor: pointer;
}
.select-option.active {
  background: #f6f7fb;
}
.select-option b {
  font-variant-numeric: tabular-nums;
}
.model-cost-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7d8797;
  font-size: 9px;
}

/* ---------- credit explanation ---------- */
.credit-cost-chip {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #6b7585;
  font-size: 9px;
  transition: 0.18s var(--ease);
}
.credit-cost-chip:hover {
  border-color: #d6d5ff;
  background: #faf9ff;
  color: #5d56e8;
}
.credit-cost-chip strong {
  font-size: 10px;
  color: #303949;
}
.credit-cost-chip svg {
  width: 12px;
  height: 12px;
  color: #6a62ef;
}
.credit-explain-card {
  display: grid;
  gap: 10px;
}
.credit-formula {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #f8f9fc;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.credit-formula b {
  color: var(--v9-purple);
}
.credit-rule-list {
  display: grid;
  gap: 7px;
}
.credit-rule-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.credit-rule-row:last-child {
  border-bottom: 0;
}
.credit-rule-row span {
  color: #727d8d;
}

/* ---------- professional mode: light UI + purple controls only ---------- */
.mode-page[data-page='vision'].professional-tone {
  background: transparent !important;
  color: var(--text) !important;
  border-radius: 0 !important;
}
.mode-page[data-page='vision'].professional-tone .page-head h1,
.mode-page[data-page='vision'].professional-tone .stream-head strong,
.mode-page[data-page='vision'].professional-tone .thread-head strong,
.mode-page[data-page='vision'].professional-tone .split-label strong {
  color: var(--text) !important;
}
.mode-page[data-page='vision'].professional-tone .micro-label,
.mode-page[data-page='vision'].professional-tone .stream-head span,
.mode-page[data-page='vision'].professional-tone .thread-head span,
.mode-page[data-page='vision'].professional-tone .split-label span {
  color: #8b95a4 !important;
}
.mode-page[data-page='vision'].professional-tone .output-column,
.mode-page[data-page='vision'].professional-tone .thread-column,
.mode-page[data-page='vision'].professional-tone .split-stage,
.mode-page[data-page='vision'].professional-tone .prompt-dock {
  background: #fff !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
.mode-page[data-page='vision'].professional-tone .mode-switch {
  background: #efedff;
  border-color: #dedaff;
}
.mode-page[data-page='vision'].professional-tone .mode-switch-thumb {
  background: #fff !important;
  box-shadow: 0 6px 14px rgba(89, 77, 218, 0.12);
}
.mode-page[data-page='vision'].professional-tone .mode-switch button {
  color: #7e789c;
}
.mode-page[data-page='vision'].professional-tone .mode-switch button.active {
  color: var(--v9-purple-strong);
}
.mode-page[data-page='vision'].professional-tone .mode-switch button.active i {
  background: var(--v9-purple);
  box-shadow: 0 0 0 3px rgba(101, 92, 244, 0.12);
}
.mode-page[data-page='vision'].professional-tone .dock-chip,
.mode-page[data-page='vision'].professional-tone .select-trigger,
.mode-page[data-page='vision'].professional-tone .split-download-all,
.mode-page[data-page='vision'].professional-tone .credit-cost-chip {
  border-color: var(--v9-purple-line) !important;
  background: #faf9ff !important;
  color: var(--v9-purple-strong) !important;
}
.mode-page[data-page='vision'].professional-tone .send-button {
  background: var(--v9-purple) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(101, 92, 244, 0.18);
}
.mode-page[data-page='vision'].professional-tone .toggle-chip.active {
  background: var(--v9-purple-soft) !important;
  color: var(--v9-purple-strong) !important;
}
.mode-page[data-page='vision'].professional-tone .result-toolbar button,
.mode-page[data-page='vision'].professional-tone .layer-row.active,
.mode-page[data-page='vision'].professional-tone .layer-row:hover {
  border-color: var(--v9-purple-line) !important;
  color: var(--v9-purple-strong) !important;
  background: #faf9ff !important;
}
.mode-page[data-page='vision'] .output-column,
.mode-page[data-page='vision'] .thread-column,
.mode-page[data-page='vision'] .split-stage,
.mode-page[data-page='vision'] .prompt-dock,
.mode-page[data-page='vision'] .dock-chip,
.mode-page[data-page='vision'] .select-trigger,
.mode-page[data-page='vision'] .send-button {
  transition:
    background-color 300ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 260ms ease,
    color 240ms ease,
    box-shadow 260ms ease;
}

/* ---------- ChatGPT-like chat readability ---------- */
.mode-page[data-page='chat'] .chat-shell {
  background: #fff;
  color: var(--text);
  overflow: hidden;
}
.mode-page[data-page='chat'] .conversation {
  overflow-x: hidden !important;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.mode-page[data-page='chat'] .chat-message {
  max-width: min(760px, 82%);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  color: #202733 !important;
}
.mode-page[data-page='chat'] .chat-message-copy {
  color: #202733 !important;
  background: transparent !important;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.72;
}
.mode-page[data-page='chat'] .chat-message.assistant {
  background: transparent !important;
  color: #202733 !important;
  border: 0 !important;
  padding-left: 0;
  padding-right: 0;
  box-shadow: none !important;
}
.mode-page[data-page='chat'] .chat-message.user {
  margin-left: auto;
  background: #f2f3f6 !important;
  color: #202733 !important;
  border: 1px solid #eceef2 !important;
  border-radius: 17px;
}
.mode-page[data-page='chat'] .assistant-actions {
  color: #778394;
}
.mode-page[data-page='chat'] .assistant-actions button {
  color: #778394;
}
.mode-page[data-page='chat'] .assistant-actions button:hover {
  background: #f3f5f8;
  color: #303947;
}
.chat-document-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f8f9fc;
  color: #5f6a79;
  font-size: 10px;
}
.chat-document-chip b {
  color: #293240;
}

/* ---------- marketplace ---------- */
.market-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 128px auto auto minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}
.market-banner {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(110deg, #f5f3ff 0%, #f8faff 48%, #f3f8ff 100%);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 500ms ease;
}
.market-banner:after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(105, 95, 238, 0.1);
  border-radius: 50%;
  right: 70px;
  top: -65px;
  box-shadow:
    0 0 0 35px rgba(105, 95, 238, 0.025),
    0 0 0 70px rgba(73, 166, 208, 0.02);
}
.market-banner-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 5px;
  max-width: 620px;
}
.market-banner-copy span {
  font-size: 9px;
  letter-spacing: 0.17em;
  color: #7772d9;
}
.market-banner-copy strong {
  font-size: 20px;
  letter-spacing: -0.02em;
}
.market-banner-copy p {
  margin: 0;
  color: #7a8595;
  font-size: 11px;
}
.market-banner-index {
  position: relative;
  z-index: 2;
  font-size: 10px;
  color: #8b95a4;
  align-self: flex-end;
}
.market-scope-tabs {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f2f4f8;
}
.market-scope-tabs button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #778292;
  font-size: 10px;
  font-weight: 700;
}
.market-scope-tabs button.active {
  background: #fff;
  color: #303846;
  box-shadow: 0 2px 8px rgba(38, 45, 58, 0.07);
}
.market-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.market-toolbar label {
  height: 34px;
  min-width: 260px;
  max-width: 420px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #8a95a4;
}
.market-toolbar label svg {
  width: 13px;
  height: 13px;
}
.market-toolbar input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 10px;
  color: #313a48;
}
.market-filters {
  display: flex;
  align-items: center;
  gap: 5px;
}
.market-filters button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #788394;
  font-size: 10px;
}
.market-filters button.active,
.market-filters button:hover {
  background: #fff;
  border-color: var(--line);
  color: #343e4c;
}
.market-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 1px 2px 18px;
  align-content: start;
}
.market-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  overflow: hidden;
  transition: 0.18s var(--ease);
}
.market-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(33, 43, 60, 0.07);
}
.market-card.private-submission {
  border-color: #e1e4ec;
  background: #fcfcfd;
}
.market-card.private-submission:hover {
  box-shadow: 0 10px 24px rgba(33, 43, 60, 0.05);
}
.market-media {
  position: relative;
  aspect-ratio: 4/3;
  background: #f2f4f8;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.market-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.market-type {
  position: absolute;
  left: 8px;
  top: 8px;
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  color: #4b5666;
}
.market-review-status {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 22px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  color: #657181;
  font-size: 9px;
  font-weight: 700;
}
.market-review-status.pending { color: #a56d19; background: rgba(255, 248, 226, 0.94); }
.market-review-status.published { color: #26805c; background: rgba(233, 250, 241, 0.94); }
.market-review-status.rejected { color: #b64a5b; background: rgba(255, 238, 241, 0.94); }
.market-review-status.unpublished { color: #5b63a8; background: rgba(240, 240, 255, 0.94); }
.market-fav {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  color: #717c8c;
}
.market-fav.active {
  color: #e15a72;
  background: #fff0f3;
}
.market-fav svg {
  width: 13px;
  height: 13px;
}
.market-copy {
  padding: 10px;
  display: grid;
  gap: 7px;
}
.market-copy strong {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.market-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #8a95a4;
  font-size: 9px;
}
.market-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.market-tags span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f5f7fa;
  color: #7a8493;
  font-size: 8px;
}
.market-card-review {
  margin: 0;
  overflow: hidden;
  color: #9a5260;
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-load-more {
  justify-self: center;
  min-width: 180px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #657181;
  font-size: 10px;
  font-weight: 700;
}
.market-load-more:disabled { opacity: 0.55; }
.primary-market {
  background: var(--v9-purple) !important;
  border-color: var(--v9-purple) !important;
  color: #fff !important;
}
.market-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 14px;
}
.market-detail-media {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #f3f5f8;
  display: grid;
  place-items: center;
}
.market-detail-media img {
  width: 100%;
  height: 100%;
  max-height: 66vh;
  object-fit: contain;
}
.market-detail-info {
  display: grid;
  align-content: start;
  gap: 12px;
}
.market-detail-info h3 {
  margin: 0;
  font-size: 17px;
}
.market-info-row {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.market-info-row span {
  color: #8390a1;
}
.prompt-box {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f9fc;
  font-size: 10px;
  line-height: 1.6;
  word-break: break-word;
}
.market-detail-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.market-detail-actions button {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #596474;
  font-size: 10px;
  font-weight: 700;
}
.market-detail-actions button.primary {
  background: #202633;
  color: #fff;
  border-color: #202633;
}
.market-private-detail {
  padding: 10px 11px;
  border: 1px solid #e4e6ed;
  border-radius: 10px;
  background: #f7f8fb;
}
.market-private-detail strong { font-size: 11px; color: #4e5868; }
.market-private-detail p { margin: 5px 0 0; color: #7b8696; font-size: 10px; line-height: 1.55; }
.market-private-detail.rejected { border-color: #f0ced5; background: #fff6f7; }
.market-private-detail.rejected strong { color: #ae4557; }
.market-private-actions {
  padding: 10px;
  border-radius: 9px;
  background: #f4f5f8;
  color: #737e8e;
  font-size: 10px;
  line-height: 1.5;
}
.market-publish-form {
  display: grid;
  gap: 11px;
}
.market-publish-form label {
  display: grid;
  gap: 5px;
  font-size: 10px;
  color: #657181;
}
.market-publish-form input,
.market-publish-form textarea,
.market-publish-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
  outline: 0;
  color: #2d3745;
  font-size: 10px;
}
.market-publish-form textarea {
  min-height: 92px;
  resize: vertical;
}
.reward-note {
  padding: 9px 10px;
  border-radius: 10px;
  background: #f4fff9;
  border: 1px solid #d8f2e5;
  color: #4b7c66;
  font-size: 10px;
}

/* ---------- animation functionality polish ---------- */
.drama-workspace,
.drama-main-panel,
.drama-project-panel,
.drama-inspector {
  min-height: 0;
}
.drama-main-content {
  overflow: auto;
}
.drama-editor-form {
  display: grid;
  gap: 10px;
  padding: 4px;
}
.drama-editor-form label {
  display: grid;
  gap: 5px;
  color: #687484;
  font-size: 10px;
}
.drama-editor-form input,
.drama-editor-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  outline: 0;
  background: #fff;
  color: #2b3440;
  font-size: 10px;
}
.drama-editor-form textarea {
  min-height: 150px;
  resize: vertical;
}
.shot-preview-box {
  display: grid;
  place-items: center;
  min-height: 340px;
  background: #151b25;
  border-radius: 13px;
  overflow: hidden;
}
.shot-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.timeline-clip {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}
.timeline-clip.moving {
  box-shadow: 0 0 0 3px rgba(101, 92, 244, 0.12);
}

/* ---------- admin shared modal/buttons ---------- */
.v9-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.v9-form-actions button {
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}
.v9-form-actions button.primary {
  background: #202633;
  color: #fff;
  border-color: #202633;
}

@media (max-width: 1380px) {
  .market-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .market-detail {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .market-shell {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }
  .market-banner {
    min-height: 116px;
  }
  .market-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .market-toolbar label {
    max-width: none;
    width: 100%;
  }
  .market-grid {
    grid-template-columns: 1fr;
  }
}
/* Professional mode remains on the light surface; only interactive accents change. */
.mode-page[data-page='vision'].professional-tone .stream-head,
.mode-page[data-page='vision'].professional-tone .thread-head,
.mode-page[data-page='vision'].professional-tone .split-label,
.mode-page[data-page='vision'].professional-tone .output-grid,
.mode-page[data-page='vision'].professional-tone .thread-scroll,
.mode-page[data-page='vision'].professional-tone .split-workspace,
.mode-page[data-page='vision'].professional-tone .image-result,
.mode-page[data-page='vision'].professional-tone .api-image-frame,
.mode-page[data-page='vision'].professional-tone .api-image-frame img,
.mode-page[data-page='vision'].professional-tone .split-art,
.mode-page[data-page='vision'].professional-tone .turn,
.mode-page[data-page='vision'].professional-tone .turn.user,
.mode-page[data-page='vision'].professional-tone .reference-mini,
.mode-page[data-page='vision'].professional-tone .split-reference-pill,
.mode-page[data-page='vision'].professional-tone .select-popover {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: inherit !important;
}
.mode-page[data-page='vision'].professional-tone .prompt-dock textarea {
  background: #fbfcfe !important;
  border-color: var(--v9-purple-line) !important;
  color: var(--text) !important;
}
.mode-page[data-page='vision'].professional-tone .tab-switch {
  background: #f1efff !important;
  border-color: var(--v9-purple-line) !important;
}
.mode-page[data-page='vision'].professional-tone .tab-switch button {
  color: #7c769d !important;
}
.mode-page[data-page='vision'].professional-tone .tab-switch button.active {
  background: #fff !important;
  color: var(--v9-purple-strong) !important;
  box-shadow: 0 5px 14px rgba(101, 92, 244, 0.08) !important;
}
.mode-page[data-page='vision'].professional-tone .ghost-action {
  border-color: var(--v9-purple-line) !important;
  background: #faf9ff !important;
  color: var(--v9-purple-strong) !important;
}
.mode-page[data-page='vision'].professional-tone .select-option {
  color: var(--text) !important;
}
.mode-page[data-page='vision'].professional-tone .select-option small,
.mode-page[data-page='vision'].professional-tone .select-title {
  color: #8b95a4 !important;
}
.mode-page[data-page='vision'].professional-tone .select-option:hover,
.mode-page[data-page='vision'].professional-tone .select-option.active {
  background: #f4f2ff !important;
}
.mode-page[data-page='vision'].professional-tone .vision-drop-overlay {
  background: rgba(248, 247, 255, 0.97) !important;
  border-color: var(--v9-purple) !important;
  color: var(--v9-purple-strong) !important;
}

/* ===== Professional interaction + marketplace refinements ===== */
/* Professional mode stays light; only the selected controls and visual chat bubbles shift into the purple family. */
.app.vision-professional .new-task {
  background: #6b5cf3 !important;
  border-color: #6b5cf3 !important;
  box-shadow: 0 10px 24px rgba(107, 92, 243, 0.18) !important;
}
.app.vision-professional .history-item.active {
  background: #f1efff !important;
  border-color: #dedaff !important;
  box-shadow: 0 0 0 1px rgba(107, 92, 243, 0.06) !important;
}
.app.vision-professional .history-pin.active,
.app.vision-professional .history-more:hover {
  background: #ece9ff !important;
  border-color: #d9d4ff !important;
}
.app.vision-professional .credits-bar i {
  background: #7a6bf5 !important;
}
.app.vision-professional .credits-foot button {
  color: #685af0 !important;
}
.app.vision-professional [data-page='vision'] .tab-switch {
  background: #eeeaff !important;
  border-color: #ddd7ff !important;
}
.app.vision-professional [data-page='vision'] .tab-switch button.active {
  background: #7868f6 !important;
  border-color: #7868f6 !important;
  color: #fff !important;
  box-shadow: 0 7px 18px rgba(105, 88, 238, 0.17) !important;
}
.app.vision-professional [data-page='vision'] .ghost-action {
  background: #f0edff !important;
  border-color: #dcd6ff !important;
}
.app.vision-professional [data-page='vision'] .dock-chip,
.app.vision-professional [data-page='vision'] .select-trigger,
.app.vision-professional [data-page='vision'] .credit-cost-chip {
  background: #f1efff !important;
  border-color: #ddd7ff !important;
}
.app.vision-professional [data-page='vision'] .mode-switch {
  background: #eae7ff !important;
  border-color: #d9d3ff !important;
}
.app.vision-professional [data-page='vision'] .mode-switch-thumb {
  background: #7868f6 !important;
  box-shadow: 0 7px 16px rgba(105, 88, 238, 0.18) !important;
}
.app.vision-professional [data-page='vision'] .mode-switch button.active {
  color: #fff !important;
}
.app.vision-professional [data-page='vision'] .send-button {
  background: #6b5cf3 !important;
  border-color: #6b5cf3 !important;
  box-shadow: 0 10px 20px rgba(107, 92, 243, 0.2) !important;
}
.app.vision-professional [data-page='vision'] .result-toolbar button {
  background: #f1efff !important;
  border-color: #ddd7ff !important;
}
/* Preserve each bubble's existing text color: user stays white, assistant stays dark. */
.mode-page[data-page='vision'].professional-tone .turn.user {
  background: #6b5cf3 !important;
  border-color: #6b5cf3 !important;
  color: #fff !important;
}
.mode-page[data-page='vision'].professional-tone .turn.assistant {
  background: #efecff !important;
  border-color: #ddd7ff !important;
  color: var(--text) !important;
}
.mode-page[data-page='vision'].professional-tone .thread-note {
  background: #f7f5ff !important;
  border-color: #ddd7ff !important;
  color: #788394 !important;
}
/* History automatically yields the full width to Marketplace, then slides back for creation modes. */
.app {
  transition:
    grid-template-columns 320ms cubic-bezier(0.22, 1, 0.36, 1),
    gap 320ms cubic-bezier(0.22, 1, 0.36, 1);
}
.app.market-focus .rail-control {
  background: #f1f0ff;
  color: #5d5ef0;
  border-color: #dfdfff;
}
/* True horizontal banner carousel motion; content leaves left and the next slide enters from the right. */
.market-banner-copy {
  will-change: transform, opacity;
  transition:
    transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 260ms ease;
}
.market-banner-copy.slide-enter-right {
  transform: translateX(34px);
  opacity: 0;
}
.market-banner-copy.slide-enter-left {
  transform: translateX(-34px);
  opacity: 0;
}
.market-banner-copy.slide-enter-right.slide-active,
.market-banner-copy.slide-enter-left.slide-active {
  transform: translateX(0);
  opacity: 1;
}
.market-banner-copy.slide-exit-left {
  transform: translateX(-34px) !important;
  opacity: 0 !important;
}
.market-banner-copy.slide-exit-right {
  transform: translateX(34px) !important;
  opacity: 0 !important;
}
.market-banner-nav {
  position: absolute;
  z-index: 4;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid rgba(105, 95, 238, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  color: #7169df;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transition:
    opacity 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}
.market-banner:hover .market-banner-nav {
  opacity: 1;
}
.market-banner-nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.04);
}
.market-banner-nav.prev {
  left: 9px;
}
.market-banner-nav.next {
  right: 9px;
}
.market-banner-copy {
  margin-inline: 22px;
}
.market-banner-index {
  margin-right: 26px;
}
@media (prefers-reduced-motion: reduce) {
  .market-banner-copy,
  .app {
    transition: none !important;
  }
  .market-banner-nav {
    transition: none !important;
  }
}

/* Final configurable media assets */
.model-avatar {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-block;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(111, 104, 255, 0.1);
  background: #eef1f6;
}
.model-avatar-fallback {
  background: linear-gradient(145deg, #2f3746, #7b8798);
}
.assistant-brand-logo {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  border-radius: 5px;
  flex: none;
}
.assistant-mark strong {
  font-weight: 700;
  color: #566171;
}
.market-banner {
  isolation: isolate;
  background-image: linear-gradient(110deg, #f5f3ff 0%, #f8faff 48%, #f3f8ff 100%);
  background-size: cover;
  background-position: center;
}
.market-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(
      rgba(248, 250, 255, var(--market-banner-overlay, 0.12)),
      rgba(248, 250, 255, var(--market-banner-overlay, 0.12))
    ),
    var(--market-banner-image, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 420ms ease;
}
.market-banner.has-background-image::before {
  opacity: 1;
}
.market-banner.has-background-image .market-banner-copy strong {
  color: #202733;
}
.market-banner.has-background-image .market-banner-copy p {
  color: #5f6978;
}

/* FINAL 1.4.2 · Chat layout tuned to a GPT-like content column.
   The conversation owns scrolling; assistant replies sit on a centered content lane,
   while user bubbles align to the right edge of that same lane. */
.mode-page[data-page='chat'] .conversation {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-gutter: auto;
  align-items: stretch !important;
  gap: 18px !important;
  padding: 22px clamp(18px, calc((100% - 760px) / 2), 160px) 18px !important;
  box-sizing: border-box;
}
.mode-page[data-page='chat'] .chat-message,
.mode-page[data-page='chat'] .chat-message-copy {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}
.mode-page[data-page='chat'] .chat-message {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  align-self: stretch !important;
}
.mode-page[data-page='chat'] .chat-message.assistant {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.mode-page[data-page='chat'] .chat-message.user {
  width: fit-content !important;
  max-width: min(620px, 76%) !important;
  min-width: min(160px, 36%) !important;
  margin-left: auto !important;
  align-self: flex-end !important;
  padding: 0 !important;
}
.mode-page[data-page='chat'] .chat-message-copy {
  display: block;
  max-width: 100%;
}
.mode-page[data-page='chat'] .chat-message.user .chat-message-copy {
  padding: 12px 14px !important;
}
.mode-page[data-page='chat'] .assistant-actions {
  margin-top: 7px !important;
  margin-left: 0 !important;
}
.prompt-dock[data-composer='chat'] textarea {
  min-height: 52px;
  height: 52px;
  max-height: 220px;
  overflow-x: hidden !important;
  overflow-y: hidden;
  resize: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (max-width: 900px) {
  .mode-page[data-page='chat'] .conversation {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  .mode-page[data-page='chat'] .chat-message.user {
    max-width: 86% !important;
    min-width: 0 !important;
  }
}

/* Director / Video Production 2.0 — extends locked V3 workbench without redefining global shell */
.chat-mode-host {
  min-height: 0;
  height: 100%;
  position: relative;
}
.chat-mode-panel {
  display: none;
  min-height: 0;
  height: 100%;
}
.chat-mode-panel.active {
  display: block;
  animation: directorPanelIn 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes directorPanelIn {
  from {
    opacity: 0;
    transform: translateX(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.chat-mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 154px;
  height: 32px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f5f8;
}
.chat-mode-switch > span {
  position: absolute;
  left: 3px;
  top: 3px;
  width: calc(50% - 3px);
  height: 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(31, 42, 60, 0.07);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-mode-switch[data-chat-mode-switch='director'] > span {
  transform: translateX(100%);
  background: #fff7ef;
}
.chat-mode-switch button {
  z-index: 1;
  border: 0;
  background: transparent;
  color: #7a8595;
  font-size: 10px;
  font-weight: 700;
}
.chat-mode-switch button.active {
  color: #29313e;
}
.director-toggle button.active {
  color: #d87836;
}
.director-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  overflow: hidden;
}
.director-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 3px 3px;
}
.director-header strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
  margin-top: 3px;
}
.director-header p {
  margin: 4px 0 0;
  color: #8792a1;
  font-size: 10px;
}
.director-project-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.director-project-meta span {
  height: 27px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfe;
  color: #6e7989;
  font-size: 9px;
  display: flex;
  align-items: center;
}
.director-context {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #eee6df;
  border-radius: 11px;
  background: #fffaf5;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}
.director-context::-webkit-scrollbar {
  display: none;
}
.director-context span {
  white-space: nowrap;
  font-size: 9px;
  color: #705f54;
}
.director-context b {
  font-weight: 700;
  color: #392e29;
}
.director-stage-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 1px;
  overflow-x: auto;
  scrollbar-width: none;
}
.director-stage-bar::-webkit-scrollbar {
  display: none;
}
.director-stage-bar button {
  min-height: 42px;
  flex: none;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #8993a0;
  font-size: 9px;
  font-weight: 700;
  transition: 0.16s ease;
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  align-items: center;
  column-gap: 4px;
  text-align: left;
}
.director-stage-bar button:hover {
  background: #faf6f2;
  color: #5d4a3e;
}
.director-stage-bar button.active {
  background: #fff5eb;
  border-color: #f3deca;
  color: #cf7234;
}
.director-stage-bar button i {
  font-style: normal;
  opacity: 0.62;
}
.director-stage-bar button em {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-style: normal;
  font-size: 8px;
  font-weight: 500;
  opacity: 0.72;
}
.director-stage-bar button.complete:not(.active) em {
  color: #3d8a66;
}
.director-stage-brief {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 7px;
  row-gap: 2px;
  padding: 7px 9px;
  border: 1px solid #eee6df;
  border-radius: 10px;
  background: #fffaf5;
}
.director-stage-brief span {
  font-size: 8px;
  color: #a07152;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.director-stage-brief strong {
  font-size: 10px;
  color: #4c392e;
}
.director-stage-brief small {
  grid-column: 1 / -1;
  color: #81736b;
  font-size: 9px;
  line-height: 1.45;
}
.director-conversation {
  min-height: 0;
  overflow: auto;
  padding: 7px 3px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #d6dce4 transparent;
}
.director-message {
  width: min(790px, 94%);
  flex: none;
}
.director-message.user {
  align-self: flex-end;
  width: auto;
  max-width: min(660px, 84%);
  padding: 10px 12px;
  border-radius: 15px 15px 4px 15px;
  background: #f2f3f6;
  color: #202733;
  font-size: 12px;
  line-height: 1.7;
}
.director-message.assistant {
  align-self: flex-start;
}
.director-assistant-mark {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #6a7482;
  font-size: 10px;
}
.director-assistant-mark img {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  object-fit: contain;
}
.director-message-copy {
  font-size: 12px;
  line-height: 1.75;
  color: #2b3440;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.director-message-actions {
  display: flex;
  gap: 2px;
  align-items: center;
  margin-top: 6px;
  opacity: 0.67;
}
.director-message-actions button {
  height: 27px;
  padding: 0 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #748091;
  font-size: 9px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.director-message-actions button:hover {
  background: #f5f7fa;
  color: #313a48;
}
.director-message-actions svg {
  width: 12px;
  height: 12px;
}
.director-message-actions .send-video {
  color: #c8753e;
}
.director-message-actions .send-video:hover {
  background: #fff5eb;
  color: #b9622d;
}
.director-quick-actions {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.director-quick-actions::-webkit-scrollbar {
  display: none;
}
.director-quick-actions button {
  height: 28px;
  padding: 0 9px;
  border: 1px solid #ece6e0;
  border-radius: 9px;
  background: #fffaf5;
  color: #745b4a;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.director-quick-actions button:hover {
  background: #fff3e7;
  border-color: #eed7c0;
}
.director-dock {
  width: 100% !important;
  margin: 0 !important;
  border-radius: 15px;
  box-shadow: none;
  background: #fbfcfe;
}
.director-dock .dock-input-row textarea {
  max-height: 130px;
}
.director-dock .send-button {
  background: #2b3039;
}
.director-structured {
  margin-top: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbfd;
}
.director-structured strong {
  display: block;
  font-size: 10px;
  margin-bottom: 6px;
}
.director-mini-list {
  display: grid;
  gap: 5px;
}
.director-mini-list div {
  padding: 7px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #edf0f4;
  font-size: 9px;
  color: #677283;
}
.shot-card-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.director-shot-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.director-shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  background: #fbfcfd;
  border-bottom: 1px solid var(--line);
}
.director-shot-head strong {
  font-size: 10px;
}
.director-shot-head span {
  font-size: 9px;
  color: #8b95a3;
}
.director-shot-body {
  padding: 9px 10px;
  display: grid;
  gap: 6px;
  font-size: 9px;
  line-height: 1.55;
  color: #5e6978;
}
.director-shot-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.director-shot-tags span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f4f6f9;
  color: #748091;
}
.director-shot-actions {
  display: flex;
  gap: 5px;
  padding: 0 10px 9px;
}
.director-shot-actions button {
  height: 25px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #687484;
  font-size: 8px;
}
.director-shot-actions button:hover {
  background: #fff5eb;
  color: #b9622d;
  border-color: #efd8c4;
}

.video-production-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) auto;
  gap: 10px;
}
.video-project-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}
.video-project-strip strong {
  display: block;
  font-size: 12px;
}
.video-project-strip span {
  display: block;
  margin-top: 2px;
  color: #8b95a4;
  font-size: 9px;
}
.video-progress {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #7c8797;
  font-size: 9px;
}
.video-progress i {
  display: block;
  width: 110px;
  height: 5px;
  background: #edf0f4;
  border-radius: 999px;
  overflow: hidden;
}
.video-progress b {
  display: block;
  width: 0;
  height: 100%;
  background: #e8894e;
  transition: width 0.3s ease;
}
.video-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 260px;
  gap: 10px;
}
.video-shot-queue,
.video-preview-panel,
.video-shot-inspector {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  overflow: hidden;
}
.video-shot-queue,
.video-shot-inspector {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.video-panel-head {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}
.video-panel-head strong {
  display: block;
  font-size: 11px;
}
.video-panel-head span {
  display: block;
  margin-top: 2px;
  color: #8c96a4;
  font-size: 9px;
}
.video-shot-list {
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.video-shot-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  text-align: left;
}
.video-shot-item:hover,
.video-shot-item.active {
  background: #fff7f0;
  border-color: #f1d9c4;
}
.video-shot-number {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f0f2f6;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 800;
  color: #687485;
}
.video-shot-copy strong {
  display: block;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.video-shot-copy small {
  display: block;
  margin-top: 2px;
  color: #8a95a4;
  font-size: 8px;
}
.video-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c7ced7;
}
.video-status.queued {
  background: #e3b563;
}
.video-status.processing {
  background: #7197e8;
  box-shadow: 0 0 0 3px rgba(113, 151, 232, 0.1);
}
.video-status.succeeded {
  background: #31aa78;
}
.video-status.failed {
  background: #dd6672;
}
.video-status.cancelled {
  background: #9aa4b1;
}
.video-preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.video-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
}
.video-preview-head strong {
  display: block;
  font-size: 12px;
}
.video-preview-head span {
  font-size: 9px;
  color: #8b95a4;
}
.video-job-actions {
  display: flex;
  gap: 5px;
}
.video-job-actions button {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #657181;
  font-size: 8px;
}
.video-preview-stage {
  min-height: 0;
  margin: 10px;
  border-radius: 13px;
  background: #111721;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.video-preview-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #090d13;
}
.video-preview-stage .workspace-empty {
  color: #adb5c2;
}
.video-preview-stage .workspace-empty strong {
  color: #e9edf3;
}
.video-processing {
  display: grid;
  place-items: center;
  gap: 9px;
  color: #d3dae4;
  text-align: center;
}
.video-processing-ring {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #ea9459;
  border-radius: 50%;
  animation: videoSpin 0.8s linear infinite;
}
@keyframes videoSpin {
  to {
    transform: rotate(360deg);
  }
}
.video-version-strip {
  min-height: 42px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.video-version-chip {
  height: 28px;
  flex: none;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #778292;
  font-size: 8px;
}
.video-version-chip.active {
  background: #fff6ee;
  border-color: #efd7c3;
  color: #ba6631;
}
.video-shot-inspector > div:last-child {
  overflow: auto;
  padding: 10px;
}
.video-context-group {
  margin-bottom: 10px;
}
.video-context-group strong {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
}
.video-context-group p {
  margin: 0;
  color: #6e7988;
  font-size: 8.5px;
  line-height: 1.55;
}
.video-context-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.video-context-tags span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f5f7fa;
  color: #7b8594;
  font-size: 8px;
}
.video-composer {
  width: 100% !important;
  margin: 0 !important;
  border-radius: 16px;
}
.video-methods {
  display: flex;
  gap: 4px;
}
.video-methods button {
  height: 31px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fb;
  color: #768191;
  font-size: 9px;
  font-weight: 700;
}
.video-methods button.active {
  background: #fff3e8;
  border-color: #efd4bc;
  color: #bd6731;
}
.video-method-guide {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #dce8df;
  border-radius: 10px;
  background: #f4faf6;
  color: #52675a;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}
.video-method-guide strong {
  color: #2f7a4b;
  white-space: nowrap;
}
.video-method-guide.is-blocked {
  border-color: #f0d4c7;
  background: #fff7f2;
  color: #855e4b;
}
.video-method-guide.is-blocked strong {
  color: #bc5b32;
}
.video-composer .send-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.25);
}
.video-reference-tray {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  min-height: 0;
}
.video-reference-pill {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fb;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  color: #687484;
}
.video-reference-pill img {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
}

@media (max-width: 1280px) {
  .video-workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .video-shot-inspector {
    display: none;
  }
}
@media (max-width: 900px) {
  .director-header {
    align-items: flex-start;
  }
  .director-project-meta {
    max-width: 48%;
  }
  .video-workspace {
    grid-template-columns: 1fr;
  }
  .video-shot-queue {
    max-height: 180px;
  }
  .video-shot-inspector {
    display: none;
  }
  .video-shot-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chat-mode-switch {
    width: 144px;
  }
}

/* =========================================================
   AI Workbench 2.1 · Conversation stability + Drama Studio
   Scope: AI Chat normal mode and AI Video production only.
   Other modes intentionally inherit the frozen workbench UI.
   ========================================================= */

/* ---------- GPT-like normal chat: fixed viewport + fixed composer ---------- */
.mode-page[data-page='chat'] {
  overflow: hidden;
}
.mode-page[data-page='chat'] .chat-mode-host,
.mode-page[data-page='chat'] .chat-mode-panel,
.mode-page[data-page='chat'] .llm-chat-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.mode-page[data-page='chat'] .llm-chat-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}
.llm-conversation-viewport {
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: #fff;
}
.mode-page[data-page='chat'] .llm-conversation-viewport .conversation {
  position: absolute;
  inset: 0;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 30px max(22px, calc((100% - 760px) / 2)) 42px !important;
  display: flex;
  flex-direction: column;
  gap: 24px !important;
  align-items: stretch !important;
  box-sizing: border-box;
}
.mode-page[data-page='chat'] .chat-message {
  width: 100% !important;
  max-width: 760px !important;
  margin: 0 auto !important;
  flex: 0 0 auto !important;
  align-self: stretch !important;
  font-size: 14px;
  line-height: 1.78;
}
.mode-page[data-page='chat'] .chat-message.assistant {
  padding: 0 !important;
  background: transparent !important;
}
.mode-page[data-page='chat'] .chat-message.user {
  width: fit-content !important;
  max-width: min(620px, 82%) !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: max(0px, calc((100% - 760px) / 2)) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
}
.mode-page[data-page='chat'] .chat-message.user .chat-message-copy {
  padding: 10px 14px !important;
  border: 1px solid #e8ebf0;
  border-radius: 18px 18px 5px 18px;
  background: #f3f4f6 !important;
  color: #232a35 !important;
}
.mode-page[data-page='chat'] .chat-message.assistant .chat-message-copy {
  padding: 2px 0 !important;
  color: #222a35 !important;
  font-size: 14px;
  line-height: 1.82;
}
.mode-page[data-page='chat'] .assistant-mark {
  margin-bottom: 9px;
  font-size: 11px;
}
.mode-page[data-page='chat'] .assistant-actions {
  margin-top: 9px !important;
}
.llm-composer-zone {
  flex: none;
  position: relative;
  z-index: 8;
  padding: 8px 0 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 24%, #fff 100%);
}
.llm-composer-zone::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -28px;
  height: 34px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.94));
}
.prompt-dock.llm-composer {
  width: min(780px, calc(100% - 32px));
  margin: 0 auto;
  padding: 9px 10px 7px;
  gap: 7px;
  border: 1px solid #dfe3e9;
  border-radius: 22px;
  background: #fff;
  box-shadow:
    0 10px 30px rgba(24, 32, 47, 0.08),
    0 1px 2px rgba(24, 32, 47, 0.03);
}
.prompt-dock.llm-composer .dock-input-row {
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}
.prompt-dock.llm-composer textarea,
.prompt-dock[data-composer='chat'] textarea {
  height: 58px !important;
  min-height: 58px !important;
  max-height: 58px !important;
  overflow-y: auto !important;
  resize: none !important;
  padding: 11px 10px 9px !important;
  border: 0 !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: none !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}
.prompt-dock.llm-composer textarea:focus {
  outline: 0 !important;
  box-shadow: none !important;
}
.prompt-dock.llm-composer .send-button {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  box-shadow: none;
  align-self: center;
}
.llm-composer-tools {
  min-height: 30px;
  padding: 0 2px;
  gap: 6px;
  flex-wrap: nowrap;
}
.llm-composer-tools .chat-mode-switch {
  height: 30px;
  width: 148px;
}
.llm-composer-tools .chat-mode-switch > span {
  height: 22px;
}
.llm-composer-tools .select-trigger,
.llm-composer-tools .dock-chip {
  height: 30px;
}
.llm-composer-spacer {
  flex: 1 1 auto;
  min-width: 8px;
}
.llm-composer-tip {
  flex: none;
  color: #a0a8b4;
  font-size: 9px;
  white-space: nowrap;
}
.llm-disclaimer {
  text-align: center;
  color: #a3aab4;
  font-size: 9px;
  line-height: 1.4;
  margin-top: 6px;
}
.chat-empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 36px 0;
}
.chat-empty-inner {
  width: min(620px, 100%);
  text-align: center;
}
.chat-empty-brand {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 auto 12px;
}
.chat-empty-inner h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
  color: #242b36;
}
.chat-empty-inner p {
  margin: 8px 0 18px;
  color: #8a94a3;
  font-size: 11px;
}
.chat-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  text-align: left;
}
.chat-suggestion {
  padding: 11px 12px;
  border: 1px solid #e6e9ee;
  border-radius: 13px;
  background: #fff;
  color: #4f5967;
  font-size: 10px;
  line-height: 1.5;
  transition: 0.16s ease;
}
.chat-suggestion:hover {
  background: #f8f9fb;
  border-color: #dce1e8;
  color: #242c38;
  transform: translateY(-1px);
}

/* ---------- Director: keep the same stateful architecture, fix viewport discipline ---------- */
.mode-page[data-page='chat'] .director-shell {
  height: 100%;
  min-height: 0;
}
.mode-page[data-page='chat'] .director-conversation {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.mode-page[data-page='chat'] .director-dock {
  flex: none;
}

/* ---------- Professional drama production station ---------- */
.mode-page[data-page='animation'] {
  overflow: hidden;
}
.drama-studio-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 58px 58px minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}
.drama-project-strip {
  min-width: 0;
  padding: 0 15px;
  border-radius: 16px;
}
.drama-project-copy {
  min-width: 0;
}
.drama-project-copy .micro-label {
  font-size: 8px;
  letter-spacing: 0.11em;
}
.drama-project-copy strong {
  font-size: 13px;
  margin-top: 1px;
}
.drama-project-copy > span:last-child {
  font-size: 9px;
}
.drama-project-metrics {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.drama-project-metrics > span {
  height: 28px;
  display: flex !important;
  align-items: center;
  margin: 0 !important;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfd;
  color: #748092 !important;
  font-size: 8px !important;
  white-space: nowrap;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drama-project-metrics .video-progress {
  padding-left: 3px;
}
.drama-production-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 5px;
  overflow: hidden;
}
.drama-production-nav button {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  border-radius: 11px;
  padding: 6px 10px;
  color: #7a8594;
  transition: 0.16s ease;
}
.drama-production-nav button:hover {
  background: #faf8f6;
  color: #505a68;
}
.drama-production-nav button.active {
  background: #fff5ed;
  color: #b85f2f;
  box-shadow: inset 0 0 0 1px #f1d8c4;
}
.drama-production-nav button i {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #f2f4f7;
  color: #858f9e;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
}
.drama-production-nav button.active i {
  background: #e9874c;
  color: #fff;
}
.drama-production-nav button.complete:not(.active) i {
  background: #e8f6ef;
  color: #347a59;
}
.drama-production-nav button.complete:not(.active) i::after {
  content: '✓';
  margin-left: 2px;
}
.drama-production-nav button.attention:not(.active) small {
  color: #a26e42;
}
.drama-production-nav button strong {
  display: block;
  font-size: 10px;
  color: #39424f;
}
.drama-production-nav button.active strong {
  color: #9f5128;
}
.drama-production-nav button small {
  display: block;
  margin-top: 2px;
  font-size: 8px;
  color: #9ca5b2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drama-production-body {
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.drama-view-panel {
  position: absolute;
  inset: 0;
  min-height: 0;
  display: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.drama-view-panel.active {
  display: grid;
  animation: dramaViewIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes dramaViewIn {
  from {
    opacity: 0.35;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* asset library */
.drama-view-panel[data-video-view-panel='assets'] {
  grid-template-rows: auto auto minmax(0, 1fr);
}
.asset-workbench-head,
.storyboard-workbench-head,
.delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
}
.asset-workbench-head strong,
.storyboard-workbench-head strong,
.delivery-head strong {
  display: block;
  font-size: 12px;
  color: #303946;
}
.asset-workbench-head span,
.storyboard-workbench-head span,
.delivery-head span {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  color: #8c96a5;
  line-height: 1.45;
}
.asset-category-tabs {
  height: 45px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.asset-category-tabs::-webkit-scrollbar {
  display: none;
}
.asset-category-tabs button {
  height: 30px;
  flex: none;
  padding: 0 10px;
  border-radius: 9px;
  color: #778292;
  font-size: 9px;
  font-weight: 700;
}
.asset-category-tabs button:hover {
  background: #f6f7f9;
  color: #424b58;
}
.asset-category-tabs button.active {
  background: #fff2e8;
  color: #b86131;
  box-shadow: inset 0 0 0 1px #efd6c0;
}
.asset-category-tabs button b {
  font-size: 8px;
  margin-left: 4px;
  opacity: 0.58;
}
.drama-asset-grid {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  align-content: start;
  background: #fafbfd;
}
.drama-asset-card {
  min-width: 0;
  border: 1px solid #e4e8ee;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: 0.16s ease;
}
.drama-asset-card:hover {
  transform: translateY(-1px);
  border-color: #d9dee6;
  box-shadow: 0 8px 20px rgba(34, 43, 57, 0.05);
}
.drama-asset-media {
  height: 126px;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #edf0f4, #f8f9fb);
  overflow: hidden;
}
.drama-asset-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.drama-asset-placeholder {
  display: grid;
  place-items: center;
  gap: 6px;
  color: #a0a8b4;
  font-size: 9px;
  text-align: center;
}
.drama-asset-placeholder i {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #e4e8ee;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 800;
  color: #7c8796;
}
.asset-lock-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  background: rgba(20, 27, 38, 0.76);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.drama-asset-copy {
  padding: 10px;
}
.drama-asset-copy strong {
  display: block;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drama-asset-copy p {
  margin: 4px 0 0;
  height: 30px;
  overflow: hidden;
  color: #7e8998;
  font-size: 8.5px;
  line-height: 1.45;
}
.drama-asset-meta {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.drama-asset-meta span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f4f6f8;
  color: #818b99;
  font-size: 7.5px;
}
.drama-asset-actions {
  display: flex;
  gap: 5px;
  padding: 0 10px 10px;
}
.drama-asset-actions button {
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #687484;
  font-size: 8px;
}
.drama-asset-actions button.primary {
  border-color: #efd3bb;
  background: #fff4eb;
  color: #b65e2f;
}

/* storyboard production */
.drama-view-panel[data-video-view-panel='storyboard'] {
  grid-template-rows: auto minmax(0, 1fr);
}
.storyboard-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.storyboard-production-grid {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  align-content: start;
  background: #fafbfd;
}
.storyboard-production-card {
  border: 1px solid #e4e8ee;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  transition: 0.16s ease;
  cursor: pointer;
}
.storyboard-production-card:hover,
.storyboard-production-card.active {
  border-color: #efd2ba;
  box-shadow: 0 8px 22px rgba(42, 48, 58, 0.05);
}
.storyboard-frame {
  height: 128px;
  background: #1a202a;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
}
.storyboard-frame-half {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #26313f, #485869);
  color: #aeb8c5;
  font-size: 8px;
  overflow: hidden;
}
.storyboard-frame-half img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.storyboard-frame-half.end {
  background: linear-gradient(145deg, #3b3540, #675459);
}
.storyboard-shot-label {
  position: absolute;
  left: 8px;
  top: 8px;
  height: 23px;
  padding: 0 7px;
  border-radius: 7px;
  background: rgba(12, 17, 24, 0.76);
  color: #fff;
  display: flex;
  align-items: center;
  font-size: 8px;
  font-weight: 800;
}
.storyboard-shot-status {
  position: absolute;
  right: 8px;
  top: 8px;
  height: 23px;
  padding: 0 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: #687484;
  display: flex;
  align-items: center;
  font-size: 7.5px;
  font-weight: 700;
}
.storyboard-card-copy {
  padding: 10px;
}
.storyboard-card-copy > strong {
  display: block;
  font-size: 10px;
}
.storyboard-card-copy p {
  margin: 5px 0 0;
  height: 34px;
  overflow: hidden;
  color: #6e7988;
  font-size: 8.5px;
  line-height: 1.5;
}
.storyboard-card-meta {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.storyboard-card-meta span {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f4f6f8;
  color: #7b8695;
  font-size: 7.5px;
}
.storyboard-card-actions {
  display: flex;
  gap: 5px;
  padding: 0 10px 10px;
}
.storyboard-card-actions button {
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #667283;
  font-size: 8px;
}
.storyboard-card-actions button.primary {
  background: #fff3e9;
  border-color: #efd3bd;
  color: #b45f31;
}

/* generation: keep high-value queue/preview/composer, remove dashboard feel */
.drama-view-panel[data-video-view-panel='generation'] {
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 10px;
  background: #f8f9fb;
}
.drama-view-panel[data-video-view-panel='generation'].active {
  display: grid;
}
.production-generation-workspace {
  height: 100%;
  min-height: 0;
  grid-template-columns: 210px minmax(0, 1fr) 245px;
  gap: 9px;
}
.production-generation-workspace .video-shot-queue,
.production-generation-workspace .video-preview-panel,
.production-generation-workspace .video-shot-inspector {
  border-radius: 14px;
}
.production-generation-workspace .video-preview-stage {
  margin: 8px;
}
.video-composer {
  flex: none;
  background: #fff !important;
  border-radius: 15px !important;
  box-shadow: 0 8px 24px rgba(28, 36, 49, 0.05) !important;
}
.video-composer textarea {
  min-height: 54px !important;
  max-height: 86px !important;
}

/* delivery */
.drama-view-panel[data-video-view-panel='delivery'] {
  grid-template-rows: auto auto minmax(0, 1fr);
}
.delivery-head {
  min-height: 58px;
}
.delivery-head > div {
  max-width: 760px;
}
.delivery-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}
.delivery-metric {
  padding: 9px 10px;
  border: 1px solid #e6e9ee;
  border-radius: 11px;
  background: #fff;
}
.delivery-metric span {
  display: block;
  color: #929ba8;
  font-size: 8px;
}
.delivery-metric strong {
  display: block;
  margin-top: 4px;
  color: #303946;
  font-size: 15px;
}
.delivery-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 10px;
  padding: 10px;
  background: #fafbfd;
}
.delivery-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 7px;
}
.delivery-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid #e4e8ee;
  border-radius: 11px;
  background: #fff;
}
.delivery-row-index {
  width: 42px;
  height: 32px;
  border-radius: 8px;
  background: #f1f3f6;
  display: grid;
  place-items: center;
  color: #667281;
  font-size: 8px;
  font-weight: 800;
}
.delivery-row strong {
  display: block;
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.delivery-row small {
  display: block;
  margin-top: 2px;
  color: #8c96a5;
  font-size: 8px;
}
.delivery-row-actions {
  display: flex;
  gap: 5px;
}
.delivery-row-actions button {
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #667282;
  font-size: 8px;
}
.delivery-export-panel {
  align-self: start;
  padding: 13px;
  border: 1px solid #e2e6ec;
  border-radius: 13px;
  background: #fff;
}
.delivery-export-panel > strong {
  display: block;
  font-size: 11px;
}
.delivery-export-panel p {
  margin: 6px 0 12px;
  color: #7c8796;
  font-size: 8.5px;
  line-height: 1.55;
}
.delivery-export-panel button {
  width: 100%;
  height: 34px;
  margin-top: 6px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 9px;
}
.delivery-export-panel button svg {
  width: 13px;
  height: 13px;
}
.delivery-export-panel .primary-action {
  background: #262d38;
  color: #fff;
  border: 1px solid #262d38;
}
.delivery-export-panel .ghost-action {
  background: #fff;
  border: 1px solid var(--line);
  color: #667282;
}

/* Responsive: keep every production function reachable; never hide core panels. */
@media (max-width: 1180px) {
  .drama-project-metrics > span#videoProjectStyle {
    display: none !important;
  }
  .production-generation-workspace {
    grid-template-columns: 185px minmax(0, 1fr) 220px;
  }
}
@media (max-width: 980px) {
  .llm-composer-tip {
    display: none;
  }
  .drama-studio-shell {
    grid-template-rows: 58px 54px minmax(0, 1fr);
  }
  .drama-production-nav button {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 5px 7px;
  }
  .drama-production-nav button i {
    width: 24px;
    height: 24px;
  }
  .drama-production-nav button small {
    display: none;
  }
  .production-generation-workspace {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .production-generation-workspace .video-shot-inspector {
    display: none;
  }
  .delivery-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
  }
}
@media (max-width: 760px) {
  .mode-page[data-page='chat'] .llm-conversation-viewport .conversation {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .prompt-dock.llm-composer {
    width: calc(100% - 16px);
  }
  .chat-suggestion-grid {
    grid-template-columns: 1fr;
  }
  .drama-project-metrics > span {
    display: none !important;
  }
  .drama-production-nav {
    grid-template-columns: repeat(4, 1fr);
  }
  .drama-production-nav button {
    display: flex;
    justify-content: center;
    padding: 5px;
  }
  .drama-production-nav button span {
    display: none;
  }
  .production-generation-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 135px minmax(0, 1fr);
  }
  .production-generation-workspace .video-shot-queue {
    grid-template-rows: auto minmax(0, 1fr);
  }
  .production-generation-workspace .video-shot-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .production-generation-workspace .video-shot-item {
    min-width: 170px;
  }
  .delivery-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .delivery-export-panel {
    order: -1;
  }
  .delivery-list {
    overflow: visible;
  }
}

/* Professional brush studio */
.painting-pro-brush-studio {
  width: min(1180px, 92vw);
  max-height: min(820px, 88vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  color: #20231f;
}
.painting-pro-brush-studio > header,
.painting-pro-brush-studio > footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}
.painting-pro-brush-studio > header label {
  flex: 1;
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
}
.painting-pro-brush-studio input,
.painting-pro-brush-studio select {
  min-height: 36px;
  border: 1px solid #cfd4cc;
  border-radius: 8px;
  background: #fff;
  color: #20231f;
  padding: 6px 9px;
}
.painting-pro-brush-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(420px, 1.25fr);
  gap: 14px;
}
.painting-pro-brush-sections {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.painting-pro-brush-sections details {
  margin-bottom: 8px;
  border: 1px solid #dfe3dc;
  border-radius: 10px;
  background: #fafbf8;
  overflow: clip;
}
.painting-pro-brush-sections summary {
  cursor: pointer;
  padding: 11px 13px;
  color: #182019;
  font-size: 14px;
  font-weight: 720;
  background: #f2f5ef;
}
.painting-pro-brush-sections details > div {
  display: grid;
  gap: 10px;
  padding: 12px;
}
.painting-pro-range,
.painting-pro-toggle,
.painting-pro-select {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.4fr);
  align-items: center;
  gap: 12px;
  min-height: 32px;
  font-size: 13px;
}
.painting-pro-range > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.painting-pro-range output {
  color: #477562;
  font-variant-numeric: tabular-nums;
}
.painting-pro-toggle input {
  justify-self: end;
  min-height: auto;
  width: 38px;
}
.painting-pro-source {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px 12px;
}
.painting-pro-source small {
  grid-column: 1/-1;
  color: #687069;
  line-height: 1.55;
}
.painting-pro-practice {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  gap: 9px;
  border: 1px solid #d9ddd5;
  border-radius: 12px;
  padding: 12px;
  background: #eef1ea;
}
.painting-pro-practice > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.painting-pro-practice canvas {
  width: 100%;
  height: 100%;
  min-height: 320px;
  border: 1px solid #cbd0c7;
  border-radius: 9px;
  background: #f7f4ed;
  cursor: crosshair;
  touch-action: none;
}
.painting-pro-practice small {
  color: #687069;
  font-size: 12px;
}
.painting-pro-brush-studio > footer {
  justify-content: flex-end;
  border-top: 1px solid #e1e4de;
  padding-top: 12px;
}
@media (max-width: 900px) {
  .painting-pro-brush-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .painting-pro-brush-sections {
    overflow: visible;
  }
  .painting-pro-practice canvas {
    min-height: 260px;
  }
}

/* AI 绘画：真实分块画布、专业笔刷与服务端项目工作区 */
.mode-painting,
.thumb-painting {
  background: linear-gradient(135deg, #d9efe6, #b8d9cd) !important;
  color: #315f51 !important;
}
.mode-page[data-page='painting'] {
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  background: #e7e5df;
}
.painting-page-head {
  border-bottom-color: #d5d2ca;
  background: rgba(250, 249, 246, 0.94);
}
.painting-page-head h1 {
  letter-spacing: -0.035em;
}
.painting-sync-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #d9d7d0;
  border-radius: 999px;
  background: #f5f4f0;
  color: #74716a;
  font-size: 10px;
  white-space: nowrap;
}
.painting-sync-state[data-tone='ok'] {
  border-color: #b8d8ca;
  background: #eef8f3;
  color: #39715d;
}
.painting-sync-state[data-tone='busy'] {
  border-color: #c8c1a7;
  background: #faf6e8;
  color: #77682e;
}
.painting-sync-state[data-tone='local'] {
  border-color: #c7cfdf;
  background: #f1f4fa;
  color: #566683;
}
.painting-sync-state[data-tone='error'] {
  border-color: #e4bdb7;
  background: #fff1ef;
  color: #a45449;
}
.primary-painting {
  border-color: #2f5c50 !important;
  background: #315f51 !important;
  color: #fff !important;
}
.painting-app {
  display: grid;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.painting-loading {
  align-self: center;
}
.painting-stage-flow {
  display: grid;
  grid-template-columns: repeat(8, minmax(82px, 1fr));
  gap: 1px;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #ccc9c1;
  background: #d8d5ce;
}
.painting-stage-flow button {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 7px 9px;
  border: 0;
  background: #f3f2ee;
  color: #77736c;
  text-align: left;
}
.painting-stage-flow button:first-child {
  border-radius: 10px 0 0 10px;
}
.painting-stage-flow button:last-child {
  border-radius: 0 10px 10px 0;
}
.painting-stage-flow button:hover {
  background: #fff;
}
.painting-stage-flow button.active {
  background: #2d574c;
  color: #fff;
  box-shadow: 0 4px 16px rgba(35, 76, 64, 0.18);
}
.painting-stage-flow i {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  margin-right: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
  opacity: 0.66;
}
.painting-stage-flow span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.painting-stage-flow strong {
  font-size: 11px;
}
.painting-stage-flow small {
  overflow: hidden;
  font-size: 8px;
  opacity: 0.67;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.painting-workbench {
  display: grid;
  grid-template-columns: 218px minmax(380px, 1fr) 288px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.painting-brush-panel,
.painting-side-panel,
.painting-canvas-panel {
  min-width: 0;
  min-height: 0;
}
.painting-brush-panel,
.painting-side-panel {
  overflow: auto;
  background: #f7f6f2;
  scrollbar-width: thin;
}
.painting-brush-panel {
  border-right: 1px solid #cbc9c2;
}
.painting-side-panel {
  border-left: 1px solid #cbc9c2;
}
.painting-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 47px;
  padding: 9px 11px;
  border-bottom: 1px solid #dddad3;
}
.painting-panel-head > span {
  display: grid;
  gap: 2px;
}
.painting-panel-head strong {
  color: #393733;
  font-size: 11px;
}
.painting-panel-head small,
.painting-panel-head > i {
  color: #8c8880;
  font-size: 8px;
  font-style: normal;
}
.painting-panel-head button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #d7d4cc;
  border-radius: 7px;
  background: #fff;
  color: #5f5c56;
}
.painting-brush-list {
  display: grid;
  gap: 4px;
  max-height: 244px;
  padding: 8px;
  overflow: auto;
}
.painting-brush-list button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}
.painting-brush-list button:hover,
.painting-brush-list button.active {
  border-color: #c5d5cf;
  background: #e7f0ec;
}
.painting-brush-list button > i {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: #e2dfd8;
}
.painting-brush-list button > i::after {
  width: var(--brush-size);
  height: var(--brush-size);
  border-radius: 50%;
  background: #37342f;
  content: '';
}
.painting-brush-list button > i.has-tip {
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
.painting-brush-list button > i.has-tip::after {
  display: none;
}
.painting-brush-list button > span {
  display: grid;
  gap: 2px;
}
.painting-brush-list strong {
  color: #403d38;
  font-size: 10px;
}
.painting-brush-list small {
  color: #8d8981;
  font-size: 8px;
}
.painting-settings {
  display: grid;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid #dedbd4;
}
.painting-range {
  display: grid;
  gap: 4px;
}
.painting-range > span {
  display: flex;
  justify-content: space-between;
  color: #77736d;
  font-size: 9px;
}
.painting-range b {
  color: #3c514a;
  font-weight: 600;
}
.painting-range input {
  width: 100%;
  accent-color: #356457;
}
.painting-pressure-map {
  display: grid;
  gap: 7px;
  margin: 0 10px 10px;
  padding: 10px;
  border: 1px solid #ddd9d0;
  border-radius: 9px;
  background: #efeee9;
}
.painting-pressure-map strong {
  color: #555149;
  font-size: 9px;
}
.painting-pressure-map label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #77726a;
  font-size: 8px;
}
.painting-pressure-map input {
  accent-color: #356457;
}
.painting-save-brush {
  width: calc(100% - 20px);
  min-height: 32px;
  margin: 0 10px 12px;
  border: 1px solid #c7cec9;
  border-radius: 8px;
  background: #fff;
  color: #3e6258;
  font-size: 9px;
}
.painting-brush-shortcuts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 8px;
  margin: 0 10px 10px;
  padding: 8px;
  border: 1px solid #d5d9d4;
  border-radius: 8px;
  background: #edf2ef;
  color: #4f625c;
  font-size: 8px;
}
.painting-brush-shortcuts > div {
  display: flex;
  gap: 4px;
}
.painting-brush-shortcuts button {
  min-width: 38px;
  min-height: 25px;
  border: 1px solid #bdccc6;
  border-radius: 6px;
  background: #fff;
  color: #315f51;
  font: inherit;
}
.painting-brush-shortcuts small {
  grid-column: 1 / -1;
  color: #77837f;
  line-height: 1.45;
}
.painting-tool-control-panel {
  display: grid;
  gap: 12px;
}
.painting-tool-control-summary {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #edf2ef;
}
.painting-tool-control-summary strong {
  color: #304f46;
  font-size: 11px;
}
.painting-tool-control-summary span,
.painting-tool-control-note {
  color: #737d79;
  font-size: 9px;
  line-height: 1.55;
}
.painting-tool-size-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.painting-tool-size-steps button {
  min-height: 34px;
  border: 1px solid #c8d1cd;
  border-radius: 8px;
  background: #fff;
  color: #365e53;
}
.painting-tool-size-steps output {
  min-width: 72px;
  color: #263e37;
  font:
    600 11px ui-monospace,
    monospace;
  text-align: center;
}
.painting-tool-control-panel > .painting-settings {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #dedbd4;
  border-radius: 10px;
}
.painting-tool-control-panel > .painting-pressure-map {
  margin: 0;
}
.painting-tool-control-note {
  margin: 0;
  padding: 9px 11px;
  border-left: 3px solid #73988c;
  background: #f5f7f6;
}
.painting-tool-control-note kbd {
  padding: 1px 4px;
  border: 1px solid #c8cfcc;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fff;
  color: #41524d;
  font:
    600 8px ui-monospace,
    monospace;
}
.painting-canvas-panel {
  display: grid;
  grid-template-rows: 50px auto minmax(0, 1fr) 29px;
  background: #b7b5b0;
}
.painting-canvas-panel > .painting-toolbar {
  grid-row: 1;
}
.painting-canvas-panel > .painting-selection-bar {
  grid-row: 2;
}
.painting-canvas-panel > .painting-canvas-stage {
  grid-row: 3;
}
.painting-canvas-panel > .painting-canvas-status {
  grid-row: 4;
}
.painting-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-bottom: 1px solid #c9c6bf;
  background: #f5f4f0;
}
.painting-selection-bar {
  z-index: 4;
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  overflow-x: auto;
  border-bottom: 1px solid #c9c6bf;
  background: #eeefeb;
  color: #56544f;
  font-size: 10px;
  white-space: nowrap;
  scrollbar-width: thin;
}
.painting-selection-bar[hidden] {
  display: none !important;
}
.painting-selection-bar strong {
  color: #285a4c;
  font-size: 11px;
}
.painting-selection-bar label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.painting-selection-bar select,
.painting-selection-bar button {
  min-height: 27px;
  padding: 0 8px;
  border: 1px solid #c1c8c4;
  border-radius: 6px;
  background: #fff;
  color: #40534d;
  font: inherit;
}
.painting-selection-bar button:hover:not(:disabled) {
  border-color: #84a79c;
  background: #e3efea;
}
.painting-selection-bar button:disabled {
  opacity: 0.45;
}
.painting-selection-tolerance input {
  width: 86px;
  accent-color: #356457;
}
.painting-selection-bar small {
  color: #74716b;
}
.painting-tool-group {
  display: flex;
  align-items: center;
  gap: 3px;
}
.painting-tool-group button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #68645e;
  font-size: 9px;
}
.painting-tool-group button[hidden] {
  display: none !important;
}
.painting-tool-group button:hover,
.painting-tool-group button.active {
  border-color: #c5d4ce;
  background: #e5efeb;
  color: #2f5e50;
}
.painting-tool-group button:disabled {
  opacity: 0.35;
}
.painting-tool-group svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
.painting-tool-letter {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 8px;
}
.painting-color {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #77726b;
  font-family: ui-monospace, monospace;
  font-size: 8px;
}
.painting-color input {
  width: 27px;
  height: 27px;
  padding: 1px;
  border: 1px solid #c8c5bd;
  border-radius: 50%;
  background: #fff;
}
.painting-color button {
  min-width: 35px;
  height: 25px;
  padding: 0 6px;
  border: 1px solid #cbc8c0;
  border-radius: 6px;
  background: #fff;
  color: #4b655d;
  font-size: 8px;
}
.painting-canvas-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #aaa8a3;
  box-shadow: inset 0 1px 18px rgba(35, 33, 30, 0.08);
}
.painting-canvas-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#paintingStrokeCanvas {
  z-index: 2;
  cursor: none;
  touch-action: none;
}
.painting-canvas-stage[data-tool='select'] #paintingStrokeCanvas {
  cursor: default;
}
.painting-canvas-stage[data-tool='hand'] #paintingStrokeCanvas {
  cursor: grab;
}
.painting-canvas-stage[data-tool='hand'][data-dragging='true'] #paintingStrokeCanvas {
  cursor: grabbing;
}
.painting-canvas-stage[data-tool='eyedropper'] #paintingStrokeCanvas {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='m18 3 7 7-4 4-2-2-9 9-5 2 2-5 9-9-2-2z' fill='white' stroke='%23252220' stroke-width='1.5'/%3E%3C/svg%3E")
      4 24,
    crosshair;
}
.painting-canvas-stage[data-tool='zoom'] #paintingStrokeCanvas {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='11' cy='11' r='7' fill='white' stroke='%23252220' stroke-width='2'/%3E%3Cpath d='m16 16 8 8M7 11h8M11 7v8' stroke='%23252220' stroke-width='2'/%3E%3C/svg%3E")
      11 11,
    ew-resize;
}
.painting-canvas-stage[data-tool='lasso'] #paintingStrokeCanvas {
  cursor: crosshair;
}
.painting-canvas-stage[data-tool='region-select'] #paintingStrokeCanvas {
  cursor: cell;
}
.painting-canvas-stage[data-tool='light'] #paintingStrokeCanvas {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='15' r='6' fill='%23fff1a8' stroke='%2345382d' stroke-width='1.5'/%3E%3Cpath d='M15 2v6M15 22v6M2 15h6M22 15h6M6 6l4 4M20 20l4 4M24 6l-4 4M10 20l-4 4' stroke='%2345382d' stroke-width='1.5'/%3E%3C/svg%3E")
      15 15,
    crosshair;
}
.painting-canvas-stage[data-tool='transform'] #paintingStrokeCanvas {
  cursor: move;
}
.painting-brush-cursor {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  box-sizing: border-box;
  border: 1px solid rgba(28, 27, 25, 0.68);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65);
  pointer-events: none;
}
.painting-canvas-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  border-top: 1px solid #c8c5be;
  background: #efeee9;
  color: #77736c;
  font-size: 8px;
  white-space: nowrap;
}
.painting-layers-panel {
  min-height: 280px;
  border-bottom: 1px solid #cbc8c1;
}
.painting-layer-list {
  display: grid;
  max-height: 286px;
  overflow: auto;
}
.painting-layer-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  min-height: 49px;
  border-bottom: 1px solid #e3e0da;
  background: #f8f7f4;
}
.painting-layer-row:hover,
.painting-layer-row.selected,
.painting-layer-row.object-selected,
.painting-layer-row.active {
  background: #e7efeb;
}
.painting-layer-row.is-child .painting-layer-main {
  padding-left: 14px;
}
.painting-layer-row.is-child .painting-layer-thumb {
  width: 25px;
  height: 25px;
}
.painting-layer-row > button:not(.painting-layer-main) {
  height: 100%;
  border: 0;
  background: transparent;
  color: #77736b;
  font-size: 10px;
}
.painting-layer-main {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 100%;
  padding: 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.painting-layer-thumb {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #d4d0c8;
  border-radius: 6px;
  background: linear-gradient(135deg, #fff, #ddd8ce);
  color: #65615a;
  font-size: 9px;
}
.painting-layer-main > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.painting-layer-main strong,
.painting-layer-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.painting-layer-main strong {
  color: #49453f;
  font-size: 9px;
}
.painting-layer-main small {
  color: #938f87;
  font-size: 7.5px;
}
.painting-layer-inspector {
  display: grid;
  gap: 8px;
  padding: 9px 10px 11px;
  background: #efeee9;
}
.painting-layer-inspector > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.painting-layer-selection-summary {
  display: grid;
  gap: 4px;
  padding: 2px 1px;
}
.painting-layer-selection-summary strong {
  color: #49453f;
  font-size: 10px;
}
.painting-layer-selection-summary small {
  color: #77736b;
  font-size: 8px;
  line-height: 1.45;
}
.painting-layer-inspector button,
.painting-layer-inspector select {
  min-height: 27px;
  border: 1px solid #d0cdc5;
  border-radius: 6px;
  background: #fff;
  color: #65615b;
  font-size: 8px;
}
.painting-layer-inspector button.danger {
  color: #a05248;
}
.painting-layer-inspector label {
  display: grid;
  gap: 4px;
  color: #77726b;
  font-size: 8px;
}
.painting-layer-inspector .painting-layer-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #dedbd5;
  border-radius: 7px;
  background: #fff;
  color: #56524c;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.painting-layer-inspector .painting-layer-toggle.active {
  border-color: #8e8172;
  background: #f0ece6;
  color: #272522;
}
.painting-layer-inspector .painting-toggle-mark {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid #aaa39a;
  border-radius: 3px;
  font-size: 9px;
}
.painting-layer-inspector label > span {
  display: flex;
  justify-content: space-between;
}
.painting-layer-inspector input {
  width: 100%;
  accent-color: #356457;
}
.painting-ai-panel {
  padding-bottom: 12px;
}
.painting-ai-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 9px;
}
.painting-ai-actions button {
  display: grid;
  gap: 3px;
  min-height: 49px;
  padding: 7px;
  border: 1px solid #dbd8d1;
  border-radius: 8px;
  background: #fff;
  color: #55514b;
  text-align: left;
}
.painting-ai-actions button.active {
  border-color: #8bb2a5;
  background: #e6f0ec;
  color: #2e5e50;
}
.painting-ai-actions strong {
  font-size: 9px;
}
.painting-ai-actions small {
  color: #969188;
  font-size: 7px;
  line-height: 1.35;
}
.painting-ai-stage-head {
  display: grid;
  gap: 3px;
  margin: 0 9px 7px;
  padding: 9px;
  border: 1px solid #cfded8;
  border-radius: 8px;
  background: #eef5f2;
}
.painting-ai-stage-head strong {
  color: #315f51;
  font-size: 10px;
}
.painting-ai-stage-head small,
.painting-ai-stage-options small,
.painting-ai-context-note {
  color: #777f79;
  font-size: 7.5px;
  line-height: 1.45;
}
.painting-ai-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0 9px 7px;
  padding: 6px 7px;
  border: 1px dashed #d5d1c9;
  border-radius: 7px;
  color: #7a756d;
  font-size: 7.5px;
}
.painting-ai-scope.ready {
  border-color: #7aaa9b;
  background: #edf7f3;
  color: #356457;
}
.painting-ai-scope button,
.painting-ai-stage-options button {
  min-height: 27px;
  border: 1px solid #d4d0c8;
  border-radius: 6px;
  background: #fff;
  color: #5f625d;
  font-size: 7.5px;
}
.painting-ai-stage-options {
  display: grid;
  gap: 6px;
  margin: 0 9px 7px;
}
.painting-ai-stage-options label {
  display: grid;
  gap: 4px;
  color: #6d6962;
  font-size: 8px;
}
.painting-ai-stage-options select {
  min-width: 0;
  height: 30px;
  border: 1px solid #d7d4cc;
  border-radius: 7px;
  background: #fff;
  color: #5f5b55;
  font-size: 8px;
}
.painting-ai-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.painting-ai-context-note {
  padding: 8px;
  border-radius: 7px;
  background: #f1eee7;
}
.painting-ai-panel textarea {
  display: block;
  box-sizing: border-box;
  width: calc(100% - 18px);
  min-height: 66px;
  margin: 0 9px 7px;
  padding: 8px;
  resize: vertical;
  border: 1px solid #d7d4cc;
  border-radius: 8px;
  background: #fff;
  color: #4a4640;
  font: inherit;
  font-size: 9px;
  line-height: 1.5;
}
.painting-ai-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 0 9px 7px;
}
.painting-ai-options select {
  min-width: 0;
  height: 29px;
  border: 1px solid #d7d4cc;
  border-radius: 7px;
  background: #fff;
  color: #69645d;
  font-size: 8px;
}
.painting-ai-run {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: calc(100% - 18px);
  min-height: 36px;
  margin: 0 9px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: #315f51;
  color: #fff;
  font-size: 9px;
}
.painting-ai-run:disabled {
  cursor: progress;
  opacity: 0.64;
}
.painting-empty-state {
  align-self: center;
  justify-self: center;
  width: min(620px, calc(100% - 48px));
  padding: 58px 48px;
  border: 1px solid #d0cdc5;
  border-radius: 18px;
  background: #f7f6f2;
  box-shadow: 0 18px 60px rgba(45, 43, 39, 0.08);
  text-align: center;
}
.painting-empty-mark {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 21px;
  background: #dbeae4;
  color: #315f51;
}
.painting-empty-mark svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.painting-empty-state h2 {
  margin: 7px 0 10px;
  color: #302e2a;
  font-size: 26px;
}
.painting-empty-state p {
  max-width: 500px;
  margin: 0 auto 24px;
  color: #77726a;
  font-size: 12px;
  line-height: 1.75;
}
.painting-empty-state > div:not(.painting-empty-mark) {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.painting-empty-state button {
  min-height: 38px;
  padding: 0 17px;
  border: 1px solid #cbc8bf;
  border-radius: 9px;
  background: #fff;
  color: #5a5650;
}
.painting-empty-state button.primary {
  border-color: #315f51;
  background: #315f51;
  color: #fff;
}
.painting-empty-state > small {
  display: block;
  margin-top: 18px;
  color: #969188;
  font-size: 9px;
}
.painting-create-form,
.painting-version-dialog,
.painting-brush-menu,
.painting-export-result {
  display: grid;
  gap: 14px;
}
.painting-create-form > label,
.painting-create-form > div > label {
  display: grid;
  gap: 6px;
  color: #55514b;
  font-size: 10px;
}
.painting-create-form textarea,
.painting-create-form input,
.painting-version-create input {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #d9d5cd;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.painting-create-form textarea {
  min-height: 92px;
  resize: vertical;
}
.painting-create-form > div:not(.painting-size-presets) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.painting-size-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.painting-size-presets button,
.painting-version-create button,
.painting-version-list button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d4d0c8;
  border-radius: 7px;
  background: #f6f5f1;
  color: #5f5b54;
  font-size: 9px;
}
.painting-version-create {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}
.painting-version-list {
  display: grid;
  gap: 5px;
  max-height: 420px;
  overflow: auto;
}
.painting-version-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid #dedbd4;
  border-radius: 9px;
  background: #fff;
}
.painting-version-list article span {
  display: grid;
  gap: 3px;
}
.painting-version-list strong {
  font-size: 10px;
}
.painting-version-list small,
.painting-form-note,
.painting-brush-menu p {
  color: #89847c;
  font-size: 8px;
  line-height: 1.55;
}
.painting-export-result {
  justify-items: center;
  padding: 18px;
  text-align: center;
}
.painting-export-check {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: #dcefe6;
  color: #2d6a55;
  font-size: 24px;
}
.painting-export-result h3 {
  margin: 0;
  font-size: 16px;
}
.painting-export-result p {
  margin: 0;
  color: #77726a;
  font-size: 10px;
}
.painting-export-result > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}
.painting-export-result a {
  text-decoration: none;
}
.painting-send-dialog {
  display: grid;
  gap: 14px;
}
.painting-send-preview {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e7e2d9;
  border-radius: 12px;
  background: #fbfaf7;
}
.painting-send-preview img {
  width: 88px;
  height: 66px;
  object-fit: contain;
  border-radius: 8px;
  background: #eeeae3;
}
.painting-send-preview span {
  display: grid;
  gap: 4px;
}
.painting-send-preview small,
.painting-send-note {
  color: #77726a;
  font-size: 10px;
  line-height: 1.55;
}
.painting-send-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.painting-send-grid button {
  min-height: 42px;
  border: 1px solid #ddd7cc;
  border-radius: 10px;
  background: #fff;
  color: #4e4a44;
  cursor: pointer;
  text-align: left;
  padding: 9px 11px;
  font-size: 10px;
}
.painting-send-grid button:hover {
  border-color: #cf7656;
  background: #fff8f4;
}
.painting-context-menu {
  position: absolute;
  z-index: 20;
  display: grid;
  width: 186px;
  padding: 5px;
  border: 1px solid rgba(60, 57, 52, 0.24);
  border-radius: 9px;
  background: rgba(250, 249, 246, 0.98);
  box-shadow: 0 13px 36px rgba(35, 31, 26, 0.24);
}
.painting-context-menu button {
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4b4741;
  font-size: 9px;
  text-align: left;
}
.painting-context-menu button:hover {
  background: #e3eee9;
  color: #2e5d4f;
}
.painting-context-menu hr {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid #dedbd4;
}
.painting-light-form,
.painting-color-form {
  display: grid;
  gap: 11px;
}
.painting-light-form > label,
.painting-color-form > label {
  display: grid;
  gap: 5px;
  color: #5e5a54;
  font-size: 9px;
}
.painting-light-form label > span {
  display: flex;
  justify-content: space-between;
}
.painting-light-form select,
.painting-color-form select,
.painting-color-form input[type='number'] {
  min-height: 34px;
  border: 1px solid #d4d0c8;
  border-radius: 7px;
  background: #fff;
}
.painting-light-form > div:last-child {
  display: flex;
  justify-content: space-between;
}
.painting-color-form [data-color-fields] {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.painting-color-form [data-color-fields][hidden] {
  display: none;
}
.painting-color-form [data-color-fields] label {
  display: grid;
  gap: 4px;
  color: #77726b;
  font-size: 8px;
}
.painting-color-form p {
  margin: 0;
  color: #858078;
  font-size: 8px;
  line-height: 1.55;
}
.painting-layer-create-menu {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.painting-layer-create-menu button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid #d8d4cc;
  border-radius: 9px;
  background: #fff;
  color: #4e4a44;
  font-size: 10px;
  text-align: left;
}
.painting-layer-create-menu button:hover {
  border-color: #88aa9f;
  background: #edf4f1;
}
.painting-layer-create-menu small {
  color: #8b867e;
  font-size: 8px;
  line-height: 1.4;
}
.painting-special-form {
  display: grid;
  gap: 10px;
}
.painting-special-form > label,
.painting-special-form > div > label {
  display: grid;
  gap: 5px;
  color: #5e5a54;
  font-size: 9px;
}
.painting-special-form > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.painting-special-form input,
.painting-special-form select,
.painting-special-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid #d4d0c8;
  border-radius: 7px;
  background: #fff;
  font: inherit;
}
.painting-special-form textarea {
  min-height: 90px;
  resize: vertical;
}
.painting-focus-edge {
  display: none;
}
.painting-app[data-focus-mode='true'] {
  position: fixed;
  inset: 0;
  z-index: 450;
  grid-template-rows: minmax(0, 1fr);
  background: #aaa8a3;
}
.painting-app[data-focus-mode='true'] .painting-stage-flow {
  display: none;
}
.painting-app[data-focus-mode='true'] .painting-workbench {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.painting-app[data-focus-mode='true'] .painting-canvas-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.painting-app[data-focus-mode='true'] .painting-brush-panel,
.painting-app[data-focus-mode='true'] .painting-side-panel {
  position: absolute;
  z-index: 20;
  top: 0;
  bottom: 0;
  display: block;
  max-height: none;
  transition: transform 180ms ease;
  box-shadow: 0 12px 42px rgba(32, 37, 35, 0.24);
}
.painting-app[data-focus-mode='true'] .painting-brush-panel {
  left: 0;
  width: clamp(218px, 23vw, 320px);
  transform: translateX(-100%);
}
.painting-app[data-focus-mode='true'] .painting-side-panel {
  right: 0;
  width: clamp(288px, 28vw, 380px);
  transform: translateX(100%);
}
.painting-app[data-focus-mode='true'][data-focus-left-open='true'] .painting-brush-panel,
.painting-app[data-focus-mode='true'][data-focus-right-open='true'] .painting-side-panel {
  transform: translateX(0);
}
.painting-app[data-focus-mode='true'] .painting-focus-edge {
  position: absolute;
  z-index: 25;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 28px;
  min-height: 88px;
  padding: 8px 5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(42, 65, 58, 0.92);
  color: #fff;
  box-shadow: 0 6px 22px rgba(27, 35, 32, 0.25);
  font-size: 8px;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  transition:
    left 180ms ease,
    right 180ms ease,
    background 120ms ease;
}
.painting-app[data-focus-mode='true'] .painting-focus-edge:hover,
.painting-app[data-focus-mode='true'] .painting-focus-edge:focus-visible {
  background: #234e42;
  outline: 2px solid #d9f0e8;
  outline-offset: -2px;
}
.painting-app[data-focus-mode='true'] .painting-focus-edge-left {
  left: 0;
  border-left: 0;
  border-radius: 0 9px 9px 0;
}
.painting-app[data-focus-mode='true'] .painting-focus-edge-right {
  right: 0;
  border-right: 0;
  border-radius: 9px 0 0 9px;
}
.painting-app[data-focus-mode='true'][data-focus-left-open='true'] .painting-focus-edge-left {
  left: clamp(218px, 23vw, 320px);
}
.painting-app[data-focus-mode='true'][data-focus-right-open='true'] .painting-focus-edge-right {
  right: clamp(288px, 28vw, 380px);
}
.painting-app[data-focus-mode='true'] #paintingStrokeCanvas:focus-visible {
  outline: 2px solid rgba(219, 242, 234, 0.86);
  outline-offset: -2px;
}

@media (max-width: 1280px) {
  .painting-workbench {
    grid-template-columns: 190px minmax(340px, 1fr) 258px;
  }
  .painting-tool-group button span:last-child {
    display: none;
  }
  .painting-stage-flow small {
    display: none;
  }
}
@media (max-width: 980px) {
  .painting-stage-flow {
    grid-template-columns: repeat(4, 1fr);
  }
  .painting-stage-flow button:first-child,
  .painting-stage-flow button:last-child {
    border-radius: 0;
  }
  .painting-workbench {
    grid-template-columns: 160px minmax(300px, 1fr);
    grid-template-rows: minmax(460px, 68vh) auto;
    overflow: auto;
  }
  .painting-side-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    max-height: 420px;
  }
  .painting-color span {
    display: none;
  }
}
@media (max-width: 720px) {
  .painting-page-head .painting-sync-state,
  .painting-page-head [data-painting-action='save'],
  .painting-page-head [data-painting-action='versions'] {
    display: none;
  }
  .painting-stage-flow {
    display: flex;
    overflow-x: auto;
  }
  .painting-stage-flow button {
    min-width: 92px;
  }
  .painting-workbench {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 62vh) auto auto;
  }
  .painting-brush-panel {
    display: block;
    max-height: 320px;
    order: 2;
  }
  .painting-canvas-column {
    order: 1;
  }
  .painting-side-panel {
    grid-column: 1;
    grid-template-columns: 1fr;
    max-height: none;
    order: 3;
  }
  .painting-send-grid {
    grid-template-columns: 1fr;
  }
  .painting-toolbar {
    overflow-x: auto;
  }
  .painting-canvas-status span:nth-child(2) {
    display: none;
  }
}

/* AI painting readability pass: scoped production-density overrides */
.mode-page[data-page='painting'] {
  --painting-text-strong: #302f2c;
  --painting-text-body: #4d4b46;
  --painting-text-muted: #68655f;
  --painting-surface: #f8f8f5;
  --painting-surface-raised: #ffffff;
  --painting-line: #cfcdc6;
  --painting-accent: #2f6253;
  --painting-accent-soft: #e3efea;
  --painting-font-body: 12px;
  --painting-font-support: 11px;
  color: var(--painting-text-body);
}
.mode-page[data-page='painting'] .painting-app {
  font-size: var(--painting-font-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.mode-page[data-page='painting'] .painting-page-head h1 {
  color: var(--painting-text-strong);
  font-size: 21px;
}
.mode-page[data-page='painting'] .painting-page-head .micro-label,
.mode-page[data-page='painting'] .painting-sync-state {
  font-size: var(--painting-font-support);
  letter-spacing: 0.04em;
}
.mode-page[data-page='painting'] .painting-page-head .ghost-action {
  min-height: 38px;
  padding-inline: 13px;
  font-size: var(--painting-font-body);
}
.mode-page[data-page='painting'] .painting-sync-state {
  min-height: 32px;
  padding-inline: 12px;
  color: var(--painting-text-muted);
}
.mode-page[data-page='painting'] .painting-stage-flow {
  grid-template-columns: repeat(8, minmax(94px, 1fr));
  gap: 2px;
  padding: 9px 12px;
  background: #d2d1cc;
}
.mode-page[data-page='painting'] .painting-stage-flow button {
  min-height: 58px;
  padding: 8px 10px;
  color: #5d5a55;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    color 120ms ease,
    box-shadow 120ms ease;
}
.mode-page[data-page='painting'] .painting-stage-flow i {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  margin-right: 8px;
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-stage-flow strong {
  font-size: 13px;
  line-height: 1.25;
}
.mode-page[data-page='painting'] .painting-stage-flow small {
  font-size: var(--painting-font-support);
  line-height: 1.25;
}
.mode-page[data-page='painting'] .painting-workbench {
  grid-template-columns:
    clamp(232px, 18vw, 268px) minmax(400px, 1fr)
    clamp(306px, 23vw, 344px);
  background: #a4a5a1;
}
.mode-page[data-page='painting'] :is(.painting-brush-panel, .painting-side-panel) {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #aaa8a1 transparent;
  scrollbar-gutter: stable;
  background: var(--painting-surface);
}
.mode-page[data-page='painting'] .painting-panel-head {
  min-height: 54px;
  padding: 10px 12px;
  border-bottom-color: var(--painting-line);
  background: rgba(250, 250, 247, 0.97);
}
.mode-page[data-page='painting'] .painting-panel-head strong {
  color: var(--painting-text-strong);
  font-size: 14px;
  line-height: 1.3;
}
.mode-page[data-page='painting'] :is(.painting-panel-head small, .painting-panel-head > i) {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.35;
}
.mode-page[data-page='painting'] .painting-panel-head button {
  width: 36px;
  height: 36px;
  border-color: var(--painting-line);
  color: var(--painting-text-body);
  font-size: 13px;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-brush-list {
  gap: 5px;
  max-height: min(31vh, 300px);
  padding: 10px;
}
.mode-page[data-page='painting'] .painting-brush-list button {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  min-height: 54px;
  padding: 7px 9px;
  border-radius: 9px;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-brush-list button > i {
  width: 36px;
  height: 36px;
}
.mode-page[data-page='painting'] .painting-brush-list strong {
  color: var(--painting-text-strong);
  font-size: 13px;
  line-height: 1.25;
}
.mode-page[data-page='painting'] .painting-brush-list small {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.3;
}
.mode-page[data-page='painting'] .painting-settings {
  gap: 11px;
  padding: 13px;
}
.mode-page[data-page='painting'] .painting-range {
  gap: 7px;
}
.mode-page[data-page='painting'] .painting-range > span {
  color: var(--painting-text-body);
  font-size: var(--painting-font-body);
}
.mode-page[data-page='painting'] .painting-range input {
  min-height: 20px;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-pressure-map {
  gap: 9px;
  margin: 0 11px 11px;
  padding: 11px;
  background: #f0f1ed;
}
.mode-page[data-page='painting'] .painting-pressure-map strong,
.mode-page[data-page='painting'] .painting-pressure-map label {
  color: var(--painting-text-body);
  font-size: var(--painting-font-body);
  line-height: 1.35;
}
.mode-page[data-page='painting'] .painting-pressure-map input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-save-brush {
  min-height: 38px;
  margin: 0 11px 13px;
  font-size: var(--painting-font-body);
  font-weight: 600;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-brush-shortcuts {
  gap: 8px;
  margin: 0 11px 11px;
  padding: 10px;
  color: var(--painting-text-body);
  font-size: var(--painting-font-support);
  line-height: 1.45;
}
.mode-page[data-page='painting'] .painting-brush-shortcuts button {
  min-width: 44px;
  min-height: 34px;
  font-size: var(--painting-font-body);
  font-weight: 650;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-brush-shortcuts small {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-tool-control-summary strong {
  font-size: 14px;
}
.mode-page[data-page='painting'] :is(.painting-tool-control-summary span, .painting-tool-control-note) {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-tool-size-steps button {
  min-height: 38px;
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-tool-size-steps output {
  font-size: 13px;
}
.mode-page[data-page='painting'] .painting-tool-control-note kbd {
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-canvas-panel {
  grid-template-rows: 56px auto minmax(0, 1fr) 34px;
  box-shadow:
    0 0 0 1px rgba(43, 43, 40, 0.18),
    0 8px 28px rgba(36, 37, 34, 0.12);
}
.mode-page[data-page='painting'] .painting-selection-bar {
  min-height: 44px;
  gap: 9px;
  padding: 6px 11px;
  color: var(--painting-text-body);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-selection-bar strong {
  font-size: var(--painting-font-body);
}
.mode-page[data-page='painting'] :is(.painting-selection-bar select, .painting-selection-bar button) {
  min-height: 34px;
  padding-inline: 10px;
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-selection-bar small {
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-selection-tolerance input {
  width: 100px;
}
.mode-page[data-page='painting'] .painting-toolbar {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 10px;
  padding: 8px 11px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom-color: #c2c2bc;
  background: rgba(248, 248, 245, 0.98);
  box-shadow: 0 2px 10px rgba(45, 45, 42, 0.07);
  scrollbar-width: thin;
}
.mode-page[data-page='painting'] .painting-tool-group {
  flex: 0 0 auto;
  gap: 4px;
}
.mode-page[data-page='painting'] .painting-tool-group button {
  min-width: 38px;
  height: 40px;
  padding-inline: 10px;
  border-radius: 8px;
  color: #56544f;
  font-size: var(--painting-font-body);
  font-weight: 560;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-tool-group button:hover {
  border-color: #aebeb8;
  background: #edf3f0;
}
.mode-page[data-page='painting'] .painting-tool-group button.active {
  border-color: #83a99d;
  background: var(--painting-accent-soft);
  color: #245447;
  box-shadow: inset 0 0 0 1px rgba(47, 98, 83, 0.08);
}
.mode-page[data-page='painting'] .painting-tool-group button:disabled {
  cursor: not-allowed;
}
.mode-page[data-page='painting'] .painting-tool-group svg {
  width: 17px;
  height: 17px;
}
.mode-page[data-page='painting'] .painting-tool-group .painting-select-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.6;
}
.mode-page[data-page='painting']
  .painting-tool-group
  button[data-paint-tool='select']:not(.active)
  .painting-select-icon {
  color: #202320;
}
.mode-page[data-page='painting'] .painting-tool-letter {
  width: 19px;
  height: 19px;
  font-size: var(--painting-font-support);
  font-weight: 650;
}
.mode-page[data-page='painting'] .painting-color {
  flex: 0 0 auto;
  gap: 7px;
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-color input {
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-color button {
  min-width: 42px;
  height: 34px;
  font-size: var(--painting-font-body);
  font-weight: 650;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-canvas-stage {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.12), transparent 48%),
    linear-gradient(135deg, #a7a8a4, #999a97);
  box-shadow: inset 0 2px 20px rgba(29, 30, 28, 0.15);
}
.mode-page[data-page='painting'] .painting-canvas-status {
  min-width: 0;
  padding-inline: 12px;
  overflow: hidden;
  background: #f2f2ee;
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.3;
}
.mode-page[data-page='painting'] .painting-layers-panel {
  min-height: 300px;
  border-bottom-color: var(--painting-line);
}
.mode-page[data-page='painting'] .painting-layer-list {
  max-height: min(34vh, 360px);
  scrollbar-gutter: stable;
}
.mode-page[data-page='painting'] .painting-layer-row {
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  min-height: 58px;
  border-bottom-color: #dcdbd5;
  background: #fafaf7;
}
.mode-page[data-page='painting'] .painting-layer-row:hover,
.mode-page[data-page='painting'] .painting-layer-row.selected,
.mode-page[data-page='painting'] .painting-layer-row.object-selected,
.mode-page[data-page='painting'] .painting-layer-row.active {
  background: var(--painting-accent-soft);
}
.mode-page[data-page='painting'] .painting-layer-row > button:not(.painting-layer-main) {
  min-width: 36px;
  color: #5b5954;
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-layer-main {
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-layer-thumb {
  width: 34px;
  height: 34px;
  color: var(--painting-text-body);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-layer-main strong {
  color: var(--painting-text-strong);
  font-size: 13px;
  line-height: 1.25;
}
.mode-page[data-page='painting'] .painting-layer-main small {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.3;
}
.mode-page[data-page='painting'] .painting-layer-inspector {
  gap: 10px;
  padding: 11px 12px 13px;
  background: #f1f1ed;
}
.mode-page[data-page='painting'] :is(.painting-layer-inspector button, .painting-layer-inspector select) {
  min-height: 36px;
  color: var(--painting-text-body);
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-layer-inspector label {
  gap: 6px;
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.35;
}
.mode-page[data-page='painting'] .painting-layer-inspector .painting-layer-toggle {
  min-height: 38px;
  padding: 8px 9px;
  font-size: var(--painting-font-body);
}
.mode-page[data-page='painting'] .painting-layer-inspector .painting-toggle-mark {
  width: 17px;
  height: 17px;
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-ai-actions {
  gap: 7px;
  padding: 11px;
}
.mode-page[data-page='painting'] .painting-ai-actions button {
  gap: 5px;
  min-height: 62px;
  padding: 9px;
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-ai-actions strong,
.mode-page[data-page='painting'] .painting-ai-stage-head strong {
  font-size: 13px;
  line-height: 1.3;
}
.mode-page[data-page='painting'] .painting-ai-actions small,
.mode-page[data-page='painting']
  :is(.painting-ai-stage-head small, .painting-ai-stage-options small, .painting-ai-context-note) {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.45;
}
.mode-page[data-page='painting'] .painting-ai-stage-head {
  gap: 5px;
  margin: 0 11px 9px;
  padding: 11px;
}
.mode-page[data-page='painting'] .painting-ai-scope {
  gap: 8px;
  margin: 0 11px 9px;
  padding: 8px 9px;
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.4;
}
.mode-page[data-page='painting'] :is(.painting-ai-scope button, .painting-ai-stage-options button) {
  min-height: 34px;
  padding-inline: 9px;
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-ai-stage-options {
  gap: 8px;
  margin: 0 11px 9px;
}
.mode-page[data-page='painting'] .painting-ai-stage-options label {
  gap: 6px;
  color: var(--painting-text-body);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] :is(.painting-ai-stage-options select, .painting-ai-options select) {
  height: 38px;
  padding-inline: 9px;
  color: var(--painting-text-body);
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-ai-panel textarea {
  width: calc(100% - 22px);
  min-height: 88px;
  margin: 0 11px 9px;
  padding: 10px;
  color: var(--painting-text-strong);
  font-size: 13px;
  line-height: 1.55;
}
.mode-page[data-page='painting'] .painting-ai-options {
  gap: 7px;
  margin: 0 11px 9px;
}
.mode-page[data-page='painting'] .painting-ai-run {
  width: calc(100% - 22px);
  min-height: 42px;
  margin-inline: 11px;
  padding-inline: 13px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.mode-page[data-page='painting']
  :is(
    .painting-create-form > label,
    .painting-create-form > div > label,
    .painting-light-form > label,
    .painting-color-form > label,
    .painting-special-form > label,
    .painting-special-form > div > label
  ) {
  color: var(--painting-text-body);
  font-size: var(--painting-font-body);
  line-height: 1.4;
}
.mode-page[data-page='painting']
  :is(
    .painting-create-form textarea,
    .painting-create-form input,
    .painting-version-create input,
    .painting-special-form input,
    .painting-special-form select,
    .painting-special-form textarea,
    .painting-light-form select,
    .painting-color-form select,
    .painting-color-form input[type='number']
  ) {
  min-height: 40px;
  color: var(--painting-text-strong);
  font-size: var(--painting-font-body);
}
.mode-page[data-page='painting']
  :is(.painting-size-presets button, .painting-version-create button, .painting-version-list button) {
  min-height: 36px;
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-version-list strong {
  font-size: 13px;
}
.mode-page[data-page='painting']
  :is(
    .painting-version-list small,
    .painting-form-note,
    .painting-brush-menu p,
    .painting-empty-state > small,
    .painting-send-preview small,
    .painting-send-note,
    .painting-color-form p,
    .painting-layer-create-menu small
  ) {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
  line-height: 1.5;
}
.mode-page[data-page='painting'] .painting-empty-state button,
.mode-page[data-page='painting'] .painting-send-grid button,
.mode-page[data-page='painting'] .painting-context-menu button,
.mode-page[data-page='painting'] .painting-layer-create-menu button {
  min-height: 40px;
  font-size: var(--painting-font-body);
  cursor: pointer;
}
.mode-page[data-page='painting'] .painting-export-result p {
  font-size: var(--painting-font-body);
}
.mode-page[data-page='painting'] .painting-context-menu {
  width: 216px;
  padding: 7px;
}
.mode-page[data-page='painting'] .painting-context-menu button {
  padding-inline: 11px;
}
.mode-page[data-page='painting'] .painting-color-form [data-color-fields] label {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-focus-edge {
  font-size: var(--painting-font-body);
  font-weight: 650;
}
.mode-page[data-page='painting'] :is(button, input, select, textarea):focus-visible {
  outline: 2px solid #397764;
  outline-offset: 2px;
}

@media (max-width: 1280px) and (min-width: 981px) {
  .mode-page[data-page='painting'] .painting-workbench {
    grid-template-columns: 206px minmax(340px, 1fr) 278px;
  }
  .mode-page[data-page='painting'] .painting-stage-flow {
    grid-template-columns: repeat(8, minmax(76px, 1fr));
  }
}
@media (max-width: 980px) {
  .mode-page[data-page='painting'] .painting-workbench {
    grid-template-columns: 184px minmax(320px, 1fr);
  }
  .mode-page[data-page='painting'] .painting-side-panel {
    max-height: 480px;
  }
}
@media (max-width: 720px) {
  .mode-page[data-page='painting'] .painting-workbench {
    grid-template-columns: 1fr;
  }
  .mode-page[data-page='painting'] .painting-stage-flow button {
    min-width: 108px;
  }
  .mode-page[data-page='painting'] .painting-toolbar {
    align-items: stretch;
    scrollbar-width: thin;
  }
  .mode-page[data-page='painting'] .painting-tool-group button span:last-child {
    display: inline;
  }
  .mode-page[data-page='painting'] .painting-brush-panel {
    max-height: 390px;
  }
}

/* AI painting visual system refresh: warm studio surfaces + production workflow hierarchy */
.mode-page[data-page='painting'] {
  --painting-text-strong: #262b28;
  --painting-text-body: #454b47;
  --painting-text-muted: #69716c;
  --painting-surface: #f7f6f1;
  --painting-surface-raised: #fcfcf8;
  --painting-line: #d5d4cc;
  --painting-line-strong: #c2c8c2;
  --painting-accent: #2d6656;
  --painting-accent-deep: #214d41;
  --painting-accent-soft: #e3efea;
  --painting-accent-pale: #f0f6f2;
  --painting-font-body: 13px;
  --painting-font-support: 12px;
  container-name: painting-workspace;
  container-type: inline-size;
  gap: 10px;
  background:
    radial-gradient(circle at 82% 4%, rgba(78, 128, 108, 0.08), transparent 24%),
    linear-gradient(145deg, #eeece6 0%, #e7e7e1 100%);
}
.mode-page[data-page='painting'] .painting-page-head {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(190px, 0.78fr) minmax(0, 2.5fr);
  min-height: 78px;
  box-sizing: border-box;
  align-items: center;
  gap: 18px;
  padding: 11px 13px 11px 16px;
  overflow: hidden;
  border: 1px solid rgba(122, 129, 119, 0.24);
  border-radius: 17px;
  background:
    linear-gradient(115deg, rgba(255, 255, 252, 0.91), rgba(243, 245, 239, 0.94) 55%, rgba(231, 241, 235, 0.94)),
    #f3f2ed;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.86) inset,
    0 8px 24px rgba(44, 49, 44, 0.065);
}
.mode-page[data-page='painting'] .painting-page-head::after {
  position: absolute;
  z-index: -1;
  top: -66px;
  right: -40px;
  width: 260px;
  height: 180px;
  border: 1px solid rgba(58, 108, 90, 0.08);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(71, 124, 104, 0.08), transparent 66%);
  content: '';
  pointer-events: none;
}
.mode-page[data-page='painting'] .painting-page-identity {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.mode-page[data-page='painting'] .painting-title-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(64, 113, 95, 0.24);
  border-radius: 13px;
  background: linear-gradient(145deg, #e8f3ee, #d5e7df);
  color: var(--painting-accent-deep);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.84) inset,
    0 5px 13px rgba(46, 87, 72, 0.1);
}
.mode-page[data-page='painting'] .painting-title-mark svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.mode-page[data-page='painting'] .painting-title-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.mode-page[data-page='painting'] .painting-title-copy .micro-label {
  margin: 0;
  color: #527467;
  font-size: 9.5px;
  font-weight: 760;
  letter-spacing: 0.105em;
  line-height: 1.2;
  white-space: nowrap;
}
.mode-page[data-page='painting'] .painting-title-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}
.mode-page[data-page='painting'] .painting-title-line h1 {
  color: #202622;
  font-size: 25px;
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 1.05;
}
.mode-page[data-page='painting'] .painting-title-line > span {
  display: inline-grid;
  min-height: 18px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid #a9c1b7;
  border-radius: 999px;
  background: rgba(237, 246, 242, 0.86);
  color: #396655;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.mode-page[data-page='painting'] .painting-title-copy p {
  margin: 1px 0 0;
  overflow: hidden;
  color: #6a716c;
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mode-page[data-page='painting'] .painting-page-head .page-actions {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid rgba(130, 136, 127, 0.2);
  border-radius: 14px;
  background: rgba(249, 249, 245, 0.66);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
  scrollbar-width: none;
}
.mode-page[data-page='painting'] .painting-page-head .page-actions::-webkit-scrollbar {
  display: none;
}
.mode-page[data-page='painting'] .painting-page-head .ghost-action {
  flex: 0 0 auto;
  min-height: 40px;
  padding-inline: 10px;
  border-color: transparent;
  border-radius: 10px;
  background: transparent;
  color: #535d57;
  font-size: 12px;
  font-weight: 620;
  transition:
    border-color 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}
.mode-page[data-page='painting'] .painting-page-head .ghost-action svg {
  width: 15px;
  height: 15px;
}
.mode-page[data-page='painting'] .painting-page-head .ghost-action:hover:not(:disabled) {
  border-color: rgba(76, 105, 93, 0.18);
  background: rgba(255, 255, 252, 0.9);
  color: #294e42;
  box-shadow: 0 4px 11px rgba(47, 70, 60, 0.075);
  transform: translateY(-1px);
}
.mode-page[data-page='painting'] .painting-page-head .primary-painting {
  border-color: #255647 !important;
  background: linear-gradient(145deg, #367664, #285c4d) !important;
  color: #fff !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 5px 13px rgba(40, 92, 77, 0.2);
}
.mode-page[data-page='painting'] .painting-page-head .primary-painting:hover:not(:disabled) {
  background: linear-gradient(145deg, #3a7e6a, #285c4d) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 7px 16px rgba(40, 92, 77, 0.25);
}
.mode-page[data-page='painting'] .painting-sync-state {
  position: relative;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px 0 23px;
  border-color: transparent;
  background: transparent;
  color: #637069;
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0;
}
.mode-page[data-page='painting'] .painting-sync-state::before {
  position: absolute;
  left: 10px;
  width: 7px;
  height: 7px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  background: #9ba39e;
  box-shadow: 0 0 0 1px rgba(86, 96, 90, 0.2);
  content: '';
}
.mode-page[data-page='painting'] .painting-sync-state[data-tone='ok']::before {
  background: #2e9871;
  box-shadow: 0 0 0 1px rgba(46, 152, 113, 0.24);
}
.mode-page[data-page='painting'] .painting-sync-state[data-tone='busy']::before {
  background: #b7943d;
}
.mode-page[data-page='painting'] .painting-sync-state[data-tone='local']::before {
  background: #7186ae;
}
.mode-page[data-page='painting'] .painting-sync-state[data-tone='error']::before {
  background: #bd6259;
}
.mode-page[data-page='painting'] .painting-app {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.mode-page[data-page='painting'] .painting-stage-flow {
  position: relative;
  grid-template-columns: repeat(8, minmax(96px, 1fr));
  gap: 7px;
  padding: 9px 10px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(126, 130, 122, 0.24);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(247, 247, 243, 0.96), rgba(238, 238, 232, 0.96));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.84) inset,
    0 6px 18px rgba(52, 54, 50, 0.055);
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-color: #b0b5af transparent;
  scrollbar-width: thin;
}
.mode-page[data-page='painting'] .painting-stage-flow button {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: center;
  padding: 8px 9px;
  overflow: hidden;
  border: 1px solid #d8d8d1;
  border-radius: 11px;
  background: linear-gradient(180deg, #fafaf7, #f4f4ef);
  color: #4e544f;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 6px rgba(46, 48, 45, 0.035);
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}
.mode-page[data-page='painting'] .painting-stage-flow button:first-child,
.mode-page[data-page='painting'] .painting-stage-flow button:last-child {
  border-radius: 11px;
}
.mode-page[data-page='painting'] .painting-stage-flow button::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #77a493;
  content: '';
  opacity: 0;
  transform: scaleX(0.35);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}
.mode-page[data-page='painting'] .painting-stage-flow button:hover:not(:disabled):not(.active) {
  border-color: #aebfb7;
  background: #fff;
  color: #2e4f43;
  box-shadow: 0 6px 14px rgba(47, 76, 64, 0.09);
  transform: translateY(-1px);
}
.mode-page[data-page='painting'] .painting-stage-flow button:hover:not(:disabled)::after,
.mode-page[data-page='painting'] .painting-stage-flow button.is-complete::after,
.mode-page[data-page='painting'] .painting-stage-flow button.active::after {
  opacity: 1;
  transform: scaleX(1);
}
.mode-page[data-page='painting'] .painting-stage-flow button.active {
  border-color: #214e41;
  background: linear-gradient(145deg, #367462, #255749);
  color: #f8fffb;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 7px 18px rgba(36, 85, 70, 0.22);
  transform: translateY(-1px);
}
.mode-page[data-page='painting'] .painting-stage-flow button.active::after {
  right: 9px;
  left: 9px;
  background: #bfe3d5;
}
.mode-page[data-page='painting'] .painting-stage-flow button.is-complete {
  border-color: #bfd2ca;
  background: linear-gradient(180deg, #f0f7f3, #e8f2ed);
  color: #315d4f;
}
.mode-page[data-page='painting'] .painting-stage-flow button:disabled,
.mode-page[data-page='painting'] .painting-stage-flow button[aria-disabled='true'] {
  border-color: #deddd7;
  background: #efeee9;
  color: #999a95;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}
.mode-page[data-page='painting'] .painting-stage-flow i {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  margin-right: 8px;
  border: 1px solid #c9cbc6;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  color: #70756f;
  font-size: 11px;
  font-weight: 740;
  font-style: normal;
  opacity: 1;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}
.mode-page[data-page='painting'] .painting-stage-flow button.active i {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}
.mode-page[data-page='painting'] .painting-stage-flow button.is-complete i {
  border-color: #abc8bc;
  background: #d8eae3;
  color: #2d6252;
}
.mode-page[data-page='painting'] .painting-stage-flow span {
  gap: 3px;
}
.mode-page[data-page='painting'] .painting-stage-flow strong {
  color: inherit;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.mode-page[data-page='painting'] .painting-stage-flow small {
  display: block;
  color: #777c77;
  font-size: 11px;
  line-height: 1.25;
  opacity: 1;
}
.mode-page[data-page='painting'] .painting-stage-flow button.active small {
  color: #d8ebe4;
}
.mode-page[data-page='painting'] .painting-stage-flow button.is-complete small {
  color: #5e756b;
}
.mode-page[data-page='painting'] .painting-stage-flow button:focus-visible {
  z-index: 2;
  outline: 3px solid rgba(56, 126, 102, 0.32);
  outline-offset: 2px;
}
.mode-page[data-page='painting'] .painting-workbench {
  overflow: hidden;
  border: 1px solid rgba(106, 110, 104, 0.28);
  border-radius: 16px;
  background: #9fa19d;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.58) inset,
    0 12px 30px rgba(41, 44, 40, 0.1);
}
.mode-page[data-page='painting'] :is(.painting-brush-panel, .painting-side-panel) {
  background: linear-gradient(180deg, #faf9f5, #f5f4ef);
}
.mode-page[data-page='painting'] .painting-brush-panel {
  border-right-color: #c9cac4;
}
.mode-page[data-page='painting'] .painting-side-panel {
  border-left-color: #c9cac4;
}
.mode-page[data-page='painting'] .painting-panel-head {
  position: sticky;
  z-index: 5;
  top: 0;
  min-height: 56px;
  padding: 10px 12px;
  border-bottom-color: #d8d8d1;
  background: rgba(249, 249, 245, 0.98);
  box-shadow: 0 3px 9px rgba(48, 50, 46, 0.04);
}
.mode-page[data-page='painting'] .painting-panel-head strong {
  color: #29302c;
  font-size: 14px;
  font-weight: 720;
}
.mode-page[data-page='painting'] :is(.painting-panel-head small, .painting-panel-head > i) {
  color: #737a75;
  font-size: 11px;
}
.mode-page[data-page='painting'] .painting-panel-head button:hover:not(:disabled) {
  border-color: #abc0b7;
  background: #eff6f2;
  color: #2d6152;
}
.mode-page[data-page='painting'] .painting-brush-list button,
.mode-page[data-page='painting'] .painting-layer-row,
.mode-page[data-page='painting'] .painting-ai-actions button,
.mode-page[data-page='painting'] .painting-layer-inspector button,
.mode-page[data-page='painting'] .painting-tool-group button {
  transition:
    border-color 130ms ease,
    background-color 130ms ease,
    color 130ms ease,
    box-shadow 130ms ease,
    transform 130ms ease;
}
.mode-page[data-page='painting'] .painting-brush-list button:hover:not(:disabled) {
  border-color: #b5c9c0;
  background: #eef5f1;
  transform: translateX(1px);
}
.mode-page[data-page='painting'] .painting-brush-list button.active {
  border-color: #91b4a6;
  background: linear-gradient(90deg, #dfede7, #edf5f1);
  box-shadow: inset 3px 0 #3b7562;
}
.mode-page[data-page='painting'] .painting-range > span,
.mode-page[data-page='painting'] .painting-pressure-map label,
.mode-page[data-page='painting'] .painting-brush-shortcuts {
  font-size: 12px;
}
.mode-page[data-page='painting'] .painting-canvas-panel {
  background: #a2a49f;
  box-shadow: none;
}
.mode-page[data-page='painting'] .painting-toolbar {
  border-bottom-color: #c8cac3;
  background: linear-gradient(180deg, #fafaf7, #f3f3ee);
  box-shadow: 0 3px 10px rgba(42, 46, 42, 0.07);
}
.mode-page[data-page='painting'] .painting-tool-group button:hover:not(:disabled) {
  border-color: #b2c3bc;
  background: #edf4f0;
  color: #2e5d4f;
}
.mode-page[data-page='painting'] .painting-tool-group button.active {
  border-color: #6f9e8d;
  background: linear-gradient(145deg, #dcece5, #edf5f1);
  color: #245445;
  box-shadow:
    inset 0 0 0 1px rgba(48, 105, 86, 0.08),
    0 3px 8px rgba(42, 81, 68, 0.08);
}
.mode-page[data-page='painting'] .painting-canvas-stage {
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.15), transparent 46%),
    linear-gradient(145deg, #a8aaa6, #979a96);
}
.mode-page[data-page='painting'] .painting-canvas-status {
  border-top-color: #c8cac3;
  background: #f0f0eb;
  color: #646c67;
  font-size: 11px;
}
.mode-page[data-page='painting'] .painting-layer-row:hover {
  background: #edf3f0;
}
.mode-page[data-page='painting'] .painting-layer-row.selected,
.mode-page[data-page='painting'] .painting-layer-row.object-selected {
  background: #e7f0eb;
  box-shadow: inset 3px 0 #78a391;
}
.mode-page[data-page='painting'] .painting-layer-row.active {
  background: linear-gradient(90deg, #dfece6, #edf4f0);
  box-shadow: inset 3px 0 #3b7562;
}
.mode-page[data-page='painting'] .painting-layer-selection-summary strong {
  color: var(--painting-text-strong);
  font-size: 13px;
}
.mode-page[data-page='painting'] .painting-layer-selection-summary small {
  color: var(--painting-text-muted);
  font-size: var(--painting-font-support);
}
.mode-page[data-page='painting'] .painting-layer-inspector {
  border-bottom: 1px solid #d8d8d1;
  background: #f0f0eb;
}
.mode-page[data-page='painting'] .painting-ai-actions button:hover:not(:disabled) {
  border-color: #b3c7be;
  background: #f1f7f4;
  transform: translateY(-1px);
}
.mode-page[data-page='painting'] .painting-ai-actions button.active {
  border-color: #79a18f;
  background: linear-gradient(145deg, #dcece5, #edf5f1);
  color: #235445;
  box-shadow:
    inset 0 0 0 1px rgba(47, 98, 83, 0.07),
    0 4px 10px rgba(43, 86, 71, 0.075);
}
.mode-page[data-page='painting'] .painting-ai-actions button.active small {
  color: #567166;
}
.mode-page[data-page='painting'] .painting-ai-stage-head {
  border-color: #bfd4cb;
  border-left: 4px solid #4c806d;
  background: linear-gradient(115deg, #edf6f2, #f5f8f5);
}
.mode-page[data-page='painting'] .painting-ai-run {
  border: 1px solid #245546;
  background: linear-gradient(145deg, #367664, #285d4e);
  box-shadow: 0 5px 13px rgba(40, 91, 76, 0.18);
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}
.mode-page[data-page='painting'] .painting-ai-run:hover:not(:disabled) {
  box-shadow: 0 7px 16px rgba(40, 91, 76, 0.24);
  transform: translateY(-1px);
}
.mode-page[data-page='painting'] :is(button, input, select, textarea):disabled {
  cursor: not-allowed;
}
.mode-page[data-page='painting']
  :is(.painting-brush-panel, .painting-side-panel, .painting-toolbar, .painting-stage-flow)::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.mode-page[data-page='painting']
  :is(.painting-brush-panel, .painting-side-panel, .painting-toolbar, .painting-stage-flow)::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #aeb4ae;
  background-clip: padding-box;
}

@container painting-workspace (max-width: 860px) {
  .mode-page[data-page='painting'] .painting-page-head {
    grid-template-columns: minmax(176px, 0.65fr) minmax(0, 2.5fr);
    gap: 10px;
    padding-inline: 12px;
  }
  .mode-page[data-page='painting'] .painting-page-identity {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
  }
  .mode-page[data-page='painting'] .painting-title-mark {
    width: 40px;
    height: 40px;
  }
  .mode-page[data-page='painting'] .painting-title-copy p {
    display: none;
  }
  .mode-page[data-page='painting'] .painting-page-head .ghost-action {
    min-height: 38px;
    padding-inline: 9px;
  }
}
@container painting-workspace (max-width: 690px) {
  .mode-page[data-page='painting'] .painting-page-head {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .mode-page[data-page='painting'] .painting-page-head .page-actions {
    justify-content: flex-start;
  }
  .mode-page[data-page='painting'] .painting-stage-flow {
    grid-template-columns: repeat(8, 116px);
  }
}
@media (pointer: coarse) {
  .mode-page[data-page='painting'] .painting-stage-flow button,
  .mode-page[data-page='painting'] .painting-page-head .ghost-action,
  .mode-page[data-page='painting'] .painting-tool-group button,
  .mode-page[data-page='painting'] .painting-layer-inspector button {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mode-page[data-page='painting'] *,
  .mode-page[data-page='painting'] *::before,
  .mode-page[data-page='painting'] *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* 2.1 reachability + micro details */
.chat-suggestion strong {
  display: block;
  color: #303846;
  font-size: 10px;
  margin-bottom: 3px;
}
.chat-suggestion span {
  display: block;
  color: #8c96a4;
  font-size: 8.5px;
  line-height: 1.45;
}
.drama-asset-empty {
  min-height: 210px;
  grid-column: 1/-1;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  color: #8b95a3;
  padding: 28px;
}
.drama-asset-empty strong {
  font-size: 11px;
  color: #4b5564;
}
.drama-asset-empty p {
  margin: 5px 0 0;
  font-size: 9px;
  line-height: 1.5;
}
.video-version-empty {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  color: #9aa3af;
  font-size: 8px;
}
.video-asset-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1280px) and (min-width: 981px) {
  .production-generation-workspace .video-shot-inspector {
    display: grid !important;
  }
}
@media (max-width: 980px) {
  .production-generation-workspace {
    grid-template-columns: 180px minmax(0, 1fr) !important;
    grid-template-rows: minmax(330px, 1fr) 150px;
    overflow: hidden;
  }
  .production-generation-workspace .video-shot-inspector {
    display: grid !important;
    grid-column: 1/-1;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .production-generation-workspace .video-shot-inspector > div:last-child {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: auto;
  }
  .production-generation-workspace .video-context-group {
    margin: 0;
    padding: 7px;
    border: 1px solid #edf0f3;
    border-radius: 8px;
  }
}
@media (max-width: 760px) {
  .production-generation-workspace {
    grid-template-columns: 1fr !important;
    grid-template-rows: 135px minmax(260px, 1fr) 170px !important;
    overflow: auto;
  }
  .production-generation-workspace .video-shot-inspector {
    grid-column: 1 !important;
  }
  .production-generation-workspace .video-shot-inspector > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 2.1 chat attachments: compact, real input affordance */
.chat-attachment-tray {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 12px 8px;
  max-height: 94px;
  overflow: auto;
}
.chat-attachment-tray.has-items {
  display: flex;
}
.chat-attachment-chip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 8px;
  min-width: 180px;
  max-width: 280px;
  padding: 6px 7px;
  border: 1px solid var(--line, #e7e9ee);
  border-radius: 12px;
  background: #f7f8fa;
}
.chat-attachment-chip img,
.chat-attachment-file {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  display: grid;
  place-items: center;
  border: 1px solid #e7e9ee;
}
.chat-attachment-file svg {
  width: 15px;
  height: 15px;
}
.chat-attachment-chip > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.chat-attachment-chip strong {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-attachment-chip small {
  font-size: 9px;
  color: #9299a7;
}
.chat-attachment-chip button {
  border: 0;
  background: transparent;
  color: #8c93a0;
  font-size: 17px;
  cursor: pointer;
  padding: 0;
}
.chat-attachment-chip button:hover {
  color: #ef5a5a;
}
.message-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  max-width: 230px;
  padding: 4px 8px;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #f7f8fa;
  color: #596271;
  font-size: 10px;
}
.message-attachment-pill img {
  width: 25px;
  height: 25px;
  object-fit: cover;
  border-radius: 6px;
}
.message-attachment-pill svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.message-attachment-pill > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================
   2.2 readability + layout polish
   Goal: preserve the approved structure while improving
   legibility, hierarchy and 16-inch desktop ergonomics.
   ========================================================== */

/* Normal LLM conversation: readable GPT-like rhythm without moving the composer. */
.mode-page[data-page='chat'] .llm-conversation-viewport .conversation {
  padding-top: 34px !important;
  padding-bottom: 48px !important;
  gap: 26px !important;
}
.mode-page[data-page='chat'] .chat-message {
  max-width: 790px !important;
  font-size: 15.5px !important;
  line-height: 1.82 !important;
  letter-spacing: -0.005em;
}
.mode-page[data-page='chat'] .chat-message.assistant .chat-message-copy {
  font-size: 15.5px !important;
  line-height: 1.84 !important;
  color: #202732 !important;
}
.mode-page[data-page='chat'] .chat-message.user {
  max-width: min(650px, 84%) !important;
}
.mode-page[data-page='chat'] .chat-message.user .chat-message-copy {
  padding: 11px 15px !important;
  font-size: 14.5px !important;
  line-height: 1.65 !important;
  background: #f1f3f6 !important;
  border-color: #e2e6ec !important;
}
.mode-page[data-page='chat'] .assistant-mark {
  margin-bottom: 10px;
  font-size: 12.5px !important;
  font-weight: 650;
  color: #5f6977;
}
.mode-page[data-page='chat'] .assistant-actions {
  margin-top: 11px !important;
  gap: 5px;
}
.mode-page[data-page='chat'] .assistant-actions button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.prompt-dock.llm-composer {
  width: min(820px, calc(100% - 36px));
  padding: 11px 12px 9px;
  gap: 8px;
  border-color: #d9dee6;
  border-radius: 23px;
  box-shadow:
    0 14px 36px rgba(24, 32, 47, 0.09),
    0 1px 2px rgba(24, 32, 47, 0.04);
}
.prompt-dock.llm-composer textarea,
.prompt-dock[data-composer='chat'] textarea {
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  padding: 12px 11px 10px !important;
  font-size: 14.5px !important;
  line-height: 1.58 !important;
  color: #242b35 !important;
}
.prompt-dock.llm-composer textarea::placeholder {
  color: #98a1ad;
}
.prompt-dock.llm-composer .send-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.llm-composer-tools {
  min-height: 34px;
  gap: 7px;
}
.llm-composer-tools .chat-mode-switch {
  height: 32px;
  width: 158px;
}
.llm-composer-tools .chat-mode-switch > span {
  height: 24px;
  font-size: 11px;
}
.llm-composer-tools .select-trigger,
.llm-composer-tools .dock-chip {
  height: 32px;
  font-size: 11.5px;
}
.llm-composer-tools .select-trigger strong {
  font-size: 11.5px;
}
.llm-composer-tip,
.llm-disclaimer {
  font-size: 10px;
}
.chat-empty-inner {
  width: min(660px, 100%);
}
.chat-empty-inner h2 {
  font-size: 24px;
}
.chat-empty-inner p {
  font-size: 12.5px;
  line-height: 1.6;
}
.chat-suggestion {
  padding: 13px 14px;
  border-radius: 14px;
}
.chat-suggestion strong {
  font-size: 12px;
  margin-bottom: 4px;
}
.chat-suggestion span {
  font-size: 10.5px;
  line-height: 1.55;
}
.chat-attachment-chip strong {
  font-size: 12px;
}
.chat-attachment-chip small {
  font-size: 10px;
}
.message-attachment-pill {
  font-size: 11px;
}

/* Video project shell: stronger hierarchy and less microscopic UI. */
.drama-studio-shell {
  grid-template-rows: 64px 64px minmax(0, 1fr);
  gap: 11px;
}
.drama-project-strip {
  padding: 0 17px;
  border-radius: 17px;
}
.drama-project-copy .micro-label {
  font-size: 9.5px;
  letter-spacing: 0.12em;
}
.drama-project-copy strong {
  font-size: 15px;
  line-height: 1.25;
}
.drama-project-copy > span:last-child {
  font-size: 10.5px;
  line-height: 1.45;
}
.drama-project-metrics {
  gap: 8px;
}
.drama-project-metrics > span {
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  font-size: 10px !important;
  color: #667281 !important;
}
.drama-production-nav {
  border-radius: 17px;
  padding: 6px;
}
.drama-production-nav button {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  padding: 7px 11px;
  border-radius: 12px;
}
.drama-production-nav button i {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 9.5px;
}
.drama-production-nav button strong {
  font-size: 12.5px;
  line-height: 1.25;
}
.drama-production-nav button small {
  font-size: 10px;
  line-height: 1.35;
  margin-top: 3px;
}
.drama-view-panel {
  border-radius: 19px;
}
.asset-workbench-head,
.storyboard-workbench-head,
.delivery-head {
  min-height: 62px;
  padding: 12px 15px;
}
.asset-workbench-head strong,
.storyboard-workbench-head strong,
.delivery-head strong {
  font-size: 14px;
}
.asset-workbench-head span,
.storyboard-workbench-head span,
.delivery-head span {
  font-size: 10.5px;
  line-height: 1.5;
}
.asset-category-tabs {
  height: 50px;
  padding: 7px 14px;
  gap: 5px;
}
.asset-category-tabs button {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 11px;
}
.asset-category-tabs button b {
  font-size: 9.5px;
}
.drama-asset-grid {
  padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.drama-asset-card {
  border-radius: 15px;
}
.drama-asset-media {
  height: 136px;
}
.drama-asset-placeholder {
  font-size: 10.5px;
}
.drama-asset-placeholder i {
  width: 38px;
  height: 38px;
  font-size: 10px;
}
.asset-lock-badge {
  height: 24px;
  font-size: 9.5px;
}
.drama-asset-copy {
  padding: 11px 12px;
}
.drama-asset-copy strong {
  font-size: 12px;
}
.drama-asset-copy p {
  height: 35px;
  font-size: 10.5px;
  line-height: 1.55;
}
.drama-asset-meta {
  margin-top: 8px;
  gap: 5px;
}
.drama-asset-meta span {
  font-size: 9.5px;
  padding: 4px 7px;
}
.drama-asset-actions {
  padding: 0 12px 12px;
  gap: 6px;
}
.drama-asset-actions button {
  height: 30px;
  padding: 0 9px;
  font-size: 10px;
  border-radius: 8px;
}
.drama-asset-empty strong {
  font-size: 13px;
}
.drama-asset-empty p {
  font-size: 10.5px;
}

/* Storyboard cards get enough text and frame area to scan shots quickly. */
.storyboard-production-grid {
  padding: 14px;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}
.storyboard-production-card {
  border-radius: 15px;
}
.storyboard-frame {
  height: 142px;
}
.storyboard-frame-half {
  font-size: 9.5px;
}
.storyboard-shot-label {
  height: 25px;
  font-size: 9.5px;
}
.storyboard-shot-status {
  height: 25px;
  font-size: 9px;
}
.storyboard-card-copy {
  padding: 11px 12px;
}
.storyboard-card-copy > strong {
  font-size: 12px;
}
.storyboard-card-copy p {
  height: 38px;
  font-size: 10.5px;
  line-height: 1.55;
}
.storyboard-card-meta {
  gap: 5px;
  margin-top: 8px;
}
.storyboard-card-meta span {
  font-size: 9.5px;
  padding: 4px 7px;
}
.storyboard-card-actions {
  gap: 6px;
  padding: 0 12px 12px;
}
.storyboard-card-actions button {
  height: 30px;
  padding: 0 9px;
  font-size: 10px;
  border-radius: 8px;
}

/* Shot production: keep preview dominant, but give queue/context enough width to read. */
.drama-view-panel[data-video-view-panel='generation'] {
  gap: 10px;
  padding: 11px;
}
.production-generation-workspace {
  grid-template-columns: 225px minmax(0, 1fr) 270px;
  gap: 11px;
}
.production-generation-workspace .video-shot-queue,
.production-generation-workspace .video-preview-panel,
.production-generation-workspace .video-shot-inspector {
  border-radius: 15px;
}
.video-panel-head {
  padding: 13px 14px;
}
.video-panel-head strong {
  font-size: 13px;
}
.video-panel-head span {
  font-size: 10.5px;
  margin-top: 3px;
  line-height: 1.4;
}
.video-shot-list {
  padding: 9px;
  gap: 7px;
}
.video-shot-item {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 9px;
  border-radius: 11px;
}
.video-shot-number {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 9.5px;
}
.video-shot-copy strong {
  font-size: 11.5px;
}
.video-shot-copy small {
  font-size: 10px;
  margin-top: 3px;
}
.video-preview-head {
  padding: 13px 15px;
}
.video-preview-head strong {
  font-size: 14px;
}
.video-preview-head span {
  font-size: 10.5px;
}
.video-job-actions button {
  height: 31px;
  padding: 0 9px;
  font-size: 10px;
}
.production-generation-workspace .video-preview-stage {
  margin: 10px;
}
.video-preview-stage .workspace-empty strong {
  font-size: 14px;
}
.video-preview-stage .workspace-empty p {
  font-size: 11px;
  line-height: 1.55;
}
.video-version-strip {
  min-height: 46px;
  padding: 8px 11px;
  gap: 7px;
}
.video-version-chip {
  height: 31px;
  padding: 0 9px;
  font-size: 10px;
}
.video-version-empty {
  height: 31px;
  font-size: 10px;
}
.video-shot-inspector > div:last-child {
  padding: 12px;
}
.video-context-group {
  margin-bottom: 13px;
}
.video-context-group strong {
  margin-bottom: 5px;
  font-size: 11px;
  color: #424b58;
}
.video-context-group p {
  font-size: 10.5px;
  line-height: 1.62;
  color: #657181;
}
.video-context-tags {
  gap: 5px;
}
.video-context-tags span {
  padding: 4px 7px;
  font-size: 9.5px;
}
.video-composer {
  border-radius: 16px !important;
  padding: 10px !important;
  gap: 8px !important;
}
.video-composer .dock-top {
  gap: 6px;
}
.video-composer .dock-chip,
.video-composer .select-trigger {
  height: 33px;
  font-size: 11px;
}
.video-composer .select-trigger strong {
  font-size: 11px;
}
.video-methods {
  gap: 5px;
}
.video-methods button {
  height: 33px;
  padding: 0 9px;
  font-size: 10.5px;
}
.video-reference-pill {
  height: 31px;
  padding: 0 9px;
  font-size: 10px;
}
.video-composer textarea {
  min-height: 62px !important;
  max-height: 94px !important;
  font-size: 13.5px !important;
  line-height: 1.58 !important;
  padding: 11px 12px !important;
}
.video-composer .send-button {
  width: 40px;
  height: 40px;
}

/* Delivery should read like a handoff checklist, not a tiny admin table. */
.delivery-head {
  min-height: 62px;
}
.delivery-metrics {
  gap: 10px;
  padding: 11px 14px;
}
.delivery-metric {
  padding: 10px 11px;
  border-radius: 12px;
}
.delivery-metric span {
  font-size: 10px;
}
.delivery-metric strong {
  font-size: 17px;
}
.delivery-layout {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  padding: 12px;
}
.delivery-list {
  gap: 8px;
}
.delivery-row {
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
}
.delivery-row-index {
  width: 46px;
  height: 36px;
  font-size: 9.5px;
}
.delivery-row strong {
  font-size: 11px;
}
.delivery-row small {
  font-size: 9.5px;
  margin-top: 3px;
}
.delivery-row-actions {
  gap: 6px;
}
.delivery-row-actions button {
  height: 29px;
  padding: 0 9px;
  font-size: 9.5px;
}
.delivery-export-panel {
  padding: 15px;
  border-radius: 14px;
}
.delivery-export-panel > strong {
  font-size: 13px;
}
.delivery-export-panel p {
  font-size: 10.5px;
  line-height: 1.6;
}
.delivery-export-panel button {
  height: 36px;
  font-size: 10.5px;
}

/* Mid-width desktop: retain readability before collapsing the layout. */
@media (max-width: 1280px) and (min-width: 981px) {
  .production-generation-workspace {
    grid-template-columns: 205px minmax(0, 1fr) 245px !important;
  }
  .drama-project-metrics > span {
    font-size: 9.5px !important;
    padding: 0 8px;
  }
  .drama-production-nav button {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 7px 8px;
  }
  .drama-production-nav button i {
    width: 30px;
    height: 30px;
  }
  .drama-production-nav button strong {
    font-size: 11.5px;
  }
  .drama-production-nav button small {
    font-size: 9.5px;
  }
}
@media (max-width: 980px) {
  .drama-studio-shell {
    grid-template-rows: 62px 58px minmax(0, 1fr);
  }
  .production-generation-workspace {
    grid-template-columns: 195px minmax(0, 1fr) !important;
  }
  .production-generation-workspace .video-shot-inspector > div:last-child {
    gap: 9px;
  }
  .production-generation-workspace .video-context-group {
    padding: 9px;
  }
}
@media (max-width: 760px) {
  .mode-page[data-page='chat'] .chat-message,
  .mode-page[data-page='chat'] .chat-message.assistant .chat-message-copy {
    font-size: 14.5px !important;
  }
  .prompt-dock.llm-composer textarea,
  .prompt-dock[data-composer='chat'] textarea {
    font-size: 14px !important;
  }
  .production-generation-workspace {
    grid-template-rows: 150px minmax(270px, 1fr) 190px !important;
  }
}

/* ==========================================================
   AI DRAMA PIPELINE 2.3 — linked asset/shot production graph
   ========================================================== */
.asset-production-layout,
.storyboard-production-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.asset-production-layout > .drama-asset-grid,
.storyboard-production-layout > .storyboard-production-grid {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}
.asset-link-inspector,
.storyboard-shot-inspector {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid #e4e8ee;
  background: #fbfcfe;
}
.asset-link-inspector {
  padding: 14px;
  overflow: auto;
}
.asset-link-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.asset-link-head > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.asset-link-head span {
  font-size: 10px;
  color: #8893a1;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.asset-link-head strong {
  font-size: 13px;
  line-height: 1.4;
  color: #222b36;
}
.asset-link-head > button {
  border: 1px solid #dde3eb;
  background: #fff;
  border-radius: 8px;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  font-size: 10px;
  color: #55606e;
}
.asset-link-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #e5e9ef;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 10px;
}
.asset-link-status span,
.asset-link-status b {
  font-size: 10px;
  font-weight: 600;
}
.asset-link-status span {
  color: #3d8b6d;
}
.asset-link-status b {
  color: #6d7785;
}
.asset-link-shots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.asset-link-shots > button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e4e8ee;
  background: #fff;
  border-radius: 10px;
  text-align: left;
}
.asset-link-shots > button:hover,
.asset-link-shots > button.active {
  border-color: #a8b1ff;
  background: #f5f5ff;
}
.asset-link-shots i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f0f2f6;
  color: #576171;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
}
.asset-link-shots span {
  min-width: 0;
}
.asset-link-shots strong {
  display: block;
  font-size: 10.5px;
  color: #2e3743;
}
.asset-link-shots small {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  color: #8a94a2;
}
.asset-link-shots b {
  font-size: 9px;
  color: #6a5bf4;
  white-space: nowrap;
}
.asset-link-empty {
  padding: 18px 12px;
  border: 1px dashed #dce2e9;
  border-radius: 11px;
  text-align: center;
  font-size: 10px;
  line-height: 1.55;
  color: #8b95a2;
}
.asset-link-empty.large {
  margin-top: 40px;
}
.asset-link-foot,
.composition-actions {
  display: flex;
  gap: 7px;
}
.asset-link-foot button,
.composition-actions button {
  flex: 1;
  min-height: 32px;
  border: 1px solid #dce2ea;
  background: #fff;
  border-radius: 9px;
  font-size: 10px;
  color: #505b69;
}
.asset-link-foot button.primary,
.composition-actions button.primary {
  background: #5c53ee;
  border-color: #5c53ee;
  color: #fff;
}
.asset-link-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 7px;
  background: rgba(18, 24, 35, 0.75);
  backdrop-filter: blur(8px);
  font-size: 9px;
  color: #fff;
}
.drama-asset-media {
  position: relative;
}
.drama-asset-card.focused {
  outline: 2px solid rgba(92, 83, 238, 0.4);
  outline-offset: -1px;
}
.composition-preview {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px;
  border: 1px solid #e5e9ef;
  background: #fff;
  border-radius: 11px;
}
.composition-preview > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}
.composition-preview > div > span {
  padding-top: 5px;
  font-size: 9.5px;
  color: #8993a0;
}
.composition-preview button {
  display: inline-flex;
  margin: 0 4px 4px 0;
  padding: 5px 7px;
  border: 1px solid #dde3eb;
  background: #f7f8fa;
  border-radius: 7px;
  font-size: 9.5px;
  color: #485361;
}
.composition-preview em {
  padding-top: 5px;
  font-size: 9.5px;
  color: #a2aab5;
  font-style: normal;
}
.composition-readiness {
  margin: 10px 0 12px;
  padding: 11px;
  border: 1px solid #e5e9ef;
  background: #fff;
  border-radius: 11px;
}
.composition-readiness > strong {
  font-size: 10.5px;
  color: #303a46;
}
.composition-readiness > span {
  float: right;
  font-size: 9.5px;
}
.composition-readiness > span.warn {
  color: #b67535;
}
.composition-readiness > span.ready {
  color: #2d8b66;
}
.composition-readiness p {
  clear: both;
  margin: 8px 0 0;
  font-size: 9.5px;
  line-height: 1.5;
  color: #7b8694;
}
.composition-readiness ul {
  clear: both;
  margin: 8px 0 0;
  padding-left: 16px;
}
.composition-readiness li {
  margin: 3px 0;
  font-size: 9.5px;
  color: #7b6871;
}

.storyboard-production-layout {
  grid-template-columns: minmax(0, 1fr) 390px;
}
.storyboard-shot-inspector {
  display: flex;
  flex-direction: column;
  background: #f9fafc;
}
.storyboard-inspector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  border-bottom: 1px solid #e4e8ee;
  background: #fff;
}
.storyboard-inspector-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.storyboard-inspector-head span {
  font-size: 10px;
  color: #7e8997;
}
.storyboard-inspector-head strong {
  font-size: 12px;
  color: #3b4552;
}
.storyboard-inspector-head > button {
  width: 30px;
  height: 30px;
  border: 1px solid #e0e5eb;
  background: #fff;
  border-radius: 8px;
  color: #6b7582;
}
.storyboard-inspector-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 11px;
}
.storyboard-inspector-empty {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.storyboard-inspector-empty strong {
  font-size: 13px;
}
.storyboard-inspector-empty p {
  max-width: 260px;
  margin: 7px 0 12px;
  font-size: 10px;
  line-height: 1.6;
  color: #84909d;
}
.shot-field-section {
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid #e4e8ee;
  background: #fff;
  border-radius: 12px;
}
.shot-field-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.shot-field-title strong {
  font-size: 11px;
  color: #313b47;
}
.shot-field-title span {
  font-size: 9px;
  color: #8c96a3;
}
.shot-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.shot-field-grid label,
.shot-field-wide {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.shot-field-grid label span,
.shot-field-wide > span {
  font-size: 9px;
  color: #7b8693;
}
.shot-field-grid input,
.shot-field-wide input,
.shot-field-wide textarea,
.continuity-note textarea,
.frame-editor-card textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #dfe4eb;
  background: #fafbfc;
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  font-size: 10.5px;
  color: #303945;
  outline: none;
}
.shot-field-grid input:focus,
.shot-field-wide textarea:focus,
.continuity-note textarea:focus,
.frame-editor-card textarea:focus {
  border-color: #8c83f6;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(92, 83, 238, 0.07);
}
.shot-field-wide textarea {
  min-height: 64px;
  resize: vertical;
  margin-top: 8px;
}
.shot-entity-editor {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.shot-entity-editor > div {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 7px;
}
.shot-entity-editor > div > span {
  padding-top: 6px;
  font-size: 9px;
  color: #87919e;
}
.shot-entity-editor button {
  display: inline-flex;
  margin: 0 4px 4px 0;
  padding: 5px 7px;
  border: 1px solid #dde3e9;
  background: #f7f8fa;
  border-radius: 7px;
  font-size: 9.5px;
  color: #4d5865;
}
.shot-entity-editor button.active {
  border-color: #6d62ef;
  background: #eeecff;
  color: #5046d8;
  font-weight: 650;
}
.frame-pair-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.frame-editor-card {
  min-width: 0;
  padding: 7px;
  border: 1px solid #e5e9ef;
  background: #fafbfc;
  border-radius: 10px;
}
.frame-editor-media {
  display: grid;
  place-items: center;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 7px;
  background: #eef1f5;
  color: #8994a2;
  font-size: 9px;
}
.frame-editor-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame-editor-card textarea {
  min-height: 58px;
  margin: 7px 0;
  resize: vertical;
  background: #fff;
}
.frame-editor-card button,
.inherit-frame-action {
  width: 100%;
  min-height: 30px;
  border: 1px solid #dddff2;
  background: #f3f1ff;
  border-radius: 8px;
  font-size: 9.5px;
  color: #584de1;
}
.inherit-frame-action {
  margin-top: 8px;
}
.video-prompt-editor {
  min-height: 84px !important;
}
.continuity-note {
  margin-top: 9px;
}
.continuity-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 9.5px;
  color: #66717e;
}
.continuity-note textarea {
  min-height: 54px;
  resize: vertical;
}
.continuity-issue-list {
  margin: 9px 0 0;
  padding: 8px 8px 8px 23px;
  border-radius: 8px;
  background: #fff8ef;
}
.continuity-issue-list li {
  margin: 3px 0;
  font-size: 9px;
  color: #9a6738;
}
.storyboard-inspector-actions {
  display: grid;
  grid-template-columns: auto auto 1fr 1.3fr;
  gap: 6px;
  padding: 10px 11px;
  border-top: 1px solid #e3e8ee;
  background: #fff;
}
.storyboard-inspector-actions button {
  min-height: 32px;
  border: 1px solid #dde2e8;
  background: #fff;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 9.5px;
  color: #596473;
}
.storyboard-inspector-actions button.save {
  background: #f2f4f7;
}
.storyboard-inspector-actions button.primary {
  border-color: #5c53ee;
  background: #5c53ee;
  color: #fff;
}
.storyboard-warning {
  position: absolute;
  left: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  background: #fff2dc;
  color: #a26828;
  font-size: 9px;
  font-weight: 700;
}
.storyboard-shot-status.status-needs-review,
.sequence-clip.status-needs-review {
  color: #a26828;
  border-color: #e7c588;
  background: #fff7e8;
}

.sequence-transport {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas: 'copy controls rail' 'note note note';
  align-items: center;
  gap: 8px 12px;
  padding: 9px 11px;
  border: 1px solid #e2e7ed;
  background: #fafbfc;
  border-radius: 14px;
  overflow: hidden;
}
.sequence-transport-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}
.sequence-transport-copy strong {
  font-size: 11px;
  color: #343e49;
}
.sequence-transport-copy span {
  font-size: 9px;
  color: #87929f;
}
.sequence-controls {
  grid-area: controls;
  display: flex;
  gap: 4px;
}
.sequence-controls button {
  height: 30px;
  min-width: 30px;
  border: 1px solid #dde3ea;
  background: #fff;
  border-radius: 8px;
  font-size: 12px;
  color: #596574;
}
.sequence-controls .sequence-play {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  font-size: 9.5px;
}
.sequence-controls .sequence-play svg {
  width: 12px;
  height: 12px;
}
.sequence-controls .sequence-play.active {
  background: #5c53ee;
  border-color: #5c53ee;
  color: #fff;
}
.sequence-rail {
  grid-area: rail;
  display: flex;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 1px;
}
.sequence-clip {
  flex: 0 0 var(--clip-w);
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 5px 6px;
  border: 1px solid #dfe4eb;
  background: #fff;
  border-radius: 9px;
  text-align: left;
}
.sequence-clip:hover,
.sequence-clip.active {
  border-color: #7f75f2;
  background: #f3f1ff;
}
.sequence-clip i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #eef1f5;
  font-style: normal;
  font-size: 8px;
  color: #697482;
}
.sequence-clip span {
  min-width: 0;
}
.sequence-clip strong,
.sequence-clip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sequence-clip strong {
  font-size: 9px;
  color: #39434f;
}
.sequence-clip small {
  margin-top: 2px;
  font-size: 8px;
  color: #8a95a2;
}
.sequence-clip b {
  font-size: 10px;
  color: #39a176;
}
.sequence-note {
  grid-area: note;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8.5px;
  color: #8b95a1;
}
.context-edit-shot {
  width: 100%;
  min-height: 31px;
  margin-top: 4px;
  border: 1px solid #dfe3ea;
  background: #f7f8fa;
  border-radius: 8px;
  font-size: 9.5px;
  color: #596574;
}
.continuity-context {
  padding: 9px;
  border: 1px solid #e6e9ee;
  border-radius: 9px;
  background: #fafbfc;
}
.continuity-context ul {
  margin: 6px 0 0;
  padding-left: 16px;
}
.continuity-context li {
  font-size: 9px;
  color: #916239;
}
.continuity-pass {
  font-size: 9px;
  color: #318465;
}

@media (max-width: 1360px) {
  .asset-production-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
  .storyboard-production-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}
@media (max-width: 1050px) {
  .asset-production-layout,
  .storyboard-production-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .asset-link-inspector,
  .storyboard-shot-inspector {
    position: absolute;
    right: 10px;
    top: 10px;
    bottom: 10px;
    width: min(360px, calc(100% - 20px));
    z-index: 8;
    border: 1px solid #dfe4eb;
    border-radius: 14px;
    box-shadow: 0 18px 55px rgba(28, 35, 48, 0.14);
  }
  .drama-view-panel[data-video-view-panel='assets'],
  .drama-view-panel[data-video-view-panel='storyboard'] {
    position: relative;
  }
  .sequence-transport {
    grid-template-columns: auto 1fr;
    grid-template-areas: 'copy controls' 'rail rail' 'note note';
  }
  .sequence-controls {
    justify-content: flex-end;
  }
}
.storyboard-inspector-actions {
  grid-template-columns: auto auto auto auto 1fr 1.35fr;
}
.delivery-row.has-blocker {
  border-color: #ead3aa;
  background: #fffdf8;
}
.delivery-row em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 9px;
  color: #a36d35;
}
/* 2.3 generation contains timeline + workspace + composer. */
.drama-view-panel[data-video-view-panel='generation'] {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}
.delivery-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
/* 3.0 分层设计 - only affects the former split workspace */
[data-vision-tab='split'] {
  min-height: 0;
  display: none;
  grid-template-rows: minmax(0, 1fr);
}
[data-vision-tab='split'].active {
  display: grid;
}
.ld-modebar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 10px;
}
.ld-modebar > div {
  display: flex;
  background: #f2f4f8;
  border: 1px solid #e4e8ef;
  border-radius: 10px;
  padding: 3px;
}
.ld-modebar > div button {
  height: 30px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 12px;
  color: #7b8492;
}
.ld-modebar > div button.active {
  background: #fff;
  color: #1f2530;
  box-shadow: 0 1px 5px #18233b10;
}
.ld-classic-grid {
  display: grid;
  grid-template-columns: 220px minmax(230px, 0.78fr) minmax(300px, 1.15fr) 260px;
  gap: 10px;
  min-height: 0;
  height: calc(100% - 134px);
}
.ld-source,
.ld-plan,
.ld-preview,
.ld-log,
.ld-tree,
.ld-editor-canvas,
.ld-inspector {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 0;
  overflow: hidden;
}
.ld-panel-head {
  height: 48px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ld-panel-head strong {
  font-size: 12px;
}
.ld-panel-head span {
  font-size: 10px;
  color: #98a1ae;
}
.ld-source {
  display: flex;
  flex-direction: column;
}
.ld-source-preview {
  margin: 10px;
  min-height: 260px;
  flex: 1;
  border-radius: 12px;
  background: linear-gradient(180deg, #f1eee9, #dce3eb);
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  color: #86909d;
}
.ld-source-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f7f8fa;
}
.ld-source-preview div {
  padding: 18px;
  display: grid;
  gap: 6px;
}
.ld-source-preview span {
  font-size: 10px;
  line-height: 1.6;
}
.ld-source-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 10px 10px;
}
.ld-source-actions button,
.ld-tree-actions button,
.ld-wide-btn {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfc;
  font-size: 11px;
}
.ld-ref-strip {
  display: flex;
  gap: 5px;
  padding: 0 10px 10px;
  overflow: auto;
}
.ld-ref-strip img {
  width: 42px;
  height: 42px;
  border-radius: 7px;
  object-fit: cover;
}
.ld-plan {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.ld-layer-plan-list,
.ld-tree-list {
  overflow: auto;
  padding: 7px;
}
.ld-layer-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  align-items: center;
  text-align: left;
  padding: 8px;
  border-radius: 9px;
  gap: 7px;
  margin-bottom: 4px;
}
.ld-layer-row:hover,
.ld-layer-row.active {
  background: #f1efff;
}
.ld-layer-row span:nth-child(2) {
  display: grid;
  gap: 2px;
}
.ld-layer-row strong {
  font-size: 11px;
}
.ld-layer-row small {
  font-size: 9.5px;
  color: #8b95a3;
}
.ld-layer-icon {
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #6551dc;
}
.ld-preview {
  padding-bottom: 8px;
}
.ld-canvas-toolbar {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
}
.ld-canvas-toolbar button {
  height: 25px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f6f7f9;
  font-size: 9.5px;
}
.ld-canvas-toolbar span {
  margin-left: auto;
  font-size: 9.5px;
  color: #8f98a6;
}
.ld-canvas {
  position: relative;
  max-height: calc(100% - 44px);
  height: calc(100% - 44px);
  margin: 8px;
  background: repeating-conic-gradient(#f0f1f3 0 25%, #fff 0 50%) 50%/18px 18px;
  overflow: hidden;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
}
.ld-canvas-layer {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.ld-canvas-layer.selected {
  outline: 2px solid #6f56ee;
  outline-offset: -2px;
}
.ld-canvas-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ld-placeholder-layer {
  width: 100%;
  height: 100%;
  border: 1px dashed #b8bec8;
  background: #ffffff55;
  display: grid;
  place-items: center;
  color: #8f97a3;
  font-size: 10px;
}
.ld-placeholder-layer.background {
  background: linear-gradient(145deg, #eee9e1, #e4e8ed);
}
.ld-placeholder-layer.subject {
  background: linear-gradient(180deg, #d2d8e2, #bbc6d5);
  border-radius: 30% 30% 12% 12%;
}
.ld-placeholder-layer.effect,
.ld-placeholder-layer.decoration {
  background: radial-gradient(circle, #ffffffd9 0, #b7a6ff44 35%, transparent 70%);
  border: 0;
}
.ld-text-layer {
  white-space: nowrap;
  width: 100%;
  min-height: 100%;
  padding: 4px 7px;
  overflow: hidden;
  cursor: text;
  outline: 0;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: inherit;
  user-select: text;
}
.ld-text-layer[contenteditable='plaintext-only']:focus {
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px #6f56ee;
}
.ld-editable-badge {
  color: #3d327f;
  background: #f0edff;
}
.ld-shape-layer {
  width: 100%;
  height: 100%;
}
.ld-log {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.ld-log-body {
  padding: 10px;
  overflow: auto;
}
.ld-log article {
  border-bottom: 1px solid #edf0f4;
  padding: 10px 2px;
}
.ld-log article b {
  font-size: 10px;
}
.ld-log article p {
  font-size: 10.5px;
  color: #657080;
  line-height: 1.6;
}
.ld-log .primary-action {
  margin: 10px;
  height: 36px;
}
.ld-empty {
  padding: 34px 16px;
  text-align: center;
  color: #818b99;
}
.ld-empty strong {
  font-size: 12px;
}
.ld-empty p {
  font-size: 10px;
  line-height: 1.7;
}
.ld-classic-composer,
.ld-ai-composer {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-top: 10px;
  padding: 8px 10px;
}
.ld-chips {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ld-chips button {
  height: 25px;
  padding: 0 10px;
  border-radius: 7px;
  background: #f4f3fb;
  font-size: 9.5px;
}
.ld-chips span {
  font-size: 9.5px;
  color: #8e97a5;
  margin-left: auto;
}
.ld-editor-top {
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 10px;
}
.ld-editor-top > button {
  justify-self: start;
}
.ld-editor-top > div:nth-child(2) {
  display: grid;
}
.ld-editor-top strong {
  font-size: 12px;
}
.ld-editor-top span {
  font-size: 9.5px;
  color: #929aa6;
}
.ld-editor-top > div:last-child {
  display: flex;
  gap: 6px;
}
.ld-editor-top button {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 10px;
}
.ld-editor {
  display: grid;
  grid-template-columns: 250px minmax(420px, 1fr) 290px;
  gap: 10px;
  height: calc(100% - 154px);
  min-height: 0;
}
.ld-tree {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}
.ld-tree-actions {
  padding: 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}
.ld-tree-row {
  height: 44px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 25px 25px;
  align-items: center;
  border-radius: 8px;
}
.ld-tree-row.active {
  background: #efedff;
}
.ld-tree-row > button {
  height: 30px;
  display: grid;
  place-items: center;
}
.ld-tree-main {
  grid-template-columns: 26px 1fr !important;
  display: grid !important;
  text-align: left !important;
}
.ld-tree-main span:last-child {
  display: grid;
  gap: 1px;
}
.ld-tree-main strong {
  font-size: 10.5px;
}
.ld-tree-main small {
  font-size: 8.5px;
  color: #8993a1;
}
.ld-editor-canvas {
  padding: 0;
}
.ld-editor-canvas .ld-canvas {
  height: calc(100% - 55px);
  max-height: none;
}
.ld-inspector {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.ld-inspector-body {
  overflow: auto;
  padding: 10px;
}
.ld-field {
  display: grid;
  gap: 5px;
  margin-bottom: 10px;
}
.ld-field label {
  font-size: 9.5px;
  color: #77808e;
}
.ld-field input,
.ld-field textarea,
.ld-field select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  font-size: 10.5px;
  background: #fbfcfd;
}
.ld-field textarea {
  min-height: 72px;
  resize: vertical;
}
.ld-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.ld-source-badge {
  padding: 8px;
  border-radius: 8px;
  background: #f5f6f8;
  font-size: 9.5px;
  color: #7e8794;
  margin-bottom: 10px;
}
.ld-wide-btn {
  width: 100%;
  margin-bottom: 8px;
}
.ld-wide-btn.danger {
  color: #b44855;
}
.ld-ai-composer {
  height: 82px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 10px;
  align-items: center;
}
.ld-ai-scope {
  display: grid;
  gap: 2px;
  border-right: 1px solid var(--line);
}
.ld-ai-scope span,
.ld-ai-scope i {
  font-size: 9px;
  color: #929aa7;
  font-style: normal;
}
.ld-ai-scope strong {
  font-size: 11px;
}
.ld-modal-backdrop {
  position: fixed;
  inset: 0;
  background: #11182744;
  z-index: 2000;
  display: grid;
  place-items: center;
}
.ld-edit-modal {
  width: min(620px, calc(100vw - 40px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px #11182730;
  padding: 16px;
}
.ld-edit-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.ld-edit-modal-head > div {
  display: grid;
  gap: 3px;
}
.ld-edit-modal-head strong {
  font-size: 14px;
}
.ld-edit-modal-head span {
  font-size: 10px;
  color: #8d96a3;
}
.ld-edit-modal-head > button {
  font-size: 22px;
}
.ld-edit-types {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  font-size: 11px;
}
.ld-edit-modal-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ld-edit-modal-preview > div {
  padding: 10px;
  background: #f7f8fa;
  border-radius: 9px;
  display: grid;
  gap: 3px;
}
.ld-edit-modal-preview strong {
  font-size: 10px;
}
.ld-edit-modal-preview span {
  font-size: 9.5px;
  color: #838c99;
}
.ld-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.ld-modal-actions button {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
}
@media (max-width: 1280px) {
  .ld-classic-grid {
    grid-template-columns: 190px 220px minmax(280px, 1fr) 220px;
  }
  .ld-editor {
    grid-template-columns: 220px minmax(360px, 1fr) 250px;
  }
}
@media (max-width: 980px) {
  .ld-classic-grid {
    grid-template-columns: 190px minmax(240px, 1fr) 220px;
  }
  .ld-preview {
    display: none;
  }
  .ld-editor {
    grid-template-columns: 210px minmax(340px, 1fr);
  }
  .ld-inspector {
    grid-column: 1/-1;
    max-height: 240px;
  }
  .ld-ai-composer {
    grid-template-columns: 1fr;
  }
  .ld-ai-scope {
    display: none;
  }
}
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: #f4f6f9;
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(390px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid #e4e8ef;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 30px 90px #18233b18;
  display: grid;
  gap: 14px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.auth-logo img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.auth-logo div {
  display: grid;
}
.auth-logo strong {
  font-size: 18px;
}
.auth-logo span {
  font-size: 11px;
  color: #8a94a3;
}
.auth-card label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  color: #5f6978;
}
.auth-card input {
  height: 42px;
  border: 1px solid #dfe4eb;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
}
.auth-card > button {
  height: 43px;
  border-radius: 10px;
  background: #1f2632;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.auth-card small {
  color: #929aa7;
  line-height: 1.6;
}
.auth-error {
  min-height: 18px;
  color: #c34855;
  font-size: 11px;
  margin: 0;
}
.admin-entry {
  font-weight: 650;
}
.user-popover {
  position: fixed;
  z-index: 4000;
  width: 180px;
  border: 1px solid #e3e7ee;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 45px #17203318;
  padding: 10px;
  display: grid;
  gap: 4px;
}
.user-popover strong {
  font-size: 12px;
}
.user-popover span {
  font-size: 10px;
  color: #8c95a2;
}
.user-popover button {
  margin-top: 8px;
  height: 32px;
  background: #f5f6f8;
  border-radius: 8px;
  font-size: 10.5px;
}
.user-popover a {
  display: flex;
  align-items: center;
  height: 32px;
  margin-top: 8px;
  padding: 0 10px;
  border-radius: 8px;
  background: #f1efff;
  color: #554be3;
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
}
.user-popover-error {
  min-height: 0;
  margin: 4px 0 0;
  color: #c34855;
  font-size: 10px;
  line-height: 1.4;
}
.user-popover-error:empty {
  display: none;
}
.inbox-entry {
  position: relative;
}
.inbox-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #e34c5b;
  color: #fff;
  font: 700 8px/13px Inter, sans-serif;
  text-align: center;
}
.inbox-dialog-shell {
  position: fixed;
  inset: 0;
  z-index: 4100;
  pointer-events: none;
}
.inbox-dialog {
  position: absolute;
  top: 64px;
  right: 18px;
  width: min(410px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 82px));
  overflow: hidden;
  border: 1px solid #e0e5ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(26, 35, 52, 0.2);
  pointer-events: auto;
  animation: inbox-enter 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.inbox-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 14px;
  border-bottom: 1px solid #e7eaf0;
}
.inbox-dialog > header strong,
.inbox-dialog > header span {
  display: block;
}
.inbox-dialog > header strong {
  font-size: 14px;
}
.inbox-dialog > header span {
  margin-top: 3px;
  color: #8993a2;
  font-size: 10px;
}
.inbox-close {
  width: 34px;
  height: 34px;
  border: 1px solid #e2e6ed;
  border-radius: 10px;
  background: #fff;
  color: #687384;
  font: 400 23px/1 system-ui, sans-serif;
}
.inbox-close:hover {
  background: #f3f5f8;
  color: #1d2531;
}
.inbox-preview-note {
  padding: 9px 14px;
  border-bottom: 1px solid #dce6f7;
  background: #f3f7ff;
  color: #41618c;
  font-size: 10px;
  line-height: 1.5;
}
.inbox-list {
  display: grid;
  max-height: min(510px, calc(100vh - 185px));
  overflow: auto;
}
.inbox-message {
  position: relative;
  padding: 14px 15px 13px 19px;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
}
.inbox-message.unread {
  background: #fafaff;
}
.inbox-message.unread::before {
  content: '';
  position: absolute;
  top: 19px;
  left: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #655cf4;
}
.inbox-message-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.inbox-message-head strong {
  font-size: 12px;
}
.inbox-message-head time {
  flex: none;
  color: #9aa3b0;
  font-size: 9px;
}
.inbox-message p {
  margin: 7px 0 0;
  color: #596475;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.inbox-message button {
  height: 27px;
  margin-top: 9px;
  padding: 0 9px;
  border: 1px solid #dddff5;
  border-radius: 8px;
  background: #f3f1ff;
  color: #5b52dc;
  font-size: 9px;
  font-weight: 700;
}
.inbox-empty {
  padding: 42px 18px;
  color: #8a94a3;
  font-size: 11px;
  text-align: center;
}
.inbox-empty.error {
  color: #bd4352;
}
@keyframes inbox-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 3.0 Director entity binding / episode look timeline */
.look-timeline,
.prop-relations,
.shot-context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.look-timeline span,
.prop-relations span,
.shot-context-chips span {
  font-size: 12px;
  line-height: 1.4;
  padding: 5px 8px;
  border: 1px solid #e2e6ef;
  border-radius: 8px;
  background: #f8f9fc;
  color: #48536a;
}
.shot-context-summary {
  margin: 0 0 12px;
  padding: 12px 13px;
  border: 1px solid #dfe6f4;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8faff, #fff);
}
.shot-context-summary > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.shot-context-summary strong {
  font-size: 13px;
}
.shot-context-summary > div:first-child span {
  font-size: 12px;
  color: #758097;
}
.director-entity-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(17, 24, 39, 0.28);
  display: grid;
  place-items: center;
  padding: 24px;
}
.director-entity-modal.hidden {
  display: none;
}
.director-entity-dialog {
  width: min(680px, calc(100vw - 48px));
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border: 1px solid #dfe4ee;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(25, 33, 50, 0.2);
}
.director-entity-head,
.director-entity-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid #edf0f5;
}
.director-entity-head button {
  border: 0;
  background: transparent;
  font-size: 22px;
}
.director-entity-body {
  padding: 18px;
  display: grid;
  gap: 12px;
}
.director-entity-actions {
  border-top: 1px solid #edf0f5;
  border-bottom: 0;
  justify-content: flex-end;
  gap: 8px;
}
.director-entity-body label {
  font-size: 12px;
  color: #667085;
  display: grid;
  gap: 6px;
}
.director-entity-body input,
.director-entity-body select,
.director-entity-body textarea {
  width: 100%;
  border: 1px solid #dfe4ee;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #202839;
  font: inherit;
}
.director-entity-body textarea {
  min-height: 88px;
  resize: vertical;
}
.entity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.entity-grid .wide {
  grid-column: 1/-1;
}
.entity-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  border: 1px solid #e5e9f1;
  border-radius: 10px;
  max-height: 150px;
  overflow: auto;
}
.entity-checks label {
  display: flex;
  align-items: center;
  gap: 7px;
}
.entity-checks input {
  width: auto;
}
.entity-note {
  font-size: 12px;
  line-height: 1.65;
  color: #57647a;
  background: #f6f8fb;
  border-radius: 10px;
  padding: 10px 12px;
}
/* 分层设计 3.0：在线编辑真实画布控制 */
.ld-canvas-toolbar button.active {
  background: #ebe7ff;
  color: #5b43d6;
  border: 1px solid #d9d0ff;
}
.ld-canvas-scroll {
  height: calc(100% - 38px);
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px;
  background: #f8f9fb;
}
.ld-canvas-scroll .ld-canvas {
  flex: 0 0 auto;
  margin: 0;
  height: auto;
  max-height: none;
  min-height: 320px;
}
.ld-canvas.show-grid:after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(#6f56ee18 1px, transparent 1px), linear-gradient(90deg, #6f56ee18 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 999;
}
.ld-tree-spacer {
  display: block;
  width: 25px;
}
.ld-editor-canvas .ld-canvas-scroll {
  height: calc(100% - 38px);
}
/* 分层设计容器：三段式垂直布局，避免模式栏覆盖工作区 */
[data-vision-tab='split'].active {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
[data-vision-tab='split'] .ld-modebar,
[data-vision-tab='split'] .ld-editor-top {
  flex: 0 0 auto;
}
[data-vision-tab='split'] .ld-classic-grid,
[data-vision-tab='split'] .ld-editor {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}
[data-vision-tab='split'] .ld-classic-composer,
[data-vision-tab='split'] .ld-ai-composer {
  flex: 0 0 auto;
}
.ld-editor-empty-start {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.ld-empty-start-card {
  width: min(680px, 90%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 18px 55px #1720330d;
  display: grid;
  gap: 14px;
}
.ld-empty-start-card h2 {
  font-size: 20px;
  margin: 0;
}
.ld-empty-start-card p {
  margin: 0;
  color: #737d8b;
  font-size: 12px;
  line-height: 1.75;
}
.ld-empty-start-card .ld-source-actions {
  padding: 0;
  grid-template-columns: 140px 140px;
  justify-content: start;
}
.ld-empty-start-card .ld-ref-strip {
  padding: 0;
}
.ld-empty-start-card .dock-input-row textarea {
  min-height: 90px;
}
.ld-start-plan {
  height: 38px;
  justify-self: end;
  padding: 0 18px;
  border-radius: 10px;
}

/* 3.1 P0: smart conversation follow, visible transfers, and focused editor polish. */
.chat-jump-latest {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 4;
  transform: translateX(-50%);
  height: 34px;
  padding: 0 14px;
  border: 1px solid #dce1e8;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(24, 33, 48, 0.13);
  color: #303947;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.chat-jump-latest:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 14px 34px rgba(24, 33, 48, 0.17);
}
.chat-jump-latest[hidden] {
  display: none;
}

/* 3.1.1 shared smart follow for every prompt/history stream */
.smart-scroll-host {
  position: relative;
  min-height: 0;
}
.smart-scroll-jump {
  position: absolute;
  left: 50%;
  bottom: var(--smart-scroll-bottom, 16px);
  z-index: 18;
  transform: translateX(-50%);
  height: 34px;
  padding: 0 14px;
  border: 1px solid #dce1e8;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 30px rgba(24, 33, 48, 0.13);
  color: #303947;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.smart-scroll-jump:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 14px 34px rgba(24, 33, 48, 0.17);
}
.smart-scroll-jump[hidden] {
  display: none;
}
.director-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.drama-view-panel[data-video-view-panel='generation'] {
  grid-template-rows: auto auto minmax(0, 1fr) auto !important;
}
.video-transfer-landing {
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid #d9e2ec;
  border-radius: 13px;
  background: linear-gradient(135deg, #f8fafc, #fff);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(35, 45, 61, 0.05);
}
.video-transfer-landing[hidden] {
  display: none;
}
.video-transfer-landing > div {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
}
.video-transfer-landing span {
  grid-row: 1/3;
  padding: 5px 8px;
  border-radius: 7px;
  background: #202733;
  color: #fff;
  font-size: 9.5px;
  font-weight: 750;
}
.video-transfer-landing strong {
  font-size: 11px;
  color: #2d3744;
}
.video-transfer-landing small {
  font-size: 9.5px;
  color: #7f8996;
}
.video-transfer-landing > button {
  height: 29px;
  flex: none;
  padding: 0 10px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #fff;
  color: #687381;
  font-size: 9.5px;
}
.video-source-context {
  padding: 9px;
  border: 1px solid #dde5ed;
  border-radius: 9px;
  background: #f8fafc;
}
.video-source-context p {
  color: #354252 !important;
  font-weight: 650;
}
.transfer-highlight {
  animation: transferFieldHighlight 2.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes transferFieldHighlight {
  0%,
  18% {
    border-color: #202733 !important;
    box-shadow: 0 0 0 4px rgba(32, 39, 51, 0.13);
  }
  100% {
    border-color: var(--line);
    box-shadow: none;
  }
}

/* 在线编辑：统一为克制的一体化三栏，不复制传统桌面软件的重工具感。 */
[data-vision-tab='split'] .ld-editor-top {
  height: 62px;
  margin-bottom: 9px;
  padding: 0 14px;
  border-color: #e3e6eb;
  border-radius: 16px;
  box-shadow: 0 7px 24px rgba(25, 33, 46, 0.035);
}
[data-vision-tab='split'] .ld-editor-top strong {
  font-size: 13px;
  color: #202733;
}
[data-vision-tab='split'] .ld-editor-top span {
  margin-top: 3px;
  font-size: 10px;
  color: #8a939f;
}
[data-vision-tab='split'] .ld-editor-top button {
  height: 32px;
  border-color: #e0e4e9;
  background: #fff;
  color: #596473;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease;
}
[data-vision-tab='split'] .ld-editor-top button:hover {
  background: #f5f6f8;
  border-color: #cfd5dc;
  transform: translateY(-1px);
}
[data-vision-tab='split'] .ld-editor {
  grid-template-columns: 240px minmax(420px, 1fr) 300px;
  gap: 0;
  border: 1px solid #dfe3e8;
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(24, 32, 45, 0.055);
}
[data-vision-tab='split'] .ld-tree,
[data-vision-tab='split'] .ld-editor-canvas,
[data-vision-tab='split'] .ld-inspector {
  border: 0;
  border-radius: 0;
  background: #fff;
}
[data-vision-tab='split'] .ld-editor-canvas {
  border-left: 1px solid #e4e7eb;
  border-right: 1px solid #e4e7eb;
  background: #f3f4f6;
}
[data-vision-tab='split'] .ld-panel-head {
  height: 46px;
  padding: 0 13px;
  background: #fff;
  border-color: #eceef1;
}
[data-vision-tab='split'] .ld-panel-head strong {
  font-size: 11.5px;
  color: #252d38;
}
[data-vision-tab='split'] .ld-panel-head span {
  font-size: 9px;
  color: #9aa2ad;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
[data-vision-tab='split'] .ld-tree-actions {
  padding: 8px 9px;
  border-color: #eceef1;
  background: #fafafa;
}
[data-vision-tab='split'] .ld-tree-actions button {
  height: 31px;
  border-color: #e2e5e9;
  background: #fff;
  color: #66717e;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
[data-vision-tab='split'] .ld-tree-actions button:hover {
  background: #202733;
  color: #fff;
}
[data-vision-tab='split'] .ld-tree-list {
  padding: 8px;
}
[data-vision-tab='split'] .ld-tree-row {
  position: relative;
  height: 45px;
  margin-bottom: 2px;
  border-radius: 9px;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}
[data-vision-tab='split'] .ld-tree-row:hover {
  background: #f5f6f7;
  transform: translateX(1px);
}
[data-vision-tab='split'] .ld-tree-row.active {
  background: #eef0f2;
}
[data-vision-tab='split'] .ld-tree-row.active:before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: #202733;
}
[data-vision-tab='split'] .ld-tree-main strong {
  font-size: 11px;
  color: #303946;
}
[data-vision-tab='split'] .ld-tree-main small {
  font-size: 9px;
  color: #929aa5;
}
[data-vision-tab='split'] .ld-canvas-toolbar {
  height: 42px;
  padding: 0 11px;
  background: #fff;
  border-color: #e6e9ed;
}
[data-vision-tab='split'] .ld-canvas-toolbar button {
  height: 27px;
  background: transparent;
  color: #707b88;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
[data-vision-tab='split'] .ld-canvas-toolbar button:hover,
[data-vision-tab='split'] .ld-canvas-toolbar button.active {
  border-color: transparent;
  background: #202733;
  color: #fff;
}
[data-vision-tab='split'] .ld-canvas-scroll {
  height: calc(100% - 42px);
  padding: 22px;
  background: #f2f3f5;
}
[data-vision-tab='split'] .ld-canvas {
  border-color: #d9dde2;
  border-radius: 5px;
  box-shadow: 0 16px 44px rgba(28, 35, 46, 0.12);
}
[data-vision-tab='split'] .ld-canvas-layer {
  transition:
    outline-color 0.16s ease,
    filter 0.16s ease;
}
[data-vision-tab='split'] .ld-canvas-layer:hover {
  filter: brightness(0.985);
}
[data-vision-tab='split'] .ld-canvas-layer.selected {
  outline: 2px solid #202733;
  outline-offset: -2px;
}
[data-vision-tab='split'] .ld-inspector-body {
  padding: 12px 13px;
}
[data-vision-tab='split'] .ld-field {
  gap: 6px;
  margin-bottom: 12px;
}
[data-vision-tab='split'] .ld-field label {
  font-size: 9.5px;
  color: #697481;
  font-weight: 650;
}
[data-vision-tab='split'] .ld-field input,
[data-vision-tab='split'] .ld-field textarea,
[data-vision-tab='split'] .ld-field select {
  border-color: #e0e4e9;
  border-radius: 9px;
  background: #fafbfc;
  color: #303946;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}
[data-vision-tab='split'] .ld-field input:focus,
[data-vision-tab='split'] .ld-field textarea:focus,
[data-vision-tab='split'] .ld-field select:focus {
  outline: 0;
  border-color: #8d96a1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42, 50, 62, 0.07);
}
[data-vision-tab='split'] .ld-source-badge {
  border: 1px solid #e8eaed;
  background: #f7f8f9;
  color: #717b87;
}
[data-vision-tab='split'] .ld-wide-btn {
  border-color: #e1e4e8;
  background: #fff;
  color: #56616e;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
[data-vision-tab='split'] .ld-wide-btn:hover {
  background: #f1f2f4;
  color: #202733;
}
[data-vision-tab='split'] .ld-ai-composer {
  height: 88px;
  margin-top: 9px;
  padding: 10px 13px;
  border-color: #dfe3e8;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(27, 35, 48, 0.045);
}
[data-vision-tab='split'] .ld-ai-scope {
  border-color: #e5e8ec;
}
[data-vision-tab='split'] .ld-ai-scope strong {
  font-size: 11.5px;
  color: #252d38;
}
.ld-edit-modal {
  border: 1px solid #e0e4e9;
  border-radius: 20px;
  box-shadow: 0 28px 90px rgba(17, 24, 39, 0.2);
}
.ld-edit-types label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid #e2e6ea;
  border-radius: 9px;
  background: #fafbfc;
  color: #596473;
}
.ld-reference-field small {
  font-size: 9px;
  line-height: 1.5;
  color: #929aa5;
}
@media (max-width: 1280px) {
  [data-vision-tab='split'] .ld-editor {
    grid-template-columns: 220px minmax(360px, 1fr) 265px;
  }
}

/* C7 locked-cut transport, version targeting, and collapsible context. */
.sequence-transport {
  grid-template-areas: 'copy controls rail' 'playhead playhead playhead' 'note note note';
}
.sequence-playhead {
  grid-area: playhead;
  display: grid;
  grid-template-columns: 52px minmax(120px, 1fr) 52px;
  align-items: center;
  gap: 9px;
  color: #707b89;
  font-variant-numeric: tabular-nums;
  font-size: 9px;
}
.sequence-playhead span:last-child {
  text-align: right;
}
.sequence-playhead input {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #5c53ee;
  cursor: pointer;
}
.sequence-playhead input:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.sequence-clip {
  cursor: grab;
  touch-action: pan-y;
}
.sequence-clip:active {
  cursor: grabbing;
}
.sequence-clip.status-locked {
  border-color: #cde5da;
  background: #f7fcf9;
}
.sequence-clip.status-locked b {
  color: #278664;
}
.sequence-clip.status-unlocked {
  border-color: #ead7ae;
  background: #fffaf0;
}
.sequence-clip.status-unlocked b {
  color: #ad782a;
}
.sequence-clip.status-missing {
  border-style: dashed;
  background: #fafbfc;
  opacity: 0.78;
}
.sequence-clip.status-missing b {
  color: #9aa4b1;
}
.sequence-clip-ghost {
  opacity: 0.28 !important;
}
.sequence-clip-chosen {
  border-color: #655aea !important;
  box-shadow: 0 8px 24px rgba(92, 83, 238, 0.18);
}
.sequence-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.video-preview-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.video-version-panel {
  border-top: 1px solid var(--line);
  background: #fff;
  transition:
    box-shadow 0.2s ease,
    background 0.2s ease;
}
.video-version-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px 0;
}
.video-version-panel-head strong {
  font-size: 10px;
  color: #3d4754;
}
.video-version-panel-head span {
  font-size: 9px;
  color: #8a95a3;
}
.video-version-panel .video-version-strip {
  border-top: 0;
}
.video-version-chip {
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 5px;
}
.video-version-chip small {
  font-size: 8px;
  color: #8993a0;
}
.video-version-chip b {
  padding: 2px 5px;
  border-radius: 5px;
  background: #e5f5ed;
  color: #28795c;
  font-size: 7.5px;
}
.video-version-chip.locked {
  border-color: #97cdb5;
  background: #f1fbf6;
  color: #28795c;
}
.video-version-panel.version-focus {
  background: #faf9ff;
  box-shadow: inset 0 0 0 2px rgba(92, 83, 238, 0.28);
}

.production-generation-workspace.details-collapsed {
  grid-template-columns: 225px minmax(0, 1fr) 52px !important;
}
.video-shot-inspector .video-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.video-shot-inspector [data-video-details-toggle] {
  flex: none;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #fff;
  color: #626e7d;
  font-size: 9px;
}
.video-shot-inspector.is-collapsed > div:last-child {
  display: none !important;
}
.video-shot-inspector.is-collapsed .video-panel-head {
  height: 100%;
  box-sizing: border-box;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px 6px;
  border-bottom: 0;
}
.video-shot-inspector.is-collapsed .video-panel-head > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.video-shot-inspector.is-collapsed .video-panel-head strong {
  writing-mode: vertical-rl;
  letter-spacing: 0.12em;
  font-size: 10px;
}
.video-shot-inspector.is-collapsed .video-panel-head span {
  display: none;
}
.video-shot-inspector.is-collapsed [data-video-details-toggle] {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 0;
}
.video-shot-inspector.is-collapsed [data-video-details-toggle]::after {
  content: '›';
  font-size: 17px;
}

@media (max-width: 1050px) {
  .sequence-transport {
    grid-template-areas: 'copy controls' 'rail rail' 'playhead playhead' 'note note';
  }
}
@media (max-width: 980px) {
  .production-generation-workspace.details-collapsed {
    grid-template-columns: 195px minmax(0, 1fr) !important;
    grid-template-rows: minmax(330px, 1fr) 48px !important;
  }
  .production-generation-workspace .video-shot-inspector.is-collapsed {
    display: grid !important;
    grid-column: 1/-1;
    grid-template-rows: 48px !important;
  }
  .video-shot-inspector.is-collapsed .video-panel-head {
    height: 48px;
    flex-direction: row;
    justify-content: space-between;
    padding: 7px 11px;
    border-top: 1px solid var(--line);
  }
  .video-shot-inspector.is-collapsed .video-panel-head > div {
    display: block;
  }
  .video-shot-inspector.is-collapsed .video-panel-head strong {
    writing-mode: horizontal-tb;
    letter-spacing: normal;
  }
  .video-shot-inspector.is-collapsed [data-video-details-toggle] {
    width: auto;
    height: 28px;
    padding: 0 9px;
    font-size: 9px;
  }
  .video-shot-inspector.is-collapsed [data-video-details-toggle]::after {
    content: none;
  }
}
@media (max-width: 760px) {
  .production-generation-workspace.details-collapsed {
    grid-template-columns: 1fr !important;
    grid-template-rows: 135px minmax(260px, 1fr) 48px !important;
  }
  .video-version-panel-head span {
    display: none;
  }
}
