/* Revisit the six-card Inspiration view without changing private History or image generation. */
#app.image-studio-active .image-studio .history-head-actions{
  grid-template-columns:110px 54px 62px 12px 34px;
}
#history-moods-toggle{display:none}
#app.image-studio-active #history-moods-toggle{
  display:inline-flex;grid-column:1;grid-row:1;align-items:center;justify-content:center;gap:6px;
  width:100%;height:32px;min-height:32px;min-width:0;padding:5px 8px;
  box-sizing:border-box;white-space:nowrap;
}
/* Inspiration: soft silver light outside the button, no highlighted outline. */
#app.image-studio-active:not(.pv-moods-discovery-open) .image-studio #history-moods-toggle{
  border-color:#383b42;
  box-shadow:0 0 12px rgba(241,242,247,.13),0 0 26px rgba(241,242,247,.065);
  transition:box-shadow .25s ease,background-color .25s ease,color .25s ease;
}
#app.image-studio-active:not(.pv-moods-discovery-open) .image-studio #history-moods-toggle:is(:hover,:focus-visible){
  border-color:#383b42;
  box-shadow:0 0 17px rgba(241,242,247,.22),0 0 34px rgba(241,242,247,.11);
}
#app.image-studio-active .image-studio #history-select{grid-column:2;grid-row:1}
#app.image-studio-active .image-studio #refresh{grid-column:3;grid-row:1}
#app.image-studio-active #history-preview-toggle{grid-column:5;grid-row:1}
#history-moods-toggle svg{
  display:block;width:13px;height:13px;flex:none;fill:none;stroke:currentColor;
  stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round
}
#history-moods-toggle .history-view-icon{display:none}
#app.pv-moods-discovery-open #history-moods-toggle .mood-view-icon{display:none}
#app.pv-moods-discovery-open #history-moods-toggle .history-view-icon{display:block}
#app.image-studio-active.pv-moods-discovery-open #history-moods-toggle{
  color:#f0eeea;border-color:rgba(237,233,226,.36);background:rgba(44,45,48,.7)
}
#app.image-studio-active:not(.pv-moods-discovery-open)
  .image-gallery-shell:has(#image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden]))
  #history-moods-toggle{visibility:hidden;pointer-events:none}
/* The discovery view reuses the real first-image gallery; cards in History remain mounted. */
#app.image-studio-active.pv-moods-discovery-open #history,
#app.image-studio-active.pv-moods-discovery-open #history-selection,
#app.image-studio-active.pv-moods-discovery-open #more{display:none!important}
html:not(.pv-image-previews-hidden) #app.image-studio-active.pv-moods-discovery-open
  .image-gallery-shell>.image-gallery-host:has(.card[data-kind="image"]) + #image-gallery-empty{
  display:flex!important
}
/* Discreet Mode always takes precedence; a Mood tile must never appear under the eye. */
html.pv-image-previews-hidden #app.image-studio-active.pv-moods-discovery-open #image-gallery-empty{
  display:none!important
}
/* Discreet Mode hides Inspiration in both History and the discovery view.
   Visibility keeps its grid slot reserved so the eye stays anchored. */
