:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #1d2126;
  --panel-deep: #171a1f;
  --surface: #23272b;
  --surface-hover: #2c3036;
  --surface-active: #383d44;
  --line: #30363f;
  --soft-line: #262c34;
  --text: #f4f6f8;
  --muted: #a7b0bb;
  --faint: #747e8b;
  --blue: #75b9ff;
  --green: #7ddd9a;
  --pink: #ff8bd3;
  --yellow: #ffd770;
  --red: #ff5f58;
  --left-width: 310px;
  --right-width: 330px;
  --timeline-height: 330px;
  --timeline-gutter: 132px;
  font-family: Inter, "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 32px;
  border: 1px solid #3a414c;
  border-radius: 10px;
  padding: 0 30px 0 10px;
  background:
    linear-gradient(45deg, transparent 50%, #d8e0ea 50%) calc(100% - 15px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, #d8e0ea 50%, transparent 50%) calc(100% - 10px) 50% / 6px 6px no-repeat,
    #25272a;
  color: #eef3f8;
  font-weight: 800;
  outline: none;
}

select:hover,
select:focus {
  border-color: #596270;
  background-color: #30343a;
}

select option {
  background: #25272a;
  color: #eef3f8;
  font-weight: 800;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-rows: 60px minmax(0, 1fr) 8px var(--timeline-height);
  height: 100vh;
  padding: 0 14px 14px;
  overflow: hidden;
}

.app-shell.chat-mode {
  grid-template-rows: 60px minmax(0, 1fr) 0 0;
}

.app-shell.chat-mode .horizontal,
.app-shell.chat-mode .editor {
  display: none;
}

.app-shell.table-mode {
  grid-template-rows: 60px minmax(0, 1fr) 0 0;
}

.app-shell.table-mode .horizontal,
.app-shell.table-mode .editor {
  display: none;
}

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

.brand,
.mode-switch,
.tool-group,
.preview-controls,
.time-readout,
.timeline-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

h1 {
  margin: 0;
  font-size: 23px;
}

.badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid #3a4048;
  color: var(--muted);
  font-size: 12px;
}

.mode-switch {
  margin-left: auto;
  padding: 4px;
  border-radius: 999px;
  background: #171a20;
  border: 1px solid var(--line);
}

.admin-entry {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #171a20;
  border: 1px solid var(--line);
  color: var(--muted);
}

.admin-entry:hover {
  background: #2c3036;
  color: var(--text);
}

.mode-switch button,
.preview-controls button,
.composer button:not(.model-select-trigger):not(.model-select-option),
.tool-group button {
  height: 32px;
  border-radius: 8px;
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
}

.preview-controls button {
  display: grid;
  place-items: center;
  width: 34px;
  padding: 0;
  border: 1px solid var(--soft-line);
  background: #1d2024;
  font-size: 15px;
}

.preview-controls button:hover {
  background: #252c36;
  color: var(--text);
}

.mode-switch button.active,
.composer button:not(.model-select-trigger):not(.model-select-option),
.tool-group button.active {
  background: #f5f7fa;
  color: #111317;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: var(--left-width) 8px minmax(360px, 1fr) 8px var(--right-width);
  min-height: 0;
  overflow: hidden;
}

.app-shell.chat-mode .workspace {
  grid-template-columns: minmax(340px, var(--left-width)) 8px minmax(360px, 1fr);
}

.app-shell.chat-mode .preview-pane,
.app-shell.chat-mode .splitter[data-resizer="right"] {
  display: none;
}

.app-shell.table-mode .workspace {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.table-mode .chat-pane,
.app-shell.table-mode .splitter[data-resizer="left"],
.app-shell.table-mode .preview-pane,
.app-shell.table-mode .inspector-pane,
.app-shell.table-mode .splitter[data-resizer="right"] {
  display: none;
}

.app-shell.table-mode .table-pane {
  display: none;
  grid-column: 1 / -1;
  min-width: 0;
}

.app-shell.table-mode .table-pane.active {
  display: grid;
}

.pane,
.editor {
  min-height: 0;
  background: var(--panel);
  border: 1px solid #343941;
  border-radius: 14px;
  overflow: hidden;
}

.chat-pane,
.preview-pane,
.inspector-pane {
  padding: 14px;
}

.pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--soft-line);
  position: relative;
}

.pane-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.chat-history-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.chat-history-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 260;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 32px));
  max-height: min(360px, calc(100vh - 180px));
  padding: 10px;
  border: 1px solid #343941;
  border-radius: 12px;
  background: #23272b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

.chat-history-panel[hidden] {
  display: none !important;
}

.chat-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-history-head strong {
  font-size: 13px;
  color: #f2f4f6;
}

.chat-history-list {
  display: grid;
  gap: 6px;
  max-height: min(280px, calc(100vh - 240px));
  overflow: auto;
}

.chat-history-item {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid #343941;
  border-radius: 10px;
  background: #1d2024;
}

.chat-history-item strong {
  font-size: 12px;
  color: #f2f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-history-item small {
  color: #9ba3ad;
  font-size: 11px;
}

.chat-history-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.chat-history-item-actions button {
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid #3a4048;
  border-radius: 999px;
  background: #2c3036;
  color: #f2f4f6;
  font-size: 11px;
}

.chat-history-item-actions button:hover {
  background: #383d44;
}

.chat-history-item-actions button.danger {
  color: #ffb4ae;
}

.chat-history-empty {
  margin: 0;
  padding: 8px 2px;
  color: #9ba3ad;
  font-size: 12px;
  text-align: center;
}

.pane-head h2 {
  margin: 0;
  font-size: 17px;
}

.pane-head span {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

.preview-aspect-select {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #1d2024;
  color: var(--text);
}

.menu-dot {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #23272b;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}

.menu-dot:hover {
  background: #252a33;
  color: var(--text);
}

.chat-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-composer-stack {
  position: relative;
  padding: 0 14px 14px 16px;
}

.composer-topic-duration {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #1a1e24;
}

.composer-topic-duration[hidden] {
  display: none !important;
}

.composer-topic-duration-label {
  color: #8d949d;
  font-size: 12px;
  white-space: nowrap;
}

.composer-topic-duration-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.composer-topic-duration-actions button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #17191c;
  color: #d8dee8;
  font-size: 12px;
  cursor: pointer;
}

.composer-topic-duration-actions button.active {
  border-color: #3e444c;
  color: #f2f4f6;
  background: #32363c;
}

.pipeline-topic-duration-card .chat-action-row,
.pipeline-topic-duration-actions {
  gap: 8px;
}

.pipeline-topic-duration-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pipeline-topic-duration-row[hidden] {
  display: none !important;
}

.pipeline-topic-duration-label {
  font-size: 12px;
  color: #9aa3ad;
}

.pipeline-topic-duration-card .chat-action-row button.active,
.pipeline-topic-duration-actions button.active {
  border-color: #3e444c;
  color: #f2f4f6;
  background: #32363c;
}

.chat-composer-stack.has-pipeline-steps {
  padding-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.composer-pipeline-steps {
  display: none;
  overflow: hidden;
}

.composer-pipeline-steps:not([hidden]) {
  display: block;
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: min(480px, 72%);
  margin: 0 auto;
  padding: 6px 12px 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.composer-pipeline-steps:not([hidden])::after {
  display: none;
}

.chat-composer-stack.has-pipeline-steps .composer {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: -16px;
  border-radius: 20px;
  background: #20252b;
  border-color: #30363f;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
}

.composer-pipeline-steps .composer-pipeline-step-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.composer-pipeline-steps .pipeline-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  font-size: 11px;
  flex-shrink: 0;
}

.composer-pipeline-steps .pipeline-step b {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}

.composer-pipeline-steps .pipeline-step.done {
  color: #72dfc3;
}

.composer-pipeline-steps .pipeline-step.done b {
  background: rgba(114, 223, 195, 0.16);
  color: #72dfc3;
}

.composer-pipeline-steps .pipeline-step.current {
  color: #72dfc3;
  background: rgba(114, 223, 195, 0.1);
  border: 0;
  box-shadow: none;
  transform: none;
}

.composer-pipeline-steps .pipeline-step.current b {
  background: #72dfc3;
  color: #0b1218;
}

.composer-pipeline-steps .pipeline-step:not(.done):not(.current) {
  color: #5f6b78;
}

.composer-pipeline-steps .pipeline-step-sep {
  width: 8px;
  opacity: 0.65;
}

.chat-feed {
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 26px 16px 18px 20px;
}

.message {
  max-width: 100%;
  min-width: 0;
  margin-bottom: 12px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message.user {
  width: fit-content;
  max-width: 86%;
  margin-left: auto;
  padding: 12px 14px;
  background: var(--surface-hover);
}

.message p {
  margin-bottom: 14px;
  color: #e6edf5;
  line-height: 1.65;
  font-size: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message > strong {
  display: none;
}

.thinking-message {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  color: #dce5ef;
}

.thinking-text {
  color: #b9c3cf;
}

.thinking-dots {
  display: inline-flex;
  gap: 3px;
}

.thinking-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #aeb8c5;
  animation: dot-pulse 1s ease-in-out infinite;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.14s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes text-shimmer {
  to { background-position: -180% 0; }
}

@keyframes dot-pulse {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 20px;
}

.message-actions button {
  height: 32px;
  border-radius: 999px;
  padding: 0 11px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 700;
}

.message-actions button:hover,
.message-actions button:first-child {
  border-color: var(--line);
  background: #20252d;
}

.quick-prompts {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
}

.quick-prompts button {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 14px;
  background: #1d2024;
  color: var(--text);
  text-align: left;
}

.quick-prompts button:hover {
  background: #222832;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto 38px;
  grid-template-rows: minmax(52px, auto) auto;
  align-items: center;
  gap: 8px 10px;
  min-height: 92px;
  padding: 12px 14px 12px 16px;
  border: 1px solid #30363f;
  border-radius: 19px;
  background: #20252b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.composer textarea {
  grid-column: 1 / 4;
  min-width: 0;
  width: 100%;
  min-height: 54px;
  max-height: 92px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.composer-attachments {
  grid-column: 1 / 4;
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 2px;
}

.composer-attachments.active {
  display: flex;
}

.composer-asset-chip {
  position: relative;
  display: grid !important;
  place-items: center;
  flex: 0 0 auto;
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  padding: 3px !important;
  border: 1px solid #3a4554 !important;
  border-radius: 10px !important;
  background: var(--panel-deep) !important;
  color: #e7edf5 !important;
  box-shadow: none !important;
  overflow: hidden;
}

.composer-asset-chip img,
.composer-asset-chip video,
.composer-asset-chip > span {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  background: #141619;
}

.composer-asset-chip > span {
  display: grid;
  place-items: center;
  color: #9eabba;
}

.composer-asset-chip small {
  display: none;
}

.composer-asset-chip i {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: rgba(8, 12, 17, 0.78);
  color: #fff;
  font-style: normal;
  font-size: 13px;
  line-height: 1;
}

.composer-asset-chip small {
  min-width: 0;
  overflow: hidden;
  color: #d7e0eb;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-asset-chip i {
  color: #8994a3;
  font-style: normal;
}

.composer-asset-chip::before,
.composer-asset-chip::after {
  display: none !important;
  content: none !important;
}

.composer-mode {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
}

.composer .composer-mode {
  z-index: 5;
  overflow: visible !important;
}

.composer-mode button,
.composer-mode select {
  height: 26px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #c9d2dd;
}

.composer-mode button {
  width: 26px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.composer-mode select {
  max-width: 124px;
  padding: 0 4px;
  font-size: 12px;
}

.native-mode-select,
.composer-mode:has(#composerModeTrigger) > select#chatModeSelect,
.composer-mode:has(#composerModeTrigger) #chatModeSelect.native-mode-select {
  display: none !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  background: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  visibility: hidden !important;
}

.composer-media-controls[data-capability="chat"] select:not([data-param="model"]):not(.model-select-native):not(.model-billing-select),
.composer-media-controls[data-capability="chat"] input,
.composer-media-controls[data-capability="chat"] [data-media-kind],
.composer-media-controls[data-capability="chat"] [data-param]:not([data-param="model"]),
.composer-media-controls[data-capability="chat"] .composer-dynamic-param,
.composer-media-controls.pipeline-chat-controls select:not([data-param="model"]):not(.model-select-native):not(.model-billing-select),
.composer-media-controls.pipeline-chat-controls input,
.composer-media-controls.pipeline-chat-controls [data-media-kind],
.composer-media-controls.pipeline-chat-controls [data-param]:not([data-param="model"]),
.composer-media-controls.pipeline-chat-controls .composer-dynamic-param {
  display: none !important;
}

.composer-media-controls[data-capability="chat"] > .model-select-wrap,
.composer-media-controls.pipeline-chat-controls > .model-select-wrap {
  display: block !important;
  flex: 0 1 auto;
  min-width: 112px;
  max-width: 176px;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.composer .composer-media-controls.pipeline-chat-controls .model-select-wrap,
.composer .composer-media-controls[data-capability="chat"] .model-select-wrap {
  display: block !important;
  flex: 0 1 auto !important;
  min-width: 112px !important;
  max-width: 176px !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.composer .composer-media-controls.pipeline-chat-controls .model-select-trigger,
.composer .composer-media-controls[data-capability="chat"] .model-select-trigger {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.composer-media-controls[data-capability="chat"] .model-select-trigger {
  pointer-events: auto !important;
  cursor: pointer !important;
}

.composer-media-controls[data-capability="chat"] .model-select-menu {
  z-index: 500 !important;
}

.composer-media-controls.pipeline-hidden-controls,
.composer-media-controls[data-capability="pipeline"] {
  display: none !important;
}

.composer .composer-media-controls.pipeline-hidden-controls,
.composer .composer-media-controls[data-capability="pipeline"],
.composer .composer-media-controls.pipeline-hidden-controls.active,
.composer .composer-media-controls[data-capability="pipeline"].active {
  display: none !important;
}

.composer-mode-trigger {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  width: auto !important;
  min-width: 96px;
  max-width: 148px;
  height: 28px !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  background: rgba(117, 185, 255, 0.08) !important;
  border: 1px solid rgba(117, 185, 255, 0.28) !important;
  color: #d7dee8 !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 600;
  flex: 0 0 auto;
  overflow: hidden;
}

.composer-mode-trigger span {
  white-space: nowrap;
}

.composer-mode-trigger i {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.82;
}

.composer-mode-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  top: auto;
  z-index: 220;
  display: none;
  width: min(420px, 78vw);
  padding: 8px;
  border: 1px solid #3a414c;
  border-radius: 14px;
  background: rgba(37, 39, 42, 0.98);
  box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.composer-mode-menu.open {
  display: grid;
  gap: 2px;
}

.composer-mode-menu button {
  display: grid !important;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100% !important;
  height: auto !important;
  min-height: 52px;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #eef3f8 !important;
  box-shadow: none !important;
  text-align: left;
}

.composer-mode-menu button:hover,
.composer-mode-menu button.active {
  background: #30343a !important;
}

.composer-mode-menu strong,
.composer-mode-menu small {
  grid-column: 1;
}

.composer-mode-menu strong {
  font-size: 14px;
  line-height: 1.35;
}

.composer-mode-menu small {
  margin-top: 2px;
  color: #aab2bd;
  font-size: 12px;
  line-height: 1.3;
}

.composer-mode-menu b {
  display: none;
  grid-column: 2;
  grid-row: 1 / span 2;
  color: #e9eef6;
  font-size: 16px;
}

.composer-mode-menu button.active b {
  display: block;
}

.composer button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger):not(.composer-settings-btn):not(#attachBtn) {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  background: #4c5cff;
  color: white;
  font-size: 0;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(76, 92, 255, 0.28);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.composer button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger):not(.composer-settings-btn):not(#attachBtn)::before {
  content: "";
  width: 14px;
  height: 14px;
  border-top: 3px solid currentColor;
  border-right: 3px solid currentColor;
  transform: rotate(45deg);
  margin-left: -4px;
}

.composer .composer-mode-trigger::before,
.composer .composer-mode-trigger::after,
.composer .model-select-trigger::before,
.composer .model-select-trigger::after,
.composer .composer-settings-btn::before,
.composer .composer-settings-btn::after,
.composer #attachBtn::before,
.composer #attachBtn::after {
  display: none !important;
  content: none !important;
}

.composer button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger):not(.composer-settings-btn):not(#attachBtn)::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  transform: translateX(-1px);
}

.composer button.stop {
  background: #b92b27;
  color: white;
  box-shadow: 0 10px 24px rgba(185, 43, 39, 0.3);
}

.composer button.stop::before {
  content: "■";
}

.composer button.stop {
  color: transparent;
}

.composer button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger):not(.composer-settings-btn):not(#attachBtn):hover {
  background: #444b55;
}

.composer button.stop::before {
  content: "";
  width: 15px;
  height: 15px;
  margin: 0;
  border: 2.5px solid currentColor;
  border-radius: 2px;
  transform: none;
  background: transparent;
}

.composer button.stop::after {
  display: none;
}

.composer button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger):not(.composer-settings-btn):not(#attachBtn):hover {
  background: #5867ff;
  transform: translateY(-1px);
}

.composer button.stop:hover {
  background: #c73732;
}

.composer button.stop {
  color: white;
}

.composer #sendBtn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #4f63ff;
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 99, 255, 0.22);
  transform: none;
}

.composer #sendBtn::before {
  width: 12px;
  height: 12px;
  margin-left: -3px;
  border-top: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
}

.composer #sendBtn::after {
  display: block;
  width: 19px;
  height: 2.5px;
  background: currentColor;
  transform: translateX(-1px);
}

.composer #sendBtn:hover {
  background: #6172ff;
  box-shadow: 0 10px 22px rgba(79, 99, 255, 0.26);
  transform: none;
}

.composer #sendBtn.stop {
  border-color: rgba(255, 255, 255, 0.07);
  background: #b92c28;
  color: #fff;
  box-shadow: 0 8px 18px rgba(185, 44, 40, 0.22);
}

.composer #sendBtn.stop::before {
  width: 12px;
  height: 12px;
  margin: 0;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: transparent;
  transform: none;
}

.composer #sendBtn.stop::after {
  display: none;
}

.composer #sendBtn.stop:hover {
  background: #c63a35;
  box-shadow: 0 10px 22px rgba(185, 44, 40, 0.26);
}

.composer .composer-mode button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger) {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #c9d2dd;
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}

.composer .composer-mode button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger)::before,
.composer .composer-mode button:not(.model-select-trigger):not(.model-select-option):not(.composer-mode-trigger)::after,
.composer #attachBtn::before,
.composer #attachBtn::after {
  display: none;
  content: none;
}

.composer .composer-mode button:hover {
  background: #2a3039;
  transform: none;
}

.composer #attachBtn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: transparent;
  color: #c9d2dd;
  box-shadow: none;
  font-size: 22px;
  font-weight: 300;
}

.chat-asset-preview {
  width: 96px;
  aspect-ratio: 16 / 9;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17191c;
}

.chat-asset-preview img,
.chat-asset-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-choice-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-deep);
}

.chat-feed .style-choice-btn:has(.style-choice-preview) {
  align-items: stretch;
  height: auto;
  min-height: 0;
  padding: 10px;
}

.chat-feed .style-choice-btn:has(.style-choice-preview) strong,
.chat-feed .style-choice-btn:has(.style-choice-preview) small {
  display: block;
  text-align: left;
}

.character-scene-design-grid {
  gap: 10px;
  margin-top: 12px;
}

.pipeline-input-hint {
  margin: 0 0 10px;
  color: #8d949d;
  font-size: 12px;
  line-height: 1.5;
}

