/* Shared contract for the four OUOU creation modes. */
:root {
  --creation-topbar-height: 56px;
  --creation-stage-shift: max(0px, calc(50vh - 388px));
  --creation-recommend-shift: max(0px, calc(100vh - 776px));
}

.main {
  overflow-anchor: none;
}

@media (min-width: 721px) {
  /* The target creation surface keeps its 48px activity strip above the tool shell. */
  body:not(.ouou-embedded) > .campaign {
    display: flex !important;
  }

  body:not(.sidebar-expanded) {
    --sidebar-width: 68px !important;
  }

  body.sidebar-expanded {
    --sidebar-width: 200px !important;
  }

  body.sidebar-expanded .app {
    grid-template-columns: 200px minmax(0, 1fr) !important;
  }

  body:not(.sidebar-expanded) .nav-label,
  body:not(.sidebar-expanded) .nav-item .chev {
    display: none !important;
  }

  /* Keep the rail header identical when any creation mode is opened directly. */
  .sidebar-head {
    position: relative !important;
    width: 44px;
    height: 46px !important;
    justify-content: center !important;
  }

  body:not(.sidebar-expanded) .brand {
    display: none !important;
    pointer-events: none !important;
  }

  body:not(.sidebar-expanded) .sidebar-toggle {
    position: static !important;
    inset: auto !important;
    width: 36px !important;
    height: 36px !important;
    flex: 0 0 36px !important;
    border-radius: 6px !important;
  }

  body:not(.sidebar-expanded) .sidebar-toggle i,
  body:not(.sidebar-expanded) .sidebar-toggle svg {
    width: 20px !important;
    height: 20px !important;
    opacity: 1 !important;
  }

  body.sidebar-expanded .sidebar-head {
    width: 168px !important;
    justify-content: space-between !important;
  }

  body.sidebar-expanded .brand {
    display: flex !important;
    pointer-events: auto !important;
  }

  body.sidebar-expanded .brand-mark {
    width: 30px !important;
    height: 28px !important;
    flex: 0 0 30px !important;
  }

  body.sidebar-expanded .brand-mark::before {
    inset: 1px 1px 4px !important;
    border-width: 3px !important;
    border-radius: 8px 8px 6px 6px !important;
  }

  body.sidebar-expanded .brand-mark::after {
    left: 4px !important;
    bottom: 3px !important;
    width: 8px !important;
    height: 3px !important;
    box-shadow: 14px 0 0 var(--coral) !important;
  }

  body.sidebar-expanded .brand-word {
    display: block !important;
    font-size: 22px !important;
    line-height: 28px !important;
  }

  body.sidebar-expanded .sidebar-toggle {
    position: static !important;
    inset: auto !important;
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
  }

  body.sidebar-expanded .sidebar-toggle i,
  body.sidebar-expanded .sidebar-toggle svg {
    opacity: 1 !important;
  }

  .app {
    height: calc(100vh - 48px) !important;
  }

  .topbar {
    height: var(--creation-topbar-height) !important;
    padding-inline: 16px !important;
    gap: 10px !important;
  }

  .top-action,
  .benefits {
    height: 30px !important;
    border-radius: 16px !important;
  }

  .top-action {
    padding-inline: 10px !important;
    border: 0 !important;
    background: #f4f4f5 !important;
    font-size: 12px !important;
    line-height: 18px !important;
    font-weight: 500 !important;
  }

  .top-action i,
  .top-action svg,
  .benefit i,
  .benefit svg {
    width: 16px !important;
    height: 16px !important;
  }

  .benefits {
    padding: 0 !important;
    border: 0 !important;
    background: #f4f4f5 !important;
  }

  .benefit {
    height: 30px !important;
    padding-inline: 12px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
  }

  .benefit-divider {
    height: 13px !important;
  }

  .icon-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .icon-btn i,
  .icon-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .avatar {
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
    margin-inline: 8px !important;
    font-size: 9px !important;
  }

  .avatar::after {
    display: none !important;
  }

  .main {
    padding: 68px 24px 30px !important;
  }
}

