/* PV LAB public Image entry. Only the signed-out preview uses these rules.
   Private galleries, wallet balances and generation remain behind Clerk. */
#main:has(#gate.pv-guest-image:not([hidden])){
  width:100%;max-width:none;padding:0!important;overflow:clip;
}
#gate.pv-guest-image:not([hidden]){
  display:block;position:relative;isolation:isolate;width:100%;max-width:none;
  min-height:calc(100dvh - var(--lab-header-height,75px));margin:0!important;
  padding:0!important;border:0;border-radius:0;background:#0c0e13;overflow:hidden;
}
/* Reuse the approved cobalt/copper plate from signed-in welcome/Inspiration. */
#gate.pv-guest-image:before{
  content:"";position:absolute;inset:0;z-index:-2;pointer-events:none;
  background:url("./visuals/pvlab-subtle-cinematic-background-20261017.webp") center center/cover no-repeat;
  opacity:1;filter:none;
}
#gate.pv-guest-image:after{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:linear-gradient(180deg,rgba(2,4,8,.16) 0%,rgba(2,4,8,.035) 38%,rgba(2,4,8,.08) 74%,rgba(3,4,7,.25) 100%);
}
@media(min-width:681px){
  /* The writing deck changes section height. Frame both layers against the
     viewport so opening/closing it cannot rescale the artwork or its shade. */
  html:not(.pv-native-lab) #gate.pv-guest-image:before,
  html:not(.pv-native-lab) #gate.pv-guest-image:after{background-attachment:fixed}
  html:not(.pv-native-lab) #gate.pv-guest-image:after{background-size:100vw 100dvh}
}
#gate.pv-guest-image .pv-guest-content{
  position:relative;z-index:1;max-width:1720px;margin:0 auto;padding:
    clamp(37px,6vh,74px) clamp(20px,2.6vw,46px) 80px;
  display:flex;flex-direction:column;align-items:center;text-align:center;
}
#gate .pv-guest-kicker{color:#d1cbca;font-size:10px;letter-spacing:.36em;line-height:1.4}
#gate.pv-guest-image h1{
  margin:15px 0 0;font:400 clamp(32px,3.3vw,54px)/1.09 'DM Sans',Arial,sans-serif;
  letter-spacing:-.048em;color:#f8f8f8;text-wrap:balance;
}
#gate .pv-guest-subtitle{margin:13px 0 0;font:400 14px/1.55 'DM Sans',Arial,sans-serif;color:#d4d0d1}
#gate .pv-guest-credit-note{margin:12px 0 0;color:#c9c6c9;font-size:12px}
#gate .pv-guest-credit-note strong{color:#fff;font-weight:650}
#gate .pv-guest-cards{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:clamp(9px,1vw,18px);
  width:100%;margin:31px 0 0;
}
#gate .pv-guest-card{
  appearance:none;position:relative;display:block;min-width:0;width:100%;
  height:clamp(275px,40vh,405px);padding:0;margin:0;overflow:hidden;
  color:#fff;text-align:left;cursor:pointer;background:#111216;
  border:1px solid rgba(255,255,255,.24);border-radius:13px;
  box-shadow:0 14px 33px rgba(0,0,0,.38);transition:transform .2s,border-color .2s,box-shadow .2s;
}
#gate .pv-guest-card img{
  position:absolute;inset:0;display:block;width:100%;height:100%;
  object-fit:cover;object-position:center;filter:brightness(.94);transition:transform .28s,filter .28s;
}
#gate .pv-guest-card:nth-child(3) img{object-position:64% center}
#gate .pv-guest-card:nth-child(5) img{object-position:50% center}
#gate .pv-guest-card:after{
  content:"";position:absolute;inset:37% 0 0;pointer-events:none;
  background:linear-gradient(transparent 24%,rgba(0,0,0,.16) 55%,rgba(0,0,0,.78));
}
#gate .pv-guest-card span{
  position:absolute;bottom:17px;left:18px;right:12px;z-index:1;
  display:block;font:430 clamp(16px,1.28vw,21px)/1.2 'DM Sans',Arial,sans-serif;
  white-space:nowrap;letter-spacing:-.025em;text-shadow:0 2px 12px #0009;
}
#gate .pv-guest-card small{
  display:block;margin-top:9px;color:#e5e2e0;
  font:400 clamp(8px,.6vw,10px)/1.2 'DM Sans',Arial,sans-serif;letter-spacing:.19em;
}
#gate .pv-guest-card:hover,#gate .pv-guest-card:focus-visible{
  transform:translateY(-2px);border-color:#f9f0eb;
  box-shadow:0 0 0 1px #eaded777,0 13px 35px #0009;
}
#gate .pv-guest-card:hover img{filter:brightness(1);transform:scale(1.026)}
#gate .pv-guest-card[aria-pressed=true]{
  border-color:#f0d9c9;box-shadow:0 0 0 1px #f5dccba0,0 0 26px #f3c8a144,0 18px 38px #0009;
}
#gate .pv-guest-card:focus-visible{outline:2px solid #fff;outline-offset:3px}
/* Guest shell mirrors the working Image instrument. It remains a public
   preview: only the seven Inspiration cards and typing work without sign-in. */
