/* Final, isolated layout for the production marketplace project page. */
.marketplace-project{display:flex;flex-direction:column;min-width:0}
.marketplace-project .marketplace-project-head{margin-bottom:8px}.marketplace-project .project-meta{font-size:12px}
.marketplace-project .marketplace-workspace{display:grid;grid-template-columns:minmax(0,3fr) minmax(320px,2fr);gap:18px;min-height:0;align-items:stretch}
.marketplace-project .result-column{display:grid;grid-template-rows:minmax(0,1fr) auto;min-width:0;min-height:0;gap:8px}
.marketplace-project .result-area{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0}
.marketplace-project .result-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:4px}.marketplace-project .result-heading h2{margin:2px 0 0;font-size:18px;line-height:1.1}.marketplace-project .result-state{padding:4px 8px;font-size:11px}
.marketplace-project .visual-layout{display:grid;grid-template-columns:104px minmax(0,1fr);gap:14px;min-height:0;align-items:center}.marketplace-project .visual-layout:not(:has(.reference-rail)){grid-template-columns:minmax(0,1fr)}
.marketplace-project .reference-rail{display:flex;flex-direction:column;align-items:center;align-self:start;gap:10px;min-width:0;padding-top:2px}.marketplace-project .reference-rail .reference-item{display:grid;justify-items:center;gap:4px;color:var(--muted);font-size:10px;text-align:center}.marketplace-project .reference-rail .reference-thumb{display:grid;place-items:center;width:92px;height:118px;padding:0;border:1px solid rgba(255,255,255,.12);border-radius:9px;background:#fff;overflow:hidden;cursor:zoom-in}.marketplace-project .reference-rail .reference-thumb:hover{border-color:rgba(236,126,255,.8)}.marketplace-project .reference-rail .reference-thumb img{display:block;width:100%;height:100%;object-fit:contain;object-position:center}
.marketplace-project .image-area{display:grid;place-items:center;min-width:0;min-height:0;overflow:hidden}.marketplace-project .image-lightbox-trigger{display:grid;place-items:center;width:min(100%,360px);height:min(100%,480px);aspect-ratio:3 / 4;padding:0;border:0;border-radius:12px;background:transparent;cursor:zoom-in;overflow:hidden}.marketplace-project .image-lightbox-trigger:focus-visible{outline:2px solid #f09bff;outline-offset:5px}.marketplace-project .result-image{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain!important;object-position:center;border:0;border-radius:10px;background:transparent}.marketplace-project .result-placeholder{width:min(100%,360px);height:min(100%,480px);aspect-ratio:3 / 4;min-height:0;padding:24px;border:1px dashed rgba(217,104,255,.35);border-radius:14px;background:rgba(18,16,23,.32);text-align:center}
.marketplace-project .result-actions{justify-content:flex-start;margin-top:7px;gap:7px}.marketplace-project .result-actions .button{padding:8px 11px;font-size:12px}.marketplace-project .result-actions form{margin:0}
.marketplace-project .parameters-column{display:block;min-width:0;min-height:0}.marketplace-project .info-card{height:100%;min-height:0;padding:14px;overflow:auto}.marketplace-project .info-section{min-width:0}.marketplace-project .info-section+.info-section{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}.marketplace-project .section-heading-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.marketplace-project .section-heading-row .summary-arrow{font-size:18px}.marketplace-project .info-section h2{margin:2px 0 8px;font-size:17px;line-height:1.1}.marketplace-project .compact-parameters,.marketplace-project .compact-text{display:grid;grid-template-columns:minmax(68px,.62fr) minmax(0,1.38fr);gap:5px 12px;margin:0;font-size:12px;line-height:1.25}.marketplace-project .compact-parameters dt,.marketplace-project .compact-text dt{color:var(--muted)}.marketplace-project .compact-parameters dd,.marketplace-project .compact-text dd{margin:0;text-align:right;overflow-wrap:anywhere}.marketplace-project .project-text{max-height:66px;overflow:auto;white-space:pre-wrap}.marketplace-project .references-section{display:none}
.marketplace-project .series-stage{flex:0 0 auto;min-height:68px;margin-top:12px;margin-bottom:0;padding:10px 14px}.marketplace-project .series-stage strong{font-size:15px}.marketplace-project .series-stage p{margin:2px 0 0;font-size:11px;line-height:1.2}
.marketplace-project .revision-drawer[hidden]{display:none}.marketplace-project .revision-drawer{position:fixed;inset:0;z-index:30;display:flex;justify-content:flex-end;visibility:hidden;opacity:0;transition:opacity .2s ease,visibility .2s ease}.marketplace-project .revision-drawer.is-open{visibility:visible;opacity:1}.marketplace-project .revision-drawer-backdrop{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:rgba(3,2,7,.64);cursor:default}.marketplace-project .revision-drawer-panel{position:relative;z-index:1;width:min(100%,480px);height:100%;padding:24px;background:linear-gradient(145deg,#21112a,#0f0c14);border-left:1px solid rgba(217,104,255,.42);box-shadow:-20px 0 60px rgba(0,0,0,.42);transform:translateX(100%);transition:transform .22s ease;overflow:auto}.marketplace-project .revision-drawer.is-open .revision-drawer-panel{transform:translateX(0)}.drawer-open{overflow:hidden!important}
.lightbox{width:fit-content;max-width:96vw;max-height:94vh;padding:20px;border:1px solid rgba(217,104,255,.45);border-radius:16px;background:rgba(12,8,17,.96);box-shadow:0 24px 80px rgba(0,0,0,.6)}.lightbox::backdrop{background:rgba(2,1,5,.84)}.lightbox img{display:block;width:auto;height:auto;max-width:92vw;max-height:88vh;object-fit:contain}.lightbox-close{position:absolute;top:8px;right:8px;z-index:1}
@media (min-width:1001px) and (min-height:700px){body:has(.marketplace-project){overflow-y:hidden}.marketplace-project{height:calc(100vh - 104px);overflow:hidden;padding-top:10px;padding-bottom:7px}.marketplace-project .marketplace-workspace{flex:1;grid-template-columns:minmax(0,3fr) minmax(320px,2fr);gap:18px;min-height:0;align-items:stretch}.marketplace-project .visual-layout{height:100%;grid-template-columns:104px minmax(0,1fr);align-items:center}.marketplace-project .visual-layout:not(:has(.reference-rail)){grid-template-columns:minmax(0,1fr)}.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{width:min(100%,360px);height:min(100%,calc(100vh - 350px));max-height:560px}.marketplace-project .reference-rail{gap:9px}.marketplace-project .reference-rail .reference-thumb{width:88px;height:116px}.marketplace-project .info-card{padding:14px}.marketplace-project .info-section+.info-section{margin-top:14px;padding-top:14px}.marketplace-project .compact-parameters,.marketplace-project .compact-text{font-size:12px;gap:5px 10px}.marketplace-project .series-stage{min-height:64px;margin-top:9px;padding:8px 12px}.marketplace-project:has(.series-current){height:auto;overflow:visible}body:has(.marketplace-project .series-current){overflow-y:auto}}
@media (max-width:1000px){body:has(.marketplace-project){overflow-y:auto}.marketplace-project{height:auto;overflow:visible;padding-top:34px}.marketplace-project .marketplace-workspace{grid-template-columns:1fr;gap:16px}.marketplace-project .result-area{display:block}.marketplace-project .visual-layout{display:flex;flex-direction:column;gap:12px}.marketplace-project .reference-rail{width:100%;flex-direction:row;align-items:flex-start;overflow-x:auto;padding:0 2px 3px}.marketplace-project .reference-rail .reference-thumb{width:92px;height:74px}.marketplace-project .image-area{width:100%;min-height:0;margin:12px 0}.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{width:min(100%,420px);height:auto;min-height:300px;aspect-ratio:3 / 4}.marketplace-project .info-card{height:auto;overflow:visible}.marketplace-project .revision-drawer-panel{width:min(100%,520px);padding:20px}.marketplace-project:has(.series-current){height:auto;overflow:visible}}
@media (max-width:600px){.marketplace-project .generation-bar{display:block}.marketplace-project .generation-action{justify-content:flex-start;margin-top:12px}.marketplace-project .generation-action .button{width:100%}.marketplace-project .result-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.marketplace-project .result-actions form,.marketplace-project .result-actions .button{width:100%}.marketplace-project .result-actions form:last-child{grid-column:1/-1}.marketplace-project .result-actions a{text-align:center}.marketplace-project .series-stage{display:block}.marketplace-project .series-stage form{margin-top:12px}.marketplace-project .series-stage .button{width:100%}.marketplace-project .revision-footer{align-items:stretch}.marketplace-project .revision-footer .button{width:100%}}

.marketplace-project .series-stage-copy{min-width:0}.marketplace-project .series-stage-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.marketplace-project .series-stage-actions form{display:flex;align-items:center;margin:0}.marketplace-project .series-stage-actions .button{white-space:nowrap}.marketplace-project .result-state{max-width:100%;text-align:right;overflow-wrap:anywhere}
@media (max-width:600px){.marketplace-project .series-stage-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:12px}.marketplace-project .series-stage-actions form,.marketplace-project .series-stage-actions .button{width:100%}.marketplace-project .series-stage-actions form:last-child{grid-column:1/-1}.marketplace-project .series-stage-actions .button{text-align:center}}
@media(prefers-reduced-motion:reduce){.marketplace-project .revision-drawer,.marketplace-project .revision-drawer-panel{transition:none}}

/* Approved shared preview for the marketplace product-card branch. The
 * project-specific parameters and series workflow remain unchanged. */
.marketplace-project .product-preview-card {
  display: flex !important;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  background: linear-gradient(145deg,rgba(20,16,24,.95),rgba(12,10,16,.97));
  box-shadow: 0 20px 70px rgba(0,0,0,.23);
}
.marketplace-project .product-preview-card > .ad-editor-card-head {
  order: 1;
  min-height: 54px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: transparent;
}
.marketplace-project .product-preview-card > .product-source-materials {
  order: 2;
  position: relative;
  z-index: 1;
  margin: 18px 20px 0;
}
.marketplace-project .product-preview-card .ad-editor-source-materials-label {
  margin: 0 0 10px;
  color: #df79f6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}
.marketplace-project .product-preview-card .ad-editor-source-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 12px;
}
.marketplace-project .product-preview-card .ad-editor-source-card {
  display: grid;
  grid-template-columns: 74px minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 96px;
  padding: 10px;
  border: 1px solid rgba(217,104,255,.3);
  border-radius: 16px;
  color: #f4edf7;
  background: #211826;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  transition: border-color .18s ease,background .18s ease,transform .18s ease,box-shadow .18s ease;
}
.marketplace-project .product-preview-card .ad-editor-source-card.image-lightbox-trigger {
  width: auto !important;
  height: auto !important;
  aspect-ratio: auto !important;
}
.marketplace-project .product-preview-card .ad-editor-source-card:hover {
  border-color: rgba(238,126,255,.78);
  background: #2a1b32;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  transform: translateY(-1px);
}
.marketplace-project .product-preview-card .ad-editor-source-card:focus-visible {
  outline: 2px solid #f0a5ff;
  outline-offset: 3px;
}
.marketplace-project .product-preview-card .ad-editor-source-thumb {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  overflow: hidden;
  border-radius: 11px;
  background: #f4eef0;
}
.marketplace-project .product-preview-card .ad-editor-source-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.marketplace-project .product-preview-card .ad-editor-source-thumb-style { background: #211826; }
.marketplace-project .product-preview-card .ad-editor-source-thumb-style img { object-fit: cover; background: #211826; }
.marketplace-project .product-preview-card .ad-editor-source-copy { display: grid; min-width: 0; gap: 5px; }
.marketplace-project .product-preview-card .ad-editor-source-copy strong { overflow-wrap: anywhere; font-size: 14px; line-height: 1.2; }
.marketplace-project .product-preview-card .ad-editor-source-copy small { overflow: hidden; color: #b9aebe; font-size: 12px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.marketplace-project .product-preview-card .ad-editor-source-chevron { align-self: center; color: #e79aff; font-size: 22px; line-height: 1; }
.marketplace-project .product-preview-card > .visual-layout {
  order: 3;
  display: block;
  min-width: 0;
  min-height: 0;
  margin: 0;
}
.marketplace-project .product-preview-card .image-area {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0 20px 18px;
  overflow: visible;
}
.marketplace-project .product-preview-card .generated-slide-item { display: grid; justify-items: center; gap: 7px; width: 100%; }
.marketplace-project .product-preview-card .generated-image-wrap {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: calc(100% - 32px);
  max-width: none;
  min-width: 0;
  height: auto;
  margin: 16px auto 0;
  padding: 0;
  border: 1px solid rgba(217,104,255,.22);
  border-radius: 15px;
  background-color: #0a080d;
  background-image: linear-gradient(rgba(255,255,255,.038) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.038) 1px,transparent 1px);
  background-size: 32px 32px;
  box-shadow: 0 18px 48px rgba(0,0,0,.24),0 0 34px rgba(139,55,198,.08);
  overflow: hidden;
}
.marketplace-project .product-preview-card .generated-image-wrap::before { display: none; }
.marketplace-project .product-preview-card .generated-image-wrap::after { display: block; z-index: 0; inset: 0; border: 0; padding: 0; border-radius: inherit; background: radial-gradient(circle at 50% 50%,rgba(162,55,255,.08),transparent 46%); animation: none; pointer-events: none; }
.marketplace-project .product-preview-card .generated-image-wrap .image-lightbox-trigger {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  overflow: hidden;
}
.marketplace-project .product-preview-card .generated-image-wrap .result-image {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border: 0;
  border-radius: 0;
  object-fit: contain !important;
  object-position: center;
  box-shadow: none;
}
.marketplace-project .product-preview-card .result-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  width: calc(100% - 32px);
  max-width: none;
  height: auto;
  min-height: 260px;
  margin: 16px auto 0;
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid rgba(217,104,255,.52);
  border-radius: 16px;
  background: #120d17;
  box-shadow: 0 18px 42px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.035);
}
.marketplace-project .product-preview-card .result-placeholder strong { color: #f3e7f6; font-size: 18px; }
.marketplace-project .product-preview-card .result-placeholder small { max-width: 250px; margin-top: 8px; line-height: 1.45; }
.marketplace-project .product-preview-card .product-generation-preview { margin-top: 16px; }
.marketplace-project .product-preview-card .product-generation-preview > .product-generating { z-index: 1; }
.marketplace-project .product-preview-card .product-generation-preview > .ad-editor-generation-note { z-index: 4; }

/* Version rail: arrows and metadata mirror the approved other branches. */
.marketplace-project .product-preview-card .image-version-switcher {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 34px;
  grid-template-rows: auto auto;
  grid-template-areas: "prev items next" "meta meta meta";
  align-items: center;
  width: calc(100% - 40px);
  min-height: 0;
  margin: 20px auto 0;
  gap: 0;
  color: var(--editor-muted);
  font-size: 12px;
}
.marketplace-project .product-preview-card .image-version-arrow:first-child { grid-area: prev; justify-self: start; }
.marketplace-project .product-preview-card .image-version-arrow:nth-of-type(2) { grid-area: next; justify-self: end; }
.marketplace-project .product-preview-card .image-version-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(217,104,255,.38);
  border-radius: 50%;
  color: #f6e3fb;
  background: rgba(35,17,45,.9);
  font-size: 17px;
  line-height: 1;
}
.marketplace-project .product-preview-card .image-version-items {
  grid-area: items;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  max-width: none;
  overflow-x: auto;
}
.marketplace-project .product-preview-card .image-version-item {
  display: block;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  padding: 2px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  opacity: .68;
  cursor: pointer;
  transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease,opacity .18s ease;
}
.marketplace-project .product-preview-card .image-version-item.is-current {
  position: relative;
  z-index: 2;
  border-color: #e35bff;
  box-shadow: 0 0 0 2px rgba(215,68,255,.18),0 0 18px rgba(215,68,255,.22);
  opacity: 1;
  transform: scale(1.08);
}
.marketplace-project .product-preview-card .image-version-item img { display: block; width: 100%; height: 100%; border-radius: 7px; object-fit: cover; pointer-events: none; }
.marketplace-project .product-preview-card .image-version-meta { grid-area: meta; margin-top: 9px; color: #9f91a5; font-size: 11px; text-align: center; }
.marketplace-project .product-preview-card .image-version-meta strong { color: #f2cfff; }
.marketplace-project .product-preview-card .series-base-switcher { margin-top: 14px; }

@media(max-width:700px) {
  .marketplace-project .product-preview-card { border-radius: 18px; }
  .marketplace-project .product-preview-card > .product-source-materials { margin: 14px 12px 0; }
  .marketplace-project .product-preview-card .ad-editor-source-grid { grid-template-columns: 1fr; gap: 9px; }
  .marketplace-project .product-preview-card .ad-editor-source-card { min-height: 86px; }
  .marketplace-project .product-preview-card .ad-editor-source-thumb { width: 64px; height: 64px; }
  .marketplace-project .product-preview-card .image-area { padding: 0 12px 14px; }
  .marketplace-project .product-preview-card .generated-image-wrap,
  .marketplace-project .product-preview-card .result-placeholder { width: calc(100% - 24px); margin-top: 12px; }
  .marketplace-project .product-preview-card .image-version-switcher { width: calc(100% - 24px); margin-top: 16px; }
  .marketplace-project .product-preview-card .image-version-items { gap: 6px; }
  .marketplace-project .product-preview-card .image-version-item { flex-basis: 52px; width: 52px; height: 52px; }
}

/* Product workspace controls use the same dark native menu and quiet violet focus glow. */
.marketplace-project select{color-scheme:dark;appearance:none;-webkit-appearance:none;padding-right:42px!important;background-color:#121017;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23e99cff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-position:right 14px center;background-repeat:no-repeat;background-size:16px}
.marketplace-project select option,.marketplace-project select optgroup{color:#f3eef7;background:#121017}
.marketplace-project select:focus,.marketplace-project select:focus-visible{border-color:rgba(218,92,255,.82)!important;outline:2px solid rgba(218,92,255,.64)!important;outline-offset:1px!important;box-shadow:0 0 0 3px rgba(185,75,255,.14),0 8px 24px rgba(71,18,92,.12)!important}
.marketplace-project select option:checked{color:#fff;background-color:#5b1d75;background-image:linear-gradient(135deg,#5b1d75,#792a82)}

/* Natural page flow: the site header and footer remain reachable by wheel scroll. */
body:has(.marketplace-project){overflow-y:auto}
.marketplace-project{height:auto;min-height:calc(100vh - 104px);overflow:visible;padding-top:22px;padding-bottom:28px}
.marketplace-project .marketplace-project-head{margin-bottom:12px}.marketplace-project .marketplace-project-head h1{font-size:clamp(36px,3.5vw,52px);line-height:.98;letter-spacing:-.06em;margin-bottom:5px}.marketplace-project .project-meta{font-size:14px;color:var(--muted)}
.marketplace-project .generation-bar{min-height:58px;margin-bottom:16px;padding:12px 16px}.marketplace-project .generation-label,.marketplace-project .card-kicker{font-size:10px}.marketplace-project .generation-copy h2{font-size:18px}.marketplace-project .generation-copy p{font-size:13px;line-height:1.35}.marketplace-project .generation-action{gap:12px}.marketplace-project .generation-cost{font-size:13px}.marketplace-project .generation-action .button{padding:9px 13px;font-size:13px}
.marketplace-project .marketplace-workspace{grid-template-columns:minmax(0,3fr) minmax(340px,2fr);gap:22px;min-height:0}.marketplace-project .result-area{grid-template-rows:auto auto auto}.marketplace-project .result-heading{margin-bottom:8px}.marketplace-project .result-heading h2{font-size:21px}.marketplace-project .visual-layout{min-height:clamp(460px,60vh,560px);grid-template-columns:116px minmax(0,1fr);gap:18px}.marketplace-project .visual-layout:not(:has(.reference-rail)){grid-template-columns:minmax(0,1fr)}.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{width:min(100%,420px);height:clamp(460px,60vh,560px);max-height:none}.marketplace-project .reference-rail{gap:12px}.marketplace-project .reference-rail .reference-thumb{width:104px;height:136px}.marketplace-project .reference-rail .reference-item{font-size:11px}
.marketplace-project .result-actions{margin-top:12px;gap:9px}.marketplace-project .result-actions .button{padding:9px 13px;font-size:13px}.marketplace-project .info-card{padding:18px}.marketplace-project .info-section+.info-section{margin-top:16px;padding-top:16px}.marketplace-project .info-section h2{font-size:20px;margin-bottom:10px}.marketplace-project .compact-parameters,.marketplace-project .compact-text{font-size:14px;line-height:1.35;gap:7px 14px}.marketplace-project .project-text{max-height:110px}.marketplace-project .series-stage{min-height:74px;margin-top:16px;padding:12px 16px}.marketplace-project .series-stage strong{font-size:16px}.marketplace-project .series-stage p{font-size:12px}
@media (min-width:1001px) and (max-height:820px){.marketplace-project .visual-layout{min-height:clamp(420px,56vh,500px)}.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{height:clamp(420px,56vh,500px)}.marketplace-project .reference-rail .reference-thumb{height:120px}}
@media (max-width:1000px){body:has(.marketplace-project){overflow-y:auto}.marketplace-project{height:auto;min-height:0;padding-top:34px;padding-bottom:42px}.marketplace-project .marketplace-workspace{grid-template-columns:1fr;gap:18px}.marketplace-project .visual-layout{min-height:0}.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{height:auto;min-height:300px}.marketplace-project .info-card{padding:16px}.marketplace-project .compact-parameters,.marketplace-project .compact-text{font-size:13px}.marketplace-project .series-stage{min-height:0}}

/* Keep the completed-stage actions compact while giving the 3:4 slide room to show in full. */
.marketplace-project .series-stage{min-height:0;margin-top:10px;padding:8px 10px}
.marketplace-project .series-stage-actions{justify-content:flex-start;margin:0}
.marketplace-project .image-area{overflow:visible}
.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{width:min(100%,500px);height:auto;aspect-ratio:3 / 4}
.marketplace-project .result-image{width:100%;height:100%;object-fit:contain!important}
@media (max-width:600px){.marketplace-project .series-stage-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;margin:0}.marketplace-project .series-stage-actions form,.marketplace-project .series-stage-actions .button{width:100%}.marketplace-project .series-stage-actions form:last-child{grid-column:1/-1}.marketplace-project .series-stage-actions .button{text-align:center}}

/* Put the actions beneath the parameters panel and keep the main slide compact. */
.marketplace-project .marketplace-workspace{align-items:start}
.marketplace-project .result-column{display:block}
.marketplace-project .parameters-column{display:flex;flex-direction:column;gap:10px;align-items:stretch}
.marketplace-project .info-card{height:auto}
.marketplace-project .visual-layout{min-height:0}
.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{width:min(100%,360px);height:auto;aspect-ratio:3 / 4}
.marketplace-project .image-area{overflow:visible}
.marketplace-project .result-image{width:100%;height:100%;object-fit:contain!important}
.marketplace-project .marketplace-actions-bar{width:100%;margin:0;padding:8px 10px}
.marketplace-project .marketplace-actions-bar .series-stage-actions{justify-content:flex-start}
@media (max-width:600px){.marketplace-project .marketplace-actions-bar{padding:8px}.marketplace-project .marketplace-actions-bar .series-stage-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Keep the project identity in the header, enlarge the product reference, and give actions a readable 2x2 layout. */
.marketplace-project .reference-rail .reference-thumb{width:116px;height:150px}
.marketplace-project .marketplace-actions-bar .series-stage-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:10px}
.marketplace-project .marketplace-actions-bar .series-stage-actions form{display:block;width:100%}
.marketplace-project .marketplace-actions-bar .series-stage-actions .button{width:100%;min-height:42px;padding:10px 12px;font-size:13px;line-height:1.15;text-align:center;white-space:normal}
@media (max-width:600px){.marketplace-project .reference-rail .reference-thumb{width:106px;height:86px}.marketplace-project .marketplace-actions-bar .series-stage-actions{gap:8px}.marketplace-project .marketplace-actions-bar .series-stage-actions .button{min-height:40px;padding:9px 10px;font-size:12px}}

/* Final composition: align the result and parameters cards, with actions below the parameters. */
.marketplace-project .marketplace-workspace{align-items:stretch}
.marketplace-project .result-column{display:flex;flex-direction:column;min-height:0}
.marketplace-project .result-area{height:100%}
.marketplace-project .parameters-column{display:flex;flex-direction:column;gap:10px;min-height:0}
.marketplace-project .info-card{height:100%}
.marketplace-project .result-heading h2{font-size:20px}
.marketplace-project .project-panel-id{margin:2px 0 11px;color:#dc74f3;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.marketplace-project .visual-layout{grid-template-columns:150px minmax(0,1fr);min-height:0}
.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{width:min(100%,340px);height:auto;aspect-ratio:3 / 4}
.marketplace-project .reference-rail{width:150px}
.marketplace-project .reference-rail .reference-thumb{width:136px;height:176px}
.marketplace-project .marketplace-actions-bar{flex:0 0 auto}
@media (max-width:1000px){.marketplace-project .marketplace-workspace{align-items:stretch}.marketplace-project .visual-layout{grid-template-columns:1fr}.marketplace-project .reference-rail{width:100%}.marketplace-project .image-lightbox-trigger,.marketplace-project .result-placeholder{width:min(100%,380px)}.marketplace-project .info-card{height:auto}}
@media (max-width:600px){.marketplace-project .reference-rail{width:100%}.marketplace-project .reference-rail .reference-thumb{width:112px;height:90px}.marketplace-project .project-panel-id{font-size:11px;letter-spacing:.05em}}

/* Align the reference and the generated slide to the same upper edge. */
.marketplace-project .visual-layout{align-items:start}
.marketplace-project .image-area{place-items:start center}
.marketplace-project .reference-rail{align-self:start}

/* Final visual polish for the approved desktop composition. */
.marketplace-project .generated-slide-item{display:grid;justify-items:center;gap:7px;width:min(100%,370px)}
.marketplace-project .generated-image-wrap{position:relative;isolation:isolate;display:grid;place-items:center;width:100%;height:auto;aspect-ratio:3 / 4}
.marketplace-project .generated-image-wrap::before{content:"";position:absolute;inset:8% 4%;background:radial-gradient(ellipse at center,rgba(194,55,255,.14) 0%,rgba(110,48,180,.07) 42%,transparent 72%);filter:blur(32px);z-index:-1;pointer-events:none}
.marketplace-project .generated-image-wrap .image-lightbox-trigger{width:100%;height:100%;overflow:visible}
.marketplace-project .generated-image-wrap .result-image{display:block;width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain!important;object-position:center;border:0;box-shadow:0 26px 55px rgba(0,0,0,.38)}
.marketplace-project .info-card{background:linear-gradient(145deg,rgba(255,255,255,.018),rgba(255,255,255,.004)),rgba(18,14,23,.95)}
.marketplace-project .marketplace-workspace{gap:18px}
.marketplace-project .marketplace-actions-bar .series-stage-actions{gap:10px}
.marketplace-project .marketplace-actions-bar .action-primary,.marketplace-project .marketplace-actions-bar .action-next,.marketplace-project .marketplace-actions-bar .action-secondary{transition:background .18s ease,border-color .18s ease,transform .18s ease,box-shadow .18s ease}
.marketplace-project .marketplace-actions-bar .action-primary{background:linear-gradient(135deg,#b52cff,#ed48dc);border-color:rgba(255,196,255,.78);color:#fff;box-shadow:0 9px 22px rgba(203,45,235,.28)}
.marketplace-project .marketplace-actions-bar .action-next{background:linear-gradient(135deg,#c33cff,#f05be3);border-color:rgba(255,205,255,.82);color:#fff;box-shadow:0 9px 22px rgba(214,54,233,.24)}
.marketplace-project .marketplace-actions-bar .action-secondary{background:rgba(28,18,34,.88);border:1px solid rgba(211,72,255,.34);color:#f4eaf7;box-shadow:0 4px 12px rgba(0,0,0,.16)}
.marketplace-project .marketplace-actions-bar .action-primary:hover,.marketplace-project .marketplace-actions-bar .action-next:hover{transform:translateY(-1px);filter:brightness(1.05);box-shadow:0 10px 24px rgba(203,45,235,.34)}
.marketplace-project .marketplace-actions-bar .action-secondary:hover{background:rgba(50,25,59,.95);border-color:rgba(224,104,255,.62);transform:translateY(-1px);box-shadow:0 6px 15px rgba(92,29,111,.22)}
@media (min-width:1001px) and (min-height:760px){body:has(.marketplace-project){overflow-y:hidden}.marketplace-project{height:calc(100vh - 100px);overflow:hidden}}

/* Keep the reference label beneath its image and make the result glow gently visible. */
.marketplace-project .reference-rail .reference-item>span{color:var(--muted);font-size:11px;line-height:1.2}
.marketplace-project .generated-image-caption{color:var(--muted);font-size:11px;line-height:1.2;text-align:center}
.marketplace-project .generated-image-wrap::before{inset:-14% -18%;background:radial-gradient(ellipse at center,rgba(194,55,255,.26) 0%,rgba(120,48,180,.15) 42%,rgba(82,35,142,.08) 58%,transparent 78%);filter:blur(32px);transform:scale(1.02)}
.marketplace-project .generated-image-wrap::after{content:"";position:absolute;z-index:-1;left:-16%;right:-16%;bottom:-5%;height:38%;background:radial-gradient(ellipse at center,rgba(194,55,255,.18) 0%,rgba(92,68,180,.09) 46%,transparent 76%);filter:blur(26px);pointer-events:none;opacity:.9}
.marketplace-project .generated-image-wrap .image-lightbox-trigger{transition:transform .2s ease,filter .2s ease}
.marketplace-project .generated-image-wrap .result-image{transition:opacity .22s ease,transform .22s ease,box-shadow .2s ease,filter .2s ease}
.marketplace-project .generated-image-wrap.is-switching .result-image{opacity:0;transform:scale(1.02)}
.marketplace-project .generated-image-wrap:hover .image-lightbox-trigger{transform:translateY(-2px)}
.marketplace-project .generated-image-wrap:hover .result-image{filter:brightness(1.02);box-shadow:0 29px 58px rgba(0,0,0,.4)}
.marketplace-project .reference-rail .reference-thumb{transition:transform .18s ease,border-color .18s ease}
.marketplace-project .reference-rail .reference-thumb:hover{transform:scale(1.025)}
@media(prefers-reduced-motion:reduce){.marketplace-project .generated-image-wrap .image-lightbox-trigger,.marketplace-project .generated-image-wrap .result-image,.marketplace-project .reference-rail .reference-thumb{transition:none!important}.marketplace-project .generated-image-wrap:hover .image-lightbox-trigger{transform:none}}

/* Calm entrance sequence for the production project workspace. */
@keyframes marketplace-enter-up{from{opacity:0;transform:translateY(14px);filter:blur(4px)}to{opacity:1;transform:translateY(0);filter:blur(0)}}
@keyframes marketplace-enter-soft{from{opacity:0;transform:translateY(10px) scale(.985);filter:blur(3px)}to{opacity:1;transform:translateY(0) scale(1);filter:blur(0)}}
@media (prefers-reduced-motion:no-preference){
  .marketplace-project .marketplace-project-head .eyebrow{animation:marketplace-enter-up .46s cubic-bezier(.22,.7,.25,1) .04s both}
  .marketplace-project .marketplace-project-head h1{animation:marketplace-enter-up .62s cubic-bezier(.22,.7,.25,1) .12s both}
  .marketplace-project .generated-image-wrap{animation:marketplace-enter-soft .58s cubic-bezier(.22,.7,.25,1) .28s both}
  .marketplace-project .info-card{animation:marketplace-enter-up .56s cubic-bezier(.22,.7,.25,1) .22s both}
  .marketplace-project .reference-rail .reference-item{animation:marketplace-enter-soft .46s cubic-bezier(.22,.7,.25,1) both}
  .marketplace-project .reference-rail .reference-item:nth-child(1){animation-delay:.32s}
  .marketplace-project .reference-rail .reference-item:nth-child(2){animation-delay:.43s}
  .marketplace-project .marketplace-actions-bar .series-stage-actions>*{animation:marketplace-enter-up .42s cubic-bezier(.22,.7,.25,1) both}
  .marketplace-project .marketplace-actions-bar .series-stage-actions>*:nth-child(1){animation-delay:.5s}
  .marketplace-project .marketplace-actions-bar .series-stage-actions>*:nth-child(2){animation-delay:.59s}
  .marketplace-project .marketplace-actions-bar .series-stage-actions>*:nth-child(3){animation-delay:.68s}
  .marketplace-project .marketplace-actions-bar .series-stage-actions>*:nth-child(4){animation-delay:.77s}
}
@media(prefers-reduced-motion:reduce){
  .marketplace-project .marketplace-project-head .eyebrow,.marketplace-project .marketplace-project-head h1,.marketplace-project .generated-image-wrap,.marketplace-project .info-card,.marketplace-project .reference-rail .reference-item,.marketplace-project .marketplace-actions-bar .series-stage-actions>*{animation:none!important;opacity:1!important;filter:none!important;transform:none!important}
}

/* Small product flow indicator and status treatment. */
.marketplace-project .project-steps{margin:-2px 0 12px;padding:0 2px}
.marketplace-project .project-steps ol{display:flex;align-items:center;gap:0;margin:0;padding:0;list-style:none}
.marketplace-project .project-step{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:11px;font-weight:700;letter-spacing:.01em;white-space:nowrap}
.marketplace-project .project-step:not(:last-child)::after{content:"";display:block;width:42px;height:1px;margin:0 12px;background:rgba(217,104,255,.24)}
.marketplace-project .project-step-dot{display:grid;place-items:center;width:21px;height:21px;border:1px solid rgba(255,255,255,.18);border-radius:50%;color:var(--muted);font-size:10px;line-height:1}
.marketplace-project .project-step.is-active{color:#f3d8fa}.marketplace-project .project-step.is-active .project-step-dot{border-color:rgba(235,105,255,.84);background:rgba(215,68,255,.16);color:#f6b4ff;box-shadow:0 0 14px rgba(215,68,255,.2)}
.marketplace-project .project-step.is-complete{color:#d6f6e9}.marketplace-project .project-step.is-complete .project-step-dot{border-color:rgba(92,220,173,.62);background:rgba(41,160,121,.14);color:#8ee9c5}
.marketplace-project .project-status-badge{display:inline-flex;align-items:center;min-height:22px;padding:3px 9px;border:1px solid rgba(97,226,180,.55);border-radius:999px;background:rgba(47,170,128,.1);color:#9df0ca;font-size:11px;font-weight:800;letter-spacing:.01em;box-shadow:0 0 18px rgba(71,209,160,.14)}
.marketplace-project .project-status-badge.is-working{border-color:rgba(224,117,255,.58);background:rgba(215,68,255,.12);color:#edb4ff;box-shadow:0 0 18px rgba(215,68,255,.16)}

@keyframes marketplace-status-pulse{0%,100%{box-shadow:0 0 12px rgba(71,209,160,.1)}50%{box-shadow:0 0 22px rgba(71,209,160,.28)}}
@keyframes marketplace-progress-sweep{0%{transform:translateX(-120%)}55%,100%{transform:translateX(300%)}}
@keyframes marketplace-progress-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:no-preference){
  .marketplace-project .project-status-badge:not(.is-working){animation:marketplace-status-pulse 2.8s ease-in-out 1s 2}
}
.marketplace-project .progress{position:relative;display:flex;align-items:center;gap:8px;overflow:hidden;padding:10px 12px;border:1px solid rgba(224,117,255,.3);background:rgba(215,68,255,.1)}
.marketplace-project .generation-progress::before{content:"✦";display:inline-block;flex:0 0 auto;color:#f0a9ff;font-size:13px}
.marketplace-project .generation-progress::after{content:"";position:absolute;left:0;bottom:0;width:34%;height:2px;background:linear-gradient(90deg,transparent,#e45dff,#fff0ff,transparent);filter:drop-shadow(0 0 5px rgba(228,93,255,.75));transform:translateX(-120%)}
@media (prefers-reduced-motion:no-preference){.marketplace-project .generation-progress::before{animation:marketplace-progress-spin 1.8s linear infinite}.marketplace-project .generation-progress::after{animation:marketplace-progress-sweep 1.8s ease-in-out infinite}}
@media (max-width:600px){.marketplace-project .project-steps{margin-bottom:10px}.marketplace-project .project-step{font-size:10px}.marketplace-project .project-step:not(:last-child)::after{width:24px;margin:0 8px}.marketplace-project .project-step-dot{width:20px;height:20px}}
@media(prefers-reduced-motion:reduce){.marketplace-project .project-status-badge,.marketplace-project .generation-progress::before,.marketplace-project .generation-progress::after{animation:none!important}.marketplace-project .generation-progress::after{transform:none;opacity:.7}}

/* Keep version navigation directly below the generated image. */
.marketplace-project .image-version-switcher{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:8px;color:var(--muted);font-size:12px}
.marketplace-project .image-version-arrow{display:grid;place-items:center;width:32px;height:30px;padding:0;border:1px solid rgba(217,104,255,.42);border-radius:9px;background:rgba(36,18,48,.86);color:#f5ddfa;font-size:18px;line-height:1;transition:background .18s ease,border-color .18s ease,opacity .18s ease,transform .18s ease}
.marketplace-project .image-version-arrow:hover:not(:disabled){background:rgba(91,28,145,.9);border-color:rgba(237,135,255,.8);transform:translateY(-1px)}
.marketplace-project .image-version-arrow:disabled{opacity:.3;cursor:not-allowed}
.marketplace-project .image-version-counter{min-width:84px;text-align:center}
.marketplace-project .image-version-counter strong{color:#f2d5ff}
.marketplace-project .generic-image-version-wrap{display:flex;flex-direction:column;align-items:center;width:100%;height:100%}
.marketplace-project .generic-image-version-wrap .image-version-switcher{flex:0 0 auto}
@media(max-width:600px){.marketplace-project .image-version-switcher{gap:10px}.marketplace-project .image-version-arrow{width:36px;height:34px}}

/* Zoom-safe product scrolling: viewport zoom must not turn the document into a clipped canvas. */
@media (min-width:1001px) and (min-height:700px){
  body:has(.marketplace-project):not(.mobile-menu-open):not(.app-news-modal-open):not(.drawer-open){overflow-y:auto!important}
  .marketplace-project{height:auto!important;overflow:visible!important}
}

/* Final cascade guard for the shared product preview. */
.marketplace-project .product-preview-card .image-version-item.is-current {
  border-color: #e35bff !important;
  box-shadow: 0 0 0 2px rgba(215,68,255,.18),0 0 18px rgba(215,68,255,.22) !important;
  opacity: 1 !important;
  transform: scale(1.08) !important;
}
.marketplace-project .product-preview-card .image-version-switcher {
  margin-top: 20px !important;
}
.marketplace-project .product-preview-card .image-version-meta {
  grid-area: meta !important;
  margin-top: 9px !important;
}
@media(max-width:700px) {
  .marketplace-project .product-preview-card .image-version-switcher { margin-top: 16px !important; }
}

/* Do not let the legacy full-canvas lightbox rule stretch source cards. */
.marketplace-project .product-preview-card .ad-editor-source-card {
  display: grid !important;
  grid-template-columns: 74px minmax(0,1fr) auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 96px !important;
  aspect-ratio: auto !important;
  box-sizing: border-box;
}
.marketplace-project .product-preview-card .ad-editor-source-thumb {
  display: grid !important;
  width: 74px !important;
  height: 74px !important;
  min-height: 74px !important;
  aspect-ratio: 1 / 1 !important;
}
.marketplace-project .product-preview-card .ad-editor-source-thumb img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}
@media(max-width:700px) {
  .marketplace-project .product-preview-card .ad-editor-source-card {
    grid-template-columns: 64px minmax(0,1fr) auto !important;
    min-height: 86px !important;
  }
  .marketplace-project .product-preview-card .ad-editor-source-thumb {
    width: 64px !important;
    height: 64px !important;
    min-height: 64px !important;
  }
}

/* On desktop, place project parameters beside the generated slide rather than above the source materials. */
@media (min-width:1001px) {
  .marketplace-project:has(.product-source-materials) .parameters-column {
    align-self: start;
    margin-top: 213px;
  }
  .marketplace-project:has(.product-source-materials) .parameters-column .info-card {
    height: auto;
  }
}

/* Keep version arrows next to the thumbnail rail and remove its inner scrollbar. */
.marketplace-project .product-preview-card .image-version-switcher {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: fit-content !important;
  max-width: calc(100% - 24px) !important;
  overflow: visible !important;
}
.marketplace-project .product-preview-card .image-version-items {
  display: flex !important;
  flex: 0 1 auto !important;
  align-items: center;
  justify-content: center;
  max-width: 100% !important;
  overflow: hidden !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  padding: 3px 2px !important;
}