@media (min-width: 821px) {
  .main {
    padding-top: calc(68px + var(--creation-stage-shift)) !important;
  }
}

.resource {
  min-width: 52px !important;
  width: 52px;
  height: 52px !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 0 !important;
}

/* One measured creator-shell geometry, independent of the initially opened mode. */
.resources {
  height: 60px !important;
  align-items: flex-start !important;
  gap: 16px !important;
  padding: 5px 20px 3px !important;
}

.creator-footer {
  height: 52px !important;
  align-items: center !important;
  gap: 7px !important;
  padding: 5px 12px 15px !important;
}

.control {
  height: 32px !important;
  gap: 4px !important;
  padding-inline: 8px !important;
  font-size: 12px !important;
  line-height: 18px !important;
}

@media (min-width: 721px) {
  /* Match the target's textarea baseline before the 52px resource rail. */
  .creator > .digital-fields,
  .creator > .motion-instruction {
    margin-bottom: 3px !important;
  }
}

/* Keep the mode rail on the target image-workbench geometry in every mode. */
.modes {
  height: 52px !important;
  gap: 8px !important;
  padding: 12px 12px 4px !important;
}

.mode {
  height: 36px !important;
  gap: 4px !important;
  padding-inline: 14px !important;
  font-size: 14px !important;
  line-height: 21.7px !important;
}

.upload-empty {
  width: 100%;
  height: 100%;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px !important;
  line-height: 16px;
}

.upload-empty i,
.upload-empty svg,
.upload-filled i,
.upload-filled svg,
.resource > i,
.resource > svg {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px;
}

.ouou-local-ready {
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px !important;
  overflow: hidden;
}

.ouou-local-ready span {
  max-width: 44px;
  overflow: hidden;
  font-size: 9px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.state-upload .upload-empty {
  display: none !important;
}

body.state-upload #uploadButton {
  min-width: 52px !important;
  width: 52px !important;
  height: 52px !important;
  padding: 0 !important;
  color: #fff !important;
  border: 0 !important;
  background: #5d83ff !important;
}

@media (min-width: 721px) {
  .creator > .parameters {
    top: calc(100% + 8px) !important;
    right: auto !important;
    bottom: auto !important;
    left: 12px !important;
    width: min(372px, calc(100% - 24px)) !important;
    max-height: min(320px, calc(100vh - 414px)) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
  }

  .creator > .parameters .parameter-scroll {
    max-height: inherit !important;
  }

}

.cost-action {
  position: relative;
  width: 88px !important;
  height: 32px !important;
  display: grid !important;
  grid-template-columns: 16px minmax(18px, 1fr) 24px;
  align-items: center;
  justify-items: center;
  column-gap: 4px !important;
  padding: 3px 4px 3px 8px !important;
  border: 1px solid #919191 !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: #a8a8a8 !important;
  font-size: 12px !important;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}

.cost-action > i,
.cost-action > svg {
  width: 14px !important;
  height: 14px !important;
  grid-column: 1;
  grid-row: 1;
}

.cost-action > span {
  min-width: 18px;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  grid-column: 2;
  grid-row: 1;
}

.ouou-estimate-retry {
  position: relative;
  z-index: 2;
  grid-column: 1;
  grid-row: 1;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: transparent;
  cursor: pointer;
}

.ouou-estimate-retry[hidden] {
  display: none !important;
}

.ouou-estimate-retry i,
.ouou-estimate-retry svg {
  width: 13px !important;
  height: 13px !important;
}

.cost-action[data-estimate-status="error"] > [data-lucide="zap"] {
  visibility: hidden;
}

.generate {
  position: absolute !important;
  z-index: 1;
  inset: -1px !important;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  color: #fff !important;
  background: transparent !important;
  cursor: not-allowed !important;
}

.generate i,
.generate svg {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  flex: 0 0 24px;
  box-sizing: border-box;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .2);
  stroke-width: 2 !important;
}

.generate.enabled:not(:disabled) {
  background: transparent !important;
  cursor: pointer !important;
}