.character-scene-shot-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.character-scene-shot-item {
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.character-scene-shot-item summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.character-scene-expand-icon {
  display: inline-block;
  width: 8px;
  height: 8px;
  justify-self: end;
  border-right: 1.5px solid #8d949d;
  border-bottom: 1.5px solid #8d949d;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.15s ease;
}

.character-scene-shot-item[open] > summary .character-scene-expand-icon {
  transform: rotate(225deg) translateY(1px);
}

.character-scene-shot-item summary::-webkit-details-marker {
  display: none;
}

.character-scene-shot-item summary b {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(114, 223, 195, 0.14);
  color: #72dfc3;
  font-size: 11px;
}

.character-scene-shot-item summary em {
  color: #7d8791;
  font-style: normal;
  font-size: 11px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-scene-ref-item.is-single {
  position: relative;
  width: 72px;
  height: 72px;
}

.character-scene-ref-item.is-single img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.character-scene-ref-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 12, 17, 0.82);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.character-scene-ref-restore {
  min-height: 28px;
  padding: 0 10px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: #9aa5b1;
  font-size: 11px;
  cursor: pointer;
}

.character-scene-ref-restore:hover {
  border-color: #72dfc3;
  color: #eef3f8;
}

.character-scene-grid-ref-hint {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #6f7a86;
  font-size: 11px;
  line-height: 1.4;
}

.character-scene-grid-aspect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.character-scene-grid-aspect-label {
  color: #8d949d;
  font-size: 12px;
  white-space: nowrap;
}

.character-scene-grid-aspect-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.character-scene-grid-aspect-actions button {
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: #17191c;
  color: #d8dee8;
  font-size: 12px;
  cursor: pointer;
}

.character-scene-grid-aspect-actions button.active {
  border-color: #72dfc3;
  color: #eef3f8;
  background: rgba(114, 223, 195, 0.08);
}

.motion-aspect-row {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
}

.motion-aspect-label {
  color: #8d949d;
  font-size: 12px;
}

.motion-aspect-actions {
  width: 100%;
}

.character-scene-shot-editor {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.character-scene-shot-editor label {
  display: grid;
  gap: 4px;
  color: #8d949d;
  font-size: 11px;
}

.character-scene-shot-editor textarea {
  width: 100%;
  min-height: 56px;
  padding: 8px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.character-scene-ref-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.character-scene-ref-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.character-scene-editor-main input[type="text"] {
  width: 100%;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1d2024;
  color: var(--text);
  font-size: 12px;
}

.character-scene-design-workbench {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.character-scene-design-section h5 {
  margin: 0 0 8px;
  color: #c5ced8;
  font-size: 12px;
  font-weight: 700;
}

.character-scene-design-item {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.character-scene-design-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.character-scene-design-item-actions {
  display: flex;
  gap: 6px;
}

.character-scene-design-item-actions button,
.character-scene-design-workbench button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #252a30;
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.character-scene-design-item label {
  display: grid;
  gap: 4px;
  color: #8d949d;
  font-size: 11px;
}

.character-scene-design-item textarea {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1d2024;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.character-scene-ref-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8d949d;
  font-size: 11px;
}

.character-scene-ref-toggle.global {
  margin-bottom: 0;
}

.character-scene-style-ref-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.character-scene-style-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.character-scene-style-preview img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #17191c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.character-scene-ref-grid,
.character-scene-design-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.character-scene-ref-item {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.character-scene-ref-item button {
  height: 22px;
  padding: 0 6px;
  font-size: 10px;
}

.character-scene-ref-grid img,
.character-scene-design-preview img {
  width: 88px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  background: #17191c;
}

.character-scene-design-preview.composite {
  flex-direction: column;
  align-items: flex-start;
}

.character-scene-design-preview.composite span,
.character-scene-design-section h5 small {
  color: #7d8791;
  font-size: 11px;
  font-weight: normal;
}

.character-scene-design-preview.composite img {
  width: 100%;
  max-width: 360px;
  height: auto;
  aspect-ratio: 16 / 9;
}

.character-scene-quad-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 16 / 9;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.character-scene-quad-cell {
  display: grid;
  gap: 4px;
  align-content: start;
  min-height: 0;
  padding: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.character-scene-quad-cell strong {
  color: #d8e0ea;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.character-scene-quad-cell small {
  color: #8d949d;
  font-size: 10px;
  line-height: 1.35;
}

.character-scene-quad-cell.is-empty {
  place-content: center;
  color: #5f6770;
  font-size: 10px;
}

.character-scene-design-confirm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.character-scene-design-workbench-simple .character-scene-shot-list h5 {
  margin: 0 0 8px;
  color: #c5ced8;
  font-size: 12px;
  font-weight: 700;
}

.character-scene-design-workbench-simple .character-scene-shot-list h5 small {
  color: #7d8791;
  font-weight: normal;
}

.character-scene-simple-editor {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.character-scene-ref-source {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.character-scene-ref-source-label {
  color: #7d8791;
  font-size: 11px;
  font-weight: 600;
}

.character-scene-ref-item.is-style-source {
  border-color: rgba(114, 223, 195, 0.35);
}

.character-scene-add-item {
  justify-self: start;
  min-height: 32px;
  padding: 0 14px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: #9aa5b1;
  font-size: 12px;
  cursor: pointer;
}

.character-scene-add-item:hover {
  border-color: #72dfc3;
  color: #eef3f8;
}

.character-scene-editor-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.character-scene-editor-refs {
  align-self: end;
}

.character-scene-compact-refs {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.character-scene-compact-refs .character-scene-ref-grid {
  justify-content: flex-end;
}

.character-scene-ref-add {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #252a30;
  color: #eef3f8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

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

.character-scene-slot-item {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.character-scene-slot-item strong {
  color: #8d949d;
  font-size: 10px;
  font-weight: 700;
}

.character-scene-slot-item input,
.character-scene-slot-item textarea {
  width: 100%;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1d2024;
  color: var(--text);
  font-size: 11px;
}

.character-scene-slot-item textarea {
  min-height: 48px;
  resize: vertical;
}

.character-scene-empty {
  margin: 0;
  color: #7d8791;
  font-size: 12px;
}

.remotion-plan-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.remotion-plan-summary div {
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--panel-deep);
}

.remotion-plan-summary strong,
.remotion-plan-summary small {
  display: block;
}

.remotion-plan-summary small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.motion-effect-controls .legacy-motion-field {
  display: none;
}

.motion-effect-controls textarea[id="motionTextLayersInput"],
.motion-effect-controls textarea[id="motionAssetAnimationsInput"] {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

.remotion-plan-assets {
  margin-top: 12px;
}

.chat-asset-preview span {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
}

.source-count {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.preview-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.preview-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.04), transparent 34%),
    #17191c;
}

.phone-canvas {
  position: relative;
  width: min(96%, 820px);
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  max-height: min(100%, 760px);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(160deg, #2a2e34, var(--panel-deep) 58%, #252a30);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.phone-canvas.landscape {
  width: min(96%, 820px);
  height: auto;
  max-height: 100%;
}

.phone-canvas.portrait {
  width: auto;
  height: min(100%, 760px);
  max-width: 96%;
}

.phone-canvas.square {
  width: auto;
  height: min(76%, 520px);
  max-height: 100%;
}

.phone-canvas.has-generated-image .canvas-bg {
  background-image: var(--preview-image);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #05070a;
}

.preview-layer-stack {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

.preview-layer-stack.interactive {
  pointer-events: auto;
}

.preview-layer-item {
  position: absolute;
  touch-action: none;
  background: transparent !important;
  background-color: rgba(0, 0, 0, 0) !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  outline: none !important;
  overflow: visible;
}

.preview-layer-item.selected {
  background: transparent !important;
  background-color: rgba(0, 0, 0, 0) !important;
  backdrop-filter: none !important;
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
}

.preview-layer-item.editable {
  cursor: move;
}

.preview-layer-item .preview-layer {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: transparent !important;
  object-fit: contain;
  object-position: center;
}

.preview-layer-selection-frame {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  border: 1.5px solid rgba(117, 185, 255, 0.95);
  border-radius: 2px;
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  background: transparent !important;
  background-color: rgba(0, 0, 0, 0) !important;
  backdrop-filter: none !important;
}

.preview-layer-selection-frame.active {
  opacity: 1;
  pointer-events: none;
  cursor: move;
}

.preview-layer-selection-frame .sel-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 2px;
  background: #75b9ff;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
}

.preview-layer-selection-frame .sel-nw {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.preview-layer-selection-frame .sel-ne {
  top: 0;
  right: 0;
  margin-right: -5px;
  cursor: nesw-resize;
}

.preview-layer-selection-frame .sel-sw {
  bottom: 0;
  left: 0;
  margin-bottom: -5px;
  cursor: nesw-resize;
}

.preview-layer-selection-frame .sel-se {
  right: 0;
  bottom: 0;
  margin: 0 -5px -5px 0;
  cursor: nwse-resize;
}

.preview-layer-selection-frame .sel-rotate-handle {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: rgba(117, 185, 255, 0.92);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  cursor: grab;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.preview-layer-selection-frame .sel-rotate-handle::after {
  content: "↻";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.preview-layer-selection-frame.active .sel-rotate-handle {
  opacity: 1;
  pointer-events: auto;
}

.preview-layer-selection-frame .sel-handle:hover {
  background: #dff0ff;
  transform: scale(1.08);
}

.phone-canvas.layer-edit-mode .preview-layer-stack {
  pointer-events: auto;
}

.preview-layer {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent;
}

.preview-layer.background {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.phone-canvas.has-layer-preview .canvas-bg {
  background-image: var(--preview-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #15181b;
}

.phone-canvas.has-layer-preview:not(.has-generated-image) .canvas-bg {
  background-image: none;
}

.preview-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  background: #05070a;
}

.preview-video.active {
  opacity: 1;
}

.preview-motion-video {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
  background: transparent;
}

.preview-motion-video.active {
  opacity: 1;
}

.phone-canvas.has-generated-image .sticker,
.phone-canvas.has-generated-image .safe-line,
.preview-video.active ~ .sticker,
.preview-video.active ~ .safe-line {
  display: none;
}

.canvas-bg {
  position: absolute;
  inset: 0;
  background-color: #15181b;
}

.sticker,
.safe-line,
.caption-card {
  position: absolute;
  border-radius: 8px;
  font-weight: 800;
}

.caption-card {
  z-index: 9;
}

.sticker-child {
  left: 18%;
  top: 45%;
  padding: 22px 16px;
  background: #8ae3a4;
  color: #101317;
  transform: rotate(-4deg);
}

.sticker-pot {
  right: 14%;
  top: 36%;
  padding: 18px 20px;
  background: #ffd770;
  color: #101317;
  transform: rotate(5deg);
}

.sticker-steam {
  right: 18%;
  top: 25%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
  color: #20242a;
}

.safe-line {
  left: 12%;
  right: 12%;
  top: 58%;
  height: 4px;
  background: var(--red);
  box-shadow: 0 0 16px rgba(255, 95, 88, 0.55);
}

.caption-card {
  left: 8%;
  right: 8%;
  bottom: 8%;
  padding: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.caption-card:empty {
  display: none;
}

.caption-card[data-position="top"] {
  top: 8%;
  bottom: auto;
}

.caption-card[data-position="center"] {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
}

.motion-preset-row,
.motion-abc-row,
.motion-shadow-row {
  width: 100%;
  max-width: 520px;
}

.motion-preset-row {
  display: grid;
  gap: 10px;
  padding: 0 0 14px;
}

.motion-preset-label {
  color: #8d949d;
  font-size: 12px;
}

.motion-preset-actions {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.motion-preset-actions button.active {
  border-color: #72dfc3;
  color: #eef3f8;
  background: rgba(114, 223, 195, 0.08);
}

.motion-abc-row {
  display: grid;
  gap: 10px;
  padding: 0 0 14px;
}

.motion-abc-group {
  display: grid;
  gap: 6px;
}

.motion-abc-group + .motion-abc-group {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.motion-shadow-row {
  display: grid;
  gap: 8px;
  padding: 0 0 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.motion-shadow-detail {
  display: grid;
  gap: 8px;
  padding-left: 2px;
}

.motion-shadow-distance-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 48px;
  gap: 2px 10px;
  align-items: center;
  color: #8d949d;
  font-size: 12px;
  width: 100%;
}

.motion-shadow-distance-row .motion-shadow-distance-label {
  grid-column: 1;
  grid-row: 1;
}

.motion-shadow-distance-row .motion-shadow-distance-value {
  grid-column: 3;
  grid-row: 1;
  text-align: right;
  color: #c5d3e0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.motion-density-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 44px;
  gap: 2px 10px;
  align-items: center;
  color: #8d949d;
  font-size: 12px;
  width: 100%;
}

.motion-density-row input[type="range"] {
  width: 100%;
  margin: 0;
}

.motion-density-value {
  color: #c5d3e0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.motion-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: #8d949d;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.motion-switch-row:hover {
  border-color: rgba(117, 185, 255, 0.4);
  background: rgba(117, 185, 255, 0.07);
}

.motion-switch-text {
  flex: 1;
  min-width: 0;
}

.motion-switch {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  display: inline-block;
}

.motion-switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.motion-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #3a4149;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.16s ease, border-color 0.16s ease;
}

.motion-switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d7dee7;
  transition: transform 0.16s ease, background 0.16s ease;
}

.motion-switch input:checked + i {
  background: rgba(117, 185, 255, 0.85);
  border-color: rgba(117, 185, 255, 0.9);
}

.motion-switch input:checked + i::after {
  transform: translateX(14px);
  background: #ffffff;
}

.motion-shadow-distance-label {
  grid-column: 1 / -1;
  grid-row: 1;
}

.motion-shadow-distance-value {
  grid-column: 3;
  grid-row: 2;
  color: #c5d3e0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.motion-shadow-distance-row input[type="range"] {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: 14px;
  margin: 0;
  border: none;
  outline: none;
  background: transparent;
  accent-color: #72dfc3;
  -webkit-appearance: none;
  appearance: none;
}

.motion-shadow-distance-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.motion-shadow-distance-row input[type="range"]::-moz-range-track {
  height: 4px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.motion-shadow-distance-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 999px;
  background: #72dfc3;
  box-shadow: none;
}

.motion-shadow-distance-row input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #72dfc3;
  box-shadow: none;
}

.motion-bgm-row {
  display: grid;
  gap: 9px;
  padding: 0 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.motion-bgm-label {
  color: #8d949d;
  font-size: 12px;
}

.motion-bgm-status {
  color: #7f8ea0;
  font-size: 12px;
  line-height: 1.5;
}

.motion-bgm-actions {
  width: 100%;
}

.preview-controls {
  justify-content: center;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.preview-controls button {
  background: #232832;
}

.preview-controls span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.table-pane {
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 14px;
}

.app-shell.table-mode .table-pane.active {
  display: grid;
}

.table-head > div:first-child {
  display: grid;
  gap: 4px;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions button {
  height: 30px;
  border-radius: 8px;
  padding: 0 10px;
  background: #2c3036;
  color: var(--text);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.table-actions button:hover {
  background: #383e45;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  color: var(--muted);
  font-size: 13px;
}

.table-toolbar strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shot-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #17191c;
}

.shot-table {
  width: 100%;
  min-width: 1420px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.shot-table th,
.shot-table td {
  border-right: 1px solid #343941;
  border-bottom: 1px solid #343941;
  vertical-align: top;
}

.shot-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 46px;
  padding: 12px;
  background: #242930;
  color: #f2f4f6;
  text-align: center;
  font-size: 14px;
}

.shot-table tbody tr {
  height: auto;
  max-height: none;
}

.shot-table tbody td {
  height: auto;
  max-height: none;
  padding: 10px;
  overflow-y: auto;
  overflow-x: hidden;
}

.shot-table tbody td:nth-child(4),
.shot-table tbody td:nth-child(5) {
  overflow: hidden;
  vertical-align: top;
}

.shot-table tbody td:nth-child(7) {
  overflow: hidden;
  vertical-align: middle;
}

.shot-table td {
  background: #161a1e;
  vertical-align: top;
}

.shot-table tr.dirty td {
  background: var(--panel-deep);
  box-shadow: none;
}

.shot-table th:nth-child(1),
.shot-table td:nth-child(1) {
  width: 280px;
}

.shot-table th:nth-child(2),
.shot-table td:nth-child(2) {
  width: 230px;
}

.shot-table th:nth-child(3),
.shot-table td:nth-child(3) {
  width: 130px;
}

.shot-table th:nth-child(4),
.shot-table td:nth-child(4),
.shot-table th:nth-child(5),
.shot-table td:nth-child(5),
.shot-table th:nth-child(7),
.shot-table td:nth-child(7) {
  width: 230px;
}

.shot-table th:nth-child(6),
.shot-table td:nth-child(6) {
  width: 260px;
}

.visual-cell strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  color: #f7f9fc;
}

.motion-cell label,
.shot-table small {
  display: block;
  color: var(--faint);
  font-size: 11px;
}

.editable {
  min-height: 38px;
  max-height: 56px;
  overflow: auto;
  padding: 6px;
  border-radius: 7px;
  border: 1px solid transparent;
  color: #e9eef5;
  line-height: 1.35;
  font-size: 12px;
  outline: none;
}

.editable:hover,
.editable:focus {
  border-color: #3c4856;
  background: #252a30;
}

.visual-edit {
  min-height: 126px;
  max-height: 142px;
}

.dialogue-edit {
  min-height: 108px;
  max-height: 124px;
}

.motion-edit {
  min-height: 70px;
  max-height: 86px;
}

.motion-narration {
  max-height: 48px;
  overflow: auto;
  margin-top: 4px;
  padding: 6px;
  border-radius: 7px;
  background: var(--panel-deep);
  color: #b7c1cd;
  font-size: 12px;
  line-height: 1.35;
}

.duration-cell {
  text-align: left;
}

.duration-cell input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  background: var(--panel-deep);
  color: var(--text);
  outline: none;
}

.duration-cell input:focus {
  border-color: #50565e;
  box-shadow: 0 0 0 1px rgba(80, 86, 94, 0.35);
}

.duration-cell span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.shot-table tbody .table-media {
  height: auto;
  min-height: 0;
  max-height: none;
}

.table-shot-cell {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.table-shot-cell .table-media {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.shot-table tbody .table-media .media-preview,
.table-shot-cell .media-preview {
  min-height: 128px;
  height: 128px;
  max-height: none;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  box-sizing: border-box;
}

.table-cell-editor {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding-top: 2px;
}

.table-ref-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}

.table-ref-item {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0d1014;
}

.table-ref-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-ref-item button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.table-ref-add {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #0d1014;
  color: #8f9bab;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.table-ref-add:hover {
  border-color: rgba(114, 223, 195, 0.45);
  color: #d8dee8;
  background: #17191c;
}

.table-regen-prompt {
  width: 100%;
  min-height: 52px;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #0d1014;
  color: #e7edf5;
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.table-media.is-regenerating .regen-icon {
  opacity: 1;
  transform: translateY(0);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.table-media {
  position: relative;
  height: 100%;
}

.shot-table tbody .media-preview {
  min-height: 0;
}

.media-preview {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-deep);
  border: 1px solid var(--soft-line);
  color: var(--faint);
  font-size: 12px;
  cursor: zoom-in;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-media.has-media .media-preview {
  border-color: rgba(125, 221, 154, 0.55);
}

.regen-icon {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(18, 23, 30, 0.82);
  color: #f5f7fa;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.table-media:hover .regen-icon {
  opacity: 1;
  transform: translateY(0);
}

.regen-icon:hover {
  background: rgba(57, 73, 96, 0.95);
}

.table-hover-preview {
  position: fixed;
  z-index: 9999;
  display: none;
  width: 360px;
  height: 220px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(11, 14, 18, 0.94);
  border: 1px solid #3b4654;
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.48);
  pointer-events: none;
}

.table-hover-preview.active {
  display: block;
}

.table-hover-preview img,
.table-hover-preview video {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: contain;
  background: #05070a;
}

.inspector-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.inspector-pane > .pane-head,
.inspector-pane-head {
  display: none !important;
}

.inspector-pane .side-tabs {
  padding-top: 0;
  padding-bottom: 10px;
}

.side-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 0;
}

.side-tabs button {
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
}

.side-tabs button.active {
  background: var(--surface-active);
  border-color: #444a52;
  color: var(--text);
}

.side-panel {
  display: none;
  min-height: 0;
  overflow: auto;
}

.side-panel.active {
  display: grid;
  align-content: start;
  gap: 9px;
}

.asset-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.asset-item.active,
.asset-item:hover {
  background: #252a33;
}

.asset-item span {
  color: var(--faint);
  font-size: 12px;
}

.shot-actions {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #1d2024;
  border: 1px solid var(--soft-line);
}

.shot-actions strong {
  font-size: 14px;
}

.shot-actions button {
  height: 32px;
  border-radius: 8px;
  background: var(--surface-active);
  color: var(--text);
  text-align: left;
  padding: 0 10px;
}

.shot-actions button:hover {
  background: var(--surface-hover);
}

.side-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.side-panel input,
.side-panel select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #1d2024;
  color: var(--text);
}

.export-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--panel-deep);
}

.export-card strong {
  color: var(--text);
  font-size: 15px;
}

.export-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.export-card button {
  min-height: 34px;
  border-radius: 8px;
  background: var(--surface-hover);
  color: var(--text);
  font-weight: 800;
}

.export-card button:hover {
  background: var(--surface-active);
}

.export-card small {
  color: var(--muted);
  font-size: 12px;
}

.splitter {
  position: relative;
  z-index: 20;
  border-radius: 999px;
}

.splitter::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 120ms ease;
}

.splitter:hover::after,
.splitter.dragging::after {
  background: #4a5568;
}

.splitter.vertical {
  cursor: col-resize;
}

.splitter.horizontal {
  cursor: row-resize;
  margin: 0 2px;
}

.editor {
  padding: 12px;
}

.editor-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--soft-line);
}

.tool-group {
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 12px;
  background: #1d2024;
}

.tool-group button {
  background: #202631;
  color: #c5ced8;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.tool-group button:hover {
  background: #2b3442;
  color: #f6f8fb;
  transform: translateY(-1px);
}

.edit-status {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-readout {
  color: var(--muted);
}

.time-readout strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.timeline-zoom {
  min-width: 178px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
}

.timeline-zoom span {
  white-space: nowrap;
}

.timeline-zoom input {
  width: 118px;
  accent-color: #a7abb0;
}

.timeline-wrap {
  height: calc(100% - 45px);
  overflow: auto;
  padding-top: 18px;
}

.shot-strip {
  position: relative;
  z-index: 16;
  height: 38px;
  min-width: 100%;
}

.shot-pill {
  position: absolute;
  top: 5px;
  height: 28px;
  border-radius: 8px;
  padding: 0 9px;
  background: #202630;
  color: #c4ccd6;
  border: 1px solid #323b47;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  text-align: left;
  transition: left 0.18s ease, width 0.18s ease, box-shadow 0.15s ease;
}

.shot-pill.active,
.shot-pill:hover {
  border-color: #5a6068;
  background: var(--surface-hover);
  color: var(--text);
}

.shot-pill.selected {
  box-shadow: 0 0 0 2px rgba(117, 185, 255, 0.82);
  border-color: rgba(117, 185, 255, 0.72);
}

.shot-pill.dragging {
  opacity: 0.55;
}

.shot-pill.drag-active {
  z-index: 40;
  opacity: 0.96;
  cursor: grabbing;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(117, 185, 255, 0.65);
  transition: none;
  pointer-events: none;
}

.shot-pill.drop-before::before,
.shot-pill.drop-after::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: #75b9ff;
  box-shadow: 0 0 8px rgba(117, 185, 255, 0.8);
}

.shot-pill.drop-before::before {
  left: 0;
}

.shot-pill.drop-after::after {
  right: 0;
}

.shot-pill.drop-flash {
  animation: shot-pill-drop-flash 0.6s ease;
}

@keyframes shot-pill-drop-flash {
  0% { box-shadow: 0 0 0 3px rgba(122, 215, 165, 0.95); }
  100% { box-shadow: 0 0 0 0 rgba(122, 215, 165, 0); }
}

.timeline {
  position: relative;
  min-width: 1080px;
  padding-bottom: 10px;
}

.ruler {
  position: relative;
  align-items: center;
  height: 34px;
  border-top: 1px solid #2a3038;
  color: var(--faint);
  font-size: 12px;
  user-select: none;
}

.ruler::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--timeline-gutter);
  background: #1d2024;
  border-right: 1px solid #2a3038;
  pointer-events: none;
  z-index: 1;
}

.ruler span {
  top: 10px;
  z-index: 2;
}

.track {
  display: grid;
  grid-template-columns: var(--timeline-gutter) minmax(0, 1fr);
  min-height: 38px;
  margin-bottom: 7px;
}

[data-track="image-material"] {
  transition: min-height 160ms ease;
}

.timeline.material-expanded [data-track="image-material"] {
  min-height: 152px;
}

.track-name {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 4px;
  margin-right: 8px;
  padding: 0 6px 0 4px;
  min-height: 34px;
  border-radius: 6px;
  background: #181b20;
  color: var(--muted);
  font-size: 12px;
}

.track-name.has-track-controls.material-toggle::before {
  display: none;
}

.track-name.material-toggle.open .track-label-text::before,
.track-name.material-toggle:not(.open) .track-label-text::before {
  content: none;
}

.track-label-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  white-space: nowrap;
}

.track-controls {
  display: grid;
  grid-template-columns: repeat(3, 20px);
  gap: 1px;
  align-items: center;
  justify-content: start;
  flex: 0 0 62px;
  width: 62px;
}

.track-control-slot-empty {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.track-control-btn {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 4px;
  color: #8f9aa8;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 20px;
  background: transparent;
  box-shadow: none;
  transition: color 120ms ease, transform 100ms ease;
}

.track-icon-btn svg {
  display: block;
}

.track-control-btn:hover {
  color: #c5ced8;
  background: transparent;
}

.track-control-btn:active,
.track-control-btn.pressed {
  transform: scale(0.86);
}

.track-control-btn.active {
  color: #72dfc3;
  background: transparent;
}

.track-control-btn.active:hover {
  color: #8aebd0;
}

.track-control-btn.track-material-expand {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.track-control-btn.track-material-expand.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.track-name {
  width: calc(100% - 8px);
  border: 0;
  cursor: pointer;
}

.material-toggle::before,
.material-toggle.open::before {
  display: none;
  content: none;
}

.material-toggle.disabled {
  cursor: pointer;
  opacity: 1;
}

.material-toggle.ready {
  color: var(--muted);
}

.track-lane {
  position: relative;
  min-height: 38px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 150px),
    #151a20;
}

[data-track="image-material"] .track-lane {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0, rgba(255, 255, 255, 0.035) 1px, transparent 1px, transparent 150px),
    #151a20;
}

.timeline.material-expanded [data-track="image-material"] .track-lane {
  min-height: calc(36px + (var(--max-layer-order, 4) + 1) * 30px);
}

.clip {
  position: absolute;
  top: 5px;
  height: 28px;
  min-width: 28px;
  padding: 0 10px;
  border-radius: 7px;
  color: #101317;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  transition: left 0.18s ease;
}

.clip.dragging,
.clip.resizing {
  transition: none;
}

.timeline.material-expanded [data-track="image-material"] .clip.layer-bg,
.timeline.material-expanded [data-track="image-material"] .clip.layer-asset,
.timeline.material-expanded [data-track="image-material"] .clip.layer-child {
  top: calc(5px + (var(--max-layer-order, 4) - var(--layer-order, 0)) * 30px);
  height: 24px;
  padding-left: 16px;
  font-size: 11px;
}

.timeline.material-expanded [data-track="image-material"] .clip.layer-child:nth-of-type(odd) {
  filter: brightness(1.06);
}

.inspector-section {
  display: grid;
  gap: 9px;
}

.inspector-section-hidden {
  display: none !important;
}

.clip.selected {
  outline: 2px solid #f1f3f4 !important;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(241, 243, 244, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.55) inset !important;
  z-index: 12;
}

.clip.dialogue {
  display: none;
  background: var(--blue);
}

.clip.material {
  background: var(--green);
}

.clip.audio {
  background: var(--pink);
}

.clip.audio:not([data-media-url]),
.clip.bgm:not([data-media-url]) {
  background: #626c77;
  color: #f0f3f6;
}

.clip.bgm {
  top: 5px;
  background: #f4b95f;
  color: #201408;
}

.clip.bgm:not([data-media-url]) {
  background: #626c77;
  color: #f0f3f6;
}

.clip.audio.global,
.clip.bgm {
  overflow: hidden;
}

.audio-clip-envelope {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.audio-clip-envelope::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--audio-level, 50%);
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) var(--fade-in, 0%),
    rgba(255, 255, 255, 0.38) var(--fade-in, 0%),
    rgba(255, 255, 255, 0.38) calc(100% - var(--fade-out, 0%)),
    rgba(255, 255, 255, 0) calc(100% - var(--fade-out, 0%)),
    rgba(255, 255, 255, 0) 100%
  );
  border-top: 1px solid rgba(255, 255, 255, 0.62);
  opacity: 0.88;
}

.audio-clip-controls .audio-clip-hint {
  display: block;
  margin-top: 4px;
  color: var(--muted, #8a93a0);
  font-size: 11px;
  line-height: 1.45;
}

.clip.caption {
  background: var(--yellow);
  min-width: 52px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: 0;
  text-align: center;
}

.clip.hidden-shot {
  display: none;
}

.timeline .track.track-hidden .clip {
  display: none !important;
}

.track.track-locked .clip {
  cursor: not-allowed;
}

.track.track-hidden .track-lane {
  opacity: 0.42;
  filter: grayscale(0.75);
}

.track[data-track="motion-effect"].track-mode-exclusive-hidden {
  display: none !important;
}

.track.track-locked .track-lane {
  position: relative;
  opacity: 0.72;
  filter: grayscale(0.45);
}

.track.track-locked .track-lane::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 25;
  border-radius: 8px;
  background: rgba(11, 14, 18, 0.36);
  pointer-events: none;
}

.all-shots .clip.hidden-shot {
  display: block;
}

.all-shots .clip.dialogue.hidden-shot {
  display: none;
}

.all-shots .clip.layer-child.hidden-shot,
.all-shots .clip.layer-bg.hidden-shot,
.all-shots .clip.layer-prop.hidden-shot,
.all-shots .clip.layer-fx.hidden-shot,
.all-shots .clip.layer-asset.hidden-shot {
  display: none;
}

.all-shots.material-expanded .clip.layer-child.hidden-shot,
.all-shots.material-expanded .clip.layer-bg.hidden-shot,
.all-shots.material-expanded .clip.layer-prop.hidden-shot,
.all-shots.material-expanded .clip.layer-fx.hidden-shot,
.all-shots.material-expanded .clip.layer-asset.hidden-shot {
  display: block;
}

.shot-pill {
  cursor: grab;
  touch-action: none;
}

.shot-pill:active {
  cursor: grabbing;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 8px;
  z-index: 30;
  width: 2px;
  background: var(--red);
  cursor: ew-resize;
  touch-action: none;
}

.playhead.dragging {
  filter: drop-shadow(0 0 10px rgba(198, 58, 53, 0.34));
}

.playhead::before {
  content: "";
  position: absolute;
  left: -7px;
  top: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 95, 88, 0.12);
}

.playhead::after {
  content: "";
  position: absolute;
  left: -14px;
  top: -22px;
  width: 30px;
  height: 44px;
  pointer-events: auto;
}

@media (max-width: 1120px) {
  body {
    min-width: 0;
  }

  :root {
    --left-width: 240px;
    --right-width: 240px;
  }

  .style-admin-grid.category-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .style-editor-body.clean {
    grid-template-columns: 1fr;
  }

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

  .style-reference-panel,
  .style-preview-box {
    max-width: min(228px, 100%);
  }
}

@media (max-width: 760px) {
  .admin-modal {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .admin-head,
  .admin-tabs,
  .admin-section {
    padding-left: 12px;
    padding-right: 12px;
  }

  .style-admin-grid.category-grid,
  .style-substyle-grid,
  .style-form-grid {
    grid-template-columns: 1fr;
  }

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

.admin-modal {
  width: min(1080px, calc(100vw - 44px));
  max-height: min(820px, calc(100vh - 44px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: #1d2126;
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  overflow: hidden;
}

.admin-modal::backdrop {
  background: rgba(0, 0, 0, 0.52);
}

.admin-modal[open] {
  display: flex;
  flex-direction: column;
  max-height: min(820px, calc(100vh - 44px));
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--soft-line);
  background: #1d2126;
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
}

.admin-head h2,
.admin-section h3 {
  margin: 0;
}

.admin-head button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #2c3036;
  color: var(--text);
  font-size: 20px;
}

.admin-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--soft-line);
  background: #1d2126;
  position: relative;
  z-index: 30;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex: 0 0 auto;
  isolation: isolate;
}

.admin-tab-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.admin-tabs button,
.admin-tab-button {
  flex: 0 0 auto;
  height: 34px;
  border-radius: 999px;
  padding: 0 14px;
  background: #1d2024;
  color: var(--muted);
  border: 1px solid var(--line);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 21;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.admin-tabs button.active,
.admin-tab-button.active,
.admin-tab-button.active,
#adminTabModels:checked ~ .admin-tab-button[for="adminTabModels"],
#adminTabStyles:checked ~ .admin-tab-button[for="adminTabStyles"],
#adminTabGrid:checked ~ .admin-tab-button[for="adminTabGrid"],
#adminTabTalkingOverlay:checked ~ .admin-tab-button[for="adminTabTalkingOverlay"] {
  background: var(--surface-active);
  color: var(--text);
  border-color: #444a52;
}

.admin-modal[data-active-admin-tab="models"] #adminModelsPanel,
.admin-modal[data-active-admin-tab="styles"] #styleManagerPanel,
.admin-modal[data-active-admin-tab="grid"] #gridRulePanel,
.admin-modal[data-active-admin-tab="talkingOverlay"] #talkingOverlayStylePanel,
.admin-modal:has(#adminTabModels:checked) #adminModelsPanel,
.admin-modal:has(#adminTabStyles:checked) #styleManagerPanel,
.admin-modal:has(#adminTabGrid:checked) #gridRulePanel,
.admin-modal:has(#adminTabTalkingOverlay:checked) #talkingOverlayStylePanel {
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
  pointer-events: auto !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.admin-modal[data-active-admin-tab="models"] #styleManagerPanel,
.admin-modal[data-active-admin-tab="models"] #gridRulePanel,
.admin-modal[data-active-admin-tab="models"] #talkingOverlayStylePanel,
.admin-modal[data-active-admin-tab="styles"] #adminModelsPanel,
.admin-modal[data-active-admin-tab="styles"] #gridRulePanel,
.admin-modal[data-active-admin-tab="styles"] #talkingOverlayStylePanel,
.admin-modal[data-active-admin-tab="grid"] #adminModelsPanel,
.admin-modal[data-active-admin-tab="grid"] #styleManagerPanel,
.admin-modal[data-active-admin-tab="grid"] #talkingOverlayStylePanel,
.admin-modal[data-active-admin-tab="talkingOverlay"] #adminModelsPanel,
.admin-modal[data-active-admin-tab="talkingOverlay"] #styleManagerPanel,
.admin-modal[data-active-admin-tab="talkingOverlay"] #gridRulePanel,
.admin-modal:has(#adminTabModels:checked) #styleManagerPanel,
.admin-modal:has(#adminTabModels:checked) #gridRulePanel,
.admin-modal:has(#adminTabModels:checked) #talkingOverlayStylePanel,
.admin-modal:has(#adminTabStyles:checked) #adminModelsPanel,
.admin-modal:has(#adminTabStyles:checked) #gridRulePanel,
.admin-modal:has(#adminTabStyles:checked) #talkingOverlayStylePanel,
.admin-modal:has(#adminTabGrid:checked) #adminModelsPanel,
.admin-modal:has(#adminTabGrid:checked) #styleManagerPanel,
.admin-modal:has(#adminTabGrid:checked) #talkingOverlayStylePanel,
.admin-modal:has(#adminTabTalkingOverlay:checked) #adminModelsPanel,
.admin-modal:has(#adminTabTalkingOverlay:checked) #styleManagerPanel,
.admin-modal:has(#adminTabTalkingOverlay:checked) #gridRulePanel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.admin-body {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  contain: layout paint;
}

.admin-tab-panel {
  display: none !important;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  visibility: hidden;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.admin-tab-panel.active {
  display: flex !important;
  flex-direction: column;
  visibility: visible;
  pointer-events: auto;
}

.admin-body > .admin-tab-panel:not(.active),
.admin-body > .admin-tab-panel[hidden],
.admin-tab-panel[hidden],
.admin-tab-panel:not(.active) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.admin-body > .admin-tab-panel.active {
  display: flex !important;
  flex-direction: column;
  visibility: visible !important;
  pointer-events: auto !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.admin-body > .admin-section,
.admin-modal > .admin-section,
.admin-modal[open] > .admin-section {
  display: none !important;
}

.admin-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--soft-line);
}

.admin-hidden-section,
.admin-section[hidden],
#modelParamSection[hidden] {
  display: none !important;
}

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

.square-add {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #525860;
  color: #fff;
  font-size: 24px;
}

.admin-section p {
  margin: 0;
  color: var(--muted);
}

.admin-actions,
.model-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions button,
.model-counts span {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #1d2024;
  color: var(--text);
  border: 1px solid var(--line);
}

.admin-actions button {
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.admin-actions button:hover {
  background: var(--surface-hover);
  border-color: #444a52;
}

.admin-actions button:active {
  transform: translateY(1px);
  background: var(--surface-active);
}

.admin-actions button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.model-counts span {
  display: inline-flex;
  align-items: center;
}

.admin-section pre {
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #17191c;
  color: #b8bec6;
}

.style-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 14px;
}

.style-admin-grid.category-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.style-substyle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.style-substyle-head strong {
  color: #eceff2;
}

.style-substyle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.square-add.small {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 20px;
}

.style-admin-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1d2024;
  cursor: pointer;
}

.style-admin-card.category-card {
  min-height: 222px;
}

.style-admin-card.substyle-card {
  min-height: 178px;
}

.style-admin-card.active {
  border-color: #50565e;
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.style-admin-card:hover {
  border-color: #444a52;
  background: #22262b;
}

.style-thumb {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    var(--panel-deep);
}

.style-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-thumb span {
  font-weight: 800;
  color: #dfe3e7;
}

.style-admin-card strong {
  min-height: 22px;
  font-size: 14px;
}

.style-admin-card small {
  min-height: 32px;
  color: var(--muted);
  line-height: 1.35;
}

.style-card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.style-card-actions button {
  height: 30px;
  border-radius: 8px;
  background: #2c3036;
  color: var(--text);
}

.style-selected-mark {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #32363c;
  color: var(--muted);
  font-size: 11px;
}

.style-card-add {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(44, 48, 54, 0.96);
  color: #f2f4f6;
  border: 1px solid #3a4048;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.14s ease, background 0.14s ease;
}

.style-admin-card:hover .style-card-add,
.style-admin-card.active .style-card-add {
  opacity: 1;
}

.style-card-add:hover {
  background: #525860;
}

.uploaded-mode-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-deep);
  color: var(--muted);
}

.style-admin-card.active .style-selected-mark {
  background: rgba(255, 255, 255, 0.08);
  color: #d7d9dc;
}

.style-editor-panel {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-deep);
}

.style-editor-panel.hidden {
  display: none;
}

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

.style-editor-head h3 {
  margin: 0;
}

.style-editor-head button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #2c3036;
  color: var(--text);
}

.style-editor-body.clean {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(360px, 1.12fr);
  gap: 16px;
  align-items: start;
}

.style-reference-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  width: min(100%, 228px);
  max-width: 228px;
}

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

.style-reference-slot {
  position: relative;
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border: 1px dashed #444a52;
  border-radius: 8px;
  background: #1d2024;
  color: #b8bec6;
  cursor: pointer;
  overflow: hidden;
}

.style-reference-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(9, 12, 16, 0.82);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.style-reference-remove:hover {
  background: rgba(120, 28, 28, 0.92);
}

.style-reference-slot span {
  font-size: 16px;
  line-height: 1;
}

.style-reference-slot small {
  color: var(--muted);
  font-size: 11px;
}

.style-reference-slot.has-image {
  border-style: solid;
  border-color: #343941;
  background: #1d2024;
}

.style-reference-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-reference-slot i {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(9, 12, 16, 0.82);
  color: #fff;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
}

.style-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}

.style-form-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.style-form-grid label.wide {
  grid-column: 1 / -1;
}

.style-form-grid input,
.style-form-grid select,
.style-form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #1d2024;
  color: var(--text);
  font: inherit;
}

.style-form-grid textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.style-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.style-editor-actions button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  background: #2c3036;
  color: var(--text);
  border: 1px solid var(--line);
}

.style-editor-actions button:hover {
  background: #383d44;
  border-color: #444a52;
}

.style-editor-actions button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.style-editor-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
}

.style-reference-column,
.style-form-column {
  display: grid;
  align-content: start;
  gap: 10px;
}

.upload-box {
  display: grid;
  place-items: center;
  width: min(100%, 72px);
  max-width: 72px;
  min-height: 0;
  aspect-ratio: 16 / 9;
  border: 1px dashed #444a52;
  border-radius: 8px;
  color: #b8bec6;
  background: #1d2024;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  justify-self: start;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.upload-box input {
  display: none;
}

.upload-box.has-reference {
  border-style: solid;
  border-color: #343941;
  background: #1d2024;
}

.style-reference-column .upload-box.has-reference img {
  display: none;
}

.upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  grid-area: 1 / 1;
}

.upload-box.has-reference span {
  grid-area: 1 / 1;
  align-self: end;
  width: 100%;
  padding: 4px 6px;
  background: linear-gradient(180deg, transparent, rgba(16, 17, 20, 0.86));
  color: #f2f4f6;
  text-align: center;
}

.style-reference-column .upload-box.has-reference span {
  align-self: center;
  padding: 0 4px;
  background: transparent;
  color: #d7d9dc;
}

.style-reference-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: min(100%, 228px);
  max-width: 228px;
}

.style-reference-item,
.style-reference-add-slot {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid #343941;
  background: #1d2024;
  overflow: hidden;
}

.style-reference-add-slot {
  border-style: dashed;
  border-color: #444a52;
  color: #b8bec6;
  cursor: pointer;
  font-size: 16px;
}

.style-reference-add-slot input {
  display: none;
}

.style-reference-list img,
.style-reference-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.style-reference-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(9, 12, 16, 0.82);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.style-reference-item:hover button {
  opacity: 1;
}

.style-reference-item button:hover {
  background: #ff5f58;
}

.app-shell.chat-mode .workspace {
  grid-template-columns: minmax(560px, 2fr) 8px minmax(300px, 1fr);
}

.app-shell.chat-mode .chat-pane {
  min-width: 560px;
}

.app-shell.chat-mode .inspector-pane {
  min-width: 300px;
}

.composer {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto minmax(36px, auto) auto;
  align-items: end;
  gap: 6px 8px;
  min-height: 108px;
  padding: 10px 12px 8px;
  border-radius: 18px;
  background: #1c2128;
  border-color: #343941;
}

.composer-mode {
  grid-column: 1 / -1;
  align-self: start;
  margin-left: -2px;
}

.composer textarea {
  grid-column: 1 / -1;
  min-height: 36px;
  max-height: 72px;
  padding: 2px 2px 0;
  font-size: 13px;
  line-height: 1.5;
}

.composer-attachments {
  grid-column: 1 / -1;
}

.composer-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin-top: 0;
}

.source-count {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  padding-left: 1px;
}

.composer-mode-trigger {
  height: 28px !important;
  min-width: 94px;
  padding: 0 8px !important;
  color: #e7edf6 !important;
}

.composer-mode-trigger:hover,
.composer #attachBtn:hover {
  background: #252b34 !important;
}

.composer #attachBtn {
  width: 26px;
  height: 26px;
  color: #dce5f0;
}

.composer #sendBtn {
  flex: 0 0 auto;
  align-self: center;
  justify-self: end;
  width: 34px;
  height: 34px;
  border: 1px solid #6d7787;
  background: #edf3fb;
  color: #111722;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.composer #sendBtn::before {
  width: 12px;
  height: 12px;
  margin-left: -4px;
  border-top: 2.2px solid currentColor;
  border-right: 2.2px solid currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
}

.composer #sendBtn::after {
  display: block;
  width: 18px;
  height: 2.2px;
  background: currentColor;
  transform: translateX(-1px);
}

.composer #sendBtn:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.composer #sendBtn.stop {
  border-color: rgba(255, 255, 255, 0.1);
  background: #c63a35;
  color: #fff;
  box-shadow: 0 8px 18px rgba(198, 58, 53, 0.24);
}

.composer #sendBtn.stop::before {
  width: 12px;
  height: 12px;
  margin: 0;
  border: 2px solid currentColor;
  border-radius: 3px;
  background: transparent;
  transform: none;
}