html.pv-image-previews-hidden #app.image-studio-active #history-moods-toggle{
  visibility:hidden!important;pointer-events:none!important
}
html.pv-image-previews-hidden #app.image-studio-active.pv-moods-discovery-open
  .image-gallery-shell:has(#image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden]))::before{
  background-image:
    radial-gradient(ellipse 115% 85% at 50% 44%,transparent 28%,rgba(3,5,10,.28) 100%),
    linear-gradient(180deg,rgba(9,12,18,.23) 0%,rgba(9,12,18,.075) 34%,rgba(9,12,18,.17) 56%,rgba(4,6,12,.67) 100%),
    url('./visuals/open-atmosphere-hd.jpg')!important;
  background-size:cover,cover,cover!important;
  background-position:center,center,center center!important;
  filter:none!important;opacity:1!important
}
html.pv-image-previews-hidden #app.image-studio-active.pv-moods-discovery-open
  .image-gallery-shell:has(#image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden]))::after{
  background:none!important
}
@media(max-width:700px){
  /* Inspiration stays recognizable on phones instead of becoming an unexplained star. */
  #app.image-studio-active .image-studio .history-head-actions{
    grid-template-columns:80px 50px 58px 8px 34px;column-gap:4px
  }
  #app.image-studio-active #history-moods-toggle{padding:0 7px;gap:5px}
  #app.image-studio-active #history-moods-toggle .mood-view-label{
    display:inline;font-size:11px;line-height:1.2
  }
  #app.image-studio-active:not(.pv-moods-discovery-open) #history-moods-toggle .mood-view-label{
    font-size:0
  }
  #app.image-studio-active:not(.pv-moods-discovery-open) #history-moods-toggle .mood-view-label::after{
    content:"Inspire";font-size:11px
  }
  #history-moods-toggle svg{width:15px;height:15px}
  /* While looking at Moods there is no visible History to Select or Refresh. */
  #app.image-studio-active.pv-moods-discovery-open .image-studio .history-head-actions{
    grid-template-columns:91px 34px
  }
  #app.image-studio-active.pv-moods-discovery-open .image-studio #history-moods-toggle{grid-column:1}
  #app.image-studio-active.pv-moods-discovery-open .image-studio #history-preview-toggle{grid-column:2}
  #app.image-studio-active.pv-moods-discovery-open .image-studio #history-select,
  #app.image-studio-active.pv-moods-discovery-open .image-studio #refresh{
    display:none!important
  }
  /* Drop History's vacant viewport spacer so the six real Mood cards start immediately. */
  #app.image-studio-active.pv-moods-discovery-open .image-studio .archive{
    min-height:0!important;padding-bottom:0!important
  }
  #app.image-studio-active.pv-moods-discovery-open .image-gallery-empty:has(#lab-welcome-start:not([hidden])){
    padding-top:16px!important
  }
}
@media(max-width:360px){
  /* Narrow phones retain the star icon rather than squeezing Select and Refresh. */
  #app.image-studio-active:not(.pv-moods-discovery-open) .image-studio .history-head-actions{
    grid-template-columns:34px 50px 58px 8px 34px
  }
  #app.image-studio-active:not(.pv-moods-discovery-open) #history-moods-toggle .mood-view-label{
    display:none
  }
}
@media(prefers-reduced-motion:reduce){
  #history-moods-toggle{transition:none!important}
}


/* 2026-10-19: mobile Inspiration / first-image welcome, not generated History.
   The earlier 100dvh + 200px gallery minimum kept an empty lower viewport
   after the cards. The composer already has its own 255px clearance.
   Let the shell size to real welcome content, without changing the dock. */
@media(max-width:680px){
  html:not(.pv-native-lab) #app.image-studio-active:not([hidden])
    .image-gallery-shell:has(> #image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden])){
    min-height:0!important;
    height:auto!important;
  }
  html:not(.pv-native-lab) #app.image-studio-active:not([hidden])
    .image-gallery-shell:has(> #image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden]))
    > .image-gallery-host > .archive{
    min-height:0!important;
    padding-bottom:0!important;
  }
  /* In mobile mode this is a normal-flow section; keep bottom clearance for
     the fixed Generate deck, but remove the phantom min-height above it. */
  html:not(.pv-native-lab) #app.image-studio-active:not([hidden])
    .image-gallery-shell:has(> #image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden]))
    > #image-gallery-empty{
    position:relative!important;
    inset:auto!important;
    min-height:0!important;
  }
  /* This approved desktop plate is wide. 'cover' crops away the cobalt/copper
     edges on a narrow portrait viewport. Display the full abstract color field
     behind mobile Inspiration instead of only its near-black center.
     Preserve the owner's preview-hidden atmosphere as a separate mode. */
  html:not(.pv-native-lab):not(.pv-image-previews-hidden)
    #app.image-studio-active:not([hidden])
    .image-gallery-shell:has(> #image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden]))::before{
    inset:0!important;
    height:100%!important;
    background:
      radial-gradient(ellipse 85% 56% at 0% 25%,rgba(20,88,167,.19),transparent 86%),
      radial-gradient(ellipse 83% 56% at 100% 64%,rgba(154,79,53,.16),transparent 86%),
      url("./visuals/pvlab-subtle-cinematic-background-20261017.webp") center center/100% 100% no-repeat!important;
    opacity:1!important;
    filter:none!important;
    transform:none!important;
  }
  /* The normal marketing footer must not extend the browse-only Inspiration
     view beyond the last Mood; ordinary image History still has its footer. */
  body:has(#app.image-studio-active.pv-moods-discovery-open:not([hidden]) #lab-welcome-start:not([hidden]))
    > footer.pv-lab-footer{display:none!important}
}

/* Inspiration is a primary gallery destination. Keep utility controls at the
   opposite edge, with the full label visible even on narrow phones. */
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead{
  min-height:48px;box-sizing:border-box;
}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead>div:last-child{
  flex:1;width:100%;margin-left:0;
}
html:not(.pv-native-lab) #app.image-studio-active:not(.pv-moods-discovery-open) .image-studio .archivehead .history-head-actions{
  width:100%;grid-template-columns:minmax(148px,1fr) 54px 62px 74px 34px 12px 34px;
  align-items:center;
}
html:not(.pv-native-lab) #app.image-studio-active:not(.pv-moods-discovery-open) .image-studio .archivehead #history-preview-toggle{grid-column:7;grid-row:1}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #image-gallery-filters{grid-column:5;grid-row:1}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle{
  justify-self:start;width:auto;min-width:148px;height:36px;min-height:36px;
  padding:0 16px;gap:8px;border-color:#e1e2dc;border-radius:8px;
  background:#e1e2dc;color:#171917;box-shadow:none;
  font-size:14px;line-height:1;font-weight:600;letter-spacing:-.015em;
}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle .mood-view-label{
  display:inline;font-size:inherit;
}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle .mood-view-label::after{content:none}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle svg{width:16px;height:16px}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle:hover{
  background:#f5f5ee;border-color:#f5f5ee;color:#101210;box-shadow:none;
}
html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle:focus-visible{
  outline:2px solid #f5f5ee;outline-offset:4px;box-shadow:none;
}
html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open .image-studio .archivehead #history-moods-toggle{
  background:#292c29;border-color:#777d74;color:#f0f1e9;
}
@media(max-width:700px){
  html:not(.pv-native-lab) #app.image-studio-active:not(.pv-moods-discovery-open) .image-studio .archivehead .history-head-actions{
    grid-template-columns:minmax(106px,1fr) 40px 48px 32px 34px 0 30px;gap:4px;
  }
  html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle{
    min-width:106px;max-width:148px;height:34px;min-height:34px;padding:0 7px;gap:5px;font-size:12px;
  }
  html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-moods-toggle svg{width:14px;height:14px}
  html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead :is(#history-select,#refresh){
    min-width:0;padding:5px 3px;font-size:10px;
  }
  html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #history-preview-toggle{width:30px;min-width:30px}
  html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #image-gallery-view>summary{width:32px}
  html:not(.pv-native-lab) #app.image-studio-active .image-studio .archivehead #image-gallery-view .image-gallery-view-panel{right:-38px}
}