.generate.enabled:not(:disabled) i,
.generate.enabled:not(:disabled) svg {
  background: #276ef1;
}

.page-header p {
  gap: 10px !important;
}

.header-models {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex: 0 0 auto;
}

.header-models .model-logo {
  width: 22px !important;
  height: 22px !important;
  display: grid !important;
  place-items: center !important;
  overflow: hidden;
  border: 1px solid #e8ebef !important;
  border-radius: 6px !important;
  color: inherit !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(21, 25, 31, .07) !important;
}

.header-models .model-logo::after {
  display: none !important;
  content: none !important;
}

.header-models .model-logo img {
  width: 18px;
  height: 18px;
  display: block;
  border-radius: 4px;
  object-fit: contain;
}

/* Keep the example rail on one geometry contract across all four modes. */
.inspiration {
  width: calc(100% - 152px) !important;
  margin: calc(31px + var(--creation-recommend-shift) - var(--creation-stage-shift)) auto 0 !important;
}

.inspiration .section-head {
  height: 28px !important;
  margin-inline: -2px !important;
}

.inspiration-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 8px !important;
  margin-top: 3px !important;
}

.inspiration-card:nth-child(n + 7) {
  display: none !important;
}

.inspiration-card {
  box-sizing: border-box !important;
  padding: 2px !important;
}

.inspiration-card,
.inspiration-media {
  min-width: 0;
  overflow: hidden;
  border-radius: 12px !important;
}

.inspiration-media {
  aspect-ratio: 3 / 4 !important;
}

.inspiration-media img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border-radius: inherit !important;
  object-fit: cover !important;
}

@media (max-width: 1180px) and (min-width: 821px) {
  .inspiration .section-head {
    height: 38px !important;
  }

  .inspiration-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  }

  .inspiration-card:nth-child(-n + 5) {
    display: block !important;
  }

  .inspiration-card:nth-child(n + 6) {
    display: none !important;
  }
}

@media (min-width: 1340px) and (max-width: 1599px) {
  .inspiration-grid {
    margin-top: 5px !important;
  }
}

@media (min-width: 1340px) and (max-width: 1479px) {
  .inspiration-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }

  .inspiration-card:nth-child(-n + 7) {
    display: block !important;
  }

  .inspiration-card:nth-child(n + 8) {
    display: none !important;
  }
}

@media (min-width: 1480px) {
  .inspiration-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }

  .inspiration-card:nth-child(-n + 8) {
    display: block !important;
  }
}

@media (min-width: 1920px) {
  .creator {
    width: min(920px, 100%) !important;
  }

  .inspiration {
    margin-top: calc(31px + max(0px, calc(var(--creation-recommend-shift) - var(--creation-stage-shift) - 24px))) !important;
  }
}

.workspace.ouou-workbench-host {
  overflow: hidden;
}

.ouou-workbench-frame {
  position: absolute;
  z-index: 3;
  inset: var(--creation-topbar-height) 0 0;
  width: 100%;
  height: calc(100% - var(--creation-topbar-height));
  border: 0;
  background: #f8f8f8;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.workspace.ouou-mode-mounted > .ouou-workbench-frame.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.workspace.ouou-mode-mounted > .main {
  visibility: hidden;
}

html.ouou-embedded,
html.ouou-embedded body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

html.ouou-embedded body > .campaign,
html.ouou-embedded body .sidebar,
html.ouou-embedded body .topbar {
  display: none !important;
}

html.ouou-embedded .app,
html.ouou-embedded .workspace {
  width: 100%;
  height: 100% !important;
  min-height: 100%;
  display: block !important;
}

html.ouou-embedded .main {
  height: 100% !important;
  min-height: 100% !important;
  padding: 19px 24px 30px !important;
}