.composer #sendBtn.stop::after {
  display: none;
}

.style-preview-box {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 228px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid #343941;
  background: #1d2024;
  color: var(--muted);
  overflow: hidden;
}

.style-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-preview-error {
  display: grid;
  gap: 7px;
  width: 100%;
  height: 100%;
  align-content: center;
  padding: 14px;
  background: #261919;
  color: #ffd9d6;
  text-align: left;
}

.style-preview-error strong {
  color: #fff1ef;
  font-size: 13px;
}

.style-preview-error small {
  max-height: 74px;
  overflow: auto;
  color: #ffb8b0;
  line-height: 1.45;
  word-break: break-word;
}

.style-form-column label,
.grid-rule-section label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.style-form-column input,
.style-form-column select,
.style-form-column textarea,
.grid-rule-section textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #1d2024;
  color: var(--text);
}

.style-form-column textarea,
.grid-rule-section textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

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

.pipeline-switches label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--panel-deep);
  border: 1px solid var(--line);
  color: #d8e1ec;
}

.pipeline-switches input {
  width: 16px;
  height: 16px;
  accent-color: #9ba3ad;
}

.grid-rule-section textarea {
  min-height: 220px;
}

.grid-rule-notes {
  display: grid;
  gap: 8px;
}

.grid-rule-notes span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1d2024;
  color: #d4dee9;
}

.style-picker-card .chat-action-row {
  grid-template-columns: 1fr;
}

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

.style-sub-choice-title {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.sub-choice-grid {
  margin-top: 8px;
}

.style-choice-btn {
  display: grid;
  gap: 5px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-deep);
  color: var(--text);
  text-align: left;
}

.style-choice-btn strong {
  font-size: 14px;
}

.style-choice-btn small {
  color: var(--muted);
  line-height: 1.35;
}

.style-choice-btn:hover {
  border-color: #50565e;
  background: var(--surface-hover);
}

.style-choice-btn.active {
  border-color: #686c73;
  background: var(--surface-active);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.style-choice-btn.sub-style-choice {
  min-height: 62px;
  background: #1a1d21;
}

.uploaded-reference-card .chat-action-row {
  grid-template-columns: 1fr;
}

.scene-preset-panel {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.scene-preset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scene-preset-head div {
  display: grid;
  gap: 3px;
}

.scene-preset-head span,
.scene-choice-block > span {
  color: var(--muted);
  font-size: 12px;
}

.scene-preset-head button {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #525860;
  color: #fff;
  font-size: 20px;
}

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

.scene-preset-card,
.scene-choice-card {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-deep);
}

.scene-thumb,
.scene-choice-card div {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1d21;
  color: var(--muted);
  font-size: 12px;
}

.scene-thumb img,
.scene-choice-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-name-input,
.scene-prompt-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px;
  background: #1d2024;
  color: var(--text);
  font-size: 12px;
}

.scene-prompt-input {
  min-height: 54px;
  resize: vertical;
}

.scene-card-actions {
  display: flex;
  gap: 6px;
}

.scene-card-actions button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #202936;
  color: var(--text);
}

.scene-choice-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.scene-choice-card {
  text-align: left;
  color: var(--text);
}

.scene-choice-card strong {
  font-size: 12px;
}

.asset-library-box {
  display: grid;
  gap: 8px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--soft-line);
  border-radius: 10px;
  background: var(--panel-deep);
}

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

.asset-library-head .asset-library-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
}

.asset-library-head div,
.asset-library-head-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.asset-library-head .asset-library-mode-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.asset-library-head-actions button,
.asset-library-head-actions .asset-view-btn,
.asset-library-head #uploadLocalAssetBtn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-hover);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0;
}

.asset-library-head .asset-view-btn svg {
  width: 15px;
  height: 15px;
}

.asset-library-head-actions button.active,
.asset-library-head-actions .asset-view-btn.active,
.asset-library-head-actions button:hover,
.asset-library-head-actions .asset-view-btn:hover,
.asset-library-head #uploadLocalAssetBtn:hover {
  color: var(--text);
  border-color: #686c73;
  background: var(--surface-active);
}

.asset-group-flat > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.asset-library-list {
  display: grid;
  gap: 8px;
}

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

.asset-group > span,
.asset-empty {
  color: var(--muted);
  font-size: 12px;
}

.asset-group > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.asset-library-list.is-list-view .asset-group > div {
  grid-template-columns: 1fr;
  gap: 4px;
}

.asset-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #1d2024;
  color: var(--text);
  text-align: left;
}

.asset-list-row:hover,
.asset-list-row.active {
  border-color: #444a52;
  background: #2c3036;
}

.asset-list-row-thumb {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: #15181b;
}

.asset-list-row-thumb img,
.asset-list-row-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-list-row-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.asset-library-local-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.asset-library-local-toolbar[hidden] {
  display: none !important;
}

.asset-library-view-toggle {
  display: inline-flex;
  gap: 4px;
}

