/* Shared media controls; no business capability is inferred by this layer. */
.reference-ui-shell .reference-composer-slot { padding-top: 56px !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio="true"]) #generationForm { padding-top: 98px !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface]:not([data-inline-audio="true"]) .seg { top: 58px !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #assetField { position: absolute !important; top: -48px !important; left: 14px !important; right: 14px !important; height: 98px !important; min-height: 98px !important; max-height: 98px !important; width: auto !important; margin: 0 !important; }
.reference-ui-shell #workspace #creationComposer #generationForm #assetGrid { display: flex !important; flex-wrap: nowrap !important; height: 98px !important; min-height: 98px !important; max-height: 98px !important; gap: 10px !important; padding: 1px !important; overflow-x: auto !important; overflow-y: hidden !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.reference-ui-shell #workspace #creationComposer #assetGrid > .asset-tile:not(.asset-add) { flex: 0 0 158px !important; width: 158px !important; min-width: 158px !important; height: 96px !important; min-height: 96px !important; max-height: 96px !important; border-radius: 14px !important; }
.reference-ui-shell #workspace #creationComposer #assetGrid > .asset-tile:not(.asset-add) .asset-media { aspect-ratio: auto !important; inset: 2px !important; width: calc(100% - 4px) !important; height: calc(100% - 4px) !important; }
.reference-ui-shell #workspace #creationComposer #assetGrid > .asset-tile:not(.asset-add) .asset-media :is(img,video) { width: 100% !important; height: 100% !important; object-fit: contain !important; }
.reference-ui-shell #workspace #creationComposer #generationForm #assetGrid > .asset-add { display: grid !important; grid-template-columns: 96px 96px !important; flex: 0 0 202px !important; width: 202px !important; min-width: 202px !important; height: 96px !important; min-height: 96px !important; margin: 0 !important; gap: 10px !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; }
.reference-ui-shell #workspace #creationComposer #assetGrid > .asset-add .asset-add-actions { display: contents !important; }
.reference-ui-shell #workspace #creationComposer #assetGrid > .asset-add :is(.asset-add-primary,.asset-add-option) { position: static !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 5px !important; width: 96px !important; min-width: 96px !important; height: 96px !important; min-height: 96px !important; padding: 6px !important; border: 1px dashed var(--ref-border-2) !important; border-radius: 14px !important; background: var(--ref-bg-2) !important; color: var(--ref-sub) !important; font-size: 12px !important; }
.reference-ui-shell #workspace #creationComposer #assetGrid > .asset-tile .remove { width: 22px !important; height: 22px !important; }
.reference-ui-shell #workspace #creationComposer #generationForm #assetField .asset-floating-meta { position: absolute !important; inset: 106px auto auto 0 !important; width: auto !important; margin: 0 !important; pointer-events: none !important; }
.reference-ui-shell #workspace #creationComposer #generationForm #assetField #assetCountLabel { position: static !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; color: var(--ref-sub) !important; font-size: 11px !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface] {
  height: auto !important; min-height: 0 !important; overflow: visible !important;
}
.reference-ui-shell #workspace #creationComposer[data-reference-surface] .compose-scroll,
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm {
  position: relative !important; height: auto !important; min-height: 0 !important;
  max-height: none !important; overflow: visible !important;
}
.reference-ui-shell #workspace #creationComposer[data-reference-surface]:has(#generationForm) #generationForm { padding: 98px 14px 14px !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #promptEditorField {
  position: relative !important; inset: auto !important; height: auto !important;
  min-height: 0 !important; width: 100% !important; margin: 0 !important;
}
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #prompt {
  height: 90px; min-height: 78px !important; max-height: 35vh !important; width: 100% !important;
}
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls {
  position: relative !important; inset: auto !important; display: flex !important;
  flex-wrap: wrap !important; align-items: center !important; gap: 7px !important;
  width: 100% !important; height: auto !important; margin: 12px 0 0 !important; padding: 0 !important;
  min-height: 0 !important; overflow: visible !important;
}
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls > :is(button,label),
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls > .reference-duration-inline {
  position: static !important; inset: auto !important; margin: 0 !important;
  display: inline-flex !important; flex: 0 1 auto !important; align-items: center !important;
  justify-content: center; gap: 6px; width: auto !important; min-width: 0 !important;
  max-width: min(320px,100%) !important; height: 34px !important; padding: 0 11px !important;
  border: 1px solid var(--ref-border-2) !important; border-radius: 18px !important;
  background: var(--ref-bg-2) !important; color: var(--ref-text) !important; font-size: 12px !important;
}
/* The track must never move when 9 becomes 10. Keep the editable value after
   a fixed-width track; both controls mirror the existing duration field. */
