
/* ============ Server Feature UI: Assets, Mask, Multi-Angle ============ */
.asset-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  width: 100%;
}

.asset-form,
.asset-library,
.asset-picker {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.asset-form {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
}

.asset-upload-drop {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 128px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(3, 4, 8, 0.72);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.asset-upload-drop:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.07);
}

.asset-upload-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.asset-upload-preview {
  display: grid;
  place-items: center;
  width: 104px;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(3, 4, 8, 0.86);
  color: var(--soft);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
}

.asset-upload-preview img,
.asset-card > img,
.asset-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.asset-upload-copy strong,
.asset-library-head h2,
.asset-picker-head strong {
  margin: 0;
  color: var(--ink);
}

.asset-upload-copy small,
.asset-lora,
.asset-card p,
.asset-picker-empty,
.asset-picker-meta {
  color: var(--muted);
  font-size: 12px;
}

.asset-library {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  overflow: hidden;
}

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

.asset-library-head {
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px;
  overflow-y: auto;
}

.asset-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(8, 10, 16, 0.82);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.asset-card:hover,
.asset-card.selected {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.58);
  background: rgba(15, 18, 29, 0.94);
}

.asset-card.selected {
  box-shadow: inset 0 0 0 1px rgba(0, 240, 255, 0.35), 0 0 24px rgba(0, 240, 255, 0.12);
}

.asset-card > img {
  display: block;
  aspect-ratio: 4 / 3;
  background: #030408;
}