.asset-library-view-toggle button {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.asset-library-view-toggle button.active,
.asset-library-view-toggle button:hover {
  color: var(--text);
  border-color: #444a52;
  background: #2c3036;
}

@media (max-width: 720px) {
  .asset-group > div {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.asset-thumb-wrap {
  position: relative;
}

.asset-thumb {
  display: grid;
  place-items: center;
  padding: 2px;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: #1a1d21;
  color: var(--text);
  text-align: left;
}

.asset-thumb img,
.asset-thumb video,
.asset-thumb b {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: contain;
  background: #15181b;
}

.asset-hover-preview {
  position: fixed;
  z-index: 200;
  display: none;
  width: 380px;
  max-width: min(380px, calc(100vw - 36px));
  max-height: 260px;
  padding: 8px;
  border: 1px solid rgba(122, 146, 174, 0.72);
  border-radius: 10px;
  background: rgba(12, 16, 22, 0.96);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
}

.asset-library-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.asset-library-mode-tabs button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.asset-library-mode-tabs button.active {
  border-color: #444a52;
  background: #2c3036;
  color: #f2f4f6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.asset-library-mode-tabs button:hover:not(.active) {
  color: #d7d9dc;
  background: rgba(255, 255, 255, 0.04);
}

.asset-library-mode-tabs button:active {
  transform: scale(0.98);
}

.cloud-asset-stack {
  display: grid;
  gap: 12px;
}

.cloud-asset-section-divider {
  height: 1px;
  margin: 2px 0;
  background: #343941;
}

.cloud-asset-section-label {
  margin-bottom: 6px;
  color: #d7d9dc;
  font-size: 12px;
  font-weight: 600;
}

.creative-asset-panel,
.creative-asset-editor {
  display: grid;
  gap: 10px;
}

.creative-asset-toolbar,
.creative-editor-head,
.creative-editor-actions,
.uploaded-ratio-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.creative-asset-toolbar button,
.creative-editor-actions button,
.uploaded-ratio-row button,
.uploaded-asset-empty {
  min-height: 30px;
  border: 1px solid #3a4048;
  border-radius: 8px;
  background: var(--surface-hover);
  color: var(--text);
  font-size: 12px;
}

.creative-asset-grid,
.uploaded-asset-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.creative-asset-card,
.uploaded-asset-choice {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  color: var(--text);
  text-align: left;
}

.creative-asset-card.active,
.creative-asset-card:hover,
.uploaded-asset-choice.active,
.uploaded-asset-choice:hover,
.uploaded-ratio-row button.active {
  border-color: #686c73;
  background: var(--surface-hover);
}

.creative-asset-card div,
.uploaded-asset-choice div,
.creative-preview-box {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 7px;
  background: #141619;
  color: var(--muted);
  font-size: 12px;
}

.creative-asset-card img,
.uploaded-asset-choice img,
.creative-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.creative-asset-card strong,
.uploaded-asset-choice strong,
.uploaded-asset-label {
  font-size: 12px;
}

.creative-asset-card small,
.creative-editor-head span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.creative-asset-editor label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.creative-asset-editor input,
.creative-asset-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17191c;
  color: var(--text);
  padding: 8px;
  resize: vertical;
}

.uploaded-creative-asset-block {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
}

.uploaded-creative-head {
  display: grid;
  gap: 4px;
}

.uploaded-creative-head span {
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}

.uploaded-creative-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.uploaded-asset-empty {
  grid-column: 1 / -1;
  padding: 8px;
  color: var(--muted);
  text-align: center;
}

.asset-hover-preview.active {
  display: grid;
  place-items: center;
}

.asset-hover-preview img,
.asset-hover-preview video {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 7px;
  background: #05070a;
}

.asset-hover-preview.audio {
  width: 320px;
  max-height: 72px;
}

.asset-hover-preview audio {
  width: 100%;
}

.style-picker-card b {
  color: #c9ccd1;
  font-weight: 700;
}

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

.pricing-grid label,
.model-select-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.pricing-grid input,
.model-select-grid select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #1d2024;
  color: var(--text);
}

.model-billing-section .admin-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.model-billing-grid {
  display: grid;
  gap: 8px;
}

.model-billing-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17191c;
  overflow: hidden;
}

.model-billing-group summary {
  display: grid;
  grid-template-columns: 18px minmax(140px, 1fr) 90px 120px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--text);
}

.model-billing-group summary::-webkit-details-marker {
  display: none;
}

.model-billing-group summary::before {
  content: "▸";
  color: var(--muted);
}

.model-billing-group[open] summary::before {
  content: "▾";
}

.model-billing-group summary strong {
  font-size: 14px;
}

.model-billing-group summary span,
.model-billing-group summary em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.model-billing-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
  max-height: 320px;
  overflow: auto;
}

.model-billing-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

.model-billing-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) minmax(100px, 132px) 118px;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
}

.model-billing-row span,
.model-billing-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-billing-row span,
.model-billing-row em,
.model-visible-toggle,
.billing-points {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.model-visible-toggle,
.billing-points {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.billing-points input {
  width: 58px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: #1d2024;
  color: var(--text);
}

.model-billing-group summary::before {
  content: "" !important;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid var(--muted);
}

.model-billing-group[open] summary::before {
  transform: rotate(90deg);
}

.model-billing-row .credit-rule {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: #bfeccf;
  font-weight: 700;
}

.model-billing-row .credit-rule i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 4px;
  background: linear-gradient(135deg, #40e582, #15984d);
  transform: rotate(45deg);
  box-shadow: 0 0 0 1px rgba(121, 255, 173, 0.28), 0 0 12px rgba(64, 229, 130, 0.18);
}

.model-billing-actions {
  margin-top: 10px;
}

#saveModelBillingBtn.dirty {
  border-color: #7aa7ff;
  color: #eef5ff;
  box-shadow: 0 0 0 1px rgba(122, 167, 255, 0.18);
}

.model-select-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.param-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.param-grid input,
.param-grid select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #1d2024;
  color: var(--text);
}

.model-detail-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.model-detail-grid pre {
  max-height: 132px;
  white-space: pre-wrap;
}

.model-save-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding: 10px 0;
  background: linear-gradient(180deg, rgba(29, 34, 40, 0), #1d2228 28%);
}

#saveDefaultModelsBtn.dirty {
  border-color: #5d76ff;
  background: #eef2ff;
  color: #12151a;
}

.progress-stack {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.progress-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #1d2024;
  color: var(--muted);
}

.progress-row span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2a3038;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.progress-row strong {
  color: var(--text);
}

.progress-row em {
  font-style: normal;
  font-size: 12px;
}

.progress-row.done,
.progress-row.done span {
  color: var(--green);
}

.progress-row.active {
  outline: 1px solid #435a7a;
  background: #202939;
}

.style-card {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 12px;
  background: #1d2024;
  border: 1px solid var(--line);
}

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

.style-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.style-card button {
  justify-self: start;
  height: 34px;
  border-radius: 9px;
  padding: 0 12px;
  background: #f5f7fa;
  color: #111317;
  font-weight: 800;
}

.chat-action-card,
.shot-preview-card {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #2c3440;
  border-radius: 12px;
  background: #171c22;
}

.chat-action-card span,
.shot-preview-card span {
  color: #98a4b3;
  font-size: 12px;
}

.chat-action-card p,
.shot-preview-card p {
  margin: 0;
  color: #b7c0cc;
  line-height: 1.55;
  word-break: break-word;
}

.shot-preview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #303946;
  background: #17191c;
}

.shot-preview-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #303946;
  background: #090d12;
}

.chat-action-row {
  display: grid;
  gap: 9px;
}

.chat-action-row button {
  min-height: 38px;
  border-radius: 10px;
  padding: 0 13px;
  background: var(--surface-hover);
  color: #eceff2;
  text-align: left;
}

.chat-action-row button:hover {
  background: var(--surface-active);
}

.chat-action-row button:disabled {
  opacity: 0.58;
  cursor: default;
}

.chat-action-row button.busy {
  background: #31496d;
  color: #f5f8ff;
}

.chat-action-status {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: #8f9bab;
}

.chat-action-status[data-tone="progress"] {
  color: #9fc2ff;
}

.chat-action-status[data-tone="success"] {
  color: #7ad7a5;
}

.chat-action-status[data-tone="error"] {
  color: #ff9a9a;
}

.workflow-defaults {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #2a323d;
  border-radius: 10px;
  background: #151a20;
  color: #b8c2cf;
  font-size: 12px;
}

.chat-feed > .workflow-defaults,
.message .workflow-defaults {
  display: none !important;
}

.workflow-defaults span {
  display: block;
  margin-bottom: 4px;
  color: #7f8b9a;
}

.workflow-defaults strong {
  display: block;
  color: #dfe6ee;
  font-size: 12px;
  line-height: 1.45;
}

.workflow-model-grid {
  display: none;
}

.tool-group .icon-tool {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 42px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  font-size: 19px;
}

.tool-group .icon-tool.active {
  background: #f6f8fb;
  color: #111317;
}

.side-panel textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #1d2024;
  color: var(--text);
  line-height: 1.45;
}

.clip {
  isolation: isolate;
}

.clip.material,
.clip.caption {
  cursor: ew-resize;
}

.clip.material::before,
.clip.caption::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 999px;
  background: rgba(16, 19, 23, 0.28);
  opacity: 0;
  transition: opacity 120ms ease;
}

.clip.material::before,
.clip.caption::before {
  left: 4px;
}

.clip.material .resize-right,
.clip.caption .resize-right {
  display: none;
}

.clip.caption:hover::before,
.clip.material:hover .resize-right,
.clip.caption:hover .resize-right {
  opacity: 1;
}

.clip.caption:hover {
  outline: 1px solid rgba(255, 255, 255, 0.72);
  outline-offset: 1px;
  box-shadow:
    inset 4px 0 0 rgba(17, 20, 24, 0.42),
    inset -4px 0 0 rgba(17, 20, 24, 0.42);
}

.clip.layer-bg {
  background: linear-gradient(135deg, rgba(105, 125, 145, 0.94), rgba(55, 68, 82, 0.94));
  border-color: rgba(154, 174, 194, 0.58);
}

.clip.layer-asset,
.clip.layer-summary,
.clip.layer-child {
  background: linear-gradient(135deg, rgba(105, 125, 145, 0.94), rgba(55, 68, 82, 0.94));
  border-color: rgba(154, 174, 194, 0.58);
  color: #f2f6fa;
}

.clip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.38);
  transform-origin: left;
}

.clip.progress-70::after {
  transform: scaleX(0.7);
}

.clip.progress-45::after {
  transform: scaleX(0.45);
}

.clip.progress-35::after {
  transform: scaleX(0.35);
}

.clip.progress-35,
.clip.progress-45 {
  overflow: hidden;
  background: #626c77 !important;
  color: #f0f3f6;
}

.clip.progress-35::before,
.clip.progress-45::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-120%);
  animation: clip-shimmer 1.35s linear infinite;
}

.clip.pending {
  background: #68707a;
  color: #f2f5f7;
}

.clip.failed {
  background: #e1525f;
  color: #fff6f7;
  box-shadow: inset 0 -4px 0 rgba(97, 7, 18, 0.22);
}

.clip.failed::after {
  transform: scaleX(1);
  background: rgba(101, 8, 20, 0.45);
}

@keyframes clip-shimmer {
  to { transform: translateX(120%); }
}

.clip.video-gen {
  background: #8a9299;
  color: #f1f3f4;
}

.generation-context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.generation-context-menu button {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: #eceff2;
  text-align: left;
}

.generation-context-menu button:hover {
  background: var(--surface-hover);
}

.clip.layer-child,
.clip.layer-bg,
.clip.layer-prop,
.clip.layer-fx {
  background: #9ee7b4;
}

.clip.layer-asset {
  display: none;
}

.material-expanded .clip.layer-asset:not(.hidden-shot) {
  display: block;
}

.composer-mode-menu {
  width: 196px !important;
  padding: 6px !important;
  border-radius: 12px !important;
  bottom: calc(100% + 6px) !important;
  top: auto !important;
}

.composer-mode-menu.open {
  gap: 3px !important;
}

.composer-mode-menu button {
  min-height: 34px !important;
  grid-template-columns: minmax(0, 1fr) 18px !important;
  padding: 6px 8px !important;
  border-radius: 9px !important;
}

.composer-mode-menu small {
  display: none !important;
}

.composer-mode-menu strong {
  font-size: 14px !important;
  text-align: left;
}

.composer-mode-menu b {
  font-size: 15px !important;
}

[data-track="motion-effect"] .track-lane {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0, rgba(255, 255, 255, 0.028) 1px, transparent 1px, transparent 150px),
    #1a1d21;
}

.clip.motion-effect {
  background: #9fb3ff;
  color: #101522;
}

.clip.motion-render {
  background: #63d9b7;
  color: #07110f;
}

.track-lane.asset-drop-hover {
  outline: 1px solid rgba(99, 217, 183, 0.7);
  outline-offset: -2px;
  background-color: rgba(99, 217, 183, 0.08);
}

.asset-thumb.active {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 12px 30px rgba(0, 0, 0, 0.28);
}

.chat-action-status.error {
  color: #ff8f8f;
}

.motion-preview-overlay {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  max-width: 78%;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 12px;
  background: color-mix(in srgb, var(--motion-color, #75b9ff) 18%, rgba(9, 12, 16, 0.82));
  color: #fff;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -50%) scale(var(--motion-scale, 1));
  pointer-events: none;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.motion-preview-overlay.multi-layer {
  inset: 0;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.motion-preview-text-layer {
  position: absolute;
  max-width: 78%;
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 800;
  line-height: 1.12;
  white-space: normal;
  overflow-wrap: break-word;
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
}

.motion-preview-text-layer.headline,
.motion-preview-text-layer.cta {
  font-weight: 900;
  max-width: 82%;
}

.motion-preview-text-layer.badge {
  padding: 5px 9px;
  border-radius: 6px;
  font-weight: 900;
}

.motion-preview-overlay.active {
  opacity: var(--motion-opacity, 0.92);
}

.motion-preview-overlay.lower-third {
  top: 70%;
}

.motion-effect-controls {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-deep);
}

.motion-effect-controls input[type="range"],
.audio-clip-controls input[type="range"],
.caption-controls input[type="range"] {
  accent-color: #b2b5ba;
}

.motion-effect-controls.hidden {
  display: none;
}

.shot-inspector-controls,
.layer-inspector-controls {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shot-inspector-controls.hidden,
.layer-inspector-controls.hidden {
  display: none;
}

.shot-composition-actions,
.motion-composition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shot-composition-actions button.active,
.motion-composition-actions button.active {
  border-color: #72dfc3;
  color: #eef3f8;
  background: rgba(114, 223, 195, 0.08);
}

.shot-inspector-hint {
  margin: 0;
  color: #8d949d;
  font-size: 11px;
  line-height: 1.45;
}

.shot-asset-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.shot-asset-strip.hidden {
  display: none;
}

.shot-asset-item {
  position: relative;
  display: grid;
  gap: 4px;
  justify-items: center;
  cursor: default;
}

.shot-asset-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.05) 75%),
    #10b981;
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
}

.shot-asset-regen {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(10, 14, 18, 0.72);
  color: #e8eef5;
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.12s ease;
  cursor: pointer;
}

.shot-asset-item:hover .shot-asset-regen,
.shot-asset-regen.busy {
  opacity: 1;
}

.shot-asset-regen:hover {
  background: #75b9ff;
  color: #0b1016;
}

.shot-asset-regen.busy {
  animation: spin 0.9s linear infinite;
  pointer-events: none;
}

.shot-asset-name {
  max-width: 100%;
  overflow: hidden;
  color: #8d949d;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shot-asset-hover-preview {
  position: fixed;
  z-index: 3200;
  display: grid;
  gap: 6px;
  width: 260px;
  padding: 10px;
  border: 1px solid #2c3440;
  border-radius: 12px;
  background: #171c22;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.shot-asset-hover-preview.visible {
  opacity: 1;
}

.shot-asset-hover-preview img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.06) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.06) 75%),
    #10b981;
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}

.shot-asset-hover-preview span {
  color: #b8c2cf;
  font-size: 12px;
  text-align: center;
}

.motion-effect-controls > strong {
  font-size: 14px;
}

.motion-effect-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.motion-effect-controls input,
.motion-effect-controls select,
.motion-effect-controls textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  background: #17191c;
  color: var(--text);
}

.motion-effect-controls textarea {
  min-height: 64px;
  resize: vertical;
}

.motion-effect-controls label.wide {
  grid-column: 1 / -1;
}

.motion-inspector-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.motion-inspector-actions button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 248, 255, 0.92);
  font-weight: 800;
  cursor: pointer;
}

.motion-inspector-actions button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

.motion-inspector-actions button.primary {
  min-height: 40px;
  border-color: rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
  color: #f2f4f6;
}

.motion-inspector-actions button.secondary {
  justify-self: start;
  min-width: 132px;
  padding: 0 14px;
  color: rgba(216, 225, 239, 0.82);
}

.motion-inspector-actions button.busy {
  opacity: 0.66;
  pointer-events: none;
}

.motion-patch-status {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(216, 225, 239, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

.clip.motion-render.render-dirty::after {
  content: "需重渲";
  position: absolute;
  right: 6px;
  top: 5px;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 215, 112, 0.92);
  color: #161006;
  font-size: 10px;
  font-weight: 900;
}

/* Final composer send icon: single-stroke arrow so the shaft and head match. */
.composer #sendBtn {
  width: 42px !important;
  height: 42px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 999px !important;
  background: #eef4fb !important;
  color: #0c121a !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
}

.composer #sendBtn::before {
  content: "" !important;
  display: block !important;
  width: 20px !important;
  height: 20px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  transform: none !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%2012h14M13%206l6%206-6%206%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.35%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") center / contain no-repeat !important;
  mask: url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M5%2012h14M13%206l6%206-6%206%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.35%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22/%3E%3C/svg%3E") center / contain no-repeat !important;
}

.composer #sendBtn::after {
  display: none !important;
}

.composer #sendBtn:hover {
  background: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32) !important;
}

.composer #sendBtn.stop {
  background: #c63a35 !important;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(198, 58, 53, 0.26) !important;
}

.composer #sendBtn.stop::before {
  width: 13px !important;
  height: 13px !important;
  border-radius: 4px !important;
  background: currentColor !important;
  -webkit-mask: none !important;
  mask: none !important;
}

/* Chat should feel like a guided conversation, not nested configuration panels. */
.chat-feed {
  padding: 18px 26px 18px 28px;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
}

.message.assistant {
  max-width: 84%;
}

.message.user {
  max-width: 58%;
  border-radius: 18px;
  background: #171d24;
  color: #ecf3fb;
}

.message.assistant p {
  max-width: 960px;
  margin: 0 0 16px;
  color: #f2f4f6;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.workflow-defaults {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 0 0 16px !important;
  padding: 7px 10px !important;
  border: 1px solid #2d3644 !important;
  border-radius: 12px !important;
  background: #131922 !important;
}