@media (min-width: 821px) {
  /*
   * Embedded modes lose the host's 68px rail and 104px campaign/topbar stack.
   * Compensate for both so an in-place mode switch keeps the same stage and
   * recommendation geometry as the directly rendered image workbench.
   */
  html.ouou-embedded {
    --creation-stage-shift: max(0px, calc(50vh - 336px));
    --creation-recommend-shift: max(0px, calc(100vh - 672px));
  }

  html.ouou-embedded .main {
    padding-top: calc(12px + var(--creation-stage-shift)) !important;
  }
}

/* The embedded viewport is 68px narrower than the real browser viewport. */
@media (min-width: 1113px) and (max-width: 1271px) {
  html.ouou-embedded .inspiration .section-head {
    height: 28px !important;
  }

  html.ouou-embedded .inspiration-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }

  html.ouou-embedded .inspiration-card:nth-child(-n + 6) {
    display: block !important;
  }

  html.ouou-embedded .inspiration-card:nth-child(n + 7) {
    display: none !important;
  }
}

@media (min-width: 1272px) and (max-width: 1411px) {
  html.ouou-embedded .inspiration-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }

  html.ouou-embedded .inspiration-card:nth-child(-n + 7) {
    display: block !important;
  }

  html.ouou-embedded .inspiration-card:nth-child(n + 8) {
    display: none !important;
  }
}

@media (min-width: 1412px) {
  html.ouou-embedded .inspiration-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  }

  html.ouou-embedded .inspiration-card:nth-child(-n + 8) {
    display: block !important;
  }
}

@media (min-width: 1272px) and (max-width: 1531px) {
  html.ouou-embedded .inspiration-grid {
    margin-top: 5px !important;
  }
}

@media (min-width: 1852px) {
  html.ouou-embedded .creator {
    width: min(920px, 100%) !important;
  }

  html.ouou-embedded .inspiration {
    margin-top: calc(31px + max(0px, calc(var(--creation-recommend-shift) - var(--creation-stage-shift) - 24px))) !important;
  }
}

@media (max-width: 720px) {
  :root {
    --creation-topbar-height: 58px;
  }

  .ouou-workbench-frame {
    inset: var(--creation-topbar-height) 0 0;
    height: calc(100% - var(--creation-topbar-height));
  }

  html.ouou-embedded .main {
    padding: 16px 12px 24px !important;
  }

  body:not(.ouou-embedded) .main {
    min-height: calc(100vh - 90px) !important;
  }

  .nav[aria-label="Workspace"] .nav-item:nth-child(n + 2) {
    display: none !important;
  }

  .creator-footer {
    flex-wrap: nowrap !important;
  }

  .creator-footer > .control:not(.model-control):not(#settingsButton) {
    display: none !important;
  }

  body .control {
    padding-inline: 7px !important;
  }

  .page-header p {
    height: auto !important;
    min-height: 32px;
    flex-wrap: wrap;
    gap: 6px !important;
  }

  .header-models {
    gap: 3px !important;
  }

  .header-models .model-logo {
    width: 18px !important;
    height: 18px !important;
    border-radius: 5px !important;
  }

  .header-models .model-logo img {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 430px) {
  .modes {
    gap: 2px !important;
    padding-inline-end: 0 !important;
  }

  .mode {
    padding-inline: 4px !important;
    font-size: 12px !important;
    line-height: 18px !important;
  }

  .mode:nth-child(3),
  .mode:nth-child(4) {
    display: flex !important;
  }
}

@media (max-width: 820px) {
  body:not(.ouou-embedded) > .campaign {
    display: flex !important;
  }

  .inspiration {
    width: min(100%, 620px) !important;
    margin-top: 18px !important;
  }

  .inspiration-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .inspiration-card:nth-child(n + 5) {
    display: block !important;
  }
}

@media (max-width: 430px) {
  .inspiration-grid {
    gap: 8px !important;
  }
}

/* Shared source picker for video, digital-human and motion workflows. */
html.creator-overlay-open,
html.creator-overlay-open body {
  overflow: hidden !important;
}

.ouou-source-picker {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 18, 22, .46);
}

.ouou-source-picker.is-open {
  display: flex;
}