#gate .pv-guest-composer{
  display:block;box-sizing:border-box;width:min(1120px,100%);margin:35px auto 0;
  padding:14px 16px;text-align:left;background:rgba(22,23,27,.88);
  border:1px solid #c9c8c453;border-radius:19px;
  box-shadow:0 24px 85px #000a;backdrop-filter:blur(24px);
}
#gate .pv-guest-sr-only{
  position:absolute!important;width:1px!important;height:1px!important;overflow:hidden;
  clip:rect(0,0,0,0)!important;white-space:nowrap;
}
#gate .pv-guest-composer textarea,
#gate .pv-guest-composer textarea:focus,
#gate .pv-guest-composer textarea:focus-visible{
  box-sizing:border-box;display:block;width:100%;height:46px;min-height:46px;max-height:150px;
  margin:0;padding:10px 8px;resize:none;white-space:nowrap;overflow:hidden;
  color:#f4f3f0;background:transparent!important;border:0!important;
  outline:none!important;box-shadow:none!important;caret-color:#f4f3f0;
  font:400 14px/1.5 'DM Sans',Arial,sans-serif;letter-spacing:0;
  transition:none!important;
}
#gate .pv-guest-composer textarea::placeholder{color:#ccc8c5}
#gate .pv-guest-composer-footer{display:flex;align-items:center;gap:12px;justify-content:space-between}
#gate .pv-guest-settings{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-width:0}
#gate .pv-guest-setting{
  appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:5px;
  min-height:36px;box-sizing:border-box;padding:7px 10px;white-space:nowrap;
  border-radius:9px;border:1px solid #ffffff24;background:#242629;
  color:#e9e7e5;font:500 11px/1.2 'DM Sans',Arial,sans-serif;cursor:pointer;
}
#gate button.pv-guest-setting:hover{background:#353638;border-color:#ffffff48;color:#fff}
#gate button.pv-guest-setting:focus-visible{outline:2px solid #f2efeb;outline-offset:2px}
#gate .pv-guest-chevron{color:#a7a8a8;font-size:13px;line-height:.8}
#gate .pv-guest-model{font-weight:600}
#gate .pv-guest-icon{flex:none;width:36px;padding:0;font-size:20px;font-weight:400}
#gate .pv-guest-icon svg{display:block}
#gate #pv-guest-moods{color:#f4efe7}
#gate .pv-guest-expanded-only{display:none}
#gate #pv-guest-generate{
  flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-width:138px;min-height:66px;gap:3px;padding:10px 14px;cursor:pointer;
  color:#19191a;background:#f2efeb;border:1px solid #f6f3f0;border-radius:12px;
  font:600 14px/1.25 'DM Sans',Arial,sans-serif;
}
#gate #pv-guest-generate:hover{background:#fff}
#gate #pv-guest-generate small{font-size:10px;font-weight:400;opacity:.7}
/* Keep the exact approved compact welcome when nothing long is being written. */
@media(min-width:900px){
  #gate.pv-guest-image .pv-guest-composer:not(.pv-deck-expanded){
    display:flex;align-items:center;gap:12px;width:min(1090px,100%);
    min-height:78px;padding:10px 14px;
  }
  #gate.pv-guest-image .pv-guest-composer:not(.pv-deck-expanded)>.pv-guest-prompt-row>textarea{
    flex:1 1 210px;min-width:130px;height:46px;min-height:46px;max-height:46px;
    margin:0;padding:11px 7px;
  }
  #gate.pv-guest-image .pv-guest-composer:not(.pv-deck-expanded) .pv-guest-composer-footer{
    flex:0 0 auto;display:flex;align-items:center;gap:10px;
  }
  #gate.pv-guest-image .pv-guest-composer:not(.pv-deck-expanded) .pv-guest-settings{
    flex-wrap:nowrap;gap:6px;
  }
  #gate.pv-guest-image .pv-guest-composer:not(.pv-deck-expanded) #pv-guest-generate{
    min-width:132px;min-height:51px;
  }
}
/* Show the same principal tools on a full desktop entrance. Their existing
   actions remain local photo selection, Inspiration, or real sign-in. */