.workflow-defaults > div:first-child {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.workflow-defaults span {
  color: #8f9aaa !important;
  font-size: 11px !important;
}

.workflow-defaults strong {
  min-width: 0;
  overflow: hidden;
  color: #dfe3e7 !important;
  font-size: 12px !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-model-grid {
  display: none !important;
}

.chat-action-card,
.style-picker-card,
.style-card {
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 10px 0 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.chat-action-card > span,
.style-card > span {
  display: block;
  margin-bottom: 8px;
  color: #9aa7b7 !important;
  font-size: 12px !important;
}

.style-picker-card p,
.chat-action-card p,
.style-card p {
  max-width: 100% !important;
  margin: 0 0 12px !important;
  color: #d9e3ee !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.style-choice-grid,
.style-picker-card .style-choice-grid {
  display: flex !important;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
  gap: 8px !important;
}

.style-choice-btn {
  display: inline-grid !important;
  grid-template-columns: auto;
  gap: 2px !important;
  width: auto;
  min-width: 152px;
  max-width: min(260px, 100%);
  min-height: 42px !important;
  padding: 9px 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: var(--panel-deep) !important;
  color: #eceff2 !important;
  box-shadow: none !important;
}

.style-choice-btn strong {
  overflow: hidden;
  font-size: 13px !important;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-choice-btn small {
  overflow: hidden;
  color: #8f9bab !important;
  font-size: 11px !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.style-choice-btn:hover {
  border-color: #50565e !important;
  background: var(--surface-hover) !important;
}

.style-choice-btn.active {
  border-color: #686c73 !important;
  background: var(--surface-active) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

.style-sub-choice-title {
  width: 100%;
  margin: 10px 0 0 !important;
  color: #8f9bab !important;
  font-size: 12px !important;
}

.chat-pane,
.chat-pane * {
  min-width: 0;
}

.chat-feed > *,
.chat-feed article,
.chat-action-card,
.message p,
.message strong,
.message small {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-feed pre,
.chat-feed code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.progress-stack {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin: 10px 0 16px !important;
}

.progress-row {
  display: grid !important;
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 38px !important;
  padding: 8px 10px !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--panel-deep) !important;
}

.progress-row span {
  width: 24px !important;
  height: 24px !important;
  font-size: 12px !important;
}

.progress-row strong {
  font-size: 13px !important;
}

.progress-row em {
  display: inline !important;
  font-size: 11px !important;
}

.progress-row.active {
  outline: 1px solid #5a6068 !important;
  background: var(--surface-hover) !important;
}

.quick-prompts {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.quick-prompts button {
  min-height: 38px !important;
  height: auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  background: var(--panel-deep) !important;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-align: left !important;
  white-space: normal !important;
}

.quick-prompts button:hover,
.message-actions button:hover,
.style-card button:hover,
.chat-action-row button:hover {
  background: #1c2632 !important;
  border-color: #4d5e75 !important;
}

.media-generate-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.media-kind-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.media-kind-tabs button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #9ba3ad;
  font-size: 12px;
  font-weight: 400;
}

.media-kind-tabs button:hover:not(.active) {
  color: #d7d9dc;
  background: rgba(255, 255, 255, 0.04);
}

.media-kind-tabs button.active {
  color: #f2f4f6;
  background: #2c3036;
  border-color: #444a52;
  box-shadow: none;
}

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

.media-param-grid label,
.media-prompt-box {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #8c98a9;
  font-size: 11px;
  font-weight: 800;
}

.media-param-grid input,
.media-param-grid select,
.media-prompt-box textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #444a52;
  border-radius: 8px;
  background: #2c3036;
  color: #f2f4f6;
  font-size: 12px;
  font-weight: 400;
  outline: none;
}

.media-param-grid input,
.media-param-grid select {
  height: 30px;
  padding: 0 10px;
}

.media-prompt-box textarea {
  min-height: 96px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.5;
}

.media-param-grid input:focus,
.media-param-grid select:focus,
.media-prompt-box textarea:focus {
  border-color: #5a6068;
  background: #383d44;
  box-shadow: none;
}

.media-generate-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-generate-actions button {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid #4cbfa9;
  padding: 0 16px;
  background: #71d5bd;
  color: #06110f;
  font-size: 12px;
  font-weight: 900;
}

.media-generate-actions button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.media-generate-actions small {
  color: #8f9bab;
  font-size: 12px;
}

.media-result-message .chat-asset-preview {
  margin-top: 8px;
}

.media-result-message .chat-asset-preview.multi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.media-result-meta {
  margin: 8px 0 0;
  color: #7f8a99;
  font-size: 11px;
  line-height: 1.45;
}

.timeline-wrap {
  position: relative;
}

.timeline {
  position: relative;
}

.timeline-marquee {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  border: 1px solid rgba(241, 243, 244, 0.55);
  background: rgba(241, 243, 244, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
}

.timeline .clip.selected {
  outline: 2px solid #f1f3f4 !important;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(241, 243, 244, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.55) inset !important;
  z-index: 12;
}

.composer-media-controls {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.composer-media-controls.active {
  display: flex;
}

.composer-media-controls select,
.composer-media-controls input {
  flex: 0 1 auto;
  width: auto;
  min-width: 56px;
  max-width: 100%;
  height: 30px;
  border: 1px solid #444a52;
  border-radius: 8px;
  padding: 0 10px;
  background: #2c3036;
  color: #f2f4f6;
  font-size: 12px;
  font-weight: 400;
  outline: none;
  text-overflow: ellipsis;
}

.composer-media-controls [data-media-kind] {
  width: 74px;
}

.composer-media-controls [data-param="model"]:not(.model-select-native):not(.model-billing-select) {
  flex: 0 1 auto;
  min-width: 112px;
  max-width: 176px;
}

.composer-media-controls [data-param="aspect_ratio"],
.composer-media-controls [data-param="quality"],
.composer-media-controls [data-param="duration"],
.composer-media-controls [data-param="resolution"],
.composer-media-controls [data-param="audioType"] {
  width: 66px;
}

.composer-media-controls [data-param="n"] {
  width: 52px;
  order: 100;
}

.composer-media-controls .composer-dynamic-param {
  width: 92px;
  max-width: 118px;
}

.composer-media-controls [data-param="voice"] {
  flex: 1 1 96px;
  min-width: 82px;
}

.composer-media-controls select:focus,
.composer-media-controls input:focus {
  border-color: #5a6068;
  background: #383d44;
  box-shadow: none;
}

.composer-media-controls .hidden,
.composer-media-controls .model-select-wrap.hidden {
  display: none !important;
}

.composer-settings-btn {
  flex: 0 0 auto;
  margin-left: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.composer-settings-btn:hover {
  border-color: #3a4048;
  background: var(--surface-hover);
  color: var(--text);
}

.composer-settings-modal {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
}

.composer-settings-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.asset-eraser-modal {
  width: min(860px, calc(100vw - 40px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
}

.asset-eraser-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.asset-eraser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.asset-eraser-head strong {
  font-size: 15px;
}

.asset-eraser-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a7abb0;
  font-size: 20px;
  cursor: pointer;
}

.asset-eraser-body {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: flex-start;
}

.asset-eraser-canvas-wrap {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  background: #1d2024;
}

.asset-eraser-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.asset-eraser-tools {
  flex: 0 0 160px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.asset-eraser-tools label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #a7abb0;
}

.asset-eraser-tools input[type="range"] {
  width: 100%;
  accent-color: #75b9ff;
}

.asset-eraser-tool-row {
  display: flex;
  gap: 8px;
}

.asset-eraser-tool-row button {
  flex: 1;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #2c3036;
  color: #f2f4f6;
  font-size: 14px;
  cursor: pointer;
}

.asset-eraser-tool-row button:hover {
  background: #2c323c;
}

.asset-eraser-tool-row button.primary {
  background: #383d44;
  border-color: #444a52;
}

.asset-eraser-tool-row button.primary:hover {
  background: #444a52;
}

.composer-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-settings-head strong {
  font-size: 15px;
}

.composer-settings-head button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a7abb0;
  font-size: 20px;
  cursor: pointer;
}

.composer-settings-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
}

.composer-settings-tabs button {
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.composer-settings-tabs button.active {
  border-color: #3a4048;
  background: var(--surface-hover);
  color: var(--text);
}

.composer-settings-body {
  padding: 12px 16px 8px;
  max-height: min(62vh, 520px);
  overflow: auto;
}

.composer-settings-panel {
  display: none;
}

.composer-settings-panel.active {
  display: block;
}

.composer-settings-group {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.composer-settings-group:last-child {
  border-bottom: 0;
}

.composer-settings-group h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.composer-video-chain-wrap {
  margin-bottom: 8px;
}

.composer-video-chain-head h4 {
  margin-bottom: 4px;
}

.composer-video-chain-hint {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
}

.composer-video-batch-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
}

.composer-video-batch-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.composer-video-batch-controls select,
.composer-video-batch-controls input {
  min-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  color: var(--text);
}

.composer-video-batch-controls input {
  min-width: 96px;
}

.composer-video-batch-controls label[hidden] {
  display: none;
}

.video-model-chain {
  display: grid;
  gap: 10px;
}

.video-model-slot,
.admin-video-slot {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-deep);
}

.admin-video-model-chain {
  grid-column: 1 / -1;
  margin: 8px 0 4px;
}

.composer-settings-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.composer-settings-group select,
.composer-settings-group input {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 280px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
  color: var(--text);
}

.composer-settings-param-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.composer-settings-param-grid select,
.composer-settings-param-grid input,
.composer-settings-param-grid .composer-dynamic-param {
  flex: 1 1 120px;
  min-width: 96px;
  max-width: none;
  height: 30px;
  min-height: 30px;
}

.composer-settings-param-grid select.hidden,
.composer-settings-param-grid input.hidden,
.composer-settings-param-grid .composer-dynamic-param.hidden {
  display: none;
}

.media-video-chain-hint {
  display: block;
  margin: 0 0 8px;
  color: #8d949d;
  font-size: 11px;
  line-height: 1.45;
}

.composer-settings-empty {
  margin: 24px 0;
  color: #7d8791;
  font-size: 13px;
  text-align: center;
}

.composer-settings-actions {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-settings-actions button {
  min-width: 88px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid #3a4048;
  border-radius: 999px;
  background: #2c3036;
  color: #f2f4f6;
  font-size: 13px;
  cursor: pointer;
}

.composer-settings-actions button:hover {
  background: #383d44;
  border-color: #444a52;
}

.composer .composer-mode {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
  width: 100%;
  overflow: visible;
}

.composer .composer-mode-trigger {
  min-width: 86px !important;
  width: auto !important;
  flex: 0 0 auto;
}

.composer #attachBtn {
  flex: 0 0 auto;
}

/* Compact controls in the lower chat/timeline area. */
.composer #sendBtn {
  width: 21px !important;
  height: 21px !important;
  border-radius: 999px !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22) !important;
}

.composer #sendBtn::before {
  width: 10px !important;
  height: 10px !important;
}

.composer #sendBtn:hover {
  transform: translateY(-0.5px) !important;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.28) !important;
}

.composer #sendBtn.stop::before {
  width: 7px !important;
  height: 7px !important;
  border-radius: 2px !important;
}

/* Unified dark dropdown style; native popups still follow each browser/OS limits. */
.side-panel select,
.model-select-grid select,
.param-grid select,
.motion-effect-controls select,
.preview-aspect-select,
.composer-mode select {
  appearance: none !important;
  -webkit-appearance: none !important;
  min-height: 30px !important;
  border: 1px solid #444a52 !important;
  border-radius: 8px !important;
  padding: 0 28px 0 10px !important;
  background:
    linear-gradient(45deg, transparent 50%, #9ba3ad 50%) calc(100% - 14px) 50% / 5px 5px no-repeat,
    linear-gradient(135deg, #9ba3ad 50%, transparent 50%) calc(100% - 10px) 50% / 5px 5px no-repeat,
    #2c3036 !important;
  color: #f2f4f6 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

.side-panel select:focus,
.model-select-grid select:focus,
.param-grid select:focus,
.motion-effect-controls select:focus,
.preview-aspect-select:focus,
.composer-mode select:focus {
  border-color: #5a6068 !important;
  background-color: #383d44 !important;
  box-shadow: none !important;
}

select option {
  background: #25272a !important;
  color: #eef3f8 !important;
  font-weight: 800 !important;
}

select.model-billing-select {
  min-width: 168px;
}

.model-select-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.model-select-wrap > select.model-billing-select,
.model-select-wrap > select.model-select-native,
select.model-select-native {
  display: none !important;
}

.model-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding: 0 30px 0 10px;
  border: 1px solid #3a414c;
  border-radius: 10px;
  background:
    linear-gradient(45deg, transparent 50%, #d8e0ea 50%) calc(100% - 15px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, #d8e0ea 50%, transparent 50%) calc(100% - 10px) 50% / 6px 6px no-repeat,
    #25272a;
  color: #eef3f8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.model-select-trigger:focus-visible {
  outline: none;
  border-color: #596270;
  box-shadow: 0 0 0 2px rgba(216, 224, 234, 0.08);
}

.model-select-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.model-select-billing {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 12px;
  color: #5fe693;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.model-select-menu {
  display: none;
  position: absolute;
  z-index: 400;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(460px, calc(100vw - 24px));
  max-height: 280px;
  overflow: auto;
  padding: 4px;
  border: 1px solid #3a414c;
  border-radius: 10px;
  background: #25272a;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.model-select-wrap.open .model-select-menu {
  display: block !important;
  animation: modelSelectMenuIn 120ms ease-out;
}

.model-select-wrap.open-upward.open .model-select-menu {
  animation: modelSelectMenuInUp 120ms ease-out;
}

@keyframes modelSelectMenuInUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modelSelectMenuIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.model-select-wrap.open .model-select-menu[hidden] {
  display: block !important;
}

.model-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #eef3f8;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
}

.model-select-option:hover,
.model-select-option.is-selected {
  background: rgba(114, 223, 195, 0.12);
}

.model-select-option .model-select-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-select-option .model-select-billing {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 16px;
}

.model-select-option.is-empty {
  justify-content: flex-start;
  color: #8d949d;
  cursor: default;
}

.composer-settings-group .model-select-wrap:not(.hidden),
.video-model-slot .model-select-wrap:not(.hidden),
.admin-video-slot .model-select-wrap:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-width: 168px;
  pointer-events: auto !important;
}

.composer-settings-group .model-select-wrap:not(.hidden) .model-select-trigger,
.video-model-slot .model-select-wrap:not(.hidden) .model-select-trigger,
.admin-video-slot .model-select-wrap:not(.hidden) .model-select-trigger {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.composer .composer-media-controls .model-select-wrap:not(.hidden) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 1 auto !important;
  min-width: 112px !important;
  max-width: 176px !important;
  pointer-events: auto !important;
}

.composer .composer-media-controls .model-select-wrap:not(.hidden) .model-select-trigger {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.composer-settings-group label .model-select-wrap,
.model-select-grid label .model-select-wrap {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 280px;
}

.composer-settings-group .model-select-trigger,
.model-select-grid .model-select-trigger {
  min-height: 30px;
  font-size: 12px;
}

.video-model-slot .model-select-wrap,
.admin-video-slot .model-select-wrap {
  width: 100%;
  max-width: none;
}

.composer-media-controls .model-select-wrap {
  flex: 0 1 auto;
  min-width: 112px;
  max-width: 176px;
}

.composer .composer-media-controls .model-select-wrap {
  flex: 0 1 auto !important;
  min-width: 112px !important;
  max-width: 176px !important;
}

.tool-group {
  gap: 4px !important;
  padding: 2px !important;
  border-radius: 8px !important;
}

.tool-group .icon-tool {
  width: 22px !important;
  min-width: 22px !important;
  height: 19px !important;
  border-radius: 6px !important;
  font-size: 10px !important;
}

.phone-canvas .canvas-bg {
  background-color: #15181b !important;
}

.phone-canvas.has-generated-image .canvas-bg {
  background-image: var(--preview-image) !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #05070a !important;
}

.phone-canvas .sticker,
.phone-canvas .safe-line {
  display: none !important;
}

/* Final chat option style: one-line, lightweight suggestion buttons. */
.chat-feed .chat-action-row,
.chat-feed .style-choice-grid,
.chat-feed .style-picker-card .style-choice-grid {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 10px !important;
}

.chat-feed .quick-prompts {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.chat-feed .quick-prompts button,
.chat-feed .message-actions button,
.chat-feed .style-card button,
.chat-feed .chat-action-row button,
.chat-feed .style-choice-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 38px !important;
  height: auto !important;
  padding: 8px 16px !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: var(--panel-deep) !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  text-align: left !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.chat-feed .style-choice-btn strong,
.chat-feed .style-choice-btn small {
  display: inline !important;
  margin: 0 !important;
  color: inherit !important;
  font: inherit !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.chat-feed .style-choice-btn small::before {
  content: "（";
}

.chat-feed .style-choice-btn small::after {
  content: "）";
}

.chat-feed .quick-prompts button:hover,
.chat-feed .message-actions button:hover,
.chat-feed .style-card button:hover,
.chat-feed .chat-action-row button:hover,
.chat-feed .style-choice-btn:hover,
.chat-feed .style-choice-btn.active {
  border: 1px solid #303742 !important;
  background: #1b232d !important;
  box-shadow: none !important;
}

.chat-feed .chat-action-row button.active,
.chat-feed .motion-preset-actions button.active {
  border: 1px solid #72dfc3 !important;
}

/* Clean preview and timeline surface. Keep only simple viewport boundaries. */
.preview-pane {
  background: #1d2228 !important;
  border-color: #303742 !important;
  box-shadow: none !important;
}

.preview-stage {
  padding: 16px !important;
  background: #171c22 !important;
  box-shadow: none !important;
}

.phone-canvas {
  border: 1px solid #252c35 !important;
  border-radius: 2px !important;
  background: #15181b !important;
  box-shadow: none !important;
}

.phone-canvas .canvas-bg,
.phone-canvas.has-layer-preview .canvas-bg {
  background-color: #15181b !important;
  box-shadow: none !important;
}

.phone-canvas.has-generated-image .canvas-bg {
  background-image: var(--preview-image) !important;
  background-color: #15181b !important;
  background-size: contain !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.preview-video,
.preview-motion-video,
.preview-layer-stack,
.motion-preview-overlay {
  box-shadow: none !important;
}

.editor,
.timeline-wrap,
.timeline {
  background: #1d2024 !important;
  box-shadow: none !important;
}

.ruler,
.shot-strip,
.track,
[data-track="image-material"],
[data-track="motion-effect"] {
  background: #1d2024 !important;
}

.track-name,
button.track-name {
  background: #24282d !important;
  color: #bac0c8 !important;
  box-shadow: none !important;
}

.track-lane,
[data-track="image-material"] .track-lane,
[data-track="motion-effect"] .track-lane {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0, rgba(255, 255, 255, 0.028) 1px, transparent 1px, transparent 150px),
    #1a1d21 !important;
  box-shadow: none !important;
}

.clip.layer-bg,
.clip.layer-asset,
.clip.layer-summary,
.clip.layer-child,
.clip.layer-prop,
.clip.layer-fx {
  background: #4c5a68 !important;
  border-color: #6a7786 !important;
  color: #f2f6fa !important;
  box-shadow: none !important;
}

.clip.selected {
  outline: 2px solid #f1f3f4 !important;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px rgba(241, 243, 244, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.55) inset !important;
}

/* Final neutral graphite theme, matched to the cleaner notebook reference. */
:root {
  --bg: #131416;
  --panel: #202326;
  --panel-deep: #191b1e;
  --line: #303236;
  --soft-line: #292c30;
  --text: #f1f3f4;
  --muted: #b2b5ba;
  --faint: #878b91;
  --blue: #8f949d;
  --green: #9ca48c;
  --pink: #a49198;
  --yellow: #b4aa84;
  --red: #b26d68;
}

body,
.app-shell {
  background: #131416 !important;
  color: #f1f3f4 !important;
}

.topbar,
.workspace,
.editor,
.table-pane {
  background: #131416 !important;
}

.chat-pane,
.preview-pane,
.inspector-pane,
.side-panel,
.admin-modal,
.admin-section,
.style-editor-panel,
.asset-library-box,
.media-generate-panel {
  background: #202326 !important;
  border-color: #303236 !important;
  box-shadow: none !important;
}

.chat-pane header,
.preview-pane header,
.inspector-pane header,
.side-panel header,
.admin-head,
.editor-head {
  background: #202326 !important;
  border-color: #303236 !important;
}

.chat-feed,
.asset-library-list,
.side-panel,
.table-pane {
  background: #202326 !important;
}

.composer,
.composer textarea,
.composer-mode-trigger,
.composer #attachBtn,
.composer-media-controls select,
.composer-media-controls input,
.side-panel input,
.side-panel select,
.side-panel textarea,
.model-select-grid select,
.param-grid input,
.param-grid select,
.media-param-grid input,
.media-param-grid select,
.preview-aspect-select,
select,
input,
textarea {
  background-color: #17191c !important;
  border-color: #303236 !important;
  color: #f1f3f4 !important;
  box-shadow: none !important;
}

.composer textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #85898e !important;
}

.mode-switch,
.tool-group,
.composer-mode-menu,
.generation-context-menu,
.asset-hover-preview,
.table-hover-preview {
  background: #191b1e !important;
  border-color: #303236 !important;
  box-shadow: none !important;
}

.mode-switch button,
.preview-controls button,
.tool-group button,
.side-tabs button,
.asset-library-head-actions button,
.asset-library-head-actions .asset-view-btn,
.asset-library-head #uploadLocalAssetBtn,
.admin-tabs button,
.admin-tab-button,
.admin-actions button,
.style-editor-actions button,
.media-kind-tabs button,
.media-generate-actions button,
.table-actions button {
  background: #26292d !important;
  border-color: #32353a !important;
  color: #e8eaed !important;
  box-shadow: none !important;
}

.mode-switch button.active,
.side-tabs button.active,
.asset-library-head-actions button.active,
.asset-library-head-actions .asset-view-btn.active,
.asset-library-head #uploadLocalAssetBtn.active,
.admin-tabs button.active,
.admin-tab-button.active,
.media-kind-tabs button.active,
.tool-group button.active,
.track-control-btn.on {
  background: #33363b !important;
  border-color: #3d4046 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.mode-switch button:hover,
.preview-controls button:hover,
.tool-group button:hover,
.side-tabs button:hover,
.asset-library-head-actions button:hover,
.asset-library-head-actions .asset-view-btn:hover,
.asset-library-head #uploadLocalAssetBtn:hover,
.admin-actions button:hover,
.style-editor-actions button:hover,
.media-kind-tabs button:hover,
.media-generate-actions button:hover,
.table-actions button:hover {
  background: #303338 !important;
  border-color: #3a3d42 !important;
}

.chat-feed .quick-prompts button,
.chat-feed .message-actions button,
.chat-feed .style-card button,
.chat-feed .chat-action-row button,
.chat-feed .style-choice-btn,
.message-actions button,
.quick-prompts button {
  background: #17191c !important;
  color: #f1f3f4 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.chat-feed .quick-prompts button:hover,
.chat-feed .message-actions button:hover,
.chat-feed .style-card button:hover,
.chat-feed .chat-action-row button:hover,
.chat-feed .style-choice-btn:hover,
.chat-feed .style-choice-btn.active,
.message-actions button:hover,
.quick-prompts button:hover {
  background: #222529 !important;
}

.message,
.chat-action-card,
.style-picker-card,
.style-card,
.shot-preview-card {
  background: transparent !important;
  border-color: #303236 !important;
  box-shadow: none !important;
}

.message p,
.chat-action-card p,
.style-card p,
.shot-preview-card p {
  color: #d7d9dc !important;
}

.message strong,
.chat-action-card > span,
.style-card > span,
.shot-preview-card span,
.style-sub-choice-title,
.media-result-meta,
.chat-action-status,
.table-toolbar,
.time-readout,
.timeline-zoom,
.preview-controls span {
  color: #a7abb0 !important;
}

.preview-stage,
.editor,
.timeline-wrap,
.timeline,
.ruler,
.shot-strip,
.track,
[data-track="image-material"],
[data-track="motion-effect"] {
  background: #17191c !important;
}

.phone-canvas,
.phone-canvas .canvas-bg,
.phone-canvas.has-layer-preview .canvas-bg {
  background-color: #111315 !important;
  border-color: #2b2e32 !important;
}

.track-name,
button.track-name {
  background: #202326 !important;
  color: #b2b5ba !important;
}

.track-lane,
[data-track="image-material"] .track-lane,
[data-track="motion-effect"] .track-lane {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.026) 0, rgba(255, 255, 255, 0.026) 1px, transparent 1px, transparent 150px),
    #16181b !important;
  box-shadow: none !important;
}

.shot-pill {
  background: #222529 !important;
  border-color: #32353a !important;
  color: #c9ccd1 !important;
}

.shot-pill.active,
.shot-pill:hover {
  background: #2c2f34 !important;
  border-color: #44474d !important;
  color: #f1f3f4 !important;
}

.clip,
.clip.layer-bg,
.clip.layer-asset,
.clip.layer-summary,
.clip.layer-child,
.clip.layer-prop,
.clip.layer-fx,
.clip.audio:not([data-media-url]),
.clip.bgm:not([data-media-url]),
.clip.pending,
.clip.progress-35,
.clip.progress-45 {
  background: #54585f !important;
  border-color: #686c73 !important;
  color: #f1f3f4 !important;
  box-shadow: none !important;
}

.clip.material,
.clip.caption,
.clip.audio,
.clip.bgm,
.clip.motion-effect,
.clip.motion-render,
.clip.video-gen {
  background: #62666d !important;
  color: #f1f3f4 !important;
  box-shadow: none !important;
}

.clip::after {
  background: rgba(255, 255, 255, 0.24) !important;
}

/* The timeline toolbar should sit on the surface, not inside a separate tinted box. */
.editor-head {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Slightly brighter cool graphite pass, closer to the provided reference. */
:root {
  --bg: #17191c;
  --panel: #23272b;
  --panel-deep: #1d2024;
  --line: #343941;
  --soft-line: #2c3138;
  --text: #f2f4f6;
  --muted: #b8bec6;
  --faint: #8d949d;
  --blue: #9ba3ad;
  --green: #9fa995;
  --pink: #a99ba1;
  --yellow: #b9b08c;
  --red: #bd7772;
}

body,
.app-shell,
.topbar,
.workspace,
.editor,
.table-pane {
  background: #17191c !important;
  color: #f2f4f6 !important;
}

.chat-pane,
.preview-pane,
.inspector-pane,
.side-panel,
.admin-modal,
.admin-section,
.style-editor-panel,
.asset-library-box,
.media-generate-panel,
.chat-feed,
.asset-library-list {
  background: #23272b !important;
  border-color: #343941 !important;
}

.chat-pane header,
.preview-pane header,
.inspector-pane header,
.side-panel header,
.admin-head {
  background: #23272b !important;
  border-color: #343941 !important;
}

.composer,
.composer textarea,
.composer-mode-trigger,
.composer #attachBtn,
.composer-media-controls select,
.composer-media-controls input,
.side-panel input,
.side-panel select,
.side-panel textarea,
.model-select-grid select,
.param-grid input,
.param-grid select,
.media-param-grid input,
.media-param-grid select,
.preview-aspect-select,
select,
input,
textarea,
.mode-switch,
.tool-group,
.composer-mode-menu,
.generation-context-menu {
  background-color: #1d2024 !important;
  border-color: #343941 !important;
  color: #f2f4f6 !important;
}

.mode-switch button,
.preview-controls button,
.tool-group button,
.side-tabs button,
.asset-library-head-actions button,
.asset-library-head-actions .asset-view-btn,
.asset-library-head #uploadLocalAssetBtn,
.admin-tabs button,
.admin-tab-button,
.admin-actions button,
.style-editor-actions button,
.media-kind-tabs button,
.media-generate-actions button,
.table-actions button {
  background: #2c3036 !important;
  border-color: #3a4048 !important;
  color: #eceff2 !important;
}

.mode-switch button.active,
.side-tabs button.active,
.asset-library-head-actions button.active,
.asset-library-head-actions .asset-view-btn.active,
.asset-library-head #uploadLocalAssetBtn.active,
.admin-tabs button.active,
.admin-tab-button.active,
.media-kind-tabs button.active,
.tool-group button.active,
.track-control-btn.on {
  background: #383d44 !important;
  border-color: #444a52 !important;
  color: #ffffff !important;
}

.chat-feed .quick-prompts button,
.chat-feed .message-actions button,
.chat-feed .style-card button,
.chat-feed .chat-action-row button,
.chat-feed .style-choice-btn,
.message-actions button,
.quick-prompts button {
  background: #1d2024 !important;
  color: #f2f4f6 !important;
}

.chat-feed .quick-prompts button:hover,
.chat-feed .message-actions button:hover,
.chat-feed .style-card button:hover,
.chat-feed .chat-action-row button:hover,
.chat-feed .style-choice-btn:hover,
.chat-feed .style-choice-btn.active,
.message-actions button:hover,
.quick-prompts button:hover {
  background: #2a2e34 !important;
}

.preview-stage,
.editor,
.timeline-wrap,
.timeline,
.ruler,
.shot-strip,
.track,
[data-track="image-material"],
[data-track="motion-effect"] {
  background: #1d2024 !important;
}

.phone-canvas,
.phone-canvas .canvas-bg,
.phone-canvas.has-layer-preview .canvas-bg {
  background-color: #15181b !important;
  border-color: #343941 !important;
}

.track-name,
button.track-name {
  background: #24282d !important;
  color: #bac0c8 !important;
}

.track-lane,
[data-track="image-material"] .track-lane,
[data-track="motion-effect"] .track-lane {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0, rgba(255, 255, 255, 0.028) 1px, transparent 1px, transparent 150px),
    #1a1d21 !important;
}

/* Final interaction polish: dark suggestion bubbles, no white selected state. */
.mode-switch button.active,
.side-tabs button.active,
.asset-library-head-actions button.active,
.asset-library-head-actions .asset-view-btn.active,
.asset-library-head #uploadLocalAssetBtn.active,
.admin-tabs button.active,
.admin-tab-button.active,
.media-kind-tabs button.active,
.tool-group button.active,
.tool-group .icon-tool.active,
.shot-pill.active,
.track-control-btn.on,
.chat-feed .style-choice-btn.active {
  background: #32363c !important;
  border-color: #3e444c !important;
  color: #f2f4f6 !important;
  box-shadow: none !important;
}

.mode-switch button.active:hover,
.side-tabs button.active:hover,
.asset-library-head-actions button.active:hover,
.asset-library-head-actions .asset-view-btn.active:hover,
.asset-library-head #uploadLocalAssetBtn.active:hover,
.admin-tabs button.active:hover,
.admin-tab-button.active:hover,
.admin-tab-button.active:hover,
.media-kind-tabs button.active:hover,
.tool-group button.active:hover,
.tool-group .icon-tool.active:hover,
.shot-pill.active:hover,
.track-control-btn.on:hover,
.chat-feed .style-choice-btn.active:hover {
  background: #3a3f46 !important;
  border-color: #474d56 !important;
  color: #ffffff !important;
}

.chat-feed .quick-prompts button,
.chat-feed .message-actions button,
.chat-feed .style-card button,
.chat-feed .chat-action-row button,
.chat-feed .style-choice-btn {
  min-height: 46px !important;
  height: 46px !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-radius: 18px 13px 13px 7px !important;
  background: #181b1f !important;
  color: #f1f3f4 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  box-shadow: none !important;
}

.mode-switch button,
.side-tabs button,
.asset-library-head-actions button,
.asset-library-head-actions .asset-view-btn,
.asset-library-head #uploadLocalAssetBtn,
.admin-tabs button,
.admin-tab-button,
.media-kind-tabs button,
.tool-group button,
.tool-group .icon-tool,
.shot-pill,
.track-control-btn {
  border-radius: 14px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
}

.chat-feed .quick-prompts button:hover,
.chat-feed .message-actions button:hover,
.chat-feed .style-card button:hover,
.chat-feed .chat-action-row button:hover,
.chat-feed .style-choice-btn:hover,
.chat-feed .style-choice-btn.active {
  background: #22262b !important;
  color: #ffffff !important;
}

.phone-canvas,
.phone-canvas .canvas-bg,
.phone-canvas.has-layer-preview .canvas-bg {
  border: 0 !important;
  box-shadow: none !important;
}

/* Final requested exceptions and table palette cleanup. */
.mode-switch button.active {
  background: #f5f7f8 !important;
  border-color: #f5f7f8 !important;
  color: #111417 !important;
  font-weight: 400 !important;
}

.mode-switch button.active:hover {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #0f1114 !important;
}

.chat-feed .quick-prompts button,
.chat-feed .message-actions button,
.chat-feed .style-card button,
.chat-feed .chat-action-row button,
.chat-feed .style-choice-btn {
  position: relative !important;
  overflow: hidden !important;
  background: #181b1f !important;
}

.chat-feed .quick-prompts button::after,
.chat-feed .message-actions button::after,
.chat-feed .style-card button::after,
.chat-feed .chat-action-row button::after,
.chat-feed .style-choice-btn::after {
  display: none !important;
  content: none !important;
}

.chat-feed .quick-prompts button:hover,
.chat-feed .message-actions button:hover,
.chat-feed .style-card button:hover,
.chat-feed .chat-action-row button:hover,
.chat-feed .style-choice-btn:hover,
.chat-feed .style-choice-btn.active {
  background: #30353b !important;
}

.chat-feed .quick-prompts button:hover::after,
.chat-feed .message-actions button:hover::after,
.chat-feed .style-card button:hover::after,
.chat-feed .chat-action-row button:hover::after,
.chat-feed .style-choice-btn:hover::after,
.chat-feed .style-choice-btn.active::after {
  display: none !important;
  content: none !important;
}

.table-pane {
  background: #17191c !important;
  color: #f2f4f6 !important;
}

.shot-table-wrap {
  background: #17191c !important;
  border-color: #343941 !important;
  box-shadow: none !important;
}

.shot-table th {
  background: #242930 !important;
  border-color: #343941 !important;
  color: #f2f4f6 !important;
  font-weight: 500 !important;
}

.shot-table td {
  background: #161a1e !important;
  border-color: #30363d !important;
  color: #dfe3e7 !important;
}

.shot-table tr.dirty td {
  background: #1b1f24 !important;
}

.editable,
.motion-narration,
.duration-cell input,
.media-preview {
  background: #1d2024 !important;
  border-color: #343941 !important;
  color: #e5e8ec !important;
  box-shadow: none !important;
}

.editable:hover,
.editable:focus,
.duration-cell input:focus {
  background: #252a30 !important;
  border-color: #4a515b !important;
  box-shadow: none !important;
}

.table-actions button {
  background: #2c3036 !important;
  border-color: #3a4048 !important;
  color: #eceff2 !important;
  font-weight: 400 !important;
}

.table-actions button:hover {
  background: #383e45 !important;
}

/* Minimal cold scrollbars: thin thumb only, no arrows or visible track. */
* {
  scrollbar-width: thin;
  scrollbar-color: #6f7780 transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: #69717a;
}

::-webkit-scrollbar-thumb:hover {
  background: #7b848e;
}

::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:vertical,
::-webkit-scrollbar-button:horizontal,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.chat-feed .quick-prompts button,
.chat-feed .message-actions button,
.chat-feed .style-card button,
.chat-feed .chat-action-row button,
.chat-feed .style-choice-btn {
  border-radius: 18px 18px 4px 18px !important;
  font-size: 14px !important;
  font-weight: 400 !important;
}

/* Extra-minimal zoom slider and scrollbars. */
.timeline-zoom {
  gap: 8px !important;
}

.timeline-zoom input[type="range"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 104px !important;
  height: 14px !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  accent-color: #626a73 !important;
}

.timeline-zoom input[type="range"]::-webkit-slider-runnable-track {
  height: 3px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #4a5058 !important;
  box-shadow: none !important;
}

.timeline-zoom input[type="range"]::-webkit-slider-thumb {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 14px !important;
  height: 14px !important;
  margin-top: -5.5px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #7a8490 !important;
  box-shadow: none !important;
}

.timeline-zoom input[type="range"]::-moz-range-track {
  height: 3px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #4a5058 !important;
}

.timeline-zoom input[type="range"]::-moz-range-thumb {
  width: 14px !important;
  height: 14px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #7a8490 !important;
}

* {
  scrollbar-color: #535b64 transparent;
}

/* Motion preview image layers must stay transparent even though they are editable. */
.preview-layer-stack .preview-layer-item,
.preview-layer-stack .preview-layer-item.editable,
.preview-layer-stack .preview-layer-item.selected,
.preview-layer-stack .preview-layer {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

::-webkit-scrollbar {
  width: 4px !important;
  height: 4px !important;
  background: transparent !important;
}

::-webkit-scrollbar-thumb {
  min-height: 34px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #535b64 !important;
  box-shadow: none !important;
}

::-webkit-scrollbar-thumb:hover {
  background: #626b75 !important;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-track-piece,
::-webkit-scrollbar-corner {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:vertical:decrement,
::-webkit-scrollbar-button:vertical:increment,
::-webkit-scrollbar-button:horizontal:decrement,
::-webkit-scrollbar-button:horizontal:increment,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

/* Splitter hover: soft center glow fading to transparent ends. */
.splitter::after {
  background: transparent !important;
  opacity: 0;
  transition: opacity 140ms ease, background 140ms ease !important;
}

.splitter.vertical::after {
  left: 2px !important;
  right: 2px !important;
  top: 10px !important;
  bottom: 10px !important;
  border-radius: 999px !important;
}

.splitter.horizontal::after {
  left: 10px !important;
  right: 10px !important;
  top: 2px !important;
  bottom: 2px !important;
  border-radius: 999px !important;
}

.splitter.vertical:hover::after,
.splitter.vertical.dragging::after {
  opacity: 1;
  background: linear-gradient(
    180deg,
    rgba(126, 137, 150, 0) 0%,
    rgba(126, 137, 150, 0.18) 22%,
    rgba(150, 160, 172, 0.92) 50%,
    rgba(126, 137, 150, 0.18) 78%,
    rgba(126, 137, 150, 0) 100%
  ) !important;
}

.splitter.horizontal:hover::after,
.splitter.horizontal.dragging::after {
  opacity: 1;
  background: linear-gradient(
    90deg,
    rgba(126, 137, 150, 0) 0%,
    rgba(126, 137, 150, 0.18) 22%,
    rgba(150, 160, 172, 0.92) 50%,
    rgba(126, 137, 150, 0.18) 78%,
    rgba(126, 137, 150, 0) 100%
  ) !important;
}

/* Timeline playhead: match the composer stop button red. */
.playhead {
  background: #c63a35 !important;
}

.playhead::before {
  background: #c63a35 !important;
  box-shadow: 0 0 0 5px rgba(198, 58, 53, 0.16) !important;
}

/* Final minimal chrome cleanup. */
.pane-head .menu-dot,
#chatResetBtn {
  width: 34px !important;
  height: 34px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #b8bec6 !important;
  box-shadow: none !important;
}

.pane-head .menu-dot:hover,
#chatResetBtn:hover {
  background: #30353b !important;
  color: #f2f4f6 !important;
}

.tool-group {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  gap: 6px !important;
  box-shadow: none !important;
}

.tool-group .icon-tool {
  width: 28px !important;
  min-width: 28px !important;
  height: 24px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
}

.preview-stage {
  background: transparent !important;
  box-shadow: none !important;
}

/* Minimal secondary icon buttons: no default box, hover only. */
.preview-controls button,
.asset-library-head-actions button,
.asset-library-head-actions .asset-view-btn,
.asset-library-head #uploadLocalAssetBtn {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #b8bec6 !important;
}

.preview-controls button:hover,
.preview-controls button.active,
.asset-library-head-actions button:hover,
.asset-library-head-actions .asset-view-btn:hover,
.asset-library-head-actions button.active,
.asset-library-head-actions .asset-view-btn.active,
.asset-library-head #uploadLocalAssetBtn:hover {
  border: 0 !important;
  background: #30353b !important;
  color: #f2f4f6 !important;
  box-shadow: none !important;
}

/* Restore semantic timeline colors after the neutral app chrome pass. */
.timeline .clip.dialogue {
  background: #75b9ff !important;
  color: #07111d !important;
}

.timeline .clip.material {
  background: #7ddd9a !important;
  color: #07140b !important;
}

.timeline .clip.video-gen {
  background: #8a9299 !important;
  color: #f1f3f4 !important;
}

.timeline .clip.video-gen.progress-70 {
  background: #5ec8ff !important;
  color: #041018 !important;
  box-shadow: inset 0 -4px 0 rgba(8, 44, 68, 0.18);
}

.timeline .clip.video-gen.failed {
  background: #e1525f !important;
  color: #fff6f7 !important;
  box-shadow: inset 0 -4px 0 rgba(97, 7, 18, 0.22);
}

.timeline .clip.audio {
  background: #ff8bd3 !important;
  color: #211018 !important;
}

.timeline .clip.bgm {
  background: #f4b95f !important;
  color: #201408 !important;
}

.timeline .clip.caption {
  background: #ffd770 !important;
  color: #201704 !important;
  min-width: 0 !important;
  padding-left: 4px !important;
  padding-right: 4px !important;
}

.timeline .clip.motion-effect {
  background: #9fb3ff !important;
  color: #101522 !important;
}

.timeline .clip.motion-render {
  background: #63d9b7 !important;
  color: #07110f !important;
}

.timeline .clip.layer-bg {
  background: linear-gradient(135deg, #7d8da0, #4b5b6b) !important;
  color: #f2f6fa !important;
}

.timeline .clip.layer-asset,
.timeline .clip.layer-summary,
.timeline .clip.layer-child,
.timeline .clip.layer-prop,
.timeline .clip.layer-fx {
  background: linear-gradient(135deg, #8adba8, #4f9c72) !important;
  color: #06120b !important;
}

.timeline .clip.audio:not([data-media-url]),
.timeline .clip.bgm:not([data-media-url]),
.timeline .clip.pending,
.timeline .clip.progress-35,
.timeline .clip.progress-45 {
  background: #626c77 !important;
  color: #f0f3f6 !important;
}

.timeline .track.track-hidden .clip {
  display: none !important;
}

.timeline .track.track-hidden .track-lane {
  opacity: 0.42 !important;
  filter: grayscale(0.75) !important;
}

/* Uploaded reference scene library. */
.uploaded-scene-admin {
  display: grid;
  gap: 14px;
}

.uploaded-scene-copy {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
}

.uploaded-scene-copy strong,
.uploaded-scene-user-block > span {
  color: #f2f6fa;
  font-weight: 800;
}

.uploaded-scene-copy p,
.uploaded-scene-user-block p {
  margin: 0;
  color: #aeb8c4;
  font-size: 13px;
  line-height: 1.55;
}

.uploaded-scene-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.uploaded-scene-toolbar button,
.uploaded-scene-card-actions button,
.uploaded-scene-ref-row button,
.uploaded-scene-actions button {
  min-height: 34px;
  border: 1px solid #3a4048;
  border-radius: 8px;
  background: var(--surface-hover);
  color: #eceff2;
  font-weight: 700;
}

.uploaded-scene-actions button {
  background: #dfe8f4;
  color: #10151b;
}

.uploaded-scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.uploaded-scene-admin-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-deep);
}

.uploaded-scene-admin-card.active {
  border-color: #686c73;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.uploaded-scene-preview-block {
  display: grid;
  gap: 6px;
}

.uploaded-scene-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #141619;
  color: #9ba3ad;
}

.uploaded-scene-preview-select {
  position: absolute;
  right: 8px;
  bottom: 8px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(20, 22, 25, 0.82);
  border: 1px solid #4a5058;
  color: #eef1f4;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.uploaded-scene-preview:hover .uploaded-scene-preview-select,
.uploaded-scene-admin-card.active .uploaded-scene-preview-select {
  opacity: 1;
}

.uploaded-scene-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.uploaded-scene-storage-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2a3139;
  color: #d6dde5;
  font-size: 11px;
  line-height: 1.4;
}

.uploaded-scene-source-link {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #8ec5ff;
  font-size: 11px;
  text-decoration: none;
}

.uploaded-scene-source-link:hover {
  text-decoration: underline;
}

.uploaded-scene-url-row button {
  flex: 0 0 auto;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
}

.uploaded-scene-preview img,
.uploaded-scene-user-card img,
.uploaded-scene-ref-row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uploaded-scene-admin-card label {
  display: grid;
  gap: 6px;
  color: #b7c1cd;
  font-size: 12px;
}

.uploaded-scene-admin-card input,
.uploaded-scene-admin-card textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: #17191c;
  color: #f2f4f6;
  font: inherit;
}

.uploaded-scene-admin-card textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.45;
}

.uploaded-scene-ref-row,
.uploaded-scene-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.uploaded-scene-ref-row img {
  width: 42px;
  height: 28px;
  border-radius: 5px;
}

.uploaded-scene-card-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.uploaded-scene-user-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.uploaded-scene-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}