.ouou-source-dialog {
  width: min(1480px, calc(100vw - 320px));
  height: calc(100vh - 156px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #dfe2e6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 72px rgba(17, 20, 24, .25);
}

.ouou-source-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px 0 22px;
  border-bottom: 1px solid #eceef1;
}

.ouou-source-title {
  min-width: 0;
  flex: 1;
}

.ouou-source-title h2 {
  margin: 0;
  color: #22262b;
  font-size: 16px;
  line-height: 22px;
  font-weight: 650;
}

.ouou-source-title p {
  margin: 2px 0 0;
  color: #8b9199;
  font-size: 10px;
  line-height: 14px;
}

.ouou-source-count {
  padding: 3px 8px;
  border-radius: 4px;
  color: #6c737c;
  background: #f3f4f5;
  font-size: 10px;
  white-space: nowrap;
}

.ouou-source-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #737a82;
  background: transparent;
  cursor: pointer;
}

.ouou-source-close:hover {
  color: #25292e;
  background: #f1f2f4;
}

.ouou-source-close svg {
  width: 17px;
  height: 17px;
}

.ouou-source-tabs {
  min-height: 50px;
  display: flex;
  align-items: stretch;
  gap: 3px;
  overflow-x: auto;
  padding: 0 18px;
  border-bottom: 1px solid #eceef1;
  scrollbar-width: none;
}

.ouou-source-tabs::-webkit-scrollbar {
  display: none;
}

.ouou-source-tab {
  min-width: 104px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  color: #717881;
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}

.ouou-source-tab svg {
  width: 15px;
  height: 15px;
}

.ouou-source-tab.active {
  color: #2369d8;
  font-weight: 650;
}

.ouou-source-tab.active::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 2px;
  background: #276ef1;
}

.ouou-source-tab:disabled:not(.active) {
  color: #a3a9b0;
  cursor: not-allowed;
}

.ouou-source-body {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #fafbfc;
}

.ouou-asset-library {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
}

.ouou-asset-filterbar {
  position: sticky;
  z-index: 3;
  top: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 12px;
  background: #fafbfc;
}

.ouou-asset-search {
  min-width: 210px;
  height: 34px;
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #dfe2e6;
  border-radius: 6px;
  background: #fff;
}

.ouou-asset-search svg {
  width: 14px;
  height: 14px;
  color: #8b929a;
}

.ouou-asset-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #333940;
  background: transparent;
  font-size: 11px;
}

.ouou-asset-filter-button,
.ouou-asset-filter-clear,
.ouou-asset-date {
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dfe2e6;
  border-radius: 6px;
  color: #59616a;
  background: #fff;
  font-size: 10px;
}

.ouou-asset-filter-button {
  padding: 0 10px;
}

.ouou-asset-filter-button.active {
  color: #245fbf;
  border-color: #9bb8e8;
  background: #f1f6ff;
}

.ouou-asset-filter-button svg,
.ouou-asset-filter-clear svg {
  width: 14px;
  height: 14px;
}

.ouou-asset-date {
  padding: 0 7px 0 9px;
}

.ouou-asset-date span {
  white-space: nowrap;
}

.ouou-asset-date input {
  width: 112px;
  border: 0;
  outline: 0;
  color: #3f464e;
  background: transparent;
  font-size: 10px;
}

.ouou-asset-filter-clear {
  width: 34px;
  justify-content: center;
  padding: 0;
}

.ouou-asset-library[hidden],
.ouou-library-section[hidden],
.ouou-asset-grid[hidden],
.ouou-asset-state[hidden],
.ouou-source-drop[hidden],
.ouou-source-preview[hidden] {
  display: none !important;
}

.ouou-library-section {
  min-width: 0;
  padding: 0 0 20px;
}

.ouou-library-section + .ouou-library-section {
  padding-top: 20px;
  border-top: 1px solid #e7eaee;
}

.ouou-library-heading {
  min-height: 28px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 1px 8px;
}

.ouou-library-heading strong {
  color: #30363d;
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
}

.ouou-library-heading span {
  color: #858d96;
  font-size: 10px;
  line-height: 16px;
}