.asset-card-body {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.asset-trigger {
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-lora {
  overflow: hidden;
  font-family: var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-card p {
  display: -webkit-box;
  min-height: 36px;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.asset-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.asset-picker {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.asset-picker-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.asset-chip {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(3, 4, 8, 0.68);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.asset-chip:hover,
.asset-chip.selected {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
}

.asset-chip img {
  display: block;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: #030408;
}

.asset-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-picker-meta {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(3, 4, 8, 0.68);
}

.seedance-panel {
  display: grid;
  gap: 22px;
  grid-column: 1 / -1;
  padding: 0;
  color: #111827;
}

.image-inputs.seedance-provider-active > .file-slot {
  display: none;
}

.seedance-modelbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #e7e9f3;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px) saturate(125%);
}

.seedance-brand,
.seedance-provider-select {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.seedance-brand {
  flex: 1 1 auto;
}

.generation-selector {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  gap: 8px;
  padding: 4px 9px;
  border: 1px solid #e2e7f2;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.82);
}

.generation-selector > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.generation-selector:focus-within {
  border-color: #67e8f9;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.generation-model-selector {
  flex: 1 1 320px;
}

.seedance-logo-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 900;
}

.seedance-brand select,
.seedance-provider-select select {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #111827;
  font-weight: 800;
}

#generationCapabilitySelect {
  flex: 1 1 220px;
  max-width: 220px;
  color: #111827;
}

#seedanceModel {
  flex: 1 1 280px;
  max-width: 360px;
  color: #334155;
}

.seedance-provider-select span {
  color: #6b7280;
  font-size: 12px;
}

.seedance-param-toggle {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #e3e6f4;
  border-radius: 8px;
  background: #fff;
  color: #374151;
}

.seedance-param-toggle.active,
.seedance-param-toggle:hover {
  border-color: #a5b4fc;
  color: #4f46e5;
}

.seedance-stage {
  display: grid;
  justify-items: center;
  width: 100%;
  min-width: 0;
  gap: 24px;
  padding: 44px 18px 26px;
  border: 1px solid #e8ebf7;
  border-radius: 8px;
  background: rgba(248, 250, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 18px 52px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(20px) saturate(120%);
}

.seedance-stage h2 {
  margin: 0;
  color: #111827;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 900;
  letter-spacing: 0;
}

.seedance-composer {
  width: min(880px, 100%);
  overflow: hidden;
  border: 1px solid #dbe1f1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px) saturate(120%);
}

.generation-contract-guide {
  display: flex;
  align-items: stretch;
  width: min(880px, 100%);
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 1px 5px;
  scrollbar-width: thin;
}

.generation-contract-summary,
.generation-contract-role {
  display: grid;
  flex: 0 0 auto;
  align-content: center;
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.generation-contract-summary {
  min-width: 190px;
}

.generation-contract-summary strong,
.generation-contract-role code {
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.generation-contract-summary span,
.generation-contract-role span {
  color: #64748b;
  font-size: 10px;
  line-height: 1.45;
}

.generation-contract-role code {
  color: #4f46e5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.seedance-composer-body {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  min-height: 132px;
  padding: 16px;
}

.seedance-upload-tile {
  display: grid;
  place-items: center;
  align-self: start;
  width: 104px;
  height: 58px;
  border: 1px dashed #d8def2;
  border-radius: 8px;
  background: #f7f9ff;
  color: #3b82f6;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.seedance-upload-tile input[type="file"] {
  display: none;
}

.seedance-upload-plus {
  color: #9ca3af;
  font-size: 18px;
  line-height: 1;
}

#generationNegativePrompt {
  resize: none;
  overflow-y: hidden;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 15px;
  line-height: 1.7;
  outline: none;
}

#generationNegativePrompt {
  grid-column: 2;
  min-height: 54px;
  padding-top: 8px;
  border-top: 1px solid #eef2f7;
}

#generationNegativePrompt[hidden] {
  display: none;
}

#seedancePrompt::placeholder,
#generationNegativePrompt::placeholder {
  color: #9aa3b8;
}

.seedance-prompt-shell {
  position: relative;
  grid-column: 2;
  min-width: 0;
  min-height: 96px;
  height: auto;
  align-self: stretch;
}

.seedance-prompt-shell > .seedance-prompt-source {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  resize: none;
}

.seedance-prompt-editor {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 96px;
  height: auto;
  padding: 0;
  overflow: visible;
  color: #111827;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  outline: none;
  cursor: text;
}

.seedance-prompt-editor:empty::before {
  color: #9aa3b8;
  content: attr(data-placeholder);
  pointer-events: none;
}

.seedance-prompt-editor.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.seedance-prompt-mention {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 28px;
  margin: 0 2px;
  padding: 2px 7px 2px 3px;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  background: #eef2ff;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.08);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  vertical-align: middle;
  cursor: default;
}

.seedance-prompt-mention:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
  outline: none;
}

.seedance-prompt-mention-thumb {
  display: grid;
  flex: 0 0 22px;
  place-items: center;
  width: 22px;
  height: 22px;
  overflow: hidden;
  border-radius: 5px;
  background: #dbe3f0;
  color: #64748b;
}

.seedance-prompt-mention-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seedance-prompt-mention-thumb svg,
.seedance-prompt-mention-preview-media svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.seedance-prompt-mention-label {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seedance-prompt-mention-preview {
  position: absolute;
  z-index: 10020;
  bottom: calc(100% + 12px);
  left: 50%;
  display: none;
  width: 242px;
  padding: 8px;
  border: 1px solid #d7ddea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 7px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  pointer-events: none;
}

.seedance-prompt-mention-preview::after {
  position: absolute;
  bottom: -7px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-right: 1px solid #d7ddea;
  border-bottom: 1px solid #d7ddea;
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.seedance-prompt-mention.type-image .seedance-prompt-mention-preview {
  display: block;
}

.seedance-prompt-mention.type-image:hover .seedance-prompt-mention-preview,
.seedance-prompt-mention.type-image:focus .seedance-prompt-mention-preview {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.seedance-prompt-mention-preview-media {
  display: grid;
  place-items: center;
  width: 224px;
  height: 204px;
  overflow: hidden;
  border-radius: 3px;
  background: #dbe3ec;
  color: #64748b;
}

.seedance-prompt-mention-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.seedance-prompt-mention-preview strong {
  display: none;
}

.seedance-mention-menu {
  position: fixed;
  z-index: 10030;
  max-height: 292px;
  overflow: auto;
  padding: 7px;
  border: 1px solid #dce2ee;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.2);
  color: #111827;
  backdrop-filter: blur(18px) saturate(125%);
}

.seedance-mention-menu[hidden] {
  display: none;
}

.seedance-mention-menu-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 7px 7px;
  border-bottom: 1px solid #eef1f6;
}

.seedance-mention-menu-heading strong {
  font-size: 12px;
}

.seedance-mention-menu-heading span {
  color: #94a3b8;
  font-size: 10px;
}

.seedance-mention-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  gap: 9px;
  min-height: 48px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #111827;
  text-align: left;
  cursor: pointer;
}

.seedance-mention-option:hover,
.seedance-mention-option.active {
  background: #f0f2f7;
}

.seedance-mention-option-thumb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 6px;
  background: #dbe3ec;
  color: #64748b;
}

.seedance-mention-option-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.seedance-mention-option-thumb svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.seedance-mention-option > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.seedance-mention-option strong,
.seedance-mention-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seedance-mention-option strong {
  color: #111827;
  font-size: 12px;
}

.seedance-mention-option small {
  color: #64748b;
  font-size: 10px;
}

@media (max-width: 860px) {
  .seedance-prompt-shell {
    grid-column: 1;
  }

  .seedance-prompt-mention-preview {
    width: min(242px, calc(100vw - 28px));
  }

  .seedance-prompt-mention-preview-media {
    width: 100%;
  }
}

.seedance-control-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 14px;
  border-top: 1px solid #f1f3fa;
}