.uploaded-scene-user-card {
  position: relative;
  display: grid !important;
  gap: 6px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 6px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: var(--panel-deep) !important;
  color: #eceff2 !important;
  overflow: visible !important;
}

.uploaded-scene-user-card.active {
  border-color: #686c73 !important;
  background: var(--surface-hover) !important;
}

.uploaded-scene-user-card div {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background: #141619;
  color: #8793a1;
  font-size: 12px;
}

.uploaded-scene-user-card strong {
  display: block !important;
  overflow: hidden;
  color: inherit !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-scene-user-card:hover::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 80;
  width: min(340px, 70vw);
  aspect-ratio: 16 / 9;
  border: 1px solid #556274;
  border-radius: 8px;
  background: var(--scene-hover-image, #141619) center / cover no-repeat;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  pointer-events: none;
}

/* Neutral surface pass: remove remaining blue-tinted panel backgrounds. */
.badge,
.topbar .badge {
  background: #2c3036 !important;
  border-color: #3a4048 !important;
  color: #b8bec6 !important;
}

.export-card,
.remotion-plan-summary div,
.model-billing-row,
.model-billing-group,
.pipeline-switches label,
.scene-preset-card,
.scene-choice-card,
.creative-preview-box,
.creative-asset-card div,
.uploaded-asset-choice div,
.asset-hover-preview,
.admin-section pre,
.grid-rule-notes span,
.style-editor-panel,
.uploaded-mode-note,
.uploaded-scene-copy {
  background: #1d2024 !important;
  border-color: #343941 !important;
}

.export-card button,
.square-add,
.square-add.small,
.scene-preset-head button {
  background: #525860 !important;
  border-color: #3a4048 !important;
  color: #f2f4f6 !important;
}

.asset-library-mode-tabs button.active,
.asset-library-mode-tabs button:hover,
.creative-asset-card.active,
.creative-asset-card:hover,
.uploaded-asset-choice.active,
.uploaded-asset-choice:hover,
.style-admin-card.active,
.style-admin-card:hover,
.style-choice-btn.active,
.uploaded-scene-admin-card.active,
.uploaded-scene-user-card.active {
  border-color: #686c73 !important;
  background: #2c3036 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.message.user {
  background: #2c3036 !important;
  border: 1px solid #3a4048 !important;
}

.asset-hover-preview {
  border-color: #444a52 !important;
  background: rgba(29, 32, 36, 0.98) !important;
}

.admin-section pre {
  color: #c9ccd1 !important;
}

.creative-editor-head span,
.creative-asset-card small {
  color: #9ba3ad !important;
}

/* Restore full workspace chrome after neutral theme passes. */
.composer {
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto minmax(36px, auto) auto !important;
  gap: 6px 8px !important;
  padding: 10px 12px 8px !important;
  overflow: visible !important;
}

.composer .composer-mode {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 12 !important;
}

.composer .composer-mode-menu.open {
  z-index: 230 !important;
}

.composer .composer-media-controls {
  flex: 1 1 auto !important;
  order: 0 !important;
  min-width: 0 !important;
  margin-top: 0 !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

.composer .composer-media-controls.active {
  display: flex !important;
}

.composer .composer-media-controls:not(.pipeline-chat-controls):not([data-capability="chat"]) select:not(.model-select-native):not(.model-billing-select),
.composer .composer-media-controls:not(.pipeline-chat-controls):not([data-capability="chat"]) input {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: 30px !important;
  min-height: 30px !important;
  font-size: 12px !important;
}

.composer .composer-media-controls.pipeline-chat-controls select:not([data-param="model"]):not(.model-select-native):not(.model-billing-select),
.composer .composer-media-controls[data-capability="chat"] select:not([data-param="model"]):not(.model-select-native):not(.model-billing-select),
.composer .composer-media-controls.pipeline-chat-controls input,
.composer .composer-media-controls[data-capability="chat"] input,
.composer .composer-media-controls.pipeline-chat-controls [data-media-kind],
.composer .composer-media-controls[data-capability="chat"] [data-media-kind],
.composer .composer-media-controls.pipeline-chat-controls .composer-dynamic-param,
.composer .composer-media-controls[data-capability="chat"] .composer-dynamic-param {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.composer .composer-media-controls select.hidden:not(.model-select-native):not(.model-billing-select),
.composer .composer-media-controls input.hidden,
.composer .composer-media-controls [data-media-kind].hidden,
.composer .composer-media-controls .composer-dynamic-param.hidden,
.composer .composer-media-controls .model-select-wrap.hidden {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
}

.composer-settings-modal .model-select-menu {
  z-index: 10050;
  min-width: 0;
  max-width: min(320px, calc(100vw - 48px));
}

.composer-settings-modal .model-select-option .model-select-name {
  flex: 1 1 auto;
  min-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-settings-modal .model-select-option .model-select-billing {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 12px;
  white-space: nowrap;
}

.composer-settings-modal .video-model-slot,
.composer-settings-modal .composer-settings-group {
  overflow: visible;
}

.composer .composer-media-controls .model-select-wrap > select.model-select-native,
.composer .composer-media-controls .model-select-wrap > select.model-billing-select {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.composer .composer-media-controls [data-param="model"],
.composer .composer-media-controls .model-select-wrap {
  flex: 0 1 auto !important;
  min-width: 112px !important;
  max-width: 176px !important;
  width: auto !important;
}

.composer .composer-media-controls .model-select-wrap {
  display: block !important;
}

.composer .composer-media-controls .model-select-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 24px 0 10px !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  border: 1px solid #444a52 !important;
  border-radius: 8px !important;
  background: #2c3036 !important;
  box-shadow: none !important;
  color: #f2f4f6 !important;
  transform: none !important;
}

.composer .composer-media-controls .model-select-trigger .model-select-name {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.composer .composer-media-controls .model-select-trigger .model-select-billing {
  flex: 0 0 auto !important;
  padding-left: 8px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
}

.composer .composer-media-controls .model-select-menu {
  min-width: 240px;
  max-width: min(360px, calc(100vw - 24px));
}

.composer .composer-media-controls .model-select-option {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 32px !important;
  height: auto !important;
  padding: 6px 10px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #eef3f8 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-align: left !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  transform: none !important;
}

.composer .composer-media-controls .model-select-option::before,
.composer .composer-media-controls .model-select-option::after {
  display: none !important;
  content: none !important;
}

.composer .composer-media-controls .model-select-option .model-select-name {
  flex: 1 1 auto !important;
  min-width: 72px !important;
  max-width: none !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #eef3f8 !important;
}

.composer .composer-media-controls .model-select-option .model-select-billing {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  padding-left: 12px !important;
  color: #5fe693 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}

.composer .composer-mode #composerMediaControls {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: visible !important;
}

.composer .composer-mode #composerSettingsBtn {
  flex: 0 0 28px !important;
  margin-left: 0 !important;
}

.composer .composer-media-controls .model-select-wrap.hidden,
.composer .composer-media-controls .hidden {
  display: none !important;
}

.composer-footer {
  grid-column: 1 / -1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-height: 28px !important;
  margin-top: 0 !important;
}

.composer-footer .source-count {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.composer-footer #sendBtn {
  flex: 0 0 auto !important;
  margin-left: auto !important;
}

.track-name.has-track-controls {
  grid-template-columns: 62px minmax(0, 1fr) !important;
}

.track-controls {
  display: grid !important;
  grid-template-columns: repeat(3, 20px) !important;
  gap: 1px !important;
  flex: 0 0 62px !important;
  width: 62px !important;
}

.track-control-slot-empty {
  display: block !important;
  width: 20px !important;
  height: 20px !important;
}

.track-control-btn,
.track-icon-btn {
  display: inline-grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 20px !important;
  height: 20px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #8f9aa8 !important;
  transition: color 120ms ease, transform 100ms ease !important;
}

.timeline .track-control-btn:hover,
.timeline .track-icon-btn:hover {
  background: transparent !important;
  color: #c5ced8 !important;
}

.timeline .track-control-btn.active,
.timeline .track-icon-btn.active {
  background: transparent !important;
  color: #72dfc3 !important;
  box-shadow: none !important;
}

.timeline .track-control-btn.active:hover,
.timeline .track-icon-btn.active:hover {
  color: #8aebd0 !important;
}

.timeline .track-control-btn:active,
.timeline .track-control-btn.pressed,
.timeline .track-icon-btn:active,
.timeline .track-icon-btn.pressed {
  transform: scale(0.86);
}

.track {
  grid-template-columns: var(--timeline-gutter) minmax(0, 1fr) !important;
}

.asset-library-box,
.asset-library-mode-tabs,
.creative-asset-panel {
  display: grid !important;
}

.asset-library-mode-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.message-actions button,
.style-card button,
.chat-action-row button {
  min-height: 38px !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  background: var(--panel-deep) !important;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

/* Timeline track controls: mint-green active icon, no gray pill background */
.timeline .track-control-btn.on,
.timeline .track-control-btn.off,
.timeline .track-icon-btn.on,
.timeline .track-icon-btn.off {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #72dfc3 !important;
}

/* Style preview grid: 3 tiles per row, hover darken only, blue selected state. */
.chat-feed .style-choice-grid.style-preview-grid,
.chat-feed .style-picker-card .style-choice-grid.style-preview-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  flex-direction: unset !important;
  align-items: stretch !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 8px;
  overflow: visible !important;
}

.style-picker-card:has(.style-preview-grid) {
  overflow: visible !important;
}

.chat-feed .message:has(.style-preview-grid) {
  overflow: visible !important;
  max-width: 100% !important;
}

.chat-feed .style-choice-btn.style-preview-tile {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 3px !important;
  border: 2px solid transparent !important;
  border-radius: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
  text-align: unset !important;
  white-space: normal !important;
  transition: border-color 0.18s ease, background 0.18s ease !important;
}

.chat-feed .style-choice-btn.style-preview-tile::after {
  display: none !important;
  content: none !important;
}

.chat-feed .style-choice-btn.style-preview-tile strong,
.chat-feed .style-choice-btn.style-preview-tile small {
  display: none !important;
}

.style-preview-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #14181d;
  transition: background 0.18s ease;
  transform: none;
}

.style-preview-frame .style-choice-preview,
.style-preview-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.style-preview-placeholder {
  display: grid;
  place-items: center;
  color: #9aa3ad;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: linear-gradient(145deg, #171b20, #101419);
}

.style-preview-label {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 2;
  max-width: calc(100% - 12px);
  padding: 3px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.68);
  color: #f5f7f8;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.chat-feed .style-choice-btn.style-preview-tile:hover,
.chat-feed .style-choice-btn.style-preview-tile:focus-visible {
  z-index: 2 !important;
  border-color: transparent !important;
  background: transparent !important;
}

.style-preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.18s ease;
  pointer-events: none;
  border-radius: inherit;
}

.chat-feed .style-choice-btn.style-preview-tile:hover:not(.active) .style-preview-frame::after,
.chat-feed .style-choice-btn.style-preview-tile:focus-visible:not(.active) .style-preview-frame::after {
  background: rgba(0, 0, 0, 0.14);
}

.chat-feed .style-choice-btn.style-preview-tile:hover .style-preview-frame,
.chat-feed .style-choice-btn.style-preview-tile:focus-visible .style-preview-frame {
  transform: none;
  box-shadow: none;
}

.chat-feed .style-choice-btn.style-preview-tile.active {
  z-index: 3 !important;
  border-color: transparent !important;
  background: rgba(68, 98, 140, 0.28) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  transform: none !important;
}

.chat-feed .style-choice-btn.style-preview-tile.active::before {
  display: none !important;
  content: none !important;
}

.chat-feed .style-choice-btn.style-preview-tile.active .style-preview-frame {
  box-shadow: none;
}

.chat-feed .style-choice-btn.style-preview-tile.active .style-preview-frame::after {
  background: transparent !important;
}

.chat-feed .style-choice-btn.style-preview-tile.active .style-preview-label {
  background: rgba(0, 0, 0, 0.68);
  color: #f5f7f8;
  font-weight: 600;
  box-shadow: none;
}

.chat-feed .style-choice-btn.style-preview-tile.active:hover,
.chat-feed .style-choice-btn.style-preview-tile.active:focus-visible {
  border-color: transparent !important;
  background: rgba(68, 98, 140, 0.32) !important;
  box-shadow: none !important;
}

.chat-feed .style-choice-btn.style-preview-tile.active:hover .style-preview-frame::after,
.chat-feed .style-choice-btn.style-preview-tile.active:focus-visible .style-preview-frame::after {
  background: transparent !important;
}

.chat-feed .style-choice-grid.style-preview-grid:has(.style-preview-tile.active) .style-preview-tile:not(.active) {
  opacity: 1;
  filter: none;
}

.chat-feed .style-choice-grid.style-preview-grid:has(.style-preview-tile.active) .style-preview-tile:not(.active):hover,
.chat-feed .style-choice-grid.style-preview-grid:has(.style-preview-tile.active) .style-preview-tile:not(.active):focus-visible {
  opacity: 1;
  filter: none;
}

@media (max-width: 720px) {
  .chat-feed .style-choice-grid.style-preview-grid,
  .chat-feed .style-picker-card .style-choice-grid.style-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Pipeline workflow step bar (explain modes only). */
.pipeline-step-message {
  max-width: 100% !important;
  margin-bottom: 10px !important;
}

.pipeline-step-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  overflow-x: auto;
}

.pipeline-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #7d8791;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.pipeline-step b {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #252a30;
  color: #9aa3ad;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}

.pipeline-step.done {
  color: #72dfc3;
}

.pipeline-step.done b {
  background: rgba(114, 223, 195, 0.18);
  color: #72dfc3;
}

.pipeline-step.current {
  color: #f1f3f4;
  background: rgba(114, 223, 195, 0.12);
}

.pipeline-step.current b {
  background: #72dfc3;
  color: #0b1218;
}

.pipeline-step-sep {
  width: 10px;
  height: 1px;
  background: #3a4048;
  flex-shrink: 0;
}

.pipeline-action-card {
  margin-top: 6px !important;
}

.pipeline-action-card > span {
  color: #b8bec6 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.pipeline-action-card p {
  margin: 0 0 10px !important;
  color: #9aa7b7 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
}

.chat-feed .thinking-message .thinking-text {
  font-size: 13px;
  font-weight: 600;
  color: #f2f4f6;
}

.pipeline-script-card {
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.pipeline-script-card-minimal {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pipeline-script-head-minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 0 2px;
}

.pipeline-script-head-minimal span {
  color: #8d949d;
  font-size: 12px;
  font-weight: 600;
}

.pipeline-script-head-minimal small {
  color: #6f7a86;
  font-size: 11px;
}

.pipeline-script-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pipeline-script-head span {
  color: #b8bec6;
  font-size: 13px;
  font-weight: 700;
}

.pipeline-script-head small {
  color: #7d8791;
  font-size: 11px;
}

.pipeline-script-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-script-head-meta .pipeline-script-refresh-btn {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b8bec6;
  font-size: 18px;
  line-height: 1;
}

.pipeline-script-head-meta .pipeline-script-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f2f4f6;
}

.pipeline-script-body {
  max-height: 280px;
  overflow-y: auto;
  color: #f2f4f6;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.pipeline-script-editor {
  display: block;
  width: 100%;
  min-height: 160px;
  max-height: 280px;
  margin: 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #f2f4f6;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.75;
  resize: none;
  outline: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.pipeline-script-editor::-webkit-scrollbar {
  width: 6px;
}

.pipeline-script-editor::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.pipeline-script-card-minimal .pipeline-script-editor {
  min-height: 160px;
}

.pipeline-script-editor:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.06);
}

.pipeline-script-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.pipeline-duration-topic {
  display: block;
  margin-top: 8px;
  color: #7d8791;
  font-size: 12px;
}

.pipeline-script-confirm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pipeline-script-confirm-head > span {
  color: #b8bec6;
  font-size: 13px;
  font-weight: 700;
}

.pipeline-script-duration-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pipeline-duration-btn,
.pipeline-script-refresh-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}