.ouou-library-section .ouou-asset-state {
  height: auto;
  min-height: 150px;
  border: 1px solid #edf0f2;
  border-radius: 8px;
  background: #fff;
}

.ouou-asset-state {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #7a828c;
  text-align: center;
}

.ouou-asset-state-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 8px;
  color: #66707b;
  background: #eef1f4;
}

.ouou-asset-state-icon svg {
  width: 19px;
  height: 19px;
}

.ouou-asset-state.is-loading .ouou-asset-state-icon svg {
  animation: ouou-source-spin .9s linear infinite;
}

@keyframes ouou-source-spin {
  to { transform: rotate(360deg); }
}

.ouou-asset-state strong {
  color: #3b4148;
  font-size: 12px;
  line-height: 18px;
}

.ouou-asset-state > span:not(.ouou-asset-state-icon) {
  max-width: 360px;
  font-size: 10px;
  line-height: 16px;
}

.ouou-asset-state button {
  height: 30px;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px solid #d4d9df;
  border-radius: 6px;
  color: #48515b;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.ouou-asset-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  align-content: start;
  gap: 12px;
}

.ouou-asset-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  color: #353b42;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.ouou-asset-card:hover:not(:disabled) {
  border-color: #9ab6e5;
  box-shadow: 0 2px 8px rgba(25, 47, 78, .08);
}

.ouou-asset-card:focus-visible {
  outline: 2px solid rgba(39, 110, 241, .36);
  outline-offset: 2px;
}

.ouou-asset-card.is-selected {
  border-color: #3979df;
  box-shadow: inset 0 0 0 1px #3979df;
}

.ouou-asset-card:disabled {
  color: #7e858d;
  background: #f6f7f8;
  cursor: not-allowed;
}

.ouou-asset-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #7a8798;
  background: #edf0f3;
}

.ouou-asset-media > img,
.ouou-asset-media > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ouou-asset-media > svg {
  width: 26px;
  height: 26px;
}

.ouou-asset-card:disabled .ouou-asset-media > img,
.ouou-asset-card:disabled .ouou-asset-media > video {
  opacity: .52;
}

.ouou-asset-check {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 50%;
  color: #5d6670;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 1px 4px rgba(22, 28, 34, .14);
}

.ouou-asset-card.is-selected .ouou-asset-check {
  border-color: #276ef1;
  color: #fff;
  background: #276ef1;
}

.ouou-asset-card.is-unavailable .ouou-asset-check {
  color: #777f88;
  background: rgba(245, 246, 247, .92);
}

.ouou-asset-check svg {
  width: 12px;
  height: 12px;
}

.ouou-reference-example-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 4px;
  color: #fff;
  background: rgba(34, 41, 49, .72);
  font-size: 9px;
  line-height: 18px;
  font-weight: 650;
}

body.state-upload #uploadButton.has-reference-example {
  overflow: hidden;
  border: 1px solid #d8dde4 !important;
  border-radius: 8px !important;
  background: #eef1f4 !important;
}

.ouou-reference-example-ready {
  position: relative;
  display: block !important;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 7px;
}

.ouou-reference-example-ready > img {
  width: 52px !important;
  height: 52px !important;
  display: block;
  border-radius: 7px;
  object-fit: cover;
}

.ouou-reference-ready-count {
  position: absolute;
  right: 3px;
  bottom: 3px;
  max-width: 44px !important;
  height: 16px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border-radius: 4px;
  color: #fff;
  background: rgba(20, 25, 31, .72);
  font-size: 9px !important;
  line-height: 16px !important;
  font-variant-numeric: tabular-nums;
}

.ouou-asset-copy {
  min-width: 0;
  display: block;
  padding: 9px 10px 10px;
}

.ouou-asset-copy strong,
.ouou-asset-copy > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ouou-asset-copy strong {
  font-size: 11px;
  line-height: 17px;
  font-weight: 620;
}

.ouou-asset-copy > span {
  margin-top: 2px;
  color: #828a93;
  font-size: 9px;
  line-height: 15px;
}