/* Keep the one-row utilities readable on narrow phones; Inspiration and the
   privacy eye remain in their original positions. No extra filter row. */
@media(max-width:360px){
  html:not(.pv-native-lab) #app.image-studio-active:not(.pv-moods-discovery-open) .image-studio .archivehead .history-head-actions{
    grid-template-columns:minmax(106px,1fr) 36px 44px 30px 30px 0 30px;gap:3px
  }
  html:not(.pv-native-lab) #app.image-studio-active:not(.pv-moods-discovery-open) .image-studio .archivehead #image-gallery-filters>summary{
    width:30px
  }
}


/* Inspiration landing switch: anchor independently of prompt/deck dimensions.
   Preserve the existing toggle and its gallery return behavior. */
html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
  .image-studio .archivehead{
  position:absolute;
  top:12px;
  left:clamp(20px,7.7vw,136px);
  right:auto;
  width:auto;
  min-height:0;
  margin:0;
  padding:0;
  z-index:80;
  pointer-events:auto;
}
html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
  .image-studio .archivehead>div:last-child{
  flex:none;
  width:auto;
  margin:0;
}
html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
  .image-studio .archivehead .history-head-actions{
  display:flex;
  width:auto;
  grid-template-columns:none;
  gap:0;
}
html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
  .image-studio .archivehead #history-moods-toggle{
  display:inline-flex;
  position:relative;
  z-index:81;
  justify-content:center;
  width:148px;
  min-width:148px;
  height:36px;
  min-height:36px;
  padding:0 14px;
  border:1px solid #777d74;
  border-radius:8px;
  background:#292c29;
  color:#f0f1e9;
  font-size:14px;
  font-weight:600;
}
html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
  .image-studio .archivehead :is(#history-select,#refresh,#image-gallery-view,#image-gallery-filters){
  display:none!important;
}
/* Discreet Mode remains in the upper-right without shifting the History switch. */
html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
  .image-studio .archivehead #history-preview-toggle{
  position:fixed;
  top:104px;
  right:27px;
  z-index:81;
  width:34px;
  min-width:34px;
}
@media(max-width:700px){
  html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
    .image-studio .archivehead{
    top:10px;
    left:20px;
  }
  html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
    .image-studio .archivehead #history-moods-toggle{
    width:106px;
    min-width:106px;
    height:34px;
    min-height:34px;
    padding:0 7px;
    font-size:12px;
  }
  html:not(.pv-native-lab) #app.image-studio-active.pv-moods-discovery-open
    .image-studio .archivehead #history-preview-toggle{
    top:104px;
    right:20px;
  }
}

/* Public Inspiration has no private-preview action. Retain the Show control
   on a concealed canvas so an existing saved preference cannot trap a user. */
html:not(.pv-native-lab):not(.pv-image-previews-hidden) #app.image-studio-active:is(.pv-moods-discovery-open,:has(#image-gallery-empty:not([hidden]) #lab-welcome-start:not([hidden]))) #history-preview-toggle{display:none!important}