.pipeline-duration-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #b8bec6;
}

.pipeline-script-refresh-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #b8bec6;
  font-size: 18px;
  line-height: 1;
}

.pipeline-duration-btn.active {
  border-color: #444a52;
  background: #383d44;
  color: #f2f4f6;
}

.pipeline-duration-btn:hover {
  border-color: #3a4048;
  background: #2c3036;
}

.pipeline-script-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f2f4f6;
}

.export-path-link {
  margin-left: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8eb6ff;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}

.export-path-link:hover {
  color: #b8d4ff;
}

.export-path-text {
  display: block;
  margin-top: 6px;
  color: #7d8791;
  font-size: 12px;
  word-break: break-all;
}

.pipeline-selected-style-summary {
  margin-top: 4px !important;
}

.pipeline-selected-style-summary > span {
  color: #b8bec6 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.pipeline-selected-style-body {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.pipeline-selected-style-thumb {
  flex: 0 0 auto;
  width: 128px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #14181d;
}

.pipeline-selected-style-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pipeline-selected-style-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #9aa3ad;
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(145deg, #171b20, #101419);
}

.pipeline-selected-style-body p {
  margin: 0;
  min-width: 0;
}

.pipeline-selected-style-body b {
  display: block;
  color: #f2f4f6;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.pipeline-selected-style-body small {
  display: block;
  margin-top: 4px;
  color: #8f9bab;
  font-size: 12px;
  line-height: 1.4;
}

.app-shell-hidden {
  display: none !important;
}

.project-home {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(117, 185, 255, 0.08), transparent 28%),
    var(--bg);
}

.project-home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.92);
}

.project-home-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.ghost-btn:hover {
  background: var(--surface-hover);
}

.project-home-main {
  overflow: auto;
  padding: 28px 32px 40px;
}

.project-home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.project-home-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.project-home-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.project-home-head code {
  color: #d6e4ff;
  font-size: 13px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.project-card:focus-visible {
  outline: 2px solid rgba(114, 223, 195, 0.55);
  outline-offset: 2px;
}

.project-card-thumb,
.project-card-body {
  cursor: pointer;
}

.project-home-error {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 120, 0.35);
  background: rgba(255, 80, 80, 0.08);
  color: #ffb4b0;
  font-size: 13px;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: #465062;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

.project-card.create-card {
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.project-card.create-card strong {
  font-size: 18px;
  color: var(--text);
}

.project-card.create-card span {
  font-size: 13px;
}

.project-card-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 250px;
  background:
    linear-gradient(135deg, rgba(117, 185, 255, 0.12), rgba(255, 139, 211, 0.08)),
    #171a1f;
}

.project-card-thumb img,
.project-card-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card-thumb-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #7f8998;
  font-size: 13px;
}

.project-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 12px;
}

.project-card-body strong {
  font-size: 15px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card-body small {
  color: var(--muted);
  font-size: 12px;
}

.project-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding: 0 14px 14px;
}

.project-card-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.project-card-actions button.danger {
  color: #ffb4b0;
}

.back-to-projects {
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

.back-to-projects:hover {
  background: var(--surface-hover);
}

.topbar .brand {
  display: flex;
  align-items: center;
}

.table-asset-picker-modal {
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: #11151b;
  color: #e7edf5;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.table-asset-picker-modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.table-asset-picker-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.table-asset-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table-asset-picker-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #8f9bab;
}

.table-asset-picker-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #d8dee8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.table-asset-picker-body {
  padding: 12px 18px;
  overflow: auto;
}

.table-asset-picker-group {
  margin-bottom: 14px;
}

.table-asset-picker-group > span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: #8f9bab;
}

.table-asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.table-asset-picker-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: #0d1014;
  cursor: pointer;
  text-align: left;
}

.table-asset-picker-item.active {
  border-color: rgba(114, 223, 195, 0.65);
  box-shadow: inset 0 0 0 1px rgba(114, 223, 195, 0.35);
}

.table-asset-picker-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  background: #080a0d;
}

.table-asset-picker-item small {
  font-size: 11px;
  color: #aeb8c4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-asset-picker-empty {
  padding: 28px 12px;
  text-align: center;
  color: #8f9bab;
  font-size: 13px;
  line-height: 1.6;
}

.table-asset-picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.table-asset-picker-count {
  font-size: 12px;
  color: #8f9bab;
}

.table-asset-picker-foot div {
  display: flex;
  gap: 8px;
}

.table-asset-picker-foot button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: #23272b;
  color: #e7edf5;
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
}

.table-asset-picker-foot button[data-action="confirm"] {
  background: rgba(114, 223, 195, 0.16);
  border-color: rgba(114, 223, 195, 0.35);
}

.table-asset-picker-foot button[data-action="confirm"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Chat pipeline option selected state — light gray, overrides bubble button defaults. */
.chat-feed .chat-action-row button.active,
.chat-feed .pipeline-action-card .chat-action-row button.active,
.chat-feed .pipeline-topic-duration-card .chat-action-row button.active,
.composer-topic-duration-actions button.active {
  background: #32363c !important;
  border: 1px solid #3e444c !important;
  color: #f2f4f6 !important;
  box-shadow: none !important;
}

.chat-feed .chat-action-row button.active:hover,
.chat-feed .pipeline-action-card .chat-action-row button.active:hover,
.chat-feed .pipeline-topic-duration-card .chat-action-row button.active:hover,
.composer-topic-duration-actions button.active:hover {
  background: #3a3f46 !important;
  border-color: #474d56 !important;
  color: #ffffff !important;
}

.talking-overlay-style-section {
  display: grid;
  gap: 12px;
}

.talking-overlay-substyle-head {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.talking-overlay-style-grid {
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}

.talking-overlay-style-card.substyle-card {
  min-height: 0;
  padding: 8px;
  gap: 6px;
}

.talking-overlay-style-thumb {
  aspect-ratio: 16 / 9;
  max-height: 58px;
}

.talking-overlay-style-card strong {
  font-size: 12px;
  min-height: 0;
  line-height: 1.3;
}

.talking-overlay-style-card small {
  min-height: 0;
  font-size: 11px;
  line-height: 1.25;
}

.talking-overlay-editor {
  margin-top: 4px;
  padding: 12px;
}

.talking-overlay-editor-body {
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.talking-overlay-reference-panel {
  gap: 8px;
}

.talking-overlay-preview-box {
  aspect-ratio: 16 / 9;
  max-height: 108px;
  min-height: 0;
}

.talking-overlay-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.talking-overlay-upload-slot.style-reference-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.talking-overlay-form-grid {
  grid-template-columns: 1fr;
  gap: 10px;
}

.talking-overlay-form-grid label.wide {
  grid-column: 1 / -1;
}

.talking-overlay-form-grid textarea {
  min-height: 68px;
  max-height: 110px;
  resize: vertical;
}

.talking-overlay-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.talking-overlay-editor-actions button {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: #2c3036;
  color: var(--text);
  border: 1px solid var(--line);
  white-space: nowrap;
  font-size: 12px;
}

.talking-overlay-preview-row {
  width: 100%;
  max-width: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #111418;
}

.talking-overlay-preview-row img {
  display: block;
  width: 100%;
  max-height: 108px;
  object-fit: cover;
}

/* Chat 口播贴片画风选择：缩小预览图 */
.chat-feed .talking-overlay-style-picker .style-choice-grid.style-preview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  max-width: min(100%, 360px);
  gap: 8px !important;
}

.chat-feed .talking-overlay-style-picker .style-preview-frame {
  aspect-ratio: 16 / 10;
  max-height: 56px;
}

.chat-feed .talking-overlay-style-picker .style-preview-label {
  font-size: 10px;
  line-height: 1.2;
  padding: 2px 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-feed .talking-overlay-style-picker .style-choice-btn.style-preview-tile {
  padding: 2px !important;
}

.chat-feed .talking-overlay-style-picker p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 920px) {
  .talking-overlay-editor-body {
    grid-template-columns: 1fr;
  }

  .talking-overlay-preview-box {
    max-height: 96px;
  }
}

.chat-feed .talking-overlay-style-picker .style-choice-grid {
  margin-top: 10px;
}

.chat-feed .talking-overlay-style-picker .talking-overlay-style-choice.active {
  box-shadow: 0 0 0 2px #75b9ff inset;
}

.talking-overlay-analysis-card pre.talking-overlay-analysis-plan {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #171a1f;
  border: 1px solid #343941;
  color: #d7dde5;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.talking-overlay-analysis-block {
  margin-top: 12px;
}

.talking-overlay-analysis-block strong {
  display: block;
  margin-bottom: 4px;
  color: #eef2f6;
  font-size: 13px;
}

.talking-overlay-preview-editor {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.talking-overlay-preview-stage-wrap {
  display: grid;
  gap: 8px;
}

.talking-overlay-preview-stage {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 9 / 16;
  border: 1px solid #343941;
  border-radius: 10px;
  overflow: hidden;
  background: #0d1014;
}

.talking-overlay-preview-stage[data-aspect="16:9"] {
  aspect-ratio: 16 / 9;
  width: min(100%, 520px);
}

.talking-overlay-preview-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.talking-overlay-preview-placeholder {
  display: grid;
  place-items: center;
  color: #8b949e;
  font-size: 13px;
}

.talking-overlay-preview-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.talking-overlay-preview-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  min-height: 28px;
  padding: 4px 8px;
  border: 2px dashed #75b9ff;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.72);
  color: #eef6ff;
  font-size: 11px;
  line-height: 1.2;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.talking-overlay-preview-marker:active {
  cursor: grabbing;
}

.talking-overlay-preview-marker span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.talking-overlay-preview-hint {
  margin: 0;
  color: #9aa3ad;
  font-size: 12px;
  line-height: 1.5;
}

.talking-overlay-preview-controls {
  display: grid;
  gap: 10px;
}

.talking-overlay-preview-item {
  padding: 10px 12px;
  border: 1px solid #343941;
  border-radius: 8px;
  background: #171a1f;
}

.talking-overlay-preview-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.talking-overlay-preview-item-head strong {
  color: #eef2f6;
  font-size: 13px;
}

.talking-overlay-preview-item-head small {
  color: #8b949e;
  font-size: 11px;
}

.talking-overlay-preview-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.talking-overlay-preview-fields label {
  display: grid;
  gap: 4px;
  color: #b6bec8;
  font-size: 11px;
}

.talking-overlay-preview-fields input,
.talking-overlay-preview-fields select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #343b44;
  border-radius: 6px;
  background: #111418;
  color: #eef2f6;
  font-size: 12px;
}

.talking-overlay-preview-text {
  margin: 8px 0 0;
  color: #c4ccd6;
  font-size: 12px;
  line-height: 1.5;
}

.talking-overlay-legacy-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #5a4a1f;
  background: rgba(90, 74, 31, 0.18);
  color: #f0d48a;
  font-size: 12px;
  line-height: 1.6;
}

.talking-overlay-asset-preview {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.talking-overlay-asset-preview strong {
  color: #eef2f6;
  font-size: 13px;
}

.talking-overlay-asset-plate {
  display: grid;
  gap: 6px;
}

.talking-overlay-asset-plate span {
  color: #9aa3ad;
  font-size: 11px;
}

.talking-overlay-asset-plate img,
.talking-overlay-asset-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #343941;
  background: #0d1014;
}

.talking-overlay-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.talking-overlay-asset-grid.compact img {
  max-height: 88px;
  object-fit: contain;
}

.talking-overlay-asset-item {
  margin: 0;
  display: grid;
  gap: 6px;
}

.talking-overlay-asset-item figcaption {
  display: grid;
  gap: 2px;
}

.talking-overlay-asset-item figcaption strong {
  font-size: 12px;
  color: #eef2f6;
}

.talking-overlay-asset-item figcaption small {
  font-size: 11px;
  color: #9aa3ad;
}

.badge[data-build]::after {
  content: " · " attr(data-build);
  font-size: 10px;
  opacity: 0.72;
  font-weight: 400;
}

/* 口播贴片专属 Table / Preview / Inspector */
.hidden {
  display: none !important;
}

.app-shell.talking-overlay-workspace-active.table-mode .talking-overlay-workspace-preview {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 12px;
  background: #0b0d10;
}

.app-shell.talking-overlay-workspace-active.table-mode .talking-overlay-workspace-preview.hidden {
  display: none;
}

.talking-overlay-table-pane {
  display: none;
}

.app-shell.table-mode .talking-overlay-table-pane.active {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.talking-overlay-table-toolbar {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  font-size: 12px;
  color: #9aa3ad;
  border-bottom: 1px solid var(--line);
  background: #17191c;
}

.talking-overlay-table-toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.talking-overlay-table-toolbar-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.chat-feed .talking-overlay-chat-workflow {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.chat-feed .talking-overlay-chat-step {
  display: grid;
  gap: 8px;
}

.chat-feed .talking-overlay-chat-step.hidden {
  display: none;
}

.chat-feed .talking-overlay-analysis-card.compact > span {
  display: block;
  margin-bottom: 8px;
}

.talking-overlay-workflow-actions {
  margin-top: 0;
}

.talking-overlay-table-actions .talking-overlay-workflow-actions button,
.chat-feed .talking-overlay-analysis-card .talking-overlay-workflow-actions button {
  width: 100%;
  max-width: 280px;
}

.talking-overlay-table-actions {
  display: grid;
  gap: 10px;
}

.talking-overlay-action-step {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid #343941;
  border-radius: 10px;
  background: #1d2024;
}

.talking-overlay-action-step.hidden {
  display: none;
}

.talking-overlay-action-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #9aa3ad;
}

.talking-overlay-table-asset-summary {
  display: grid;
  gap: 8px;
}

.talking-overlay-table-asset-summary-label {
  font-size: 12px;
  color: #b8bec6;
  font-weight: 600;
}

.talking-overlay-table-asset-summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.talking-overlay-table-asset-chip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  padding: 6px;
  border: 1px solid #343941;
  border-radius: 10px;
  background: #1d2024;
  min-width: 168px;
}

.talking-overlay-table-asset-chip .talking-overlay-asset-slot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
}

