/* Studio tab — the Generations design on PatchWork Standard tokens.
   Styling is applied inline by js/studio.js (var(--sl-*) tokens + .sl-*
   classes) so this file only carries what inline styles can't express:
   scrollbars, keyframes, placeholders, and the font baseline. Hover states are driven in
   JS (see the `hover:` option in the el() helper), mirroring the design's
   `style-hover` attribute. */

#home-tab-studio {
    padding: 0;
    height: 100%;
    min-height: 0;
    font-family: var(--sl-font-ui);
    color: var(--sl-text-1);
    background: var(--sl-app);
}
/* .studio-shell: the top bar (Skills / Templates / Products / Trending videos),
   then the gallery (.studio-root) or one of the bar's views below it. */
#home-tab-studio .studio-shell,
#home-tab-studio .studio-root { width: 100%; }
#home-tab-studio [data-studio-topbar]::-webkit-scrollbar { display: none; }
#home-tab-studio [data-studio-topbar] button:focus-visible { outline: 2px solid var(--sl-focus); outline-offset: 1px; }

#home-tab-studio ::-webkit-scrollbar { width: 8px; height: 8px; }
#home-tab-studio ::-webkit-scrollbar-thumb { background: var(--sl-control); border-radius: 4px; }
#home-tab-studio ::-webkit-scrollbar-track { background: transparent; }
#home-tab-studio textarea::placeholder,
#home-tab-studio input::placeholder { color: var(--sl-text-3); }

/* Overlays (lightbox, scene full, node graph) mount as a child of #home-screen
   so they paint with the home UI. #home-immersive-logo is z-index 10050 in that
   same context — keep the host below it or the Home mark is unclickable while
   the player is open. pointer-events:none on the empty host so it cannot steal
   clicks as a flex child of .home-screen. */
.studio-overlay ::-webkit-scrollbar { width: 8px; height: 8px; }
.studio-overlay ::-webkit-scrollbar-thumb { background: var(--sl-control); border-radius: 4px; }
.studio-overlay { font-family: var(--sl-font-ui); color: var(--sl-text-1); }
#home-screen > .studio-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
}
#home-screen > .studio-overlay > * { pointer-events: auto; }

@keyframes studio-genpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes studio-genspin { to { transform: rotate(360deg); } }

.studio-spin { animation: studio-genspin 1s linear infinite; }
.studio-pulse { animation: studio-genpulse 2s ease infinite; }

/* Gallery tiles: the hover row (select, actions, prompt) shows while the tile
   is hovered. It lets clicks through except on its buttons, so a failed
   tile's Try again under it stays clickable. */
.studio-tile:hover .studio-tile-hover { opacity: 1 !important; }

/* Buttons built from .sl-btn-* inside the gallery keep their icon at 13px. */
#home-tab-studio .sl-btn-primary svg, #home-tab-studio .sl-btn-secondary svg,
.studio-overlay .sl-btn-primary svg, .studio-overlay .sl-btn-secondary svg { flex: none; }
/* Settings popover rows sit on the menu recipe; the check marks the model in use. */
.studio-pop .sl-menu-item { flex: none; }
.studio-pop .sl-menu-item svg { color: var(--sl-link); }

/* Phone bottom sheets (filters, generation settings, references, menus):
   thumb-sized rows and controls. */
.studio-sheet .sl-menu-item { min-height: 44px; }
.studio-sheet .sl-input { min-height: 40px; }
.studio-sheet .sl-seg-btn { min-height: 36px; }
.studio-sheet input[type="range"] { min-height: 32px; }
body.pw-mobile #home-tab-studio .sl-btn-lg,
body.pw-mobile .studio-overlay .sl-btn-lg { height: 44px; }

/* Lightbox controls are real buttons: show where keyboard focus is. */
.studio-overlay .studio-lb-btn:focus-visible { outline: 2px solid var(--sl-focus); outline-offset: 2px; }

/* Studio → Skills: under the skill cards, the Marketplace's Skills section
   (js/market-items.js) flows with the view, which does the scrolling. */
.studio-market-host { flex: none; width: 100%; max-width: 980px; }
.studio-market-host > .br-page { height: auto; background: transparent; }
.studio-market-host .br-scroll { overflow: visible; }
.studio-market-host .br-body-pad { padding: 8px 0 0; }
/* A section under the view's own "Skills" title, so a smaller heading. */
.studio-market-host .mki-page-title { font-size: 17px; margin: 8px 0 12px; }