.ouou-source-drop {
  width: min(680px, 100%);
  min-height: 292px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed #cbd1d8;
  border-radius: 8px;
  color: #747b84;
  background: #fff;
  text-align: center;
  cursor: pointer;
}

.ouou-source-drop:hover {
  border-color: #8cb0ea;
  background: #fbfdff;
}

.ouou-source-drop.is-dragging {
  border-color: #276ef1;
  background: #f3f7ff;
}

.ouou-source-drop > svg {
  width: 34px;
  height: 34px;
  color: #6f94d2;
}

.ouou-source-drop strong {
  color: #363b42;
  font-size: 13px;
  line-height: 19px;
}

.ouou-source-drop span {
  max-width: 460px;
  font-size: 10px;
  line-height: 17px;
}

.ouou-source-preview {
  width: min(560px, 100%);
  display: none;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
}

.ouou-source-preview.is-ready {
  display: grid;
}

.ouou-source-error {
  width: min(560px, 100%);
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #f0c4c1;
  border-radius: 6px;
  color: #a43c36;
  background: #fff6f5;
  font-size: 10px;
  line-height: 16px;
  text-align: left;
}

.ouou-source-rights {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  background: #fff;
}

.ouou-source-rights[hidden] {
  display: none;
}

.ouou-source-rights legend {
  padding: 0 4px;
  color: #3d434a;
  font-size: 11px;
  font-weight: 650;
}

.ouou-source-rights > label:not(.ouou-source-commercial):not(.ouou-source-declaration) {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #686f78;
  font-size: 10px;
}

.ouou-source-rights input[type="text"],
.ouou-source-rights select {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  outline: 0;
  color: #343940;
  background: #fff;
  font-size: 11px;
}

.ouou-source-rights input[type="text"]:focus,
.ouou-source-rights select:focus {
  border-color: #7fa5e5;
  box-shadow: 0 0 0 2px rgba(39, 110, 241, .1);
}

.ouou-source-commercial,
.ouou-source-declaration {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #606872;
  font-size: 9px;
  line-height: 15px;
}

.ouou-source-declaration {
  grid-column: 1 / -1;
  padding-top: 2px;
}

.ouou-source-commercial input,
.ouou-source-declaration input {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
  accent-color: #276ef1;
}

.ouou-source-preview-media {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: #6682ad;
  background: #eef2f7;
}

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

.ouou-source-preview-media svg {
  width: 26px;
  height: 26px;
}

.ouou-source-preview-copy {
  min-width: 0;
  text-align: left;
}

.ouou-source-preview-copy strong,
.ouou-source-preview-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ouou-source-preview-copy strong {
  color: #343940;
  font-size: 12px;
}

.ouou-source-preview-copy span {
  margin-top: 4px;
  color: #858c95;
  font-size: 10px;
}

.ouou-source-change {
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  color: #4f5761;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.ouou-source-foot {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-top: 1px solid #e9ecef;
}

.ouou-source-note {
  min-width: 0;
  flex: 1;
  color: #858c95;
  font-size: 10px;
  line-height: 16px;
}

.ouou-source-cancel,
.ouou-source-confirm {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.ouou-source-cancel {
  border: 1px solid #d9dde3;
  color: #545b64;
  background: #fff;
}

.ouou-source-confirm {
  border: 1px solid #276ef1;
  color: #fff;
  background: #276ef1;
}

.ouou-source-confirm:disabled {
  border-color: #cfd4da;
  color: #9ca2aa;
  background: #e6e8eb;
  cursor: not-allowed;
}

.progress::after {
  width: var(--ouou-task-progress, 0%) !important;
}

.result-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.result-actions a {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: rgba(20, 22, 25, .72);
}

.result-actions a i,
.result-actions a svg {
  width: 15px;
  height: 15px;
}

.parameters .parameter-text,
.parameters .parameter-number,
.parameters .parameter-select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid #dfe3e8;
  border-radius: 6px;
  color: #34383d;
  background: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 18px;
  letter-spacing: 0;
  outline: none;
}