.seedance-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #dce2f3;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font-size: 13px;
}

.seedance-chip span:first-child {
  color: #6b7280;
}

.seedance-chip select,
.seedance-chip input {
  border: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  outline: none;
}

.generation-parameter input[type="number"],
.generation-parameter input[type="text"] {
  width: 104px;
  min-width: 72px;
}

.generation-parameter-wide {
  flex: 1 1 300px;
}

.generation-parameter-wide input[type="text"] {
  width: min(420px, 100%);
  flex: 1 1 220px;
}

.generation-parameter small {
  color: #94a3b8;
  font-size: 11px;
}

.seedream-size-picker {
  position: relative;
  flex: 0 0 auto;
}

.seedream-size-trigger {
  cursor: pointer;
}

.seedream-size-trigger strong {
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.seedream-size-chevron {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
  transition: transform 160ms ease;
}

.seedream-size-trigger[aria-expanded="true"] .seedream-size-chevron {
  transform: rotate(180deg);
}

.seedream-size-popover {
  position: absolute;
  z-index: 80;
  top: calc(100% + 10px);
  left: 0;
  width: min(520px, calc(100vw - 64px));
  padding: 14px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.seedream-size-popover[hidden] {
  display: none;
}

.seedream-size-popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #0f172a;
}

.seedream-size-popover-heading button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #dbe2ef;
  border-radius: 7px;
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
  cursor: pointer;
}

.seedream-size-popover section {
  display: grid;
  gap: 8px;
  padding: 11px 0;
  border-top: 1px solid #edf1f7;
}

.seedream-size-popover section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.seedream-size-label {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.seedream-size-popover small {
  color: #7c879a;
  font-size: 11px;
  line-height: 1.5;
}

.seedream-quality-options,
.seedream-ratio-options {
  display: grid;
  gap: 6px;
}

.seedream-quality-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.seedream-ratio-options {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.seedream-size-option,
.seedream-ratio-option {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f2f5fb;
  color: #4b5563;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.seedream-size-option:hover,
.seedream-ratio-option:hover {
  border-color: #c7d2fe;
  color: #312e81;
}

.seedream-size-option.active,
.seedream-ratio-option.active {
  border-color: #a5b4fc;
  background: #fff;
  color: #111827;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
  font-weight: 800;
}

.seedream-custom-size {
  border-radius: 7px;
}

.seedream-custom-size.active {
  margin: 0 -8px -4px;
  padding: 11px 8px 4px;
  border-color: transparent;
  background: rgba(238, 242, 255, 0.72);
}

.seedream-dimension-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.seedream-dimension-fields label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #dbe2ef;
  border-radius: 7px;
  background: #fff;
}

.seedream-dimension-fields label:focus-within {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.seedream-dimension-fields span,
.seedream-dimension-fields b {
  color: #64748b;
  font-size: 12px;
}

.seedream-dimension-fields input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #111827;
  font: inherit;
}

.seedance-composer {
  overflow: visible;
}

.seedance-audio-chip {
  border-color: #9aa8ff;
  color: #4f46e5;
}

.seedance-upload-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  padding: 0 0 2px;
}

.generation-reference-issue {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

.generation-reference-issue[hidden] {
  display: none;
}

.generation-reference-issue button {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #f59e0b;
  border-radius: 7px;
  background: #fff;
  color: #92400e;
  font-weight: 750;
  cursor: pointer;
}

.seedance-prompt-editor.has-reference-issue {
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.28);
}

.seedance-upload-empty {
  color: #8b95a8;
  font-size: 12px;
}

.seedance-upload-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #dbe1f1;
  border-radius: 7px;
  background: #f8faff;
  color: #334155;
  font-size: 12px;
}

.seedance-upload-item strong {
  color: #4f46e5;
}

.generation-media-role-static {
  padding: 4px 7px;
  border: 1px solid #dbe1f1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
}

.seedance-upload-item span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seedance-upload-item button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #eef2ff;
  color: #475569;
  cursor: pointer;
}

.seedance-upload-item button:hover {
  background: #e0e7ff;
  color: #1e293b;
}