.talking-overlay-table-asset-chip img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 8px;
  background: #0a0d11;
  display: block;
}

.talking-overlay-table-asset-chip .placeholder {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: #23272b;
  color: #666;
  font-size: 11px;
}

.talking-overlay-table-asset-chip .talking-overlay-asset-slot.cutout .regen-icon {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(18, 23, 30, 0.88);
  color: #f5f7fa;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  line-height: 1;
  opacity: 0.92;
  transform: none;
  cursor: pointer;
  padding: 0;
}

.talking-overlay-table-asset-chip .talking-overlay-asset-slot.green .regen-icon,
.talking-overlay-asset-item .talking-overlay-asset-slot.green .regen-icon,
.talking-overlay-asset-item .talking-overlay-asset-slot.cutout .regen-icon {
  position: absolute;
  right: 2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(18, 23, 30, 0.88);
  color: #f5f7fa;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
  line-height: 1;
  opacity: 0.92;
  cursor: pointer;
  padding: 0;
}

.talking-overlay-table-asset-chip.is-regenerating,
.talking-overlay-asset-item.is-regenerating {
  opacity: 0.72;
}

.talking-overlay-table-asset-chip.is-regenerating .regen-icon.busy,
.talking-overlay-asset-item.is-regenerating .regen-icon.busy,
.talking-overlay-table-media.is-regenerating .regen-icon.busy,
.regen-icon.busy {
  animation: spin 0.9s linear infinite;
  opacity: 1;
}

.asset-thumb-wrap.is-regenerating {
  opacity: 0.6;
  outline: 1px solid rgba(117, 185, 255, 0.45);
  border-radius: 10px;
}

.talking-overlay-table-asset-chip .talking-overlay-asset-slot.cutout:hover .regen-icon,
.talking-overlay-table-asset-chip .talking-overlay-asset-slot.cutout .regen-icon:hover {
  background: rgba(57, 73, 96, 0.95);
  opacity: 1;
}

.talking-overlay-shot-table {
  font-size: 11px;
  table-layout: fixed;
  width: 100%;
}

.talking-overlay-shot-table col.col-index { width: 28px; }
.talking-overlay-shot-table col.col-shot-dur { width: 52px; }
.talking-overlay-shot-table col.col-narration { width: 14%; min-width: 100px; }
.talking-overlay-shot-table col.col-fx-start { width: 52px; }
.talking-overlay-shot-table col.col-fx-dur { width: 52px; }
.talking-overlay-shot-table col.col-prompt { width: 18%; min-width: 120px; }
.talking-overlay-shot-table col.col-xy { width: 38px; }
.talking-overlay-shot-table col.col-num-sm { width: 44px; }
.talking-overlay-shot-table col.col-animation { width: 88px; }
.talking-overlay-shot-table col.col-media { width: 68px; }

.talking-overlay-shot-table td:first-child,
.talking-overlay-shot-table th:first-child {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
}

.talking-overlay-shot-table input[data-field="x"],
.talking-overlay-shot-table input[data-field="y"],
.talking-overlay-shot-table input[data-field="start"],
.talking-overlay-shot-table input[data-field="duration"],
.talking-overlay-shot-table input[data-field="shotDuration"] {
  padding: 0 4px;
  text-align: center;
}

.talking-overlay-shot-table input[data-field="scale"],
.talking-overlay-shot-table input[data-field="rotate"],
.talking-overlay-shot-table input[data-field="opacity"] {
  padding: 0 4px;
  text-align: center;
}

.talking-overlay-shot-table th,
.talking-overlay-shot-table td {
  padding: 8px;
  vertical-align: top;
}

.talking-overlay-shot-table input,
.talking-overlay-shot-table select,
.talking-overlay-shot-table textarea {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--panel-deep);
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}

.talking-overlay-shot-table input:focus,
.talking-overlay-shot-table select:focus,
.talking-overlay-shot-table textarea:focus {
  border-color: #50565e;
  background: #252a30;
}

.talking-overlay-shot-table textarea {
  min-height: 52px;
  max-height: 120px;
  resize: vertical;
}

.talking-overlay-shot-table select {
  min-height: 32px;
  padding-right: 24px;
}

.talking-overlay-shot-table input[type="number"] {
  height: 32px;
}

.talking-overlay-shot-table textarea[data-field="narration"] {
  min-width: 0;
}

.talking-overlay-shot-table textarea[data-field="overlayPrompt"] {
  min-width: 0;
}

.talking-overlay-shot-table tr.selected {
  background: rgba(117, 185, 255, 0.12);
}

.talking-overlay-table-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
  background: #111;
}

.talking-overlay-table-thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  font-size: 10px;
  color: #777;
  border: 1px dashed #444;
  border-radius: 4px;
}

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

.talking-overlay-inspector .talking-overlay-global-sync-row {
  margin-top: 2px;
}

.talking-overlay-inspector label.wide {
  grid-column: 1 / -1;
}

.talking-overlay-inspector-grid label.wide {
  grid-column: 1 / -1;
}

.talking-overlay-cut-preview-item.is-dragging {
  cursor: grabbing;
}

.talking-overlay-cut-preview-item.mode-rotate {
  cursor: grabbing;
}

.talking-overlay-cut-preview-item.mode-scale {
  cursor: nwse-resize;
}

.talking-overlay-preview-marker.is-dragging {
  cursor: grabbing;
}

.clip.motion-effect[data-layer-role="talking-overlay-element"] {
  cursor: grab;
}

.clip.motion-effect[data-layer-role="talking-overlay-element"].resize-hover-left,
.clip.motion-effect[data-layer-role="talking-overlay-element"].resize-hover-right,
.clip.motion-effect[data-layer-role="talking-overlay-element"].resizing {
  cursor: ew-resize !important;
}

.clip.motion-effect[data-layer-role="talking-overlay-element"].clip-moving {
  cursor: grabbing !important;
  z-index: 6;
  box-shadow: 0 0 0 2px rgba(117, 185, 255, 0.85), 0 8px 20px rgba(0, 0, 0, 0.28);
  filter: brightness(1.08);
}

.clip.motion-effect[data-layer-role="talking-overlay-element"].resizing {
  z-index: 6;
  box-shadow: inset 0 0 0 2px rgba(255, 180, 84, 0.95), 0 0 0 1px rgba(255, 180, 84, 0.45);
  filter: brightness(1.12);
}

.clip.motion-effect[data-layer-role="talking-overlay-element"].resizing-left {
  border-left: 2px solid #ffb454;
}

.clip.motion-effect[data-layer-role="talking-overlay-element"].resizing-right {
  border-right: 2px solid #ffb454;
}

.talking-overlay-preview-marker.has-asset {
  padding: 0;
  border-style: solid;
  background: transparent;
  overflow: hidden;
}

.talking-overlay-preview-marker.has-asset img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
}

.talking-overlay-preview-marker.selected {
  outline: 2px solid #75b9ff;
  box-shadow: 0 0 0 2px rgba(117, 185, 255, 0.35);
}

.talking-overlay-cut-preview-stack {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 13;
}

.caption-card.active {
  z-index: 12;
}

.talking-overlay-cut-preview-item {
  position: absolute;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  border: 2px solid transparent;
  border-radius: 8px;
}

.talking-overlay-cut-preview-item .talking-overlay-cut-preview-part.nested {
  position: absolute;
  width: auto;
  height: auto;
  max-width: none;
}

.talking-overlay-cut-preview-item.selected {
  border-color: #75b9ff;
  box-shadow: 0 0 0 2px rgba(117, 185, 255, 0.35);
}

.talking-overlay-cut-preview-item img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.35));
}

.talking-overlay-cut-preview-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #75b9ff;
  background: #0b0e12;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  touch-action: none;
}

.talking-overlay-cut-preview-scale {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.talking-overlay-cut-preview-rotate {
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  cursor: grab;
}

.talking-overlay-cut-preview-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: #f3f6fa;
  font-size: 12px;
  text-align: center;
}

.clip.motion-effect.talking-overlay-planned {
  opacity: 0.72;
  border-style: dashed;
}

.talking-overlay-chat-anim-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #aeb9c6;
}

.talking-overlay-chat-anim-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  max-height: 240px;
  overflow: auto;
}

.talking-overlay-chat-anim-row {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 140px);
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.talking-overlay-chat-anim-row select {
  width: 100%;
}

.talking-overlay-preview-regen-menu {
  position: fixed;
  z-index: 10020;
  display: none;
  min-width: 180px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid #3b4654;
  background: rgba(11, 14, 18, 0.96);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.48);
}

.talking-overlay-preview-regen-menu.open {
  display: grid;
  gap: 6px;
}

.talking-overlay-preview-regen-menu strong {
  display: block;
  padding: 2px 4px 6px;
  font-size: 12px;
  color: #b8bec6;
}

.talking-overlay-preview-regen-menu button {
  justify-self: stretch;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: #1a212b;
  color: #e8edf3;
  text-align: left;
  font-size: 12px;
}

.talking-overlay-preview-regen-menu button.active,
.talking-overlay-preview-regen-menu button:hover {
  background: #31496d;
}

.talking-overlay-table-toolbar-row {
  justify-content: flex-end;
}

.talking-overlay-table-media {
  position: relative;
  min-width: 60px;
}

.talking-overlay-table-media .media-preview img,
.talking-overlay-table-media .media-preview video {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 4px;
  background: #111;
  display: block;
}

.talking-overlay-table-media .regen-icon {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px 0 4px 0;
  background: rgba(20, 24, 30, 0.92);
  color: #cfe7ff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

.talking-overlay-asset-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.talking-overlay-asset-slot {
  display: grid;
  gap: 4px;
  position: relative;
}

.talking-overlay-asset-slot span {
  font-size: 10px;
  color: #8a939e;
}

.talking-overlay-asset-slot img {
  width: 100%;
  max-height: 72px;
  object-fit: contain;
  background: #111;
  border-radius: 4px;
}

.talking-overlay-asset-slot .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  font-size: 10px;
  color: #666;
  border: 1px dashed #444;
  border-radius: 4px;
}

.talking-overlay-asset-context-menu {
  position: fixed;
  z-index: 12000;
  display: none;
  min-width: 180px;
  padding: 6px;
  border-radius: 8px;
  background: #23272b;
  border: 1px solid #343941;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.talking-overlay-asset-context-menu.open {
  display: grid;
  gap: 4px;
}

.talking-overlay-asset-context-menu button {
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #e8edf2;
  cursor: pointer;
  font-size: 12px;
}

.talking-overlay-asset-context-menu button:hover {
  background: #2c3036;
}

.talking-overlay-asset-grid.compact.chat-compact {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  max-width: min(100%, 380px);
  gap: 6px;
}

.talking-overlay-asset-preview.compact {
  margin-top: 8px;
  gap: 6px;
}

.talking-overlay-asset-preview.compact .talking-overlay-asset-item figcaption strong {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.talking-overlay-asset-grid.compact.chat-compact .talking-overlay-asset-slot img {
  max-height: 44px;
}

.talking-overlay-assets-chat-card.compact p {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.chat-action-card.talking-overlay-analysis-card.compact p {
  margin: 6px 0 0;
  font-size: 13px;
}

/* Unified neutral palette: settings / admin / table surfaces match main Cut workspace. */
.composer-settings-modal,
.composer-settings-head,
.composer-settings-body,
.composer-settings-tabs,
.composer-settings-group,
.composer-settings-actions,
.asset-eraser-modal,
.asset-eraser-head,
.asset-eraser-body,
.asset-eraser-tools,
.admin-modal,
.admin-head,
.admin-tabs,
.admin-body,
.admin-section,
.style-editor-panel,
.style-editor-head,
.style-editor-body,
.style-form-grid,
.style-admin-card,
.style-editor-actions,
.talking-overlay-table-pane,
.talking-overlay-table-toolbar,
.talking-overlay-action-step,
.talking-overlay-table-asset-chip,
.table-asset-picker-modal,
.table-asset-picker-shell,
.table-asset-picker-head,
.table-asset-picker-body,
.table-asset-picker-foot,
.shot-table-wrap,
.table-pane {
  background: #23272b !important;
  border-color: #343941 !important;
  color: #f2f4f6 !important;
}

.composer-settings-modal,
.asset-eraser-modal,
.table-asset-picker-modal,
.admin-modal {
  background: #23272b !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52) !important;
}

.composer-settings-group,
.video-model-slot,
.admin-video-slot,
.talking-overlay-action-step,
.talking-overlay-table-asset-chip,
.style-admin-card,
.style-form-grid input,
.style-form-grid select,
.style-form-grid textarea,
.asset-eraser-canvas-wrap,
.asset-eraser-tool-row button,
.table-asset-picker-foot button {
  background: #1d2024 !important;
  border-color: #343941 !important;
  color: #f2f4f6 !important;
}

.composer-settings-tabs button.active,
.pipeline-duration-btn.active,
.admin-tabs button.active,
.admin-tab-button.active,
.style-admin-card.active {
  background: #383d44 !important;
  border-color: #444a52 !important;
  color: #ffffff !important;
}

.composer-settings-actions button,
.composer-settings-actions button:hover,
.asset-eraser-tool-row button.primary,
.asset-eraser-tool-row button.primary:hover {
  background: #2c3036 !important;
  border-color: #3a4048 !important;
  color: #f2f4f6 !important;
}

.shot-table th {
  background: #242930 !important;
  border-color: #343941 !important;
  color: #f2f4f6 !important;
}

.shot-table td {
  background: #161a1e !important;
  border-color: #343941 !important;
  color: #dfe3e7 !important;
}

.talking-overlay-table-toolbar,
.table-pane {
  background: #17191c !important;
}

/* Admin style editor: neutral gray reference slots and compact upload tiles. */
.style-reference-panel,
.style-reference-grid,
.style-reference-slot,
.style-reference-slot.has-image,
.style-reference-item,
.style-reference-add-slot,
.style-preview-box,
.style-reference-column .upload-box,
.upload-box,
.upload-box.has-reference {
  background: #1d2024 !important;
  border-color: #343941 !important;
}

.style-reference-slot:not(.has-image),
.style-reference-add-slot,
.upload-box:not(.has-reference) {
  border-color: #444a52 !important;
  color: #b8bec6 !important;
}

.style-reference-column .upload-box {
  width: min(100%, 72px) !important;
  max-width: 72px !important;
  aspect-ratio: 16 / 9 !important;
  justify-self: start !important;
}

.style-reference-list {
  width: min(100%, 228px);
  max-width: 228px;
}

.asset-library-head-actions.hidden {
  display: none !important;
}

.side-tabs button:not(.active) {
  background: transparent !important;
  border-color: transparent !important;
  color: #9ba3ad !important;
  box-shadow: none !important;
}

.side-tabs button:not(.active):hover {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: transparent !important;
  color: #d7d9dc !important;
}

.asset-library-mode-tabs button:not(.active) {
  background: transparent !important;
  border-color: transparent !important;
  color: #9ba3ad !important;
  box-shadow: none !important;
}

.asset-library-mode-tabs button.active {
  background: #2c3036 !important;
  border-color: #444a52 !important;
  color: #f2f4f6 !important;
}

.asset-library-mode-tabs button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #d7d9dc !important;
}

.cloud-asset-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cloud-asset-add-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #444a52;
  border-radius: 7px;
  background: #2c3036;
  color: #e8eaed;
}

.cloud-asset-add-btn svg {
  width: 14px;
  height: 14px;
}

.cloud-asset-add-btn:hover {
  border-color: #686c73;
  background: #383d44;
}

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

.cloud-asset-empty {
  grid-column: 1 / -1;
}

.cloud-creative-thumb {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.cloud-creative-thumb:hover,
.cloud-creative-thumb:focus-visible {
  border-color: #444a52;
  background: #252a30;
}

.cloud-creative-thumb-media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 7px;
  background: #15181b;
}

.cloud-creative-thumb-media img,
.cloud-creative-thumb-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cloud-creative-fallback {
  color: #9ba3ad;
  font-size: 11px;
}

.cloud-creative-thumb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  line-height: 1.2;
  color: #d7d9dc;
}

.cloud-creative-thumb-badge {
  font-size: 9px;
  color: #9ba3ad;
}

.cloud-asset-detail-modal,
.creative-asset-modal {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid #444a52;
  border-radius: 14px;
  background: #1d2024;
  color: #f2f4f6;
}

.cloud-asset-detail-modal::backdrop,
.creative-asset-modal::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.cloud-asset-detail-head,
.creative-asset-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid #343941;
}

.cloud-asset-detail-head strong,
.creative-asset-modal-head strong {
  font-size: 15px;
}

.cloud-asset-detail-close,
.creative-asset-modal-close {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a7abb0;
  font-size: 20px;
}

.cloud-asset-detail-body,
.creative-asset-modal-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.cloud-asset-detail-preview,
.creative-asset-modal-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #343941;
  border-radius: 10px;
  background: #15181b;
}

.cloud-asset-detail-preview.is-audio {
  aspect-ratio: auto;
  min-height: 72px;
  padding: 10px;
}

.cloud-asset-detail-preview img,
.cloud-asset-detail-preview video,
.creative-asset-modal-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cloud-asset-detail-preview audio {
  width: 100%;
}

.cloud-asset-detail-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}

.cloud-asset-detail-meta div {
  display: grid;
  gap: 3px;
}

.cloud-asset-detail-meta dt {
  margin: 0;
  color: #9ba3ad;
  font-size: 11px;
}

.cloud-asset-detail-meta dd {
  margin: 0;
  color: #e8eaed;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.creative-asset-modal-fields {
  display: grid;
  gap: 10px;
}

.creative-asset-modal-fields label {
  display: grid;
  gap: 6px;
  color: #b8bec6;
  font-size: 12px;
}

.creative-asset-modal-fields input,
.creative-asset-modal-fields textarea {
  width: 100%;
  border: 1px solid #444a52;
  border-radius: 8px;
  padding: 8px 10px;
  background: #15181b;
  color: #f2f4f6;
  font-size: 12px;
}

.cloud-asset-detail-foot,
.creative-asset-modal-foot {
  display: grid;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid #343941;
}

.creative-asset-modal-foot-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.creative-asset-modal-foot-tools button,
.cloud-asset-detail-foot button,
.creative-asset-modal-foot-actions button {
  min-height: 34px;
  border: 1px solid #444a52;
  border-radius: 9px;
  background: #2c3036;
  color: #f2f4f6;
  font-size: 12px;
}

.creative-asset-modal-foot-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.creative-asset-modal-foot-actions .danger {
  margin-right: auto;
  border-color: #6a3a3a;
  background: #3a2424;
  color: #ffb4b4;
}

.cloud-asset-detail-foot {
  grid-template-columns: 1fr auto;
}

.cloud-asset-detail-foot button.primary,
.creative-asset-modal-foot-actions button.primary {
  border-color: #5a6068;
  background: #383d44;
  color: #ffffff;
}

/* Media generation params: unified rounded list boxes (match asset-library tabs). */
.composer .composer-media-controls select:not(.model-select-native):not(.model-billing-select):not(.hidden),
.composer .composer-media-controls input:not(.hidden):not([type="hidden"]),
.composer .composer-media-controls .composer-dynamic-param:not(.hidden),
.composer .composer-media-controls [data-media-kind]:not(.hidden),
.media-param-grid select,
.media-param-grid input,
.composer-settings-param-grid select,
.composer-settings-param-grid input,
.composer-settings-param-grid .composer-dynamic-param {
  height: 30px !important;
  min-height: 30px !important;
  border: 1px solid #444a52 !important;
  border-radius: 8px !important;
  background-color: #2c3036 !important;
  color: #f2f4f6 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  box-shadow: none !important;
}

.composer .composer-media-controls select:not(.model-select-native):not(.model-billing-select):not(.hidden),
.media-param-grid select,
.composer-settings-param-grid select {
  appearance: none !important;
  -webkit-appearance: none !important;
  padding: 0 28px 0 10px !important;
  background-color: #2c3036 !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #9ba3ad 50%),
    linear-gradient(135deg, #9ba3ad 50%, transparent 50%) !important;
  background-position: calc(100% - 14px) 50%, calc(100% - 10px) 50% !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
}

.composer .composer-media-controls select:focus,
.composer .composer-media-controls input:focus,
.media-param-grid select:focus,
.media-param-grid input:focus,
.composer-settings-param-grid select:focus,
.composer-settings-param-grid input:focus {
  border-color: #5a6068 !important;
  background-color: #383d44 !important;
  box-shadow: none !important;
  outline: none !important;
}

.composer .composer-media-controls .model-select-trigger {
  height: 30px !important;
  min-height: 30px !important;
  border: 1px solid #444a52 !important;
  border-radius: 8px !important;
  background: #2c3036 !important;
  color: #f2f4f6 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  box-shadow: none !important;
}

.media-kind-tabs button:not(.active) {
  background: transparent !important;
  border-color: transparent !important;
  color: #9ba3ad !important;
  box-shadow: none !important;
}

.media-kind-tabs button.active {
  background: #2c3036 !important;
  border-color: #444a52 !important;
  color: #f2f4f6 !important;
  box-shadow: none !important;
}

.media-kind-tabs button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #d7d9dc !important;
}

.asset-library-head .asset-library-mode-tabs button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
  font-size: 11px !important;
  line-height: 1 !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

.asset-library-mode-tabs button.active {
  background: #2c3036 !important;
  border-color: #444a52 !important;
  color: #f2f4f6 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04) !important;
}

.asset-library-mode-tabs button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: transparent !important;
  color: #d7d9dc !important;
}

.cloud-asset-section-divider {
  height: 1px;
  margin: 4px 0 2px;
  background: #343941;
}

.cloud-asset-create-tile .cloud-asset-create-media {
  border: 1px dashed #444a52;
  background: #1a1d21;
}

.cloud-asset-create-tile:hover .cloud-asset-create-media,
.cloud-asset-create-tile:focus-visible .cloud-asset-create-media {
  border-color: #686c73;
  background: #22262b;
}

.cloud-asset-create-plus {
  color: #b8bec6;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

.cloud-asset-create-tile:hover .cloud-asset-create-plus,
.cloud-asset-create-tile:focus-visible .cloud-asset-create-plus {
  color: #f2f4f6;
}

.cloud-creative-thumb-badge {
  display: none !important;
}

/* Asset library mode tabs: keep single-line labels and clear active/inactive states. */
.asset-library-head .asset-library-mode-tabs button:not(.active) {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: #9ba3ad !important;
  box-shadow: none !important;
}

.asset-library-head .asset-library-mode-tabs button.active {
  background: #2c3036 !important;
  border-color: #444a52 !important;
  color: #f2f4f6 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

.asset-library-head .asset-library-mode-tabs button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: transparent !important;
  color: #d7d9dc !important;
}

.asset-library-head .asset-library-mode-tabs button:active {
  transform: scale(0.98);
}

.cloud-asset-create-tile {
  border-color: transparent !important;
  background: transparent !important;
}

.cloud-asset-create-tile:hover,
.cloud-asset-create-tile:focus-visible {
  border-color: transparent !important;
  background: transparent !important;
}