@media(min-width:1180px){
  #gate.pv-guest-image .pv-guest-composer:not(.pv-deck-expanded){width:min(1200px,100%)}
  #gate.pv-guest-image .pv-guest-composer:not(.pv-deck-expanded)
    :is(#pv-guest-library,#pv-guest-base,#pv-guest-resolution){display:inline-flex}
}
/* Multi-line state uses the signed-in two-row composition: one unframed
   writing surface, instruments below and Generate spanning both rows. */
@media(min-width:681px){
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded{
    display:grid;grid-template-columns:minmax(0,1fr) 126px;
    grid-template-rows:minmax(50px,auto) 40px;
    column-gap:13px;row-gap:7px;align-items:stretch;
    width:min(990px,100%);padding:11px 13px 12px;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded>.pv-guest-prompt-row>textarea{
    grid-area:1 / 1;min-width:0;min-height:50px;max-height:150px;
    padding:8px 6px;resize:none;white-space:pre-wrap;
    overflow-x:hidden;overflow-y:auto;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded .pv-guest-composer-footer{
    display:contents;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded .pv-guest-settings{
    grid-area:2 / 1;flex-wrap:nowrap;min-width:0;max-width:100%;
    overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded .pv-guest-settings::-webkit-scrollbar{display:none}
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded .pv-guest-expanded-only{display:inline-flex}
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded #pv-guest-generate{
    grid-area:1 / 2 / 3 / 3;align-self:stretch;
    min-width:0;width:100%;min-height:68px;
  }
}
@media(min-width:1180px){
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded{
    width:min(1120px,100%);padding:14px 20px;
    grid-template-columns:minmax(0,1fr) 144px;
    grid-template-rows:minmax(82px,auto) 41px;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded>.pv-guest-prompt-row>textarea{
    min-height:78px;font-size:15.5px;line-height:1.48;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded .pv-guest-setting{min-height:40px}
}
/* Mid-size screens keep every visible tool readable, without a fake clipped menu. */
@media(min-width:681px) and (max-width:1099px){
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded .pv-guest-expanded-only{display:none}
}
#gate .pv-guest-auth-status:empty{display:none}
#gate .pv-guest-auth-status{margin:17px 0 0;color:#c8c4c4;font-size:11px;line-height:1.5}
#gate .pv-guest-retry{margin:11px auto 0;padding:10px 15px;background:#27292e;color:#fff;border:1px solid #ccc7c3;border-radius:9px;cursor:pointer}
#studio-header #signin.pv-guest-signin:not([hidden]){
  display:inline-flex;align-items:center;justify-content:center;
  flex:none;min-height:42px;padding:10px 21px;
  border-radius:20px;background:#eeeae5;color:#181818;border:1px solid #e9e5e0;
  font:600 13px/1 'DM Sans',Arial,sans-serif;cursor:pointer;
}
#studio-header #signin.pv-guest-signin:disabled{opacity:.55;cursor:wait}
body:has(#gate.pv-guest-image:not([hidden])) #studio-header #identity,
body:has(#gate.pv-guest-image:not([hidden])) #tool-assets{display:none!important}
@media(max-width:1150px){
  #gate .pv-guest-cards{grid-template-columns:repeat(3,minmax(0,1fr));max-width:850px}
  #gate .pv-guest-card{height:clamp(275px,34vw,360px)}
  #gate .pv-guest-content{padding-bottom:56px}
}
@media(max-width:900px){
  body:has(#gate.pv-guest-image:not([hidden]))>#studio-header{height:auto!important;min-height:0}
  body:has(#gate.pv-guest-image:not([hidden]))>#studio-header .wrap.top{height:auto!important;min-height:0}
  #gate.pv-guest-image h1{font-size:clamp(29px,5vw,42px)}
}
@media(max-width:680px){
  #gate .pv-guest-content{padding:40px 15px 65px}
  #gate .pv-guest-kicker{font-size:9px;letter-spacing:.24em}
  #gate.pv-guest-image h1{font-size:clamp(27px,6vw,37px);line-height:1.12;margin-top:12px}
  #gate .pv-guest-subtitle{max-width:360px;margin-top:10px;font-size:12px}
  #gate .pv-guest-credit-note{font-size:11px;margin-top:11px}
  #gate .pv-guest-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:23px}
  #gate .pv-guest-card{height:clamp(210px,63vw,310px);border-radius:11px}
  #gate .pv-guest-card span{font-size:16px;left:12px;bottom:14px}
  #gate .pv-guest-card small{font-size:8px;letter-spacing:.1em;margin-top:6px}
  #gate .pv-guest-composer{padding:15px 13px 13px;margin-top:24px;border-radius:16px}
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded>.pv-guest-prompt-row>textarea{
    min-height:104px;max-height:132px;white-space:pre-wrap;
    overflow-x:hidden;overflow-y:auto;
  }
  #gate .pv-guest-composer-footer{flex-direction:column;align-items:stretch}
  #gate .pv-guest-settings{gap:6px}
  #gate .pv-guest-setting{font-size:10px;padding:7px 10px;min-height:34px}
  #gate #pv-guest-generate{width:100%;min-height:52px;flex-direction:row;gap:9px}
  #gate #pv-guest-generate small{font-size:10px}
  #studio-header #signin.pv-guest-signin:not([hidden]){padding:8px 13px;min-height:33px;font-size:11px}
}
@media(max-width:360px){
  #gate .pv-guest-card{height:195px}
  #gate .pv-guest-card span{font-size:14px}
}
@media(prefers-reduced-motion:reduce){
  #gate .pv-guest-card,#gate .pv-guest-card img{transition:none!important}
}

/* 2026-10-17: mobile Image entrance only. Desktop and other tools are untouched. */
@media(max-width:680px){
  /* About 15% less vertical scrolling, preserving two photo columns. */
  #gate.pv-guest-image .pv-guest-card{
    height:clamp(178px,53.5vw,264px);
  }
  #gate.pv-guest-image .pv-guest-composer{
    scroll-margin-top:98px;
    scroll-margin-bottom:24px;
  }
  /* The in-app browser chrome cannot be changed; compact only PV LAB's bar. */
  body:has(#gate.pv-guest-image:not([hidden]))>#studio-header.pv-mobile-entry-condensed{
    height:78px!important;min-height:78px!important;
  }
  body:has(#gate.pv-guest-image:not([hidden]))>#studio-header.pv-mobile-entry-condensed .wrap.top{
    height:78px!important;min-height:0!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-areas:'brand actions' 'nav nav'!important;
    grid-template-rows:39px 35px!important;
    padding:2px 14px!important;row-gap:0!important;
  }
  body:has(#gate.pv-guest-image:not([hidden]))>#studio-header.pv-mobile-entry-condensed .lab-brand{
    font-size:15px;
  }
  body:has(#gate.pv-guest-image:not([hidden]))>#studio-header.pv-mobile-entry-condensed #signin.pv-guest-signin{
    min-height:30px!important;padding:6px 12px!important;
  }
}
@media(max-width:360px){
  #gate.pv-guest-image .pv-guest-card{height:166px}
}


/* Closed Clerk identity recovery stays separate from the public Create flow.
   Never offer a disabled purchase as though the account were active. */
#gate .pv-guest-closed-state[hidden]{display:none!important}
#gate .pv-guest-closed-state{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;
  column-gap:18px;row-gap:10px;
  max-width:min(920px,100%);margin:18px auto 0;padding:13px 19px;
  background:rgba(13,14,16,.9);border:1px solid rgba(237,235,230,.24);
  border-radius:13px;color:#f5f3ee;text-align:left;
}
#gate .pv-guest-closed-state strong{font-size:13px;font-weight:600}
#gate .pv-guest-closed-state p{
  flex:1 1 250px;margin:0;color:#c6c3c0;font:400 12px/1.6 'DM Sans',Arial,sans-serif;
}
#gate .pv-guest-closed-state button,#gate .pv-guest-closed-state a{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:35px;padding:8px 12px;border-radius:8px;
  font:600 11px/1.2 'DM Sans',Arial,sans-serif;text-decoration:none;cursor:pointer;
}
#gate .pv-guest-closed-state button{background:#eeeae5;color:#161719;border:1px solid #eeeae5}
#gate .pv-guest-closed-state a{background:transparent;color:#d9d7d3;border:1px solid #5f6161}
#gate .pv-guest-closed-state :is(button,a):focus-visible{outline:2px solid white;outline-offset:2px}

/* The guest can select local photo references before any private API call.
   Thumbnails occupy a photo row ABOVE the tool row, never push the dock
   below its controls or create a nested prompt border. */
#gate .pv-guest-attachments[hidden]{display:none!important}
#gate .pv-guest-attachments{
  display:flex;align-items:center;gap:8px;overflow-x:auto;overflow-y:hidden;
  min-width:0;max-width:100%;height:62px;padding:2px 3px 3px;
  scrollbar-width:thin;
}
#gate .pv-guest-photo{
  position:relative;flex:0 0 55px;width:55px;height:55px;
  border:1px solid #676866;border-radius:8px;background:#111216;overflow:hidden;
}
#gate .pv-guest-photo img{display:block;width:100%;height:100%;object-fit:cover}
#gate .pv-guest-photo-remove{
  position:absolute;top:2px;right:2px;
  display:grid;place-items:center;width:20px;height:20px;min-width:20px;
  border:1px solid #bbb6b3;border-radius:50%;
  background:rgba(8,9,10,.88);color:#f5f3ef;font:600 15px/1 Arial,sans-serif;
  cursor:pointer;
}
#gate .pv-guest-photo-remove:focus-visible{outline:2px solid #fff;outline-offset:1px}
@media(min-width:681px){
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded:has(#pv-guest-attachments:not([hidden])){
    grid-template-rows:minmax(50px,auto) 62px 40px;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded .pv-guest-attachments{grid-area:2 / 1}
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded:has(#pv-guest-attachments:not([hidden])) .pv-guest-settings{
    grid-area:3 / 1;
  }
  #gate.pv-guest-image .pv-guest-composer.pv-deck-expanded:has(#pv-guest-attachments:not([hidden])) #pv-guest-generate{
    grid-area:1 / 2 / 4 / 3;
  }
}
@media(max-width:680px){
  #gate .pv-guest-closed-state{align-items:stretch;text-align:center}
  #gate .pv-guest-closed-state p{flex-basis:100%}
  #gate .pv-guest-attachments{height:58px;padding:4px 0}
  #gate .pv-guest-photo{flex-basis:49px;width:49px;height:49px}
}

/* The guest prompt uses the same semantic top row as the real instrument. */
#gate .pv-guest-composer>.pv-guest-prompt-row{display:contents}
#gate .pv-guest-settings>:is(.composer-add-wrap,.scene-image-library-wrap,.composer-model-wrap,.composer-mood-control){display:contents}
#gate #pv-guest-exact{display:none}

#gate.pv-guest-image .pv-guest-selected-tool[hidden]{display:none!important}
#gate.pv-guest-image .pv-guest-selected-tool{
  box-sizing:border-box;display:flex;flex-direction:column;align-items:center;gap:20px;
  width:min(590px,100%);margin:42px auto 0;padding:30px 24px;
  border:1px solid rgba(255,255,255,.20);border-radius:14px;
  background:rgba(17,19,22,.88);box-shadow:0 20px 65px rgba(0,0,0,.45);
}
#gate.pv-guest-image .pv-guest-selected-tool p{
  margin:0;max-width:43ch;text-align:center;
  color:#d4d0d1;font:400 14px/1.6 'DM Sans',Arial,sans-serif;
}
#gate.pv-guest-image .pv-guest-selected-tool button{
  appearance:none;min-height:45px;padding:11px 21px;border:1px solid #f5f2ee;
  border-radius:9px;background:#eeebe7;color:#151618;
  font:600 13px/1.3 'DM Sans',Arial,sans-serif;cursor:pointer;
}
#gate.pv-guest-image .pv-guest-selected-tool button:hover{background:#fff}
#gate.pv-guest-image .pv-guest-selected-tool button:focus-visible{
  outline:2px solid #fff;outline-offset:3px;
}

/* Public views reuse the approved tool decks. Private regions stay absent. */
#app[data-guest-preview] :is(.archive,#video-inspector-selected,#connection,#logout){display:none!important}
body:has(#app[data-guest-preview]) #studio-header #identity{display:none!important}
/* Keep one Sign in in the public masthead and no private Assets icon.
   The signed-in account header retains its existing Assets shortcut. */
body:has(#app[data-guest-preview]) #studio-header #tool-assets{display:none!important}
/* Image and Fashion reserve a classic 15px root scrollbar gutter. Only the
   shorter guest Upscaler/Retouch previews need a compensating right inset. */
@media(min-width:1180px) and (min-height:680px){
  body:has(#app[data-guest-preview="upscale"]) > #studio-header .wrap.top,
  body:has(#app[data-guest-preview="retouch"]) > #studio-header .wrap.top{
    padding-right:31px;
  }
}

/* Optional Scene Reference shares the existing guest attachment dimensions. */
#gate .pv-guest-scene-marker{position:absolute;bottom:2px;left:3px;padding:1px 3px;border-radius:2px;background:rgba(0,0,0,.8);color:#f0efed;font:700 8px/1.3 Arial,sans-serif;letter-spacing:.025em;pointer-events:none}