/* Generate's gallery: a node that waits for its Send (js/studio.js, "stacks").
   Send sits in the tile's top-right corner; on a narrow tile it is a round
   icon. The hover row's buttons sit left of it, and give way to it on a
   narrow tile (the lightbox has them). */
#home-tab-studio .studio-face.can-send { container-type: inline-size; }
#home-tab-studio .studio-send {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 11px 0 9px;
    border-radius: 8px;
    border: 1px solid oklch(1 0 0 / 0.18);
    background: var(--sl-accent);
    color: var(--sl-on-accent);
    font-family: var(--sl-font-ui);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.25), 0 2px 10px oklch(0 0 0 / 0.35);
    transition: filter 0.12s ease, transform 0.12s ease, opacity 0.14s ease;
}
#home-tab-studio .studio-send:hover { filter: brightness(1.1); }
#home-tab-studio .studio-send:active { transform: scale(0.96); }
#home-tab-studio .studio-send:focus-visible { outline: 2px solid var(--sl-focus); outline-offset: 2px; }
#home-tab-studio .studio-face.can-send > .studio-hover { opacity: 0; }
#home-tab-studio .studio-face.can-send:hover > .studio-hover { opacity: 1; }
#home-tab-studio .studio-face.can-send > [data-studio-tag] { transition: opacity 0.15s ease; }
#home-tab-studio .studio-face.can-send:hover > [data-studio-tag] { opacity: 0; }
#home-tab-studio .studio-face.can-send .studio-hover-top { padding-right: 84px; }
@container (max-width: 169px) {
    #home-tab-studio .studio-send.is-corner { width: 28px; height: 28px; padding: 0; justify-content: center; border-radius: 50%; }
    #home-tab-studio .studio-send.is-corner .studio-send-lbl { display: none; }
    #home-tab-studio .studio-face.can-send .studio-hover-top { padding-right: 42px; }
}
@container (max-width: 259px) {
    /* !important: the buttons carry an inline display. */
    #home-tab-studio .studio-face.can-send .studio-act { display: none !important; }
}
body.pw-mobile #home-tab-studio .studio-send { height: 32px; padding: 0 12px 0 10px; }
body.pw-mobile #home-tab-studio .studio-send.is-corner { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; }
body.pw-mobile #home-tab-studio .studio-send.is-corner .studio-send-lbl { display: none; }

/* The takes behind a stack's top card brighten, and a line fills along its
   bottom, while the pointer holds on it (HOLD_MS, set inline). */
#home-tab-studio .studio-peek { filter: brightness(0.55); transition: filter 0.5s ease; }
#home-tab-studio [data-studio-stack].is-arming .studio-peek { filter: brightness(0.85); }
#home-tab-studio .studio-hold-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    height: 3px;
    background: var(--sl-accent);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}
#home-tab-studio [data-studio-stack].is-arming .studio-hold-bar { animation: studio-hold 500ms linear forwards; }
@keyframes studio-hold { to { transform: scaleX(1); } }

/* An open stack's takes: Send shows on the take under the pointer only
   (always on a touch screen, which has no hover). */
#home-tab-studio .studio-spread-take::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 2px transparent;
    pointer-events: none;
    transition: box-shadow 0.12s ease;
}
#home-tab-studio .studio-spread-take:hover::after,
#home-tab-studio .studio-spread-take:focus-visible::after { box-shadow: inset 0 0 0 2px var(--sl-accent); }
#home-tab-studio .studio-spread-take:focus-visible { outline: none; }
#home-tab-studio .studio-spread-take .studio-send { opacity: 0; pointer-events: none; transform: translateY(-2px); }
#home-tab-studio .studio-spread-take:hover .studio-send,
#home-tab-studio .studio-spread-take:focus-within .studio-send,
#home-tab-studio .studio-spread.is-touch .studio-send { opacity: 1; pointer-events: auto; transform: none; }

/* Desktop app: the window is dragged by the title bar strip above Generate
   (css/shell.css). The canvas toolbar behind the home screen is hidden from
   the drag areas while the home screen is up, so nothing here drags. */
