/* The AI panel fills the library from its tabs to the bottom of the editor. */
.ai-panel { --ai-banner-ratio: 2.3 / 1; overflow: hidden; padding: 2px 0 14px; container-type: size; container-name: seedance; }
.ai-model-grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: 12px; align-content: start; height: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #555c64 transparent; padding: 2px 2px 18px 0; }
.ai-model-browse { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #34383e; border-radius: 10px; background: #202327; color: #d7dce2; font-size: 12px; text-align: left; }
.ai-model-browse:hover { border-color: #7a835e; background: #292e33; }
.ai-model-browse > span:nth-child(2) { flex: 1; }
.ai-model-browse .icon { width: 16px; height: 16px; }
.video-model-dialog { position: fixed; inset: 64px auto auto 18px; margin: 0; padding: 8px; width: min(402px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 24px)); color: #eceef0; background: #222526; border: 1px solid #ffffff12; border-radius: 18px; box-shadow: 0 16px 48px #0006; overflow: hidden; font-family: var(--font); }
.video-model-dialog[open] { display: flex; flex-direction: column; }
.video-model-dialog::backdrop { background: transparent; backdrop-filter: none; }
.video-model-search { display: flex; align-items: center; gap: 10px; padding: 5px 4px 12px; border-bottom: 1px solid #ffffff08; flex-shrink: 0; }
.video-model-search > svg { width: 20px; height: 20px; fill: none; stroke: #929797; stroke-width: 1.5; stroke-linecap: round; flex-shrink: 0; }
.video-model-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: #edf0f4; font: 13px var(--font); }
.video-model-search input::placeholder { color: #929aa3; }
.video-model-search button { width: 25px; height: 25px; border-radius: 7px; background: transparent; color: #a2aab2; font-size: 19px; }
.video-model-search button:hover { background: #ffffff08; color: #fff; }
.video-model-section { display: flex; align-items: center; gap: 7px; padding: 10px 5px 5px; color: #979e9d; font-size: 11px; flex-shrink: 0; }
.video-model-section > span { font-size: 14px; }
.video-model-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-top: 5px; scrollbar-width: thin; scrollbar-color: #555c64 transparent; }
.video-model-option { width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 6px; border: 0; border-radius: 11px; background: transparent; color: #e7eaed; text-align: left; cursor: pointer; }
.video-model-option:hover { background: #ffffff08; }
.video-model-option[aria-selected='true'] { background: #ffffff0b; }
.video-model-option:focus-visible { outline: 1px solid var(--accent); outline-offset: -2px; background: #ffffff0b; }
.video-model-symbol { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; background: linear-gradient(#35393c, #2b2e31); border: 1px solid #ffffff04; border-radius: 9px; color: #a9afb5; font-size: 18px; }
.video-model-symbol svg, .video-model-check svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.video-model-option[aria-selected='true'] .video-model-symbol { color: var(--accent-text); }
.video-model-copy { flex: 1; min-width: 0; }
.video-model-copy strong { display: block; font-size: 13px; font-weight: 600; line-height: 1.35; }
.video-model-details { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.video-model-details small { padding: 2px 4px; border-radius: 3px; background: #ffffff09; color: #9da5ad; font-size: 9px; line-height: 1.15; }
.video-model-details .video-model-preset { color: var(--accent-text); background: color-mix(in srgb, var(--accent) 5.1%, transparent); }
.video-model-details .video-model-price { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.video-model-check { color: var(--accent-text); font-size: 17px; opacity: 0; }
.video-model-option[aria-selected='true'] .video-model-check { opacity: 1; }
.video-model-empty { margin: 20px; color: #9da5ad; font-size: 12px; }

/* Video settings share the model field's two-line presentation. */
.seedance-resolution.video-setting-control, .general-setting.video-setting-control { display: block; padding: 0; border: 0; background: transparent; }
.video-setting-control::after { display: none; }
.video-setting-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; height: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid #ffffff08; border-radius: 11px; background: #252728; color: #eceeef; text-align: left; }
.video-setting-trigger:hover:not(:disabled), .video-setting-trigger[aria-expanded='true'], .general-model:hover:not(:disabled), .general-model[aria-expanded='true'] { background: #303233; border-color: #ffffff0d; }
.video-setting-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.video-setting-copy small { color: #979b9b; font-size: 10px; line-height: 1.2; font-weight: 500; }
.video-setting-copy strong { color: #f0f1f2; font-size: 12px; line-height: 1.2; font-weight: 600; white-space: nowrap; }
.video-setting-chevron { flex-shrink: 0; display: flex; color: #979b9b; }
.video-setting-chevron svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.video-setting-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.video-setting-trigger:disabled { cursor: default; opacity: .5; }
.video-setting-menu { position: fixed; inset: auto; margin: 0; padding: 7px; width: 144px; max-height: min(480px, calc(100dvh - 24px)); overflow-y: auto; overscroll-behavior: contain; border: 1px solid #ffffff12; border-radius: 13px; background: #272829; color: #eceeef; box-shadow: 0 12px 36px #0005; font-family: var(--font); scrollbar-width: thin; scrollbar-color: #555b5d transparent; }
.video-setting-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 36px; padding: 8px 9px; border-radius: 8px; background: transparent; color: #eceeef; text-align: left; font: 600 13px/1.2 var(--font); }
.video-setting-option:hover, .video-setting-option[aria-selected='true'] { background: #ffffff09; }
.video-setting-option:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; background: #ffffff0d; }
.video-setting-check { display: flex; opacity: 0; color: var(--accent-text); }
.video-setting-check svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.video-setting-option[aria-selected='true'] .video-setting-check { opacity: 1; }
.ai-model-card { position: relative; isolation: isolate; overflow: hidden; border: 1px solid #3d464f; border-radius: 12px; background: #202328; min-width: 0; aspect-ratio: var(--ai-banner-ratio); }
.ai-model-card::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, #00000012 0%, transparent 35%, #00000030 55%, #000000b3 100%); pointer-events: none; }
.ai-model-card[role="button"] { cursor: pointer; transition: border-color .15s; }
.ai-model-card[role="button"]:hover { border-color: #7a7d67; }
.ai-model-card[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ai-model-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; pointer-events: none; }
.ai-model-card[data-ai-model="minimax-h3"] .ai-model-video, #seedance-general-workspace[data-model="minimax-h3"] .ai-model-video { object-position: center 20%; }
.ai-model-caption { position: absolute; left: 13px; right: 13px; bottom: 12px; z-index: 2; pointer-events: none; text-shadow: 0 1px 4px #0008; }
.ai-model-caption h2 { font-family: var(--font); font-size: 19px; font-weight: 700; line-height: 1.2; letter-spacing: -.4px; color: var(--accent-text); }
.ai-model-caption p { margin-top: 4px; font-size: 12px; line-height: 1.3; color: #e0e0e4; }
.ai-model-change { position: absolute; top: 8px; right: 8px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 28px; padding: 0 10px; border: 1px solid #ffffff24; border-radius: 9px; background: #282c32b3; backdrop-filter: blur(12px); color: #f4f5f7; font-size: 12px; font-weight: 600; box-shadow: 0 2px 8px #0002; }
.ai-model-change .icon { width: 13px; height: 13px; }
.ai-model-change:hover { background: #41474dd9; border-color: #ffffff40; }
.ai-model-change:focus-visible { outline-offset: 2px; }

/* Prices belong to the catalogue; the generation banner keeps its full preview. */
.ai-card-pricing, .ai-price-basis, .ai-price-context, .ai-price-discount, .ai-price-unavailable { display: none; }
#ai-catalog .has-price .ai-model-caption { bottom: 34px; }
#ai-catalog .ai-card-pricing { position: absolute; right: 12px; bottom: 11px; z-index: 2; display: block; padding: 0; border: 0; background: transparent; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 5px #000b; }
.ai-price-sale { display: flex; align-items: baseline; gap: 6px; color: var(--accent-text); font-size: 13px; font-weight: 700; line-height: 1.2; }
.ai-price-unit { margin-left: 3px; font-size: 10px; font-weight: 500; }
#ai-catalog .ai-price-basis { position: absolute; left: 13px; bottom: 12px; z-index: 2; display: block; color: #e1e6eb; font-size: 10px; font-weight: 500; line-height: 1.3; text-shadow: 0 1px 4px #000; }
#ai-catalog .ai-price-context { position: absolute; top: 12px; left: 13px; z-index: 2; display: block; color: #e1e6eb; font-size: 9px; font-weight: 500; line-height: 1.2; text-shadow: 0 1px 5px #000b; }
#ai-catalog .ai-price-discount:not([hidden]) { position: absolute; top: 8px; right: 0; z-index: 2; display: block; min-width: 64px; padding: 5px 11px 5px 15px; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%); background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 11px; font-weight: 800; line-height: 1.15; letter-spacing: .2px; }
#ai-catalog .ai-price-unavailable { position: absolute; right: 10px; top: 8px; z-index: 2; display: block; color: #c6cbd0; font-size: 10px; background: #121719d9; padding: 4px 6px; border-radius: 6px; }
@container seedance (max-width: 260px) {
  #ai-catalog .has-price .ai-model-caption { left: 10px; right: 8px; bottom: 27px; }
  #ai-catalog .has-price .ai-model-caption h2 { font-size: 16px; }
  #ai-catalog .has-price .ai-model-caption p { font-size: 11px; margin-top: 2px; }
  #ai-catalog .ai-card-pricing { right: 8px; bottom: 7px; }
  #ai-catalog .ai-price-sale { font-size: 12px; gap: 4px; }
  #ai-catalog .ai-price-basis { left: 10px; bottom: 9px; font-size: 9px; }
  #ai-catalog .ai-price-context { top: 9px; left: 10px; }
  #ai-catalog .ai-price-discount:not([hidden]) { top: 6px; padding: 4px 9px 4px 13px; font-size: 10px; }
}

/* Genjutsu's motion-transfer screen. */
.seedance-workspace {
  --seedance-accent: var(--accent);
  display: grid; height: 100%; min-height: 0; min-width: 0; gap: 10px;
  grid-template-rows: auto minmax(260px, 1.8fr) minmax(112px, .8fr) 46px;
  color: #dedee4;
}
.seedance-workspace > * { min-width: 0; min-height: 0; }
.seedance-preview { align-self: start; overflow: hidden; border-radius: 12px; aspect-ratio: var(--ai-banner-ratio); }

.seedance-prompt { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid #353c46; border-radius: 12px; background: #22262b; overflow: hidden; }
.seedance-prompt-label { font-size: 12px; font-weight: 550; color: #d2d6dd; line-height: 16px; flex-shrink: 0; }
.seedance-prompt textarea { flex: 1; min-height: 0; min-width: 0; resize: none; border: 0; outline: none; background: transparent; color: #e3e4ea; font: 13px/1.65 var(--font); padding: 0; width: 100%; }
.seedance-prompt textarea::placeholder { color: #969eaa; }
.seedance-prompt:focus-within { border-color: var(--accent-border); }
.seedance-prompt-actions { display: flex; gap: 6px; flex-shrink: 0; }
.seedance-prompt-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 6px; background: #16191d; color: #c9ced6; font-size: 10px; white-space: nowrap; }
.seedance-prompt-actions button:hover { background: #323940; color: #f1f1f4; }
.seedance-prompt-actions .icon { width: 12px; height: 12px; }
.seedance-prompt-actions [aria-pressed="false"] { color: #858c98; }
.seedance-generation-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; pointer-events: none; }
.seedance-generation-status[data-blocked="true"] { position: static; grid-column: 1 / -1; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; color: #b5bbc5; font-size: 11px; line-height: 1.5; }
.seedance-submit-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
.seedance-resolution { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 9px; border-radius: 11px; background: #242930; border: 1px solid #343d47; }
.seedance-resolution .icon { width: 14px; height: 14px; color: #a3acb9; }
.seedance-resolution select { appearance: none; min-width: 0; width: 100%; padding: 0; border: 0; background: transparent; font: 11px/18px var(--font); color: #e4e5eb; cursor: pointer; }
.seedance-resolution::after { content: ''; width: 5px; height: 5px; flex-shrink: 0; border-right: 1px solid #9397a2; border-bottom: 1px solid #9397a2; transform: translateY(-2px) rotate(45deg); }
.seedance-workspace select option { background: #24262b; color: #e4e5eb; }
.seedance-generate { display: flex; align-items: center; justify-content: center; min-width: 0; gap: 7px; padding: 0 12px; border: 1px solid color-mix(in srgb, var(--accent-text) 14.9%, transparent); border-radius: 11px; background: var(--seedance-accent); color: var(--accent-ink); font-size: 14px; font-weight: 700; }
#seedance-generation-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seedance-generate:disabled { background: #30343b; border-color: #ffffff0f; color: #a5abb4; opacity: 1; cursor: not-allowed; }
.seedance-generate .icon { width: 16px; height: 16px; stroke-width: 1.8; }
.seedance-generate > .icon:last-child, .seedance-generate [data-icon]:last-child { margin-left: auto; }
.seedance-generate [data-icon]:first-child { margin-left: auto; }

.general-references { position: relative; }
.reference-link-button { position: absolute; right: 10px; bottom: 10px; z-index: 2; padding: 5px 8px; border-radius: 6px; background: #171b20; color: #cbd3df; font-size: 10px; }
.reference-link-button:hover:not(:disabled) { background: #343d47; color: #fff; }
.reference-link-dialog { width: min(440px, calc(100vw - 32px)); padding: 24px; border: 1px solid #343d47; border-radius: 16px; background: #1b1f24; color: #e4e5eb; }
.reference-link-dialog::backdrop { background: #0009; backdrop-filter: blur(4px); }
.reference-link-dialog form { display: grid; gap: 18px; }
.reference-link-dialog h2 { margin: 0; font-size: 17px; }
.reference-link-dialog p { margin: 0; color: #a6afbc; font-size: 12px; line-height: 1.6; }
.reference-link-dialog label { display: grid; gap: 8px; font-size: 12px; }
.reference-link-dialog input, .reference-link-dialog select { width: 100%; min-width: 0; border: 1px solid #3b4551; border-radius: 8px; padding: 10px; background: #14171c; color: #e4e5eb; font: inherit; }
.reference-link-actions { display: flex; justify-content: end; gap: 10px; }
.reference-link-actions button { padding: 10px 16px; border-radius: 8px; background: #343b44; color: #e4e5eb; }
.reference-link-actions button[type="submit"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

/* Full-width rounded cards, one for the source video and one for replacement images. */
.seedance-motion-inputs { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seedance-motion-tile { --reference-thumb-size: 56px; position: relative; min-width: 0; min-height: 0; border: 1px solid #30363e; border-radius: 14px; background: #22262b; padding: 6px; }
.seedance-motion-picker { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; padding: 10px; border: 1px dashed #3d444c; border-radius: 10px; text-align: center; overflow: hidden; }
.seedance-motion-picker:hover:not(:disabled) { background: #ffffff04; border-color: #68717b; }
.seedance-motion-icons { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.seedance-motion-icons > [data-icon] { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #515a61; background: radial-gradient(circle at 40% 25%, #484f51, #292d31); color: #bec6ca; box-shadow: 0 1px 3px #0002; margin-left: -5px; }
.seedance-motion-icons > [data-icon]:first-child { margin-left: 0; }
.seedance-motion-icons .icon { width: 16px; height: 16px; }
.seedance-motion-picker strong { display: block; flex-shrink: 0; max-width: 100%; font-size: 13px; line-height: 1.35; font-weight: 600; color: #eceef1; white-space: pre-line; }
.seedance-motion-hint { display: block; flex-shrink: 0; max-width: 100%; font-size: 11px; line-height: 1.4; color: #969eab; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#seedance-motion-video-picker { position: relative; container-type: size; }
.seedance-motion-video-preview { position: absolute; left: 50%; top: 50%; width: min(82cqw, 138cqh); aspect-ratio: 16 / 9; transform: translate(-50%, -50%) rotate(-4deg); border: 1px solid #e8e8e8; border-radius: 12px; overflow: hidden; background: #151719; box-shadow: 0 5px 16px #0002; pointer-events: none; }
.seedance-motion-video-preview video { display: block; width: 100%; height: 100%; object-fit: cover; }
.seedance-motion-gallery { display: flex; flex-wrap: wrap; align-items: center; align-content: safe center; justify-content: center; gap: 8px; width: 100%; height: 100%; padding: 12px; overflow: auto; overscroll-behavior: contain; }
.seedance-motion-add, .seedance-motion-reference-image { flex: 0 0 var(--reference-thumb-size); width: var(--reference-thumb-size); height: var(--reference-thumb-size); border-radius: 11px; }
.seedance-motion-add { display: flex; align-items: center; justify-content: center; background: #292d32; color: #788088; }
.seedance-motion-add > [data-icon] { width: 16px; height: 16px; border-radius: 50%; background: #ffffff0b; }
.seedance-motion-add .icon { width: 11px; height: 11px; }
.seedance-motion-add:hover:not(:disabled) { background: #343a40; color: #dce2e7; }
.seedance-motion-reference-image { position: relative; background: #151719; }
.seedance-motion-reference-image img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.seedance-motion-image-remove { position: absolute; top: -5px; right: -5px; display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 1px solid #4d555e; border-radius: 50%; background: #191d22; color: #e9edf0; font-size: 14px; line-height: 1; opacity: 0; transition: opacity .15s; }
.seedance-motion-reference-image:hover .seedance-motion-image-remove, .seedance-motion-reference-image:focus-within .seedance-motion-image-remove { opacity: 1; }
.seedance-motion-clear { position: absolute; top: 7px; right: 7px; display: flex; align-items: center; justify-content: center; width: 23px; height: 23px; border-radius: 6px; padding: 0; color: #b4b6c0; background: #15171ce6; }
.seedance-motion-clear .icon { width: 13px; height: 13px; }
.seedance-motion-clear:hover { color: #fff; background: #353842; }
.seedance-motion-tile.has-file { border-color: transparent; }
.seedance-motion-tile.has-file .seedance-motion-picker { padding: 0; border-color: transparent; }
.seedance-motion-tile.has-file .seedance-motion-picker > .seedance-motion-icons, .seedance-motion-tile.has-file .seedance-motion-picker > strong, .seedance-motion-tile.has-file .seedance-motion-picker > .seedance-motion-hint { display: none; }
.seedance-motion-tile.has-file .seedance-motion-clear { opacity: 0; transition: opacity .15s; }
.seedance-motion-tile.has-file:hover .seedance-motion-clear, .seedance-motion-tile.has-file:focus-within .seedance-motion-clear { opacity: 1; }
.seedance-motion-picker[aria-busy="true"] .seedance-motion-video-preview { opacity: .6; }
.seedance-motion-tile.is-dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5.1%, transparent); }
.seedance-motion-tile.is-dragging .seedance-motion-picker { border-color: var(--accent); }

@container seedance (max-height: 700px) {
  .seedance-workspace { grid-template-rows: auto minmax(220px, 1.8fr) minmax(96px, .8fr) 42px; gap: 8px; }
  .seedance-prompt { padding: 10px; gap: 6px; }
  .seedance-prompt textarea { font-size: 12px; line-height: 1.5; }
  .seedance-prompt-actions button { height: 24px; }
  .seedance-motion-picker { gap: 5px; padding: 6px; }
  .seedance-motion-icons > [data-icon] { width: 26px; height: 26px; }
  .seedance-motion-picker strong { font-size: 12px; }
  .seedance-motion-hint { font-size: 10px; }
}
@container seedance (max-height: 600px) {
  .seedance-workspace { grid-template-rows: auto minmax(174px, 1.8fr) minmax(98px, .8fr) 40px; gap: 8px; }
  .seedance-motion-inputs { gap: 8px; }
  .seedance-motion-tile { --reference-thumb-size: 44px; padding: 4px; }
  .seedance-motion-gallery { padding: 7px; }
  .seedance-motion-picker { gap: 3px; padding: 3px; }
  .seedance-motion-icons > [data-icon] { width: 22px; height: 22px; }
  .seedance-motion-icons .icon { width: 13px; height: 13px; }
  .seedance-motion-picker strong { font-size: 11px; line-height: 1.3; }
  .seedance-motion-hint { font-size: 9px; line-height: 1.3; }
  .seedance-prompt { padding: 8px 10px; gap: 5px; }
  .seedance-prompt-actions button { height: 22px; }
  .seedance-generate { font-size: 13px; }
}
@media (hover: none) {
  .seedance-motion-tile.has-file .seedance-motion-clear, .seedance-motion-image-remove { opacity: 1; }
}
@container seedance (max-width: 240px) {
  .ai-model-caption { bottom: 10px; }
  .seedance-submit-row { grid-template-columns: 84px minmax(0, 1fr); gap: 6px; }
  .seedance-resolution { padding: 0 7px; gap: 4px; }
  .seedance-resolution .icon { width: 12px; height: 12px; }
  .seedance-resolution select { font-size: 10px; }
  .seedance-generate { padding: 0 8px; gap: 5px; font-size: 13px; }
  .seedance-generate .icon { width: 14px; height: 14px; }
  .seedance-motion-picker strong { font-size: 11px; }
  .seedance-motion-hint { font-size: 10px; }
}

/* Seedance 2.5: creative references and video extension. */
.seedance-general-workspace {
  grid-template-columns: minmax(0, 1fr); gap: 8px;
  grid-template-areas: 'preview' 'source' 'references' 'prompt' 'model' 'settings' 'bitrate' 'generate';
  grid-template-rows: auto 42px minmax(100px, .8fr) minmax(132px, 1fr) 48px 40px 40px 46px;
}
.general-preview { grid-area: preview; }
.general-source-tabs { grid-area: source; display: flex; padding: 5px; gap: 4px; border-radius: 11px; background: #24272b; }
.general-source-tabs button { flex: 1; min-width: 0; border-radius: 8px; color: #94999f; font-size: 12px; font-weight: 600; }
.general-source-tabs [aria-selected='true'] { background: #383d43; color: #f4f5f6; }
.general-references { grid-area: references; --reference-thumb-size: 56px; min-height: 0; overflow: hidden; border: 1px dashed #363e46; border-radius: 13px; background: #202428; }
.general-references.has-file { border-style: solid; border-color: transparent; }
.general-reference-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 100%; padding: 10px; }
.general-reference-empty:hover { background: #ffffff04; }
.general-reference-copy { min-width: 0; text-align: center; }
.general-reference-copy strong, .general-reference-copy > span { display: block; }
.general-reference-copy strong { color: #b8bdc4; font-size: 12px; font-weight: 500; line-height: 1.35; }
.general-reference-copy > span { color: #929aa4; font-size: 11px; line-height: 1.35; margin-top: 2px; }
.general-references.is-dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 3.5%, transparent); }
.general-reference-thumbnail video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.general-reference-thumbnail.is-audio { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #32383e; color: #bbc4cb; }
.general-reference-thumbnail.is-audio .icon { width: 22px; height: 22px; }
.general-reference-thumbnail.is-audio > span { font-size: 8px; }
.general-prompt { grid-area: prompt; }
.general-model { grid-area: model; display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 7px 12px; background: #24272b; border: 1px solid #323940; border-radius: 9px; text-align: left; }
.general-model small { display: block; color: #929aa4; font-size: 10px; margin-bottom: 2px; }
.general-model strong { display: flex; align-items: center; gap: 5px; color: #eef0f3; font-size: 13px; font-weight: 600; white-space: nowrap; }
.general-model strong .icon { color: var(--accent-text); width: 14px; height: 14px; }
.general-model > [data-icon] { color: #929aa4; transform: rotate(-90deg); }
.general-model > [data-icon] .icon { width: 13px; height: 13px; }
.general-settings { grid-area: settings; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.general-setting { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 0 8px; background: #24272b; border: 1px solid #323940; border-radius: 8px; }
.general-setting .icon { width: 14px; height: 14px; color: #b7bdc6; }
.general-setting select { width: 100%; min-width: 0; appearance: none; padding: 0; background: transparent; border: 0; color: #e4e7eb; font: 11px/18px var(--font); cursor: pointer; }
.general-setting::after { content: ''; flex-shrink: 0; width: 4px; height: 4px; border-right: 1px solid #929aa4; border-bottom: 1px solid #929aa4; transform: translateY(-2px) rotate(45deg); }
.general-bitrate { grid-area: bitrate; display: flex; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; padding: 0 12px; border-radius: 8px; background: #24272b; color: #d9dee5; font-size: 12px; }
.general-bitrate > span:first-child { display: flex; align-items: center; gap: 7px; }
.general-bitrate .icon { width: 16px; height: 16px; }
.general-bitrate-value { border-radius: 5px; background: color-mix(in srgb, var(--accent) 3.5%, transparent); padding: 3px 6px; color: var(--accent-text); font-size: 11px; }
.general-bitrate-short { display: none; }
.general-generate { grid-area: generate; }
@container seedance (max-height: 700px) {
  .seedance-general-workspace { gap: 7px; grid-template-rows: auto 36px minmax(76px, .8fr) minmax(100px, 1fr) 40px 34px 34px 42px; }
  .video-setting-trigger { min-height: 0; padding: 3px 6px; border-radius: 8px; }
  .video-setting-copy small { font-size: 8px; }
  .video-setting-copy strong { font-size: 10px; }
  .general-source-tabs { padding: 4px; }
  .general-reference-empty { gap: 5px; padding: 7px; }
  .general-model { padding: 5px 10px; }
  .general-model strong { font-size: 12px; }
}
@container seedance (max-height: 600px) {
  .seedance-general-workspace {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 4px;
    grid-template-areas: 'preview preview' 'source source' 'references references' 'prompt prompt' 'model bitrate' 'settings settings' 'generate generate';
    grid-template-rows: auto 24px minmax(44px, .8fr) minmax(64px, 1fr) 30px 28px 32px;
  }
  .general-source-tabs { padding: 2px; border-radius: 8px; }
  .general-source-tabs button { font-size: 10px; border-radius: 6px; }
  .general-reference-empty { flex-direction: row; gap: 8px; padding: 5px; }
  .general-reference-copy { text-align: left; }
  .general-reference-copy strong { font-size: 10px; }
  .general-reference-copy > span { font-size: 9px; }
  .general-references { --reference-thumb-size: 30px; border-radius: 9px; }
  .general-references .seedance-motion-icons > [data-icon] { width: 20px; height: 20px; }
  .general-references .seedance-motion-icons .icon { width: 11px; height: 11px; }
  .general-reference-gallery { padding: 6px; gap: 6px; }
  .general-reference-thumbnail.is-audio { gap: 1px; }
  .general-reference-thumbnail.is-audio .icon { width: 14px; height: 14px; }
  .general-reference-thumbnail.is-audio > span { font-size: 7px; }
  .general-prompt { padding: 6px 8px; gap: 3px; border-radius: 9px; }
  .general-prompt .seedance-prompt-label { font-size: 10px; line-height: 12px; }
  .general-prompt textarea { font-size: 11px; line-height: 1.3; }
  .general-prompt .seedance-prompt-actions button { height: 18px; font-size: 8px; padding: 0 5px; }
  .general-model { padding: 0 6px; border-radius: 7px; }
  .general-model small { display: none; }
  .general-model strong { font-size: 10px; gap: 3px; }
  .general-model strong .icon { width: 10px; height: 10px; }
  .general-model > [data-icon] .icon { width: 9px; height: 9px; }
  .general-settings { gap: 4px; }
  .video-setting-trigger { padding: 2px 5px; }
  .video-setting-copy { gap: 1px; }
  .video-setting-copy strong { font-size: 9px; }
  .general-setting { padding: 0 6px; gap: 4px; }
  .general-setting .icon { width: 11px; height: 11px; }
  .general-setting select { font-size: 10px; }
  .general-bitrate { padding: 0 6px; font-size: 9px; border-radius: 7px; }
  .general-bitrate > span:first-child { gap: 4px; }
  .general-bitrate .icon { width: 12px; height: 12px; }
  .general-bitrate-value { font-size: 8px; padding: 2px 4px; }
  .general-bitrate-full { display: none; }
  .general-bitrate-short { display: inline; }
}