.seedance-upload-item.role-missing {
  border-color: #f59e0b;
  background: #fffbeb;
}

.generation-media-role,
.generation-media-target {
  max-width: 190px;
  min-height: 26px;
  border: 1px solid #dbe1f1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 12px;
}

.seedance-static-chip {
  color: #64748b;
}

.seedance-submit {
  display: grid;
  place-items: center;
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: #a7a5ff;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.seedance-submit:hover:not(:disabled) {
  background: #7c7cff;
}

.seedance-submit:disabled {
  background: #cbd5e1;
  color: #f8fafc;
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.seedance-param-panel,
.seedance-limit-board,
.seedance-asset-box {
  width: min(880px, 100%);
  justify-self: center;
}

.seedance-param-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e2e7f5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.seedance-param-panel[hidden] {
  display: none;
}

.seedance-param-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.seedance-param-head strong {
  display: block;
  color: #111827;
  font-size: 15px;
}

.seedance-param-head span,
.seedance-field-help {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.6;
}

.seedance-param-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #edf1f8;
}

.seedance-param-section h3 {
  margin: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

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

.seedance-url-grid-wide .span-2 {
  grid-column: span 2;
}

.seedance-url-grid .form-group label,
.seedance-url-grid .form-group span,
.seedance-url-grid label span {
  color: #374151;
}

.seedance-panel .seedance-url-grid input[type="text"],
.seedance-panel .seedance-url-grid input[type="number"],
.seedance-panel .seedance-url-grid select,
.seedance-panel .seedance-url-grid textarea {
  width: 100%;
  border-color: #dce2f3;
  background: #fff;
  color: #111827;
}

.seedance-panel .seedance-url-grid textarea {
  min-height: 64px;
  resize: vertical;
  line-height: 1.5;
}

.seedance-panel .seedance-url-grid input::placeholder,
.seedance-panel .seedance-url-grid textarea::placeholder {
  color: #8b95a8;
}

.seedance-check-field {
  align-content: start;
}

.seedance-check-field input {
  width: 18px;
  height: 18px;
  margin-top: 10px;
}

.seedance-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #4b5563;
  font-size: 13px;
}

.seedance-switches label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.seedance-asset-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e2e7f5;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
}

.seedance-limit-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.seedance-limit-board div {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 12px;
  border: 1px solid #e2e7f5;
  border-radius: 10px;
  background: #fff;
}

.seedance-limit-board strong {
  color: #111827;
  font-size: 13px;
}

.seedance-limit-board span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.seedance-limit-board a {
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
}

.generation-title-copy {
  display: grid;
  justify-items: center;
  gap: 5px;
  max-width: calc(100% - 190px);
  text-align: center;
}

.mask-editor,
.multi-angle-editor {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.mask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mask-header h3 {
  margin: 0;
  font-size: 15px;
}

.mask-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mask-controls label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.mask-controls button,
.mask-toggle,
.angle-preset-btn {
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.mask-controls button:hover,
.mask-toggle:hover,
.angle-preset-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.mask-canvas-container {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #030408;
}

.mask-canvas-container img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
}

.mask-body {
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.28s ease;
}

.mask-body.collapsed {
  max-height: 0 !important;
  opacity: 0;
}

.mask-hint {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 12px;
}

.angle-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.angle-sliders {
  display: grid;
  gap: 10px;
}

.angle-sliders label {
  display: grid;
  grid-template-columns: 64px 42px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.angle-sliders label span {
  color: var(--ink);
  font-family: var(--font-mono);
  text-align: right;
}

.angle-preview {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.angle-preview svg {
  width: 132px;
  height: 132px;
}

@media (max-width: 860px) {
  .asset-workbench {
    grid-template-columns: 1fr;
  }

  .asset-library {
    min-height: 0;
  }

  .asset-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    overflow: visible;
  }

  .asset-upload-drop {
    grid-template-columns: 82px minmax(0, 1fr);
    min-height: 102px;
  }

  .asset-upload-preview {
    width: 82px;
  }

  .asset-picker-rail {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  }

  .mask-editor,
  .multi-angle-editor {
    padding: 12px;
  }

  .mask-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mask-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mask-controls label {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .mask-canvas-container {
    max-width: 100%;
    overflow: auto;
  }

  .mask-canvas-container img,
  #maskSourceImage {
    max-height: 44svh !important;
  }

  #maskCanvas {
    touch-action: none;
  }

  .angle-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .angle-preset-btn {
    width: 100%;
  }
}