.reference-ui-shell #workspace #creationComposer #referenceDurationControl { flex: 0 0 auto !important; white-space: nowrap; }
.reference-ui-shell #workspace #creationComposer #referenceDurationInline { flex: 0 0 92px !important; width: 92px !important; min-width: 92px !important; max-width: 92px !important; padding: 0 !important; accent-color: var(--ref-primary); }
.reference-ui-shell #workspace #creationComposer #referenceDurationNumber { flex: 0 0 40px !important; width: 40px !important; min-width: 40px !important; max-width: 40px !important; height: 26px !important; padding: 0 3px !important; margin: 0 !important; border: 1px solid var(--ref-border-2) !important; border-radius: 7px !important; background: var(--ref-bg) !important; color: var(--ref-text) !important; font: inherit; font-variant-numeric: tabular-nums; text-align: center; appearance: textfield; }
.reference-ui-shell #workspace #creationComposer #referenceDurationNumber::-webkit-inner-spin-button,
.reference-ui-shell #workspace #creationComposer #referenceDurationNumber::-webkit-outer-spin-button { appearance: none; margin: 0; }
.reference-ui-shell #workspace #creationComposer #referenceDurationNumber:focus-visible { outline: 2px solid var(--ref-primary); outline-offset: 1px; }
.reference-ui-shell #workspace #creationComposer #referenceDurationNumber[aria-invalid="true"] { border-color: #c88616 !important; }
.reference-ui-shell #workspace #creationComposer #referenceModelSummary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-ui-shell #workspace #creationComposer #referenceComposerModelButton > :not(#referenceModelSummary) { flex-shrink: 0; }
.reference-ui-shell #workspace #creationComposer #assetGrid:has(.asset-mode-empty) { height: auto !important; min-height: 0 !important; border: 0 !important; background: transparent !important; }
.reference-ui-shell #workspace #creationComposer .asset-mode-empty { height: auto !important; min-height: 0 !important; padding: 8px !important; border: 0 !important; border-radius: 12px !important; background: var(--ref-bg-2) !important; color: var(--ref-sub) !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #referenceComposerControls #generationFooter {
  position: relative !important; inset: auto !important; display: flex !important; align-items: center !important;
  justify-content: flex-end !important; flex: 0 1 auto !important; flex-wrap: wrap !important;
  gap: 6px 10px !important; width: auto !important; max-width: 100% !important; height: auto !important;
  min-height: 36px !important; padding: 0 !important; margin: 0 0 0 auto !important;
  border: 0 !important; background: transparent !important;
}
.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter :is(.generate,#audioCloneContinue) { position: static !important; flex: 0 0 auto !important; min-width: 140px !important; width: auto !important; max-width: 100% !important; height: 36px !important; min-height: 36px !important; margin: 0 !important; white-space: nowrap; }
.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter :is(.generate,#audioCloneContinue)::after { content: none !important; display: none !important; }
.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter .cost-breakdown { position: static !important; inset: auto !important; display: flex !important; flex: 0 1 auto !important; flex-wrap: wrap !important; justify-content: flex-end !important; align-items: center !important; gap: 2px 8px !important; min-width: 0 !important; width: auto !important; max-width: 100% !important; height: auto !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; font-size: 11px !important; line-height: 1.4 !important; color: var(--ref-sub) !important; }
/* 2026-11-16: the cost is never cut to "…1 方…"; it wraps whole words instead. */
.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter .cost-breakdown .cost-total { font-family: inherit !important; letter-spacing: normal !important; font-weight: 600 !important; }
.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter .cost-breakdown > span { max-width: 100% !important; min-width: 0 !important; border: 0 !important; border-radius: 0 !important; padding: 0 !important; background: transparent !important; box-shadow: none !important; overflow: visible !important; text-overflow: clip !important; white-space: nowrap !important; }
.reference-ui-shell #workspace #creationComposer #generationFooter #genMsg { position: static !important; flex-basis: 100% !important; width: auto !important; max-width: 300px !important; margin: 0 !important; overflow-wrap: anywhere; pointer-events: none; }
.reference-ui-shell #workspace #creationComposer #generationFooter #genMsg:empty { display: none !important; }
/* Keep the existing pointer/keyboard resize behavior in the input corner,
   without a second horizontal bar or an extra row below the text field. */
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #promptEditorField #promptResizeHandle { position: absolute !important; inset: auto 4px 4px auto !important; display: grid !important; place-items: center !important; width: 22px !important; height: 22px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: transparent !important; cursor: ns-resize !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #promptEditorField #promptResizeHandle span { display: block !important; width: 9px !important; height: 9px !important; border-radius: 0 !important; background: repeating-linear-gradient(135deg, transparent 0 2px, var(--ref-muted) 2px 3px, transparent 3px 5px) !important; clip-path: polygon(100% 0, 100% 100%, 0 100%); opacity: .5; }
.reference-ui-shell #workspace #creationComposer #promptEditorField #promptResizeHandle:is(:hover,:focus-visible,[aria-grabbed="true"]) span { opacity: 1; }
.reference-ui-shell #workspace #creationComposer #promptResizeHandle:focus-visible { outline: 2px solid var(--ref-primary); outline-offset: 1px; border-radius: 4px; }
.reference-ui-shell #workspace #creationComposer #audioWorkflowQuickSwitch[aria-hidden="true"],
.reference-ui-shell #workspace #creationComposer[hidden],
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls > [hidden],
.reference-ui-shell #workspace #creationComposer #generationFooter[hidden],
.reference-ui-shell #workspace #creationComposer #generationForm[hidden],
.reference-ui-shell #workspace #creationComposer #generationFooter > [hidden],
.reference-ui-shell #workspace #creationComposer #referenceComposerSettingsPanel[hidden],
.reference-ui-shell #workspace #creationComposer .reference-composer-settings-section[hidden] { display: none !important; }
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls[data-creation-type="video"] .audio-only,
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls[data-creation-type="image"] :is(.video-only,.audio-only),
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls[data-creation-type="audio"] :is(.video-only,.visual-only,.audio-only,.model),
.reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls[data-creation-type="text"] :is(.video-only,.visual-only,.audio-only) { display: none !important; }
.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter[hidden],
.reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter > [hidden] { display: none !important; }
.reference-ui-shell #referenceComposerParametersPanel[data-active-subsection="reference"] > :not(#referenceField),
.reference-ui-shell #referenceComposerParametersPanel[data-active-subsection="ratio"] > :not(#videoParamGrid):not(#imageRatioField),
.reference-ui-shell #referenceComposerParametersPanel[data-active-subsection="resolution"] > :not(#videoParamGrid):not(#imageResolutionField),
.reference-ui-shell #referenceComposerParametersPanel[data-active-subsection="audio"] > :not(#audioParamPanel),
.reference-ui-shell #referenceComposerParametersPanel[data-active-subsection="ratio"] #videoParamGrid > :not(#ratioControl),
.reference-ui-shell #referenceComposerParametersPanel[data-active-subsection="resolution"] #videoParamGrid > :not(#resolutionControl),
.reference-ui-shell #referenceComposerParametersPanel #durationControl { display: none !important; }
.reference-ui-shell #referenceComposerParametersPanel :is(#videoParamGrid,#imageRatioField) { grid-template-columns: 1fr !important; }
.reference-ui-shell #workspace:not([data-creation-type="video"]) #referenceComposerModelPanel > #modelField,
.reference-ui-shell #workspace:not([data-creation-type="image"]) #referenceComposerParametersPanel > #imageRatioField,
.reference-ui-shell #workspace:not([data-creation-type="image"]) #referenceComposerParametersPanel > #imageResolutionField,
.reference-ui-shell #workspace:not([data-creation-type="video"]) #referenceComposerParametersPanel > #videoParamGrid { display: none !important; }
.reference-ui-shell #workspace #creationComposer #referenceComposerSettingsPanel { position: fixed !important; inset: auto; z-index: 1500 !important; pointer-events: auto !important; overflow: auto !important; }
/* The panel lives inside the shared composer. Raise that stacking context
   only while a settings panel is open, above sibling gallery badges. */
.reference-ui-shell #workspace #creationComposer.settings-open { z-index: 60 !important; }
.reference-ui-shell #workspace #creationComposer #referenceComposerSettingsPanel * { pointer-events: auto !important; }
.reference-ui-shell #workspace #creationComposer #referenceComposerControls button:focus-visible { outline: 2px solid var(--ref-primary) !important; outline-offset: 3px; }
.reference-ui-shell #workspace #creationComposer #referenceComposerControls button:disabled { opacity: .6; cursor: default; }
@media (max-width: 700px) {
  .reference-ui-shell #workspace #creationComposer[data-reference-surface]:has(#generationForm) #generationForm { padding: 98px 10px 12px !important; }
  .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls > :is(button,label),
  .reference-ui-shell #workspace #creationComposer[data-reference-surface] #generationForm #referenceComposerControls > .reference-duration-inline { font-size: 11px !important; padding-inline: 9px !important; }
  .reference-ui-shell #workspace #creationComposer #referenceComposerControls #generationFooter .kbd { display: none !important; }
}