.parameters .param-unit {
  min-width: 0;
  margin-left: auto;
  color: #858c95;
  font-size: 11px;
  font-weight: 400;
  line-height: 18px;
  white-space: nowrap;
}

.parameters .parameter-group-heading {
  margin: 14px 0 6px;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0;
}

.parameters .parameter-group-heading:first-child {
  margin-top: 0;
}

.parameters .parameter-help {
  display: block;
  margin-top: 5px;
  color: #858c95;
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0;
}

.parameters .parameter-text {
  height: 64px;
  padding-block: 9px;
  resize: none;
}

.parameters .parameter-text:focus,
.parameters .parameter-number:focus,
.parameters .parameter-select:focus {
  border-color: #8eb4f8;
  box-shadow: 0 0 0 2px rgba(55, 124, 244, .1);
}

.parameters .parameter-slider {
  width: 100%;
  height: 40px;
  margin: 0;
  accent-color: #377cf4;
}

.parameters .parameter-toggle {
  width: 100%;
  height: 40px;
  display: block;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #6a7078;
  background: #f2f3f4;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}

.parameters .parameter-toggle[aria-pressed="true"] {
  color: #2c67cf;
  background: #eaf2ff;
}

.parameters .parameter-stepper {
  grid-template-columns: 40px minmax(0, 1fr) 40px !important;
  align-items: center;
}

.parameters .parameter-stepper-value {
  min-width: 0;
  color: #34383d;
  font-size: 12px;
  line-height: 36px;
  text-align: center;
}

.parameters .segment button,
.parameters .count-row button {
  position: relative;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parameters .segment button.has-benefit-badge,
.parameters .count-row button.has-benefit-badge {
  padding-right: 24px;
}

.parameters .parameter-benefit-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 20px;
  height: 12px;
  display: inline-grid;
  place-items: center;
  padding: 0 3px;
  border-radius: 3px;
  color: #704600;
  background: #ffe8a8;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: 0;
  pointer-events: none;
}

.parameters .parameter-benefit-notice {
  min-height: 34px;
  display: flex;
  align-items: center;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #ead9ab;
  border-radius: 6px;
  color: #72591b;
  background: #fffaf0;
  font-size: 11px;
  line-height: 17px;
  letter-spacing: 0;
}

.parameters .parameter-benefit-notice.is-blocked {
  border-color: #e5b5b5;
  color: #9a3535;
  background: #fff5f5;
}

.parameters .parameter-benefit-notice[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .ouou-source-picker {
    padding: 0;
  }

  .ouou-source-dialog {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .ouou-source-head {
    padding-inline: 14px 10px;
  }

  .ouou-source-title p {
    display: none;
  }

  .ouou-source-tabs {
    padding-inline: 8px;
  }

  .ouou-source-tab {
    min-width: 94px;
    padding-inline: 8px;
  }

  .ouou-source-body {
    padding: 16px 12px;
  }

  .ouou-asset-filterbar {
    position: static;
    flex-wrap: wrap;
  }

  .ouou-asset-search {
    min-width: 100%;
    flex-basis: 100%;
  }

  .ouou-asset-date {
    min-width: calc(50% - 4px);
    flex: 1 1 calc(50% - 4px);
  }

  .ouou-asset-date input {
    width: 100%;
    min-width: 0;
  }

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

  .ouou-asset-copy {
    padding: 8px;
  }

  .ouou-asset-state {
    min-height: 220px;
  }

  .ouou-source-drop {
    min-height: 260px;
    padding: 20px;
  }

  .ouou-source-preview {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .ouou-source-preview-media {
    width: 56px;
    height: 56px;
  }

  .ouou-source-rights {
    grid-template-columns: 1fr;
  }

  .ouou-source-declaration {
    grid-column: auto;
  }

  .ouou-source-change {
    grid-column: 1 / -1;
    width: 100%;
  }

  .ouou-source-foot {
    min-height: 64px;
    padding-inline: 10px;
  }

  .ouou-source-note {
    display: none;
  }
}
