/* ---- /css/studio.css ---- */
/* studio-panel-r96 (P1 left-panel visual). Loaded last in <head>, so it wins over the inline r26-r33 blocks.
   E-Labs tokens kept: violet primary #5b4ff5, lime New pill untouched. Numbers follow the hf-ai-image/-video specs:
   chips h32 r8 14/500, Generate h48 r12, ~8-10px block gaps, one 16px inset for every panel block. */
:root{
  --p96-ctl-border:#6e6e90;   /* control boundary: 3.85:1 on #111118, 3.7:1 on #16161f, 4.04:1 on #0a0a0f (WCAG 1.4.11) */
  --p96-fill:rgba(255,255,255,.05);
  --p96-text-2:#b4b4c8;       /* nav / secondary text 9.2:1 on #111118 */
  --p96-text-3:#9a9ab8;       /* muted text 6.6:1 on #16161f */
  --p96-link:#a5a0ff;         /* accent text 8.1:1 on #111118 (was #6c63ff 4.36:1) */
  --p96-violet:#5b4ff5;       /* DS primary, white text 5.41:1 */
  --p96-violet-hover:#4c40e6;
  --p96-violet-active:#3e33c8;
  --p96-inset:16px;
}

/* ---- Service nav rows: centred label/icon, one active treatment ---- */
.sidebar .snav-item{align-items:center;gap:10px;padding:6px 10px;min-height:44px;font-size:14px;line-height:20px;font-weight:500;color:var(--p96-text-2);border:1px solid transparent}
.sidebar .snav-item::before{display:none}
.sidebar .snav-item:hover{background:var(--p96-fill);border-color:transparent;color:#fff}
.sidebar .snav-item.active{background:rgba(108,99,255,.14);border-color:transparent;color:#fff}
.sidebar .snav-icon{width:32px;height:32px;margin-top:0;border-radius:8px;border-color:var(--p96-ctl-border);color:var(--p96-text-2)}
.sidebar .snav-item.active .snav-icon{background:rgba(108,99,255,.24);border-color:transparent;color:#d6d3ff;box-shadow:none}
.sidebar .snav-text{line-height:20px}
.sidebar .snav-pin-dot{margin:0 10px 0 2px}
.sidebar .badge{align-self:center;margin-top:0;font-size:12px;line-height:16px}
.sidebar .sidebar-section-lbl{font-size:12px;color:var(--p96-text-3)}
.sidebar .snav-coll-sum{font-size:12px}
.sidebar .snav-coll-sum-ic,.sidebar .acct-link,.flyout-expand,.home-sect-more,.tmpl-use,.svc-example-lbl{color:var(--p96-link)}
.dz-title span[style*="--accent"]{color:var(--p96-link)!important}

/* ---- Model row: inset card, same left edge as the other blocks ---- */
.tool-panel .model-row{margin:12px var(--p96-inset) 0;padding:12px 16px;border:1px solid var(--p96-ctl-border);border-radius:12px;background:var(--p96-fill);box-shadow:none}
.tool-panel .model-row:hover,.tool-panel .model-row[aria-expanded="true"]{background:rgba(108,99,255,.12);border-color:#a5a0ff;box-shadow:none}
.tool-panel .model-row:focus-visible{outline:2px solid #a5a0ff;outline-offset:2px;box-shadow:none}
.tool-panel .model-chip{box-shadow:none}
.tool-panel .model-lbl{font-size:12px;line-height:16px;font-weight:600;letter-spacing:.04em;color:#bcb3d7}
.tool-panel .model-name-txt{font-size:15px;line-height:20px;font-weight:600}
.tool-panel .chevron{color:#c7c3ff}

/* ---- Workspace blocks ---- */
.tool-panel .workspace{padding:12px var(--p96-inset) 8px}
.tool-panel .wcard{padding:14px 16px;border-radius:12px;margin-bottom:10px;border-color:rgba(210,211,242,.1)}
.tool-panel .wcard::before{display:none}
.tool-panel .wcard-sub{font-size:12.5px;color:var(--p96-text-3)}
.tool-panel textarea.wfield,.tool-panel select.wfield,.tool-panel input.wfield,.gen-param-group input{border:1px solid var(--p96-ctl-border)}
.tool-panel textarea.wfield::placeholder,.tool-panel input.wfield::placeholder{color:var(--p96-text-3)}
.tool-panel textarea.wfield{font-size:14px}
.tool-panel select.wfield{font-size:14px;min-height:40px}
.svc-hl{font-size:12px}
.svc-proof-badge{font-size:12px;letter-spacing:.04em}
.svc-proof-date{font-size:12px}
.svc-proof-caption{font-size:12.5px}

/* ---- Gen bar: one column, full-width Generate with the price inside ---- */
.tool-panel .gen-bar{display:flex!important;flex-direction:column;align-items:stretch;gap:8px;padding:12px var(--p96-inset) 14px;border-top:1px solid #2e2e44}
.tool-panel .gen-bar .gen-params{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px;margin:0}
.tool-panel .gen-bar #creditBadge{order:0;font-size:12px;font-weight:500;color:var(--p96-text-3);background:none;border:0;padding:0;border-radius:0;white-space:normal}
.tool-panel .gen-bar #creditRemain{font-size:12px!important;color:var(--p96-text-3)!important}
.tool-panel .gen-bar .gen-param-toggle{font-size:14px;font-weight:500;min-height:32px;padding:6px 12px;border-radius:8px;border:1px solid var(--p96-ctl-border);background:var(--p96-fill);color:#e8e8f0}
.tool-panel .gen-bar .gen-param-toggle.native-output-entry{min-height:32px;padding:6px 12px;font-size:14px;background:var(--p96-fill);border-color:var(--p96-ctl-border);color:#e8e8f0}
.tool-panel .gen-bar .gen-param-toggle:hover:not(:disabled),.tool-panel .gen-bar .gen-param-toggle.on{background:rgba(108,99,255,.14);border-color:#a5a0ff;color:#fff}
.tool-panel .gen-bar .gen-param-label,.tool-panel .gen-bar .gen-param-group label{font-size:12px;color:var(--p96-text-3)}
.tool-panel .gen-bar #studioPriceHint{font-size:12px!important;opacity:1!important;color:var(--p96-text-3);margin:0!important;white-space:normal!important}
.tool-panel .gen-bar #studioRetentionNotice{font-size:12px}
.tool-panel .gen-bar .btn-gen{width:100%;min-height:48px;padding:12px 16px!important;border-radius:12px;background:var(--p96-violet);border:1px solid var(--p96-violet);color:#fff;font-size:15px;font-weight:700;letter-spacing:0;box-shadow:none;white-space:normal}
.tool-panel .gen-bar .btn-gen:not(:disabled){border-color:var(--p96-violet);box-shadow:none}
.tool-panel .gen-bar .btn-gen:hover:not(:disabled){background:var(--p96-violet-hover);border-color:var(--p96-violet-hover);box-shadow:none}
.tool-panel .gen-bar .btn-gen:active:not(:disabled){background:var(--p96-violet-active);border-color:var(--p96-violet-active);box-shadow:none}
.tool-panel .gen-bar .btn-gen:focus-visible{outline:2px solid #a5a0ff;outline-offset:3px;box-shadow:none}
.tool-panel .gen-bar .btn-gen:disabled:not(.upgrade-gate){background:#302c39;color:#b8b3c2;border-color:#62596f}
.tool-panel .gen-bar #genBtn[data-price]::after{content:attr(data-price);font-weight:600;margin-left:2px;padding-left:10px;border-left:1px solid rgba(255,255,255,.4)}
.tool-panel .gen-bar #genBtn[data-price] .gen-arrow{display:none}
.btn-primary{background:var(--p96-violet)}

/* ---- P2: prompt + "Use this" under Studio home showcase tiles ---- */
.home-short-wrap{display:flex;flex-direction:column;gap:6px;min-width:0}
.home-short-model{font-size:12px}
.home-short-prompt{display:flex;flex-direction:column;gap:6px;min-width:0}
.home-short-prompt-kicker{font-size:12px;line-height:16px;font-weight:600;color:var(--p96-text-2);letter-spacing:.01em} /* r101 */
.home-short-prompt-text{margin:0;font-size:12px;line-height:16px;color:var(--p96-text-3);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.home-short-use{align-self:flex-start;min-height:32px;padding:6px 12px;border-radius:8px;border:1px solid var(--p96-ctl-border);background:var(--p96-fill);color:#e8e8f0;font-family:inherit;font-size:13px;line-height:18px;font-weight:500;cursor:pointer}
.home-short-use:hover{background:rgba(108,99,255,.14);border-color:#a5a0ff;color:#fff}
.home-short-use:focus-visible{outline:2px solid #a5a0ff;outline-offset:2px}

/* 12px floor for the remaining panel/rail labels found by the computed-style sweep */
.sidebar .sfooter-legal a,.sidebar .sfooter-copy,#bc,#bc *,.tool-panel .tool-lbl,.svc-example-lbl{font-size:12px}
.tool-panel .gen-bar #creditRemain:empty{display:none}

/* review-r98 fixes: (1) restore a visible focus edge on panel fields (r96 border rule outranked r95 textarea.wfield:focus);
   (2) Generate hover/active keep a >=3:1 edge against the gen-bar; (3) at phone width keep Generate clear of the fixed Pause-motion pill. */
.tool-panel textarea.wfield:focus,.tool-panel input.wfield:focus,.tool-panel select.wfield:focus,.gen-param-group input:focus{border-color:#ec83ff}
.tool-panel .gen-bar .btn-gen:hover:not(:disabled),.tool-panel .gen-bar .btn-gen:active:not(:disabled){border-color:#a5a0ff}
@media (max-width:480px){.tool-panel .gen-bar{padding-bottom:56px}}

/* ---- /css/studio-nav-vivid.css ---- */
/* studio-nav-vivid r108 (LOCAL-STAGED). Owner: vibrant CREATE nav (Home, Video, Image, Enhance, Audio / Voice).
   Hook rules: dark base + one glowing saturated accent per item. Gradient stops are chosen so white text/icons
   keep >= 4.5:1 on the lightest stop (tests/r108 contrast checks). Single active state (r101) unchanged in JS.
   r96 alignment/12px floor kept (no size/padding changes). Generate (violet) and lime New pills untouched. */
#snav .snav-item[data-svc="home"]{--nv-a:#4d7c0f;--nv-b:#6d28d9;--nv-glow:rgba(163,230,53,.55)}
#snav .snav-item[data-svc="social-clip"]{--nv-a:#be185d;--nv-b:#831843;--nv-glow:rgba(244,114,182,.6)}
#snav .snav-item[data-svc="text-to-image"]{--nv-a:#0e7490;--nv-b:#115e59;--nv-glow:rgba(34,211,238,.55)}
#snav .snav-item[data-svc="enhance"]{--nv-a:#b45309;--nv-b:#9a3412;--nv-glow:rgba(251,191,36,.55)}
#snav .snav-item[data-svc="text-to-audio"]{--nv-a:#7c3aed;--nv-b:#5b21b6;--nv-glow:rgba(167,139,250,.6)}
#snav .snav-item[data-svc]{color:#ececf4;position:relative;background-clip:padding-box;transition:background .15s,box-shadow .18s,color .15s}
#snav .snav-item[data-svc] .snav-icon{background:linear-gradient(135deg,var(--nv-a),var(--nv-b));border-color:transparent;color:#fff;box-shadow:0 2px 10px -2px var(--nv-glow)}
#snav .snav-item[data-svc]:hover,#snav .snav-item[data-svc]:focus-visible{color:#fff;background:linear-gradient(#15151d,#15151d) padding-box,linear-gradient(135deg,var(--nv-glow),rgba(255,255,255,.06)) border-box;border:1px solid transparent;box-shadow:0 0 18px -6px var(--nv-glow)}
#snav .snav-item[data-svc]:hover .snav-icon,#snav .snav-item[data-svc]:focus-visible .snav-icon{box-shadow:0 0 16px 1px var(--nv-glow)}
#snav .snav-item[data-svc].active{color:#fff;background:linear-gradient(135deg,var(--nv-a),var(--nv-b));border:1px solid rgba(255,255,255,.18);box-shadow:0 0 22px -4px var(--nv-glow),inset 0 1px 0 rgba(255,255,255,.14)}
#snav .snav-item[data-svc].active .snav-icon{background:linear-gradient(135deg,rgba(255,255,255,.26),rgba(255,255,255,.08));color:#fff;box-shadow:none;transform:none}
#snav .snav-item[data-svc].active .snav-text{font-weight:600}

/* ---- /css/studio-feature-landing.css ---- */
/* studio-landings-r100 (P6): Studio per-feature landing (#studioFeatureLanding). Media-first; tokens from studio.html :root. */
#studioFeatureLanding{flex-shrink:0;margin-bottom:20px;display:flex;flex-direction:column;gap:16px;min-width:0}
#studioFeatureLanding[hidden]{display:none}
.sfl-head{display:flex;flex-direction:column;gap:6px}
.sfl-kicker{font-size:.75rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#c4f24a}
.sfl-title{margin:0;font-size:1.75rem;line-height:1.15;font-weight:800;color:var(--text,#e8e8f0);letter-spacing:-.01em}
.sfl-value{margin:0;font-size:.95rem;line-height:1.5;color:#b9b9cf;max-width:60ch}
.sfl-modes{display:flex;flex-wrap:wrap;gap:8px}
.sfl-mode{min-height:36px;padding:6px 14px;border-radius:999px;border:1px solid #3a3a52;background:transparent;color:#d6d6e6;font:600 .82rem/1 inherit;font-family:inherit;cursor:pointer}
.sfl-mode:hover{border-color:#6c63ff;color:#fff}
.sfl-mode.is-on{background:#6c63ff;border-color:#6c63ff;color:#fff}
.sfl-mode:focus-visible,.sfl-use:focus-visible,.sfl-view:focus-visible{outline:2px solid #c4b5fd;outline-offset:2px}
.sfl-body{display:flex;flex-direction:column;gap:14px;min-width:0}
/* Example strip: up to three large media cards */
.sfl-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.sfl-strip__item{position:relative;margin:0;border-radius:14px;overflow:hidden;background:#111118;aspect-ratio:3/4;border:1px solid #2a2a3e}
.sfl-strip__item:first-child:last-child{grid-column:1/-1;aspect-ratio:16/9}
.sfl-strip__item img{width:100%;height:100%;object-fit:cover;display:block}
.sfl-strip__cap{position:absolute;left:0;right:0;bottom:0;padding:28px 12px 10px;background:linear-gradient(transparent,rgba(0,0,0,.82));display:flex;flex-direction:column;gap:2px}
.sfl-strip__title{font-size:.9rem;font-weight:700;color:#fff}
.sfl-strip__model{font-size:.75rem;color:#d4d4e4}
.sfl-from{position:absolute;top:8px;left:8px;display:flex;align-items:center;gap:6px;padding:3px 8px 3px 3px;border-radius:999px;background:rgba(10,10,15,.78);color:#fff;font-size:.72rem;font-weight:600}
.sfl-from img{width:26px;height:26px;border-radius:50%;object-fit:cover}
/* Preset tiles */
.sfl-sect{display:flex;align-items:baseline;justify-content:space-between}
.sfl-sect__title{margin:0;font-size:1.05rem;font-weight:700;color:var(--text,#e8e8f0)}
.sfl-tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}
.sfl-tile{display:flex;flex-direction:row;border-radius:12px;overflow:hidden;background:#13131c;border:1px solid #2a2a3e;min-width:0}
.sfl-tile__media{position:relative;flex:0 0 96px;align-self:stretch;min-height:128px;background:#0d0d14}
.sfl-tile__media .sfl-from{top:6px;left:6px;padding:2px}.sfl-tile__media .sfl-from span{display:none}.sfl-tile__media .sfl-from img{width:22px;height:22px}
.sfl-tile__media>img{width:100%;height:100%;object-fit:cover;display:block}
.sfl-tile__body{display:flex;flex-direction:column;gap:4px;padding:10px 10px 12px;min-width:0;flex:1}
.sfl-tile__title{font-size:.88rem;font-weight:700;color:#f0f0f8}
.sfl-tile__model{font-size:.75rem;color:#a9a9c2}
.sfl-tile__prompt{margin:2px 0 6px;font-size:.78rem;line-height:1.4;color:#c4c4d6;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.sfl-tile__actions{margin-top:auto;display:flex;gap:8px;align-items:center}
.sfl-use{min-height:36px;padding:0 14px;border-radius:9px;border:0;background:#6c63ff;color:#fff;font:700 .8rem/1 inherit;font-family:inherit;cursor:pointer}
.sfl-use:hover{background:#7d75ff}
.sfl-view{min-height:36px;display:inline-flex;align-items:center;padding:0 10px;border-radius:9px;color:#d6d6e6;font-size:.8rem;font-weight:600;text-decoration:none;border:1px solid #3a3a52}
.sfl-view:hover{border-color:#6c63ff;color:#fff}
.sfl-empty{padding:16px 18px;border-radius:12px;border:1px dashed #3a3a52;background:#111118}
.sfl-empty p{margin:0;font-size:.9rem;line-height:1.5;color:#c4c4d6}
.sfl-note{margin:0;font-size:.78rem;color:#a9a9c2}
/* Prefill note in the left panel */
.sfl-prefill-note{position:relative;border-left:3px solid var(--accent,#6c63ff);font-size:.84rem;line-height:1.45;padding-right:44px;margin-bottom:10px;overflow-wrap:anywhere}
.sfl-prefill-note.is-warn{border-left-color:#eab308}
.sfl-prefill-note a{color:#c4b5fd}
.sfl-prefill-note__x{position:absolute;top:6px;right:6px;width:36px;height:36px;display:flex;align-items:center;justify-content:center;background:none;border:0;color:inherit;cursor:pointer;border-radius:8px}
@media (max-width:900px){.sfl-title{font-size:1.45rem}}
@media (max-width:600px){
  .sfl-strip{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:10px;padding-bottom:4px}
  .sfl-strip__item{flex:0 0 72%;scroll-snap-align:start}
  .sfl-strip__item:first-child:last-child{flex-basis:100%}
  .sfl-tiles{grid-template-columns:minmax(0,1fr)}
  .sfl-tile__body{padding:8px 8px 10px}
  .sfl-use{flex:1;min-height:40px}
}
@media (prefers-reduced-motion:reduce){.sfl-strip{scroll-behavior:auto}}

/* ---- /css/studio-media-fit-r108.css ---- */
/* studio-media-fit r108 (owner 11-09): every box takes its media's shape, so nothing is cropped badly or spills.
   Recorded-example images (landing strip + tiles) have their own ratios: the box follows the image instead of a
   fixed 3:4 / 16:9 frame. Featured 16:9 + reel 16:9 boxes hold landscape clips only (see landing-motion-r107.js). */
.sfl-strip{align-items:start}
.sfl-strip__item,.sfl-strip__item:first-child:last-child{aspect-ratio:auto}
.sfl-strip__item:first-child:last-child{max-width:520px;justify-self:start}
.sfl-strip__item img{height:auto}
.sfl-tile__media{align-self:flex-start;min-height:0}
.sfl-tile__media>img{height:auto}
/* Studio Suite tool cards: 16:9 boxes (city-run, neon-street-trio, music-video-dj are landscape). */
#homePanel .home-tool-media{aspect-ratio:16/9;height:auto}
/* Media whose shape differs from its box by >20% (e.g. the portrait Enhance clip, portrait Community items):
   shown whole (contain) over a blurred copy of itself, so no subject is cut and nothing spills. Set by JS. */
.r108-contain{background:#07070c}
.r108-contain::before{content:"";position:absolute;inset:-12px;z-index:0;background:var(--r108-bg) center/cover no-repeat;filter:blur(18px) brightness(.55);pointer-events:none}
#homePanel .r108-contain>img,#homePanel .r108-contain>video,.r108-contain>img,.r108-contain>video{object-fit:contain!important;z-index:1}

/* ---- /css/landing-motion-r107.css ---- */
/* landing-motion r107 (owner 11-09). 1) Studio home card containment: every image/clip fills its card and is clipped to it
   (object-fit:cover, absolute inset, overflow hidden, paint containment); Community Gallery strip uses the same column
   rhythm as Featured Creations instead of 2 oversized columns. 2) Owner motion clips on Featured Creations and on the
   Studio Video / Image feature landings (reel = slideshow). Motion is played by js/elabs-motion-autoplay.js (cap 6,
   Pause motion). Under prefers-reduced-motion the r107 script never creates the <video>, so posters show. */

/* ---- 1. Containment ------------------------------------------------------------------------------------------- */
#homePanel .home-inner{overflow-x:hidden}
#homePanel .home-banners>*,#homePanel .home-suite-grid>*,#homePanel .home-shorts-grid>*,#homePanel .home-gallery-strip>*{min-width:0}
#homePanel .home-banner,#homePanel .home-tool-media,#homePanel .home-short-card,#homePanel .home-gallery-item{position:relative;overflow:hidden;contain:paint;isolation:isolate;max-width:100%}
#homePanel .home-banner>img,#homePanel .home-banner>video,
#homePanel .home-short-card>img,#homePanel .home-short-card>video,
#homePanel .home-gallery-item>img,#homePanel .home-gallery-item>video,
#homePanel .home-tool-media>img{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;display:block;border:0}
#homePanel .home-banner>img{z-index:0}
#homePanel .home-banner .home-banner-overlay{z-index:2}
#homePanel .home-banner .home-banner-tag,#homePanel .home-banner .home-banner-label{z-index:3}
#homePanel .home-short-card .home-short-overlay{z-index:2}
/* Community Gallery strip: same column count as Featured Creations (3) on desktop/tablet; 2 on phones. */
#homePanel .home-gallery-strip{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#homePanel .home-gallery-strip>.home-gallery-item{width:100%;aspect-ratio:16/10;border-radius:12px;border:1px solid var(--border,#26263a)}
@media(max-width:720px){#homePanel .home-gallery-strip{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}}

/* ---- 2a. Featured Creations motion ------------------------------------------------------------------------------ */
#homePanel .home-banner>video.r107-motion{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:1;opacity:0;transition:opacity .25s ease;pointer-events:none;background:transparent}
#homePanel .home-banner.is-playing>video.r107-motion{opacity:1}
/* r108: Featured cards are 16:9 boxes holding 16:9-ish landscape clips; centre crop only. */
#homePanel .home-banner>img,#homePanel .home-banner>video{object-position:50% 50%}

/* ---- 2b. Feature-landing reel (slideshow) ----------------------------------------------------------------------- */
.r107-reel{display:flex;flex-direction:column;gap:10px;min-width:0}
.r107-reel__stage{position:relative;width:100%;aspect-ratio:16/9;max-height:none;border-radius:14px;overflow:hidden;contain:paint;isolation:isolate;
  background:radial-gradient(ellipse at 50% 60%,#1d1532 0%,#07070c 75%);border:1px solid rgba(165,160,255,.28);box-shadow:0 10px 40px -12px rgba(108,99,255,.55)}
.r107-reel__slide{position:absolute;inset:0;margin:0}
.r107-reel__slide[hidden]{display:none}
.r107-reel__slide>img,.r107-reel__slide>video{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:var(--r107-pos,50% 40%);display:block}
.r107-reel__slide>video{opacity:0;transition:opacity .25s ease}
.r107-reel__slide.is-playing>video{opacity:1}
.r107-reel__cap{position:absolute;left:0;right:0;bottom:0;z-index:2;padding:40px 16px 14px;background:linear-gradient(transparent,rgba(5,5,10,.86));display:flex;flex-direction:column;gap:2px}
.r107-reel__kicker{font-size:.68rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#c4f24a}
.r107-reel__title{font-size:1.15rem;font-weight:800;color:#fff;text-shadow:0 2px 12px rgba(0,0,0,.6)}
.r107-reel__pause{position:absolute;top:10px;right:10px;z-index:3;min-height:32px;padding:0 12px;border-radius:999px;border:1px solid rgba(255,255,255,.3);background:rgba(10,10,16,.7);color:#fff;font:600 .74rem/1 inherit;font-family:inherit;cursor:pointer;backdrop-filter:blur(6px)}
.r107-reel__pause:focus-visible,.r107-reel__thumb:focus-visible{outline:2px solid #c4b5fd;outline-offset:2px}
.r107-reel__thumbs{display:grid;grid-template-columns:repeat(var(--r108-n,3),minmax(0,1fr));gap:10px}
.r107-reel__thumb{position:relative;aspect-ratio:16/9;padding:0;border-radius:10px;overflow:hidden;contain:paint;border:1px solid #2a2a3e;background:#0d0d14;cursor:pointer;opacity:.62;transition:opacity .2s,border-color .2s,box-shadow .2s}
.r107-reel__thumb>img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:var(--r107-pos,50% 40%);display:block}
.r107-reel__thumb[aria-current="true"]{opacity:1;border-color:#a5a0ff;box-shadow:0 0 0 1px rgba(165,160,255,.55),0 6px 22px -6px rgba(108,99,255,.7)}
.r107-reel__thumb:hover{opacity:1}
.r107-reel__note{margin:0;font-size:.74rem;color:#9a9ab4}
@media(max-width:600px){.r107-reel__stage{aspect-ratio:16/9;max-height:none}.r107-reel__thumbs{gap:6px}.r107-reel__title{font-size:1rem}}
@media(prefers-reduced-motion:reduce){.r107-reel__slide>video,.r107-reel__thumb,#homePanel .home-banner>video.r107-motion{transition:none}}

/* ---- hooks-fix-r1 ------------------------------------------------------------------------------------------------ */
/* Still reels (Image service): the whole image, sharp, on a blurred copy of itself; 4:3 stage suits posters. */
.r107-reel--stills .r107-reel__stage{aspect-ratio:4/3}
.r107-reel__bg{position:absolute;inset:-12px;width:calc(100% + 24px);height:calc(100% + 24px);max-width:none;object-fit:cover;filter:blur(18px) brightness(.55) saturate(1.2);display:block}
.r107-reel__slide>.r107-reel__still,.r107-mex__media>.r107-reel__still{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain;display:block}
/* Mobile first-screen example above the signed-out lock card (compact layouts only). */
.r107-mex{position:relative;margin:0 0 12px;border-radius:14px;overflow:hidden;border:1px solid rgba(165,160,255,.28);background:#0d0d14;contain:paint;isolation:isolate}
.r107-mex__media{position:relative;aspect-ratio:16/9}
.r107-mex__media>img:not(.r107-reel__bg):not(.r107-reel__still),.r107-mex__media>video{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:var(--r107-pos,50% 50%);display:block}
.r107-mex__media>video{opacity:0;transition:opacity .25s ease}.r107-mex__media.is-playing>video,.r107-mex__media>video.is-playing{opacity:1}
.r107-mex__cap{position:absolute;left:0;right:0;bottom:0;z-index:2;display:flex;flex-wrap:wrap;align-items:flex-end;gap:2px 10px;padding:32px 12px 10px;background:linear-gradient(transparent,rgba(5,5,10,.88))}
.r107-mex__cap .r107-reel__kicker{flex-basis:100%}
.r107-mex__title{font-size:1rem;font-weight:800;color:#fff;flex:1;min-width:0}
.r107-mex__more{min-height:36px;padding:0 12px;border-radius:999px;border:1px solid rgba(255,255,255,.35);background:rgba(10,10,16,.6);color:#fff;font:600 .78rem/1 inherit;font-family:inherit;cursor:pointer}
.r107-mex__more:focus-visible{outline:2px solid #c4b5fd;outline-offset:2px}
@media(min-width:961px){.r107-mex{display:none}}
@media(max-width:720px){.r107-mex__cap{padding-right:60px}}/* keep clear of the round Pause motion control */
.r107-mex__title{flex-basis:100%}.r107-mex__more{margin-top:6px}/* button on its own row, left, clear of the round Pause control */
/* visual-hooks patch-r1 (fix 6): starter prompt under the format reel */
.r107-starter{display:flex;flex-direction:column;gap:8px;padding:14px 16px;border-radius:14px;border:1px solid #2f2f46;border-left:3px solid #c4f24a;background:#12121c}
.r107-starter__top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px}
.r107-starter__k{font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#c4f24a}
.r107-starter__state{font-size:.76rem;color:#9a9ab4}
.r107-starter__text{margin:0;font-size:.9rem;line-height:1.5;color:#e2e2ee;overflow-wrap:anywhere}
.r107-starter__go{align-self:flex-start;display:inline-flex;align-items:center;min-height:40px;padding:0 16px;border-radius:999px;background:#6c63ff;color:#fff;font-weight:700;font-size:.86rem;text-decoration:none}
.r107-starter__go:focus-visible{outline:2px solid #c4b5fd;outline-offset:2px}
.r107-mex__prompt{margin:4px 0 0;font-size:.8rem;line-height:1.45;color:#d6d6e6;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;flex-basis:100%}

/* visual-hooks-signedin r1: compact first-screen example on phone/tablet */
.r107-mex--top{margin:4px 0 10px}.r107-mex--top .r107-mex__media{aspect-ratio:21/9}
@media(max-width:480px){.r107-mex--top .r107-mex__media{aspect-ratio:2/1}.r107-mex--top .r107-mex__more{display:none}}
/* frontend-rc-20261114b: reel Sound on/off + audio rendition (replaces the silent loop on the active slide) */
.r107-reel__sound{position:absolute;top:10px;right:84px;z-index:3;min-height:32px;padding:0 12px;border-radius:999px;border:1px solid rgba(255,255,255,.3);background:rgba(10,10,16,.7);color:#fff;font:600 .74rem/1 inherit;font-family:inherit;cursor:pointer;backdrop-filter:blur(6px)}
.r107-reel__sound[aria-pressed="true"]{border-color:#c6ff3d;color:#c6ff3d}
.r107-reel__sound:focus-visible{outline:2px solid #c4b5fd;outline-offset:2px}
.r107-has-audio > video:not(.r107-reel__audio){visibility:hidden}

/* music-slideshows-r3 (owner spec): Pause/Play and Mute/Unmute always visible, 44 px touch targets on phones. */
@media (max-width:600px){.r107-reel__pause,.r107-reel__sound{min-height:44px;min-width:44px;padding:0 14px;font-size:.82rem}.r107-reel__sound{right:96px}}

/* ---- studio-music-align-20261115: published AuroFlix music-video slides (Stream) in the Studio Audio reel ----------- */
.r107-reel__slide--af .r107-af-media{position:absolute;inset:0;overflow:hidden;background:#000}
.r107-af-media>.afmr-poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;transition:filter .3s ease,transform .3s ease}
.r107-af-media.has-frame>.afmr-poster{filter:blur(22px) brightness(.55) saturate(1.2);transform:scale(1.15)}
.r107-af-media>.r107-af-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;pointer-events:none;z-index:1}
.r107-af-media.afmr-media--crop>.r107-af-frame{transform-origin:50% 50%}
.r107-af-media>.afmr-signin{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:2;padding:10px 16px;border-radius:999px;background:rgba(10,10,16,.8);color:#fff;font-weight:700;text-decoration:none;border:1px solid rgba(255,255,255,.3)}
.r107-reel__by{font-size:.78rem;color:rgba(255,255,255,.78)}
.r107-reel__watch{align-self:flex-start;margin-top:6px;padding:6px 14px;border-radius:999px;background:#c4f24a;color:#0b0910;font-weight:800;font-size:.78rem;text-decoration:none}
.r107-reel__watch:focus-visible{outline:2px solid #c4b5fd;outline-offset:2px}
/* studio-music-align (live-checks-97f451e0 #2): controls above the Stream iframe / slides, real 44px tap boxes, no double-tap zoom. */
.r107-reel__pause,.r107-reel__sound{z-index:6;min-height:44px;min-width:44px;touch-action:manipulation;pointer-events:auto}
.r107-reel__thumb{touch-action:manipulation;min-height:44px}

/* music-slide-thumbs-20261115: native-size slides in the 16:9 stage (stage size is fixed, so switching slides never shifts
   layout). Published (Stream) slides: .nf-box = exact clip aspect, centred, width capped at --nf-wcap (native px), sharp
   poster contained, blurred .afmr-poster backdrop. Local clips with known dims: poster/videos contained on a blurred copy. */
.r107-af-media .nf-box{position:absolute;inset:0;overflow:hidden}
.r107-af-media .nf-poster{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;border:0}
.r107-af-media .nf-box>.r107-af-frame{position:absolute;inset:0;width:100%;height:100%;border:0}
.r107-af-media.has-frame:not(.nf-sized) .nf-poster{opacity:0}
.r107-af-media>.afmr-poster:not([src]){visibility:hidden}
.r107-reel__slide.nf-sized>.r107-reel__bg{position:absolute;inset:-12px;width:calc(100% + 24px);height:calc(100% + 24px);max-width:none;object-fit:cover;filter:blur(18px) brightness(.55) saturate(1.2);display:block}
@supports (width:1cqw){
  .r107-af-media{container-type:size}
  .r107-af-media.nf-sized .nf-box{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);height:auto;aspect-ratio:var(--nf-ar);
    width:min(100cqw,var(--nf-wcap,100000px),calc(100cqh * var(--nf-ar,1.7778)))}
  .r107-af-media.nf-sized .nf-poster{object-fit:contain}
  .r107-af-media.nf-sized>.afmr-poster{filter:blur(22px) brightness(.55) saturate(1.2);transform:scale(1.15)}
  .r107-reel__slide.nf-sized{container-type:size}
  .r107-reel__slide.nf-sized>img[data-r107-clip],.r107-reel__slide.nf-sized>video{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);height:auto;
    aspect-ratio:var(--nf-ar);width:min(100cqw,var(--nf-wcap,100000px),calc(100cqh * var(--nf-ar,1.7778)));object-fit:contain}
}
/* music-slide-thumbs: with 5+ slides the 44px-high 16:9 thumbs (78px min wide) overflowed a 390 page by ~8px (page scrolled
   sideways on thumb click). The strip now scrolls inside its own row instead of widening the page. */
.r107-reel__thumbs{grid-template-columns:repeat(var(--r108-n,3),minmax(78px,1fr));overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;min-width:0}
/* studio-music-regression-20261115 (owner 11-15, emphatic): music slides that are smaller than the stage get SOLID BLACK fill, never a blurred poster backdrop. */
.r107-af-media{background:#000!important}
.r107-af-media.has-frame>.afmr-poster,.r107-af-media.nf-sized>.afmr-poster{visibility:hidden!important;filter:none!important;transform:none!important}
.r107-reel__slide.nf-sized{background:#000!important}
.r107-reel__slide.nf-sized>.r107-reel__bg{display:none!important}

/* owner 11-15: fill space solid black */
.r107-reel__media,.r107-reel__stage,.r107-reel__box,.r107-reel iframe,.r107-reel video{background:#000!important}
.r107-reel__stage,.r107-reel__media,.r107-af-media,.nf-box,.r107-reel__slide{background:#000!important}

/* ---- /css/auto-scroll-rows.css ---- */
/* auto-scroll-rows r108: rows driven by js/auto-scroll-rows.js. Snap is disabled while the loop runs
   (snap would fight sub-pixel scrollLeft steps); manual scrolling keeps working. No layout change. */
.as-on { scroll-snap-type: none !important; scroll-behavior: auto !important; scrollbar-width: none; }
.as-on::-webkit-scrollbar { display: none; }
.as-on > [data-as-clone] { pointer-events: auto; }
/* r106 ticker now uses the same mechanism (was a CSS marquee, disabled under reduced motion). */
.hk-ticker__viewport[data-autoscroll] { overflow-x: auto; display: flex; gap: 10px; scrollbar-width: none; }
.hk-ticker__viewport[data-autoscroll]::-webkit-scrollbar { display: none; }
.hk-ticker__viewport[data-autoscroll] .hk-ticker__track { animation: none !important; flex: none; }
/* visual-hooks patch-r1 (fix 8): the ticker's first chip started under the 8% edge fade and read as clipped ("3 Image Klein").
   Start the track one fade-width in, and use a fixed 28px fade so chips at either edge fade out instead of being cut mid-word. */
.hk-ticker__viewport[data-autoscroll] { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%); }
.hk-ticker__viewport[data-autoscroll] > .hk-ticker__track:first-child { padding-left: 30px; }

/* ---- /css/studio-music-nav.css ---- */
/* studio-music-nav-20261113 */
body[data-studio-audio-nav=music] #fAudioOptions .am-tabs{display:none}
body[data-studio-audio-nav=voice] #fAudioOptions .am-tab[data-mode=music]{display:none}
.smn-hero{display:none}
body[data-studio-audio-nav=music] .smn-hero{display:grid;grid-template-columns:minmax(0,1fr);position:relative;border-radius:14px;overflow:hidden;margin:0 0 12px;background:#0d0d10;border:1px solid #26262c;min-height:150px}
.smn-media,.smn-text{grid-area:1/1}
.smn-media{position:relative;aspect-ratio:21/7;min-height:150px}
.smn-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 35%}
.smn-text{align-self:end;padding:18px 20px;background:linear-gradient(180deg,rgba(8,8,10,0) 0%,rgba(8,8,10,.55) 45%,rgba(8,8,10,.88) 100%);z-index:1}
.smn-title{margin:0 0 4px;font-size:1.6rem;line-height:1.15;font-weight:700;color:#fff;letter-spacing:-.01em}
.smn-sub{margin:0;max-width:52ch;font-size:.92rem;line-height:1.45;color:#e4e4e7}
@media(max-width:480px){.smn-media{aspect-ratio:16/10}.smn-title{font-size:1.35rem}.smn-text{padding:14px}}
body[data-studio-audio-nav=music] #modelsLink{display:none!important}
body[data-studio-audio-nav=music][data-smn-signedout] #fVoice,body[data-studio-audio-nav=music][data-smn-signedout] #studio-create-panel .soa-out{display:none!important}/* signed out: speech Voice picker has no meaning for a song */

/* ---- /css/studio-oa-nav.css ---- */
/* studio-oa-nav.css - lane A of studio-left-panel-openart-20261116 (Studio left SIDEBAR, OpenArt-aligned structure).
   Additive layer. Every visual rule is scoped under html.soa AND a min-width media query (mobile-r1: 821 px, was 1101 px), so:
   - without html.soa nothing here applies (the nodes studio-oa-nav.js injects only exist while html.soa is set);
   - tablets (821-1100 px) get the same 232 px grouped sidebar as desktop;
   - at <=820px the sidebar is the page's own drawer (opened by "More" in the compact navigation, or the page's menu button),
     and the compact tool navigation (.soa-nav-m) is shown instead (rules at the end of this file, html.soa + max-width:820px).
   Structure follows SPEC.md "Sidebar": 232 px wide, 8 px inner inset (216 inner), 11px/700 uppercase 50% labels,
   32 px rows, 2-column tile grid for TOOLS, selected item = accent outline. Colours and icons are E-Labs' own
   (the per-service --nv-a/--nv-b/--nv-glow accents come from css/studio-nav-vivid.css). */

/* Injected nodes never render outside the scoped layout below (narrow screens keep today's sidebar exactly). */
.soa-nav-row,.soa-nav-tile,.soa-nav-label,.soa-nav-lib,.soa-nav-m{display:none}

@media (min-width:821px){
  /* The app shell grid is "var(--sidebar-w) var(--panel-w) 1fr" (studio.html:157): narrowing the variable moves the tool panel
     to start right after the sidebar. --panel-w belongs to lane B. */
  html.soa{--sidebar-w:232px}
  /* The Studio home panel is position:fixed with a hard-coded left:332px (studio.html:1015): follow the sidebar. */
  html.soa #homePanel{left:var(--sidebar-w)}

  html.soa #sidebar{border-right:0;padding-bottom:44px;scrollbar-width:thin}
  /* >=1280x760 the Help pill is parked in this rail above "Pause motion" (studio.html style#studio-help-rail-vh1): reserve both. */
  html.soa #sidebar .sidebar-top{padding:8px 8px 0;flex-shrink:0}
  html.soa #sidebar .sidebar-section-lbl,
  html.soa #sidebar .soa-nav-label{display:block;margin:0;padding:10px 8px 6px;font-size:11px;font-weight:700;line-height:16px;letter-spacing:.06em;text-transform:uppercase;color:var(--text,#e8e8f0);opacity:.5}
  html.soa #sidebar .soa-nav-label{padding-top:14px}

  /* ---- #snav: one 2-column grid. Rows span both columns, tools are tiles. No node is moved. ---- */
  html.soa #snav{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px 4px;padding:0;flex:none}
  html.soa #snav>*{grid-column:1 / -1}
  html.soa #snav>div:not([class]){display:none}
  html.soa #snav>.snav-item[data-svc]:not([data-svc="home"]),
  html.soa #snav>.soa-nav-tile{grid-column:auto}

  html.soa #snav .snav-item[data-svc],
  html.soa #sidebar .soa-nav-row,
  html.soa #sidebar .soa-nav-tile,
  html.soa #sidebar .sfooter-link{position:relative;display:flex;align-items:center;gap:8px;box-sizing:border-box;width:100%;min-width:0;height:32px;min-height:32px;margin:0;padding:0 7px;border-radius:8px;border:1px solid transparent;background:none;box-shadow:none;color:#d9d9e6;font-family:inherit;font-size:12px;font-weight:500;line-height:16px;letter-spacing:0;text-align:left;text-decoration:none;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
  html.soa #snav .snav-item[data-svc]::before{display:none}
  html.soa #snav>.snav-item[data-svc]:not([data-svc="home"]),
  html.soa #snav>.soa-nav-tile{gap:5px;padding:0 3px 0 5px;background:rgba(255,255,255,.035)}
  /* the longest tile label ("Voice & Sound") must fit a 106 px tile without truncation */
  html.soa #snav>.snav-item[data-audio-nav="voice"]{font-size:11px;letter-spacing:-.2px}

  html.soa #snav .snav-item .snav-text,
  html.soa #sidebar .soa-nav-tx{flex:1 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:16px;font-weight:inherit}

  /* icon tiles: 20 px in rows, 14 px in tiles */
  html.soa #snav .snav-item .snav-icon,
  html.soa #sidebar .soa-nav-ic{flex:0 0 20px;width:20px;height:20px;margin:0;border-radius:6px;display:flex;align-items:center;justify-content:center;transform:none}
  html.soa #sidebar .soa-nav-ic{background:rgba(255,255,255,.07);color:#e8e8f0}
  html.soa #sidebar .soa-nav-ic[data-tint="copilot"]{background:linear-gradient(135deg,#2563eb,#0e7490);color:#fff}
  html.soa #sidebar .soa-nav-ic[data-tint="director"]{background:linear-gradient(135deg,#9333ea,#be185d);color:#fff}
  html.soa #sidebar .soa-nav-ic[data-tint="shorts"]{background:linear-gradient(135deg,#be123c,#9a3412);color:#fff}
  html.soa #snav>.snav-item[data-svc]:not([data-svc="home"]) .snav-icon,
  html.soa #snav>.soa-nav-tile .soa-nav-ic{flex-basis:14px;width:14px;height:14px;border-radius:4px}
  html.soa #snav .snav-item .snav-icon svg,
  html.soa #sidebar .soa-nav-ic svg,
  html.soa #sidebar .sfooter-link>svg{width:12px;height:12px;flex:0 0 auto}
  html.soa #snav>.snav-item[data-svc]:not([data-svc="home"]) .snav-icon svg,
  html.soa #snav>.soa-nav-tile .soa-nav-ic svg{width:10px;height:10px}
  html.soa #sidebar .sfooter-link>svg{width:14px;height:14px;margin:0 3px;opacity:.85}

  /* hover / focus */
  html.soa #snav .snav-item[data-svc]:hover,
  html.soa #sidebar .soa-nav-row:hover,
  html.soa #sidebar .soa-nav-tile:hover,
  html.soa #sidebar .sfooter-link:hover{background:rgba(255,255,255,.07);border-color:transparent;box-shadow:none;color:#fff}
  html.soa #snav .snav-item[data-svc]:hover .snav-icon,
  html.soa #snav .snav-item[data-svc]:focus-visible .snav-icon{box-shadow:none}
  html.soa #snav .snav-item[data-svc]:focus-visible,
  html.soa #sidebar .soa-nav-row:focus-visible,
  html.soa #sidebar .soa-nav-tile:focus-visible,
  html.soa #sidebar .sfooter-link:focus-visible,
  html.soa #sidebar .sfooter-legal a:focus-visible{outline:2px solid #c4b5fd;outline-offset:1px;border-radius:8px;box-shadow:none;background:rgba(255,255,255,.07);color:#fff}

  /* selected: accent outline (reference: selected tile has an accent outline), service accent where one exists */
  html.soa #snav .snav-item[data-svc].active,
  html.soa #sidebar .soa-nav-row[aria-current],
  html.soa #sidebar .soa-nav-tile[aria-current]{background:rgba(255,255,255,.08);border:1px solid var(--nv-glow,rgba(167,139,250,.75));box-shadow:0 0 0 1px var(--nv-glow,rgba(167,139,250,.75)),0 0 14px -6px var(--nv-glow,rgba(167,139,250,.75));color:#fff;font-weight:600}
  html.soa #snav .snav-item[data-svc].active .snav-icon{background:linear-gradient(135deg,var(--nv-a,#6c63ff),var(--nv-b,#8b5cf6));color:#fff;box-shadow:none;transform:none}

  /* availability badges (Sign in / Loading / Unavailable) become a corner chip so a 106 px tile keeps its label */
  html.soa #snav .snav-item[data-svc] .badge{position:absolute;top:-5px;right:-2px;margin:0;padding:1px 5px;font-size:9px;line-height:11px;font-weight:700;border-radius:999px;background:#2a230a;border:1px solid rgba(234,179,8,.45);color:#facc15;pointer-events:none;z-index:1}

  /* ---- LIBRARY (own <nav>, injected after #snav) ---- */
  html.soa #sidebar .soa-nav-lib{display:flex;flex-direction:column;gap:2px;padding:0}

  /* ---- footer: Add funds & plans + legal; originals that now have a row/tile above are hidden only once the
          script has confirmed their replacements exist (data-soa-nav="ready"), so no destination can be lost. ---- */
  html.soa #sidebar .sidebar-bottom{margin-top:auto;padding:14px 8px 4px;border-top:0;flex-shrink:0}
  html.soa #sidebar[data-soa-nav="ready"] #directorLink,
  html.soa #sidebar[data-soa-nav="ready"] #shortsStudioLink,
  html.soa #sidebar[data-soa-nav="ready"] #publicGalleryLink,
  html.soa #sidebar[data-soa-nav="ready"] #privateGalleryLink{display:none}
  html.soa #sidebar .sfooter-legal{gap:0 10px;margin-top:6px;padding:6px 8px 0;border-top:1px solid rgba(255,255,255,.06);line-height:18px}
  html.soa #sidebar .sfooter-legal a,
  html.soa #sidebar .sfooter-legal .sfooter-copy{padding:1px 0;opacity:.8}

  /* fix-a2 (QA D1): studio-oa-nav.js sets html[data-soa-navmenu="hold"] to take the existing hover menu
     (#elabs-nav-menu, js/studio-nav-menu.js) off the tool panel at once while the menu's own close timer runs. */
  html.soa[data-soa-navmenu="hold"] #elabs-nav-menu{display:none!important}
}

@media (min-width:1280px) and (min-height:760px){
  html.soa #sidebar{padding-bottom:104px}
}

@media (min-width:821px) and (prefers-reduced-motion:reduce){
  html.soa #snav .snav-item[data-svc],
  html.soa #sidebar .soa-nav-row,
  html.soa #sidebar .soa-nav-tile,
  html.soa #sidebar .sfooter-link{transition:none}
}

/* ---- mobile-r1: phones (<= 820 px) ---- */
@media (max-width:820px){
  /* compact tool navigation: one horizontal scroller with the sidebar's groups (CREATE / TOOLS / LIBRARY) and More */
  html.soa .tool-panel>.soa-nav-m,html.soa #homePanel>.soa-nav-m{display:block;background:var(--bg2,#111118);border-bottom:1px solid var(--border,#1e1e2e)}
  html.soa .soa-nav-m-list{display:flex;align-items:center;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:6px 12px;scroll-padding:0 24px}
  html.soa .soa-nav-m-list::-webkit-scrollbar{display:none}
  html.soa .soa-nav-m-group{flex:none;padding:0 2px 0 6px;font-size:10.5px;line-height:14px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text,#e8e8f0);opacity:.5}
  html.soa .soa-nav-m-group:first-child{padding-left:0}
  html.soa .soa-nav-m-item{flex:none;display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;box-sizing:border-box;margin:0;padding:0 14px;border-radius:999px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.04);color:#d9d9e6;font-family:inherit;font-size:13px;font-weight:500;line-height:16px;white-space:nowrap;text-decoration:none;cursor:pointer}
  html.soa .soa-nav-m-item[aria-current]{background:rgba(108,99,255,.22);border-color:rgba(167,139,250,.75);color:#fff;font-weight:600}
  html.soa .soa-nav-m-item:focus-visible{outline:2px solid #c4b5fd;outline-offset:-2px}
  html.soa .soa-nav-m-item[data-soa-mnav="more:drawer"]{margin-left:4px}
  /* 721-820 px: the page keeps a static sidebar column only up to 720 px as a drawer; here it becomes the same drawer
     (the page's own .sidebar.open / #sov.vis classes, set by its openSidebar / closeSidebar), so the panel is full width. */
  html.soa .app-shell{grid-template-columns:minmax(0,1fr)}
  html.soa .app-shell>.tool-panel,html.soa .app-shell>.gallery{grid-column:1}
  html.soa #sidebar{position:fixed;top:0;left:-100%;width:min(332px,92vw);max-width:100%;height:100%;z-index:200;overflow-y:auto;transition:left .28s ease}
  html.soa #sidebar.open{left:0}
}
@media (max-width:820px) and (prefers-reduced-motion:reduce){html.soa #sidebar{transition:none}}
/* 721-820 px: with the sidebar now a drawer, the page's Pause-motion pill (fixed, bottom left) would sit on the panel. It takes
   the page's own phone form (studio.html hooks-fix-r1, <= 720 px): a 40 px round button at the right, in the bar's Help gutter
   above Help, keeping its text as the accessible name. */
@media (min-width:721px) and (max-width:820px){
  html.soa .elabs-motion-toggle{left:auto;right:12px;bottom:76px;width:40px;height:40px;padding:0;font-size:0;line-height:0;display:flex;align-items:center;justify-content:center;opacity:.9}
  html.soa .elabs-motion-toggle::before{content:"";box-sizing:border-box;width:11px;height:13px;border-left:4px solid currentColor;border-right:4px solid currentColor}
  html.soa .elabs-motion-toggle[aria-pressed="true"]::before{width:0;height:0;border-right:0;border-left:11px solid currentColor;border-top:7px solid transparent;border-bottom:7px solid transparent;margin-left:3px}
}

/* ---- /css/studio-oa-panel.css ---- */
/* studio-oa-panel (lane B, studio-left-panel-openart-20261116): Studio tool-panel shell, OpenArt-aligned structure.
   Everything is scoped under html.soa, which only js/studio-oa-panel.js adds. Without that script this file is inert.
   Placement and styling only: no rule here hides the price text, Generate, consent, balance or an error state.
   Desktop layer starts at 1101 px because the page's own compact layout is @media(max-width:960px). */

html.soa{
  --soa-gap:8px;
  --soa-inset:9px;
  --soa-card:#16161f;
  --soa-card-2:#1c1c28;
  --soa-line:rgba(210,211,242,.10);
  --soa-text:#f1f0f8;
  --soa-text-2:#b4b4c8;
  --soa-text-3:#9a9ab8;
  --soa-accent:#a5a0ff;
  --soa-accent-fill:rgba(108,99,255,.20);
  --soa-focus:#c9c4ff;
}
html.soa [hidden].soa-tabs,html.soa [hidden].soa-toolrow,html.soa [hidden].soa-toollist,html.soa [hidden].soa-refstrip,html.soa [hidden].soa-count,
html.soa .soa-refstrip [hidden],html.soa [data-soa-output-row][hidden],html.soa [data-soa-output-row]:empty{display:none!important}

/* ---------- shared pieces (all widths) ---------- */
html.soa .soa-ic{display:inline-flex;width:18px;height:18px;flex:none}
html.soa .soa-ic svg,html.soa .soa-chev svg{width:100%;height:100%;display:block}
html.soa .soa-chev{display:inline-flex;width:14px;height:14px;flex:none;color:var(--soa-text-3);transition:transform .15s}
html.soa .soa-tile{display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden;border-radius:10px;background:var(--soa-card-2);border:1px solid var(--soa-line);color:var(--soa-accent)}
html.soa .soa-tile img{width:100%;height:100%;object-fit:cover;display:block}
html.soa .soa-tile-md{width:44px;height:44px}
html.soa .soa-tile-md .soa-ic{width:20px;height:20px}
html.soa .soa-tile-lg{width:52px;height:52px}
html.soa .soa-tile-lg .soa-ic{width:22px;height:22px}

/* 1. media tabs */
html.soa .soa-tabs{display:flex;gap:4px;flex:none;min-width:0;overflow-x:auto;scrollbar-width:none}
html.soa .soa-tabs::-webkit-scrollbar{display:none}
html.soa .soa-tab{flex:1 0 auto;min-width:0;height:36px;padding:0 10px;border:0;border-radius:10px;background:transparent;color:var(--soa-text-3);font-family:inherit;font-size:12px;line-height:16px;font-weight:600;white-space:nowrap;cursor:pointer;transition:background .15s,color .15s}
html.soa .soa-tabs[data-soa-more="right"]{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 32px),transparent)}
html.soa .soa-tabs[data-soa-more="left"]{-webkit-mask-image:linear-gradient(270deg,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(270deg,#000 calc(100% - 32px),transparent)}
html.soa .soa-tabs[data-soa-more="both"]{-webkit-mask-image:linear-gradient(90deg,transparent,#000 32px,#000 calc(100% - 32px),transparent);mask-image:linear-gradient(90deg,transparent,#000 32px,#000 calc(100% - 32px),transparent)}
html.soa .soa-tab:hover:not(:disabled){color:var(--soa-text);background:rgba(255,255,255,.05)}
html.soa .soa-tab[aria-selected="true"]{background:var(--soa-accent-fill);color:#fff}
html.soa .soa-tab:disabled{opacity:.45;cursor:not-allowed}
html.soa .soa-tab:focus-visible,html.soa .soa-toolrow:focus-visible,html.soa .soa-tool:focus-visible,html.soa .soa-refstrip:focus-visible,html.soa .soa-count-btn:focus-visible{outline:2px solid var(--soa-focus);outline-offset:2px}

/* 4. references strip inside the prompt card (all widths): the existing #fImage block opens in place right under it */
html.soa #studioPromptCard{display:flex;flex-direction:column}
html.soa #studioPromptCard>#studioPromptLabel{order:-6}
html.soa #studioPromptCard>#jDesc{order:-5}
html.soa #studioPromptCard>.soa-refstrip{order:-4}
html.soa #studioPromptCard>#fImage{order:-3}
html.soa #studioPromptCard>.studio-output-summary{order:2}
html.soa #studioPromptCard[data-soa-refs="closed"]>#fImage{display:none!important}
html.soa .soa-refstrip{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;margin:8px 0 0;padding:8px 10px;border:1px dashed rgba(165,160,255,.45);border-radius:10px;background:rgba(108,99,255,.07);color:var(--soa-text);font-family:inherit;text-align:left;cursor:pointer;position:relative}
html.soa .soa-refstrip:hover{background:rgba(108,99,255,.12);border-color:var(--soa-accent)}
html.soa .soa-refstrip>.soa-ic{width:22px;height:22px;color:var(--soa-accent)}
html.soa .soa-refstrip-text{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}
html.soa .soa-refstrip-title{font-size:13px;line-height:18px;font-weight:600}
html.soa .soa-refstrip-rule{font-size:12px;line-height:16px;color:var(--soa-text)}
html.soa .soa-refstrip-limits{font-size:11.5px;line-height:15px;color:var(--soa-text-3)}
html.soa .soa-refstrip-count{flex:none;align-self:flex-start;font-size:11px;line-height:16px;font-weight:600;padding:1px 7px;border-radius:999px;background:rgba(0,0,0,.35);color:var(--soa-text-2)}
html.soa .soa-refstrip[aria-expanded="true"] .soa-chev{transform:rotate(90deg)}
html.soa .soa-refstrip[aria-expanded="true"]{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-color:transparent}
html.soa #studioPromptCard[data-soa-refs="open"]>#fImage{margin:0 0 8px;padding:10px;border:1px dashed rgba(165,160,255,.45);border-top:0;border-radius:0 0 10px 10px;background:rgba(108,99,255,.04)}
html.soa #studioPromptCard[data-soa-refs]>#fImage>.wcard-title{font-size:12px;line-height:16px;font-weight:600;color:var(--soa-text-2)}
html.soa #studioPromptCard[data-soa-refs]>#fImage>.wcard-sub{margin-bottom:6px}
html.soa #studioPromptCard[data-soa-refs]>#fImage .dz{margin-top:8px;padding:10px 12px;display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:10px;align-items:center;text-align:left}
html.soa #studioPromptCard[data-soa-refs]>#fImage .dz-icon{grid-row:1 / span 3;margin:0}
html.soa #studioPromptCard[data-soa-refs]>#fImage .dz-icon svg{width:22px;height:22px}
html.soa #studioPromptCard[data-soa-refs]>#fImage .dz-or{margin:8px 0}

/* count stepper: desktop only (below 1101 px the count stays in Output settings, so the tuned phone bar is untouched) */
html.soa .soa-count{display:none}

/* The inline workflow radios stay in the DOM; the tool row represents them on desktop only. */
html.soa .soa-toolrow,html.soa .soa-toollist{display:none}

/* ---------- fix-b2 (live QA r1), all widths ---------- */
/* D2. Modes with their own action (Music / Sound effects: .am-foot; Edit video / Upscale: #studioEditVideoActions).
   Their wrappers are flattened (display:contents, no node moved) and the SAME price + button nodes are sticky at the bottom
   of the scroll area, stacked above the bar by --soa-pin0..2 (heights published by studio-oa-panel.js; 0 px without it). */
html.soa .tool-panel #jobForm>#fAudioOptions:has(.am-foot),html.soa .tool-panel #fAudioOptions:has(.am-foot)>.am-body,
html.soa .tool-panel #jobForm>#studioEditVideoActions{display:contents}
html.soa .tool-panel #fAudioOptions:has(.am-foot)>*,html.soa .tool-panel #fAudioOptions:has(.am-foot)>.am-body>*,html.soa .tool-panel #studioEditVideoActions>*{flex:none;min-width:0}
html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-result,html.soa .tool-panel #studioEditVideoActions>#studioEditVideoResult{order:3}
html.soa .tool-panel #fAudioOptions .am-result:empty,html.soa .tool-panel #studioEditVideoActions>#studioEditVideoResult:empty{display:none}
html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions,
html.soa .tool-panel #studioEditVideoActions>#studioEditVideoNotice,html.soa .tool-panel #studioEditVideoActions>#studioEditVideoError.show{
  position:sticky;z-index:5;margin:0;padding:8px 0;background:var(--bg2,#111118);box-shadow:-24px 0 0 var(--bg2,#111118),24px 0 0 var(--bg2,#111118),0 var(--soa-gap) 0 var(--bg2,#111118)}
html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions{order:99;bottom:var(--soa-pin0,0px)}
html.soa .tool-panel #studioEditVideoActions>#studioEditVideoNotice{order:98;bottom:var(--soa-pin1,0px);padding:6px 0;font-size:12px;line-height:17px;color:var(--soa-text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.soa .tool-panel #studioEditVideoActions[data-soa-notice="open"]>#studioEditVideoNotice{white-space:normal;max-height:30vh;overflow:auto}
html.soa .tool-panel #studioEditVideoActions>#studioEditVideoError.show{order:97;bottom:var(--soa-pin2,0px);padding:6px 0}
html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot{gap:10px}
html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-price{font-size:12.5px;line-height:17px;color:var(--soa-text)}
html.soa .tool-panel #studioEditVideoActions .sev-status{flex:1 1 140px;min-width:0;font-size:12.5px;line-height:17px;color:var(--soa-text)}
html.soa .soa-notice-more{flex:none;margin-left:auto;min-height:32px;padding:4px 2px;border:0;background:none;color:#c9c2ff;font-family:inherit;font-size:12px;line-height:16px;text-decoration:underline;cursor:pointer}
html.soa .soa-notice-more[hidden]{display:none}
html.soa .soa-notice-more:focus-visible,html.soa .soa-dismiss:focus-visible{outline:2px solid var(--soa-focus);outline-offset:2px}
/* D7. project notices (existing #studioProjectHandoff): body-size text, a gap before the link, a close button */
html.soa #studioProjectHandoff{position:relative;padding:8px 40px 8px 12px;font-size:12.5px;line-height:18px;color:var(--soa-text-2)}
html.soa #studioProjectHandoff[hidden]{display:none!important}
html.soa #studioProjectHandoff>a{margin-left:.4em;color:var(--soa-accent)}
html.soa #studioProjectHandoff>.soa-dismiss{position:absolute;top:3px;right:4px;width:30px;height:30px;border:0;border-radius:8px;background:none;color:var(--soa-text-3);font-family:inherit;font-size:18px;line-height:1;cursor:pointer}
html.soa #studioProjectHandoff>.soa-dismiss:hover{background:rgba(255,255,255,.07);color:var(--soa-text)}

/* ---------- compact layout (<= 1100 px): keep the existing layout; the tabs row stands in for the service title block ---------- */
@media(max-width:960px){
  html.soa .tool-panel>.soa-tabs{order:-1;padding:6px 12px;border-bottom:1px solid var(--border,#1e1e2e);background:var(--bg2,#111118)}
  html.soa .soa-tab{height:44px;padding:0 12px;font-size:13px}
  /* D6: the Speech / Sound effects switch (and the music form) come before the prompt card, as on desktop */
  html.soa #jobForm>#fAudioOptions{order:-2}
  html.soa .soa-notice-more{min-height:44px}
  /* D2 below 1101 px: #ws is the scroll area and the bar sits under it. While a mode with its own action is showing
     (html[data-soa-pinned], set by studio-oa-panel.js), #ws becomes one column and the form wrappers are flattened (no node
     moved), so the pinned rows stick to the bottom of #ws for the whole scroll, not only while the form is in view. */
  html.soa[data-soa-pinned] .tool-panel>.workspace{display:flex;flex-direction:column}
  html.soa[data-soa-pinned] .tool-panel>.workspace>*,html.soa[data-soa-pinned] .tool-panel #jobForm>*{flex:none;min-width:0}
  html.soa[data-soa-pinned] .tool-panel #wsF:not([style*="display: none"]):not([style*="display:none"]),html.soa[data-soa-pinned] .tool-panel #jobForm{display:contents}
  html.soa .tool-panel>.tool-head{padding:0;border:0}
  html.soa .tool-panel>.tool-head .breadcrumb,html.soa .tool-panel>.tool-head .tool-info{display:none}
  html.soa .soa-refstrip{min-height:56px}
  html.soa [data-soa-output-row]{margin:0 0 10px}
}
@media(max-width:720px){
  /* D12: the floating Pause-motion button (40 px, right edge, just above the bar) covers what scrolls under it:
     leave room to scroll the last rows clear of it, and keep the pinned action rows out from under it. */
  html.soa .tool-panel>.workspace{padding-bottom:64px;scroll-padding-bottom:64px}
  html.soa[data-soa-pinned] .tool-panel>.workspace{padding-bottom:0;scroll-padding-bottom:calc(var(--soa-pin-top,96px) + 12px)}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions{padding-right:74px}
}
@media(max-width:480px){
  /* D11: five tabs fit a 360-390 px phone; if they still overflow the row scrolls and fades at the cut edge */
  html.soa .soa-tab{padding:0 8px;font-size:12.5px}
  html.soa .tool-panel>.soa-tabs{padding:6px 8px;gap:2px}
}

/* ---------- desktop (>= 1101 px): one scrolling stack, 8 px gaps, pinned bottom bar ---------- */
@media(min-width:961px){
  html.soa{--panel-w:440px}
  /* The panel is its own scroll container; the bottom bar is sticky inside it, so it is always visible. */
  html.soa .tool-panel{display:flex;flex-direction:column;gap:var(--soa-gap);padding:var(--soa-gap) var(--soa-inset) 0;overflow-x:hidden;overflow-y:auto;scroll-padding-bottom:150px;scrollbar-width:thin;scrollbar-color:rgba(165,160,255,.25) transparent}
  html.soa .tool-panel>*{flex:none;min-width:0}
  /* Flatten the wrappers (no node is moved): their children become rows of the one stack. Inline display:none still wins. */
  html.soa .tool-panel>.workspace,html.soa .tool-panel #wsF,html.soa .tool-panel #jobForm{display:contents}
  html.soa .tool-panel .workspace>*,html.soa .tool-panel #jobForm>*{flex:none;min-width:0}
  html.soa .tool-panel .wcard,html.soa .tool-panel .model-row{margin:0}

  /* visual order of the stack */
  html.soa .tool-panel>.tool-head{order:-70}
  html.soa .tool-panel>.soa-tabs{order:-60}
  html.soa .tool-panel>.soa-toolrow{order:-40}
  html.soa .tool-panel>.soa-toollist{order:-39}
  html.soa .tool-panel>#modelsLink{order:-30}
  html.soa .tool-panel>#engineDropdownWrap{order:-29}
  /* fix-b2 D9: the visual order follows the DOM (= tab order): project notices, then the Project row, then the form */
  html.soa .tool-panel .workspace>#studioProjectHandoff,html.soa .tool-panel .workspace>#studioProjectAssetPreview,html.soa .tool-panel .workspace>#tierGateBanner{order:-26}
  html.soa .tool-panel #jobForm>#studioProjectPickerRow{order:-25}
  html.soa .tool-panel #jobForm>#studioCloudflareControls,html.soa .tool-panel #jobForm>#studioPromptCard{order:0}
  html.soa .tool-panel .workspace>[data-soa-output-row]{order:1}
  html.soa .tool-panel #jobForm>#studioPromptCard~*{order:2}
  /* fix-b2 D6: audio: the Speech / Sound effects switch sits above the prompt; the transcription card follows the form */
  html.soa .tool-panel #jobForm>#fAudioOptions{order:-1}
  html.soa .tool-panel .workspace>#studioTranscriptionCard{order:30}
  html.soa .tool-panel .workspace>#svcPreview{order:40}
  html.soa .tool-panel>.gen-bar{order:100}

  /* header line: breadcrumb only (the service name is the selected tab) */
  html.soa .tool-panel>.tool-head{padding:0 4px;border:0}
  html.soa .tool-panel>.tool-head .breadcrumb{margin:0;font-size:11px;line-height:16px;min-height:16px}
  html.soa .tool-panel>.tool-head .tool-info{display:none}
  html.soa .tool-panel>.tool-head .tool-head-row{min-height:0}

  /* 1. tabs: five equal pills */
  html.soa .tool-panel>.soa-tabs{padding:0}
  html.soa .tool-panel>.soa-tabs .soa-tab{flex:1 1 auto;padding:0 8px}

  /* project selector: one compact row in the header area (same nodes, still inside #jobForm) */
  html.soa #studioProjectPickerRow.sp-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 10px;padding:6px 10px 6px 12px;border-radius:12px;background:var(--soa-card);border:1px solid var(--soa-line)}
  html.soa #studioProjectPickerRow .sp-head{display:contents}
  html.soa #studioProjectPickerRow .sp-title{font-size:12px;line-height:16px;font-weight:500;color:var(--soa-text-3)}
  html.soa #studioProjectPickerRow #studioProjectPickerHint{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
  html.soa #studioProjectPickerRow select.sp-select{min-height:32px;height:32px;padding:4px 28px 4px 10px;font-size:13px;border-radius:8px}
  html.soa #studioProjectPickerRow .sp-new,html.soa #studioProjectPickerRow .sp-status{grid-column:1 / -1}

  /* 2. tool row */
  html.soa .tool-panel>.soa-toolrow{display:flex;align-items:center;gap:12px;width:100%;min-height:62px;padding:8px 14px 8px 9px;border:1px solid var(--soa-line);border-radius:12px;background:linear-gradient(100deg,rgba(108,99,255,.16),rgba(56,189,248,.05) 70%),var(--soa-card);color:var(--soa-text);font-family:inherit;text-align:left;cursor:pointer}
  html.soa .tool-panel>.soa-toolrow:hover,html.soa .tool-panel>.soa-toolrow[aria-expanded="true"]{border-color:var(--soa-accent)}
  html.soa .soa-toolrow-thumb{display:flex;flex:none}
  html.soa .soa-toolrow-text{display:flex;flex-direction:column;min-width:0;flex:1}
  html.soa .soa-toolrow-kicker{font-size:12px;line-height:16px;font-weight:500;color:var(--soa-text-3)}
  html.soa .soa-toolrow-title{font-size:16px;line-height:22px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.soa .soa-toolrow[aria-expanded="true"] .soa-chev{transform:rotate(90deg)}
  /* inline tool list (fallback when lane C's flyout is not loaded) */
  html.soa .tool-panel>.soa-toollist{display:block;padding:10px 8px 8px;border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .soa-toollist-title{margin:0 4px 6px;font-size:14px;line-height:20px;font-weight:600;color:var(--soa-text)}

  /* 3. model row: logo tile, "Model" label, name, chevron */
  html.soa .tool-panel>#modelsLink.model-row{min-height:50px;padding:7px 14px 7px 9px;border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .tool-panel>#modelsLink.model-row:hover,html.soa .tool-panel>#modelsLink.model-row[aria-expanded="true"]{border-color:var(--soa-accent);background:var(--soa-card-2)}
  html.soa .tool-panel>#modelsLink .model-left{gap:12px;min-width:0}
  html.soa .tool-panel>#modelsLink .model-left>div:last-child{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:6px;align-items:baseline;min-width:0}
  html.soa .tool-panel>#modelsLink .model-lbl{font-size:12px;line-height:16px;font-weight:500;letter-spacing:0;text-transform:none;color:var(--soa-text-3)}
  html.soa .tool-panel>#modelsLink #studioModelCreator:not(:empty)::before{content:"\00b7\00a0"}
  html.soa .tool-panel>#modelsLink #mName{grid-column:1 / -1;grid-row:2;font-size:14px;line-height:20px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.soa .tool-panel>#modelsLink .chevron{color:var(--soa-text-3);flex:none}

  /* cards of the stack */
  html.soa .tool-panel .wcard{padding:12px;border-radius:12px;background:var(--soa-card);border-color:var(--soa-line)}
  html.soa .tool-panel #jobForm>#studioCloudflareControls{display:none}
  html.soa .tool-panel #jobForm>#studioCloudflareControls:has(>:not(#studioWorkflowChoices):not(select[hidden])){display:block}
  html.soa .tool-panel #jobForm>#studioCloudflareControls>#studioWorkflowChoices{display:none}

  /* 4. prompt card */
  html.soa #studioPromptCard>.wcard-title{font-size:14px;line-height:20px;font-weight:600;margin:0}
  html.soa #studioPromptCard>#jDesc{font-size:12px;line-height:16px;margin:2px 0 0}
  html.soa #studioPromptCard>textarea#jPrompt{margin-top:8px;min-height:104px;border-color:transparent;background:rgba(0,0,0,.22);border-radius:10px}
  html.soa #studioPromptCard>.studio-output-summary{margin-top:8px}

  /* examples: compact collapsed row at the end of the stack */
  html.soa .tool-panel .workspace>#svcPreview{border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .tool-panel .workspace>#svcPreview>summary{padding:8px 12px;min-height:36px;font-size:12px;line-height:20px}

  /* 6. pinned bottom bar: the existing nodes in one grid; price text sits directly above Generate */
  html.soa .tool-panel>.gen-bar{position:sticky;bottom:0;z-index:6;margin:auto calc(-1 * var(--soa-inset)) 0;display:grid!important;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 8px;padding:10px var(--soa-inset) 12px;background:var(--bg2,#111118);border-top:1px solid #2e2e44}
  html.soa .tool-panel>.gen-bar>*{grid-column:1 / -1;min-width:0}
  html.soa .tool-panel>.gen-bar>.soa-count{grid-column:1;display:flex;align-items:center;gap:2px;height:44px;padding:0 3px;border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .tool-panel>.gen-bar.soa-has-count>#genBtn{grid-column:2}
  html.soa .soa-count-btn{width:36px;height:36px;border:0;border-radius:9px;background:transparent;color:var(--soa-text);font-family:inherit;font-size:18px;line-height:1;font-weight:500;cursor:pointer}
  html.soa .soa-count-btn:hover:not(:disabled){background:rgba(255,255,255,.07)}
  html.soa .soa-count-btn:disabled{opacity:.35;cursor:not-allowed}
  html.soa .soa-count-value{min-width:44px;text-align:center;font-size:13px;line-height:18px;font-weight:600;color:var(--soa-text);white-space:nowrap}
  html.soa .tool-panel>.gen-bar .btn-gen{min-height:44px}

  /* fix-b2 D2 (desktop): pinned rows bleed to the panel edges like the bar; scrolled-to targets clear the whole pinned stack */
  html.soa .tool-panel{scroll-padding-bottom:calc(var(--soa-pin-top,138px) + 12px)}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions,
  html.soa .tool-panel #studioEditVideoActions>#studioEditVideoNotice,html.soa .tool-panel #studioEditVideoActions>#studioEditVideoError.show{margin:0 calc(-1 * var(--soa-inset));padding-left:var(--soa-inset);padding-right:var(--soa-inset);box-shadow:0 var(--soa-gap) 0 var(--bg2,#111118)}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions{border-top:1px solid #2e2e44}
  html.soa .tool-panel #studioEditVideoActions:has(>#studioEditVideoNotice:not([hidden]))>.sev-actions,html.soa .tool-panel #studioEditVideoActions:has(>#studioEditVideoError.show)>.sev-actions{border-top:0}
  html.soa .tool-panel #studioEditVideoActions>#studioEditVideoNotice:not([hidden]){border-top:1px solid #2e2e44}
  html.soa .tool-panel #studioEditVideoActions>#studioEditVideoError.show{border-top:1px solid #2e2e44}
  html.soa[data-soa-pinned] .tool-panel>.gen-bar{border-top-color:transparent}
  /* the flattened music / sound-effects form: rows of the one stack */
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-tabs,html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-models{margin:0}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>.am-label,html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>label.am-label{margin:6px 2px -2px}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>.am-hint,html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>.am-count{margin:-2px 2px 0}

  /* fix-b2 D4: the video storage notice in the bar is one line + "Details" (the page's own phone form); the full text opens in place */
  html.soa .tool-panel>.gen-bar #studioRetentionNotice{margin:0;padding:6px 10px}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details>summary{display:flex}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details:not([open]) .rn-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details[open]>summary::after{content:"Hide";flex:none;text-decoration:underline;white-space:nowrap;color:#c9c2ff}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details[open] .rn-body{margin-top:4px;max-height:min(30vh,170px);overflow:auto}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details>summary:focus-visible{outline:2px solid var(--soa-focus);outline-offset:2px;border-radius:4px}
}
@media(min-width:1280px){html.soa{--panel-w:480px}}

/* ======================= mobile-r1: the same layer at <= 1100 px (tablet 821-1100, phone <= 820) =======================
   The desktop stack above is applied unchanged at <= 1100 px (same rules, copied into this media query so the >= 1101 px
   block and its cascade are untouched), followed by the compact adjustments below. Nothing is moved: the wrappers are
   flattened with display:contents exactly as on desktop; the existing bar (price text + Generate, same nodes) is sticky at
   the bottom of the scrolling panel, so it never covers an input (the panel scrolls the input above it; scroll-padding keeps
   a focused field clear of it). The Output settings / tool list open as a bottom sheet (js/studio-oa-flyout.js) that ends
   above the bar. Results (the existing .gallery) follow the panel below; the existing Create / Results switch still works. */
@media(max-width:960px){
  html.soa{--soa-inset:16px}
  /* The panel is its own scroll container; the bottom bar is sticky inside it, so it is always visible. */
  html.soa .tool-panel{display:flex;flex-direction:column;gap:var(--soa-gap);padding:var(--soa-gap) var(--soa-inset) 0;overflow-x:hidden;overflow-y:auto;scroll-padding-bottom:150px;scrollbar-width:thin;scrollbar-color:rgba(165,160,255,.25) transparent}
  html.soa .tool-panel>*{flex:none;min-width:0}
  /* Flatten the wrappers (no node is moved): their children become rows of the one stack. Inline display:none still wins. */
  html.soa .tool-panel>.workspace,html.soa .tool-panel #wsF,html.soa .tool-panel #jobForm{display:contents}
  html.soa .tool-panel .workspace>*,html.soa .tool-panel #jobForm>*{flex:none;min-width:0}
  html.soa .tool-panel .wcard,html.soa .tool-panel .model-row{margin:0}

  /* visual order of the stack */
  html.soa .tool-panel>.tool-head{order:-70}
  html.soa .tool-panel>.soa-tabs{order:-60}
  html.soa .tool-panel>.soa-toolrow{order:-40}
  html.soa .tool-panel>.soa-toollist{order:-39}
  html.soa .tool-panel>#modelsLink{order:-30}
  html.soa .tool-panel>#engineDropdownWrap{order:-29}
  /* fix-b2 D9: the visual order follows the DOM (= tab order): project notices, then the Project row, then the form */
  html.soa .tool-panel .workspace>#studioProjectHandoff,html.soa .tool-panel .workspace>#studioProjectAssetPreview,html.soa .tool-panel .workspace>#tierGateBanner{order:-26}
  html.soa .tool-panel #jobForm>#studioProjectPickerRow{order:-25}
  html.soa .tool-panel #jobForm>#studioCloudflareControls,html.soa .tool-panel #jobForm>#studioPromptCard{order:0}
  html.soa .tool-panel .workspace>[data-soa-output-row]{order:1}
  html.soa .tool-panel #jobForm>#studioPromptCard~*{order:2}
  /* fix-b2 D6: audio: the Speech / Sound effects switch sits above the prompt; the transcription card follows the form */
  html.soa .tool-panel #jobForm>#fAudioOptions{order:-1}
  html.soa .tool-panel .workspace>#studioTranscriptionCard{order:30}
  html.soa .tool-panel .workspace>#svcPreview{order:40}
  html.soa .tool-panel>.gen-bar{order:100}

  /* header line: breadcrumb only (the service name is the selected tab) */
  html.soa .tool-panel>.tool-head{padding:0 4px;border:0}
  html.soa .tool-panel>.tool-head .breadcrumb{margin:0;font-size:11px;line-height:16px;min-height:16px}
  html.soa .tool-panel>.tool-head .tool-info{display:none}
  html.soa .tool-panel>.tool-head .tool-head-row{min-height:0}

  /* 1. tabs: five equal pills */
  html.soa .tool-panel>.soa-tabs{padding:0}
  html.soa .tool-panel>.soa-tabs .soa-tab{flex:1 1 auto;padding:0 8px}

  /* project selector: one compact row in the header area (same nodes, still inside #jobForm) */
  html.soa #studioProjectPickerRow.sp-card{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 10px;padding:6px 10px 6px 12px;border-radius:12px;background:var(--soa-card);border:1px solid var(--soa-line)}
  html.soa #studioProjectPickerRow .sp-head{display:contents}
  html.soa #studioProjectPickerRow .sp-title{font-size:12px;line-height:16px;font-weight:500;color:var(--soa-text-3)}
  html.soa #studioProjectPickerRow #studioProjectPickerHint{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
  html.soa #studioProjectPickerRow select.sp-select{min-height:32px;height:32px;padding:4px 28px 4px 10px;font-size:13px;border-radius:8px}
  html.soa #studioProjectPickerRow .sp-new,html.soa #studioProjectPickerRow .sp-status{grid-column:1 / -1}

  /* 2. tool row */
  html.soa .tool-panel>.soa-toolrow{display:flex;align-items:center;gap:12px;width:100%;min-height:62px;padding:8px 14px 8px 9px;border:1px solid var(--soa-line);border-radius:12px;background:linear-gradient(100deg,rgba(108,99,255,.16),rgba(56,189,248,.05) 70%),var(--soa-card);color:var(--soa-text);font-family:inherit;text-align:left;cursor:pointer}
  html.soa .tool-panel>.soa-toolrow:hover,html.soa .tool-panel>.soa-toolrow[aria-expanded="true"]{border-color:var(--soa-accent)}
  html.soa .soa-toolrow-thumb{display:flex;flex:none}
  html.soa .soa-toolrow-text{display:flex;flex-direction:column;min-width:0;flex:1}
  html.soa .soa-toolrow-kicker{font-size:12px;line-height:16px;font-weight:500;color:var(--soa-text-3)}
  html.soa .soa-toolrow-title{font-size:16px;line-height:22px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.soa .soa-toolrow[aria-expanded="true"] .soa-chev{transform:rotate(90deg)}
  /* inline tool list (fallback when lane C's flyout is not loaded) */
  html.soa .tool-panel>.soa-toollist{display:block;padding:10px 8px 8px;border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .soa-toollist-title{margin:0 4px 6px;font-size:14px;line-height:20px;font-weight:600;color:var(--soa-text)}

  /* 3. model row: logo tile, "Model" label, name, chevron */
  html.soa .tool-panel>#modelsLink.model-row{min-height:50px;padding:7px 14px 7px 9px;border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .tool-panel>#modelsLink.model-row:hover,html.soa .tool-panel>#modelsLink.model-row[aria-expanded="true"]{border-color:var(--soa-accent);background:var(--soa-card-2)}
  html.soa .tool-panel>#modelsLink .model-left{gap:12px;min-width:0}
  html.soa .tool-panel>#modelsLink .model-left>div:last-child{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:6px;align-items:baseline;min-width:0}
  html.soa .tool-panel>#modelsLink .model-lbl{font-size:12px;line-height:16px;font-weight:500;letter-spacing:0;text-transform:none;color:var(--soa-text-3)}
  html.soa .tool-panel>#modelsLink #studioModelCreator:not(:empty)::before{content:"\00b7\00a0"}
  html.soa .tool-panel>#modelsLink #mName{grid-column:1 / -1;grid-row:2;font-size:14px;line-height:20px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.soa .tool-panel>#modelsLink .chevron{color:var(--soa-text-3);flex:none}

  /* cards of the stack */
  html.soa .tool-panel .wcard{padding:12px;border-radius:12px;background:var(--soa-card);border-color:var(--soa-line)}
  html.soa .tool-panel #jobForm>#studioCloudflareControls{display:none}
  html.soa .tool-panel #jobForm>#studioCloudflareControls:has(>:not(#studioWorkflowChoices):not(select[hidden])){display:block}
  html.soa .tool-panel #jobForm>#studioCloudflareControls>#studioWorkflowChoices{display:none}

  /* 4. prompt card */
  html.soa #studioPromptCard>.wcard-title{font-size:14px;line-height:20px;font-weight:600;margin:0}
  html.soa #studioPromptCard>#jDesc{font-size:12px;line-height:16px;margin:2px 0 0}
  html.soa #studioPromptCard>textarea#jPrompt{margin-top:8px;min-height:104px;border-color:transparent;background:rgba(0,0,0,.22);border-radius:10px}
  html.soa #studioPromptCard>.studio-output-summary{margin-top:8px}

  /* examples: compact collapsed row at the end of the stack */
  html.soa .tool-panel .workspace>#svcPreview{border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .tool-panel .workspace>#svcPreview>summary{padding:8px 12px;min-height:36px;font-size:12px;line-height:20px}

  /* 6. pinned bottom bar: the existing nodes in one grid; price text sits directly above Generate */
  html.soa .tool-panel>.gen-bar{position:sticky;bottom:0;z-index:6;margin:auto calc(-1 * var(--soa-inset)) 0;display:grid!important;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 8px;padding:10px var(--soa-inset) 12px;background:var(--bg2,#111118);border-top:1px solid #2e2e44}
  html.soa .tool-panel>.gen-bar>*{grid-column:1 / -1;min-width:0}
  html.soa .tool-panel>.gen-bar>.soa-count{grid-column:1;display:flex;align-items:center;gap:2px;height:44px;padding:0 3px;border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-card)}
  html.soa .tool-panel>.gen-bar.soa-has-count>.btn-gen{grid-column:2}
  html.soa .soa-count-btn{width:36px;height:36px;border:0;border-radius:9px;background:transparent;color:var(--soa-text);font-family:inherit;font-size:18px;line-height:1;font-weight:500;cursor:pointer}
  html.soa .soa-count-btn:hover:not(:disabled){background:rgba(255,255,255,.07)}
  html.soa .soa-count-btn:disabled{opacity:.35;cursor:not-allowed}
  html.soa .soa-count-value{min-width:44px;text-align:center;font-size:13px;line-height:18px;font-weight:600;color:var(--soa-text);white-space:nowrap}
  html.soa .tool-panel>.gen-bar .btn-gen{min-height:44px}

  /* fix-b2 D2 (desktop): pinned rows bleed to the panel edges like the bar; scrolled-to targets clear the whole pinned stack */
  html.soa .tool-panel{scroll-padding-bottom:calc(var(--soa-pin-top,138px) + 12px)}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions,
  html.soa .tool-panel #studioEditVideoActions>#studioEditVideoNotice,html.soa .tool-panel #studioEditVideoActions>#studioEditVideoError.show{margin:0 calc(-1 * var(--soa-inset));padding-left:var(--soa-inset);padding-right:var(--soa-inset);box-shadow:0 var(--soa-gap) 0 var(--bg2,#111118)}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions{border-top:1px solid #2e2e44}
  html.soa .tool-panel #studioEditVideoActions:has(>#studioEditVideoNotice:not([hidden]))>.sev-actions,html.soa .tool-panel #studioEditVideoActions:has(>#studioEditVideoError.show)>.sev-actions{border-top:0}
  html.soa .tool-panel #studioEditVideoActions>#studioEditVideoNotice:not([hidden]){border-top:1px solid #2e2e44}
  html.soa .tool-panel #studioEditVideoActions>#studioEditVideoError.show{border-top:1px solid #2e2e44}
  html.soa[data-soa-pinned] .tool-panel>.gen-bar{border-top-color:transparent}
  /* the flattened music / sound-effects form: rows of the one stack */
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-tabs,html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-models{margin:0}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>.am-label,html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>label.am-label{margin:6px 2px -2px}
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>.am-hint,html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-body>.am-count{margin:-2px 2px 0}

  /* fix-b2 D4: the video storage notice in the bar is one line + "Details" (the page's own phone form); the full text opens in place */
  html.soa .tool-panel>.gen-bar #studioRetentionNotice{margin:0;padding:6px 10px}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details>summary{display:flex}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details:not([open]) .rn-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details[open]>summary::after{content:"Hide";flex:none;text-decoration:underline;white-space:nowrap;color:#c9c2ff}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details[open] .rn-body{margin-top:4px;max-height:min(30vh,170px);overflow:auto}
  html.soa .tool-panel>.gen-bar #studioRetentionNotice details>summary:focus-visible{outline:2px solid var(--soa-focus);outline-offset:2px;border-radius:4px}

  /* --- compact adjustments --- */
  html.soa .tool-panel{padding:0 var(--soa-inset);scroll-padding-top:64px}
  /* the page's own compact pinned-mode rules (#ws as a flex column) give way to the flattened stack */
  html.soa[data-soa-pinned] .tool-panel>.workspace{display:contents}
  html.soa .tool-panel>.studio-workspace-switch{order:-80;margin:0 calc(-1 * var(--soa-inset));padding:8px var(--soa-inset)}
  html.soa .tool-panel>.mob-bar{order:-85;margin:0 calc(-1 * var(--soa-inset))}
  html.soa .tool-panel>.soa-tabs{order:-60;margin:0 calc(-1 * var(--soa-inset));padding:4px var(--soa-inset);border-bottom:1px solid var(--border,#1e1e2e);background:var(--bg2,#111118)}
  html.soa .tool-panel>.soa-tabs .soa-tab{flex:1 0 auto;height:44px;padding:0 12px;font-size:13px}
  html.soa .tool-panel>.soa-toolrow,html.soa .tool-panel>#modelsLink.model-row{min-height:56px}
  html.soa .tool-panel>.soa-toolrow .soa-tile-md{width:40px;height:40px}
  html.soa .tool-panel>.soa-toolrow-title,html.soa .soa-toolrow-title{font-size:15px}
  html.soa #studioProjectPickerRow select.sp-select{min-height:44px;height:44px;font-size:16px}
  html.soa #studioPromptCard>textarea#jPrompt{font-size:16px}
  html.soa .tool-panel .workspace>#svcPreview>summary{min-height:44px}
  html.soa .soa-tool,html.soa .soa-xtool{min-height:64px}
  /* the bar: same nodes; one column of rows, the count stepper (when the model has one) beside Generate */
  html.soa .tool-panel>.gen-bar{gap:4px 8px;padding:8px var(--soa-inset) max(10px,env(safe-area-inset-bottom,0px));box-shadow:0 -10px 18px -12px rgba(0,0,0,.7)}
  html.soa .tool-panel>.gen-bar>.gen-params{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:2px 10px;min-width:0}
  html.soa .tool-panel>.gen-bar #creditBadge,html.soa .tool-panel>.gen-bar #creditRemain,html.soa .tool-panel>.gen-bar #genParamsToggle{grid-column:auto;grid-row:auto;margin:0}
  html.soa .tool-panel>.gen-bar>*{grid-row:auto!important}
  html.soa .tool-panel>.gen-bar>.btn-gen{grid-column:1 / -1;width:100%;min-height:48px}
  html.soa .tool-panel>.gen-bar.soa-has-count>.btn-gen{grid-column:2}
  html.soa .tool-panel>.gen-bar>.soa-count{height:48px}
  html.soa .soa-count-btn{width:44px;height:44px}
  /* Results below the panel: the shell scrolls; panel = one screen, results = one screen */
  /* signed out: the page's phone showcase (landing-motion-r107.js #r107MobileExample) stays above the sign-in card, as before */
  html.soa .tool-panel .workspace:has(>#wsA:not([style*="display: none"]):not([style*="display:none"]))>#r107MobileExample{order:-1}
  html.soa #shell:not(.studio-results-active){grid-template-rows:100% 100%;overflow-x:hidden;overflow-y:auto;scroll-snap-type:y proximity}
  html.soa #shell:not(.studio-results-active)>.tool-panel{grid-row:1;scroll-snap-align:start}
  html.soa #shell:not(.studio-results-active)>.gallery{display:flex!important;grid-row:2;min-width:0;height:100%;min-height:0;border-top:1px solid var(--border,#1e1e2e);scroll-snap-align:start}
}
/* tablet 821-1100: the 232 px grouped sidebar (css/studio-oa-nav.css) + the create panel over the rest of the width */
@media(min-width:821px) and (max-width:960px){
  html.soa #shell:not(.studio-results-active)>.sidebar{grid-row:1;position:sticky;top:0;height:100%;align-self:start}
  html.soa .tool-panel>.soa-tabs{margin-top:0}
  html.soa .tool-panel{padding-top:0}
}
/* phone <= 820: no sidebar column; the compact tool navigation (.soa-nav-m, js/studio-oa-nav.js) is sticky at the top */
@media(max-width:820px){
  html.soa{--soa-inset:12px}
  html.soa[data-soa-mnav="ready"] .tool-panel>.mob-bar{display:none}
  html.soa .tool-panel>.soa-nav-m{order:-90;position:sticky;top:0;z-index:7;margin:0 calc(-1 * var(--soa-inset))}
  html.soa .tool-panel>.studio-workspace-switch{padding:6px var(--soa-inset)}
  html.soa .tool-panel>.studio-workspace-switch button{min-height:44px}
  html.soa .tool-panel>#modelsLink .model-left>div:last-child{grid-template-columns:auto minmax(0,1fr)}
}
@media(max-width:480px){
  html.soa .tool-panel>.soa-tabs .soa-tab{padding:0 9px;font-size:12.5px}
  html.soa .tool-panel>.soa-tabs{gap:2px}
}
@media(max-width:720px){
  /* D12 in the stack: room above the bar so the last row can scroll clear of the floating Pause-motion button */
  html.soa .tool-panel::before{content:"";order:99;flex:none;height:44px}
}
@media(max-width:960px) and (prefers-reduced-motion:reduce){html.soa #shell{scroll-snap-type:none}}

/* tool list rows (inline list and lane C's flyout content): scoped by class only, because flyout content lives outside the panel */
html.soa .soa-tools{display:flex;flex-direction:column;gap:4px}
html.soa .soa-tool{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;padding:5px 10px 5px 6px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--soa-text);font-family:inherit;text-align:left;cursor:pointer}
html.soa .soa-tool:hover:not(:disabled){background:rgba(255,255,255,.05)}
html.soa .soa-tool[aria-checked="true"]{border-color:var(--soa-accent);background:rgba(108,99,255,.10)}
html.soa .soa-tool:disabled{opacity:.45;cursor:not-allowed}
html.soa .soa-tool-text{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
html.soa .soa-tool-title{font-size:13px;line-height:18px;font-weight:600}
html.soa .soa-tool-desc{font-size:12px;line-height:16px;color:var(--soa-text-3);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ---------- polish-r1 (stage 4) ---------- */
/* 1. second block of the tool list: the hover menu's entries with no other mouse path (same row look, action rows, not radios) */
html.soa .soa-xtools{display:flex;flex-direction:column;gap:4px;margin-top:8px;padding-top:8px;border-top:1px solid var(--soa-line)}
html.soa .soa-xtools[hidden]{display:none!important}
html.soa .soa-xtools-title{margin:0 6px 2px;font-size:11px;line-height:16px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--soa-text-3)}
html.soa .soa-xtool{display:flex;align-items:center;gap:12px;width:100%;min-height:64px;padding:5px 10px 5px 6px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--soa-text);font-family:inherit;text-align:left;cursor:pointer}
html.soa .soa-xtool:hover{background:rgba(255,255,255,.05)}
html.soa .soa-xtool:focus-visible{outline:2px solid var(--soa-focus);outline-offset:2px}
html.soa .soa-tile-glyph{font-size:22px;line-height:1;color:var(--soa-text)}
/* 3. way forward next to an insufficient-balance refusal (the refusal node itself is not styled or changed) */
html.soa .soa-funds{margin:-4px 0 10px;font-size:12.5px;line-height:18px}
html.soa .am-result>.soa-funds{margin:6px 0}
html.soa .soa-funds-link{display:inline-flex;align-items:center;min-height:32px;padding:4px 12px;border-radius:9px;border:1px solid var(--soa-accent);background:var(--soa-accent-fill);color:var(--soa-text);font-weight:600;text-decoration:none}
html.soa .soa-funds-link:hover{background:rgba(108,99,255,.32)}
html.soa .soa-funds-link:focus-visible{outline:2px solid var(--soa-focus);outline-offset:2px}
/* 4. references: what will be sent */
html.soa #studioPromptCard>.soa-refnote{order:-3}
html.soa .soa-refnote{margin:6px 0 0;padding:6px 10px;border-radius:8px;border:1px solid rgba(251,191,36,.35);background:rgba(251,191,36,.08);color:#fcd34d;font-size:12px;line-height:17px;overflow-wrap:anywhere}
html.soa .soa-refnote[hidden]{display:none!important}
html.soa .soa-refstrip-count[data-soa-warn]{background:rgba(251,191,36,.16);color:#fcd34d}
@media(max-width:720px){html.soa .soa-funds-link{min-height:44px}}

/* fix-r3 #3: the storage notice keeps its one-line summary + "Details" at EVERY width the layer is on (the page's own style hides
   the summary from 721 px, which left the notice open at full height at 1024 and invisible after a resize from desktop) */
html.soa #studioRetentionNotice details>summary{display:flex}
html.soa #studioRetentionNotice details:not([open]) .rn-line{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.soa #studioRetentionNotice details[open]>summary::after{content:"Hide";flex:none;text-decoration:underline;white-space:nowrap;color:#c9c2ff}
html.soa #studioRetentionNotice details[open] .rn-body{margin-top:4px;max-height:min(30vh,170px);overflow:auto}
html.soa #studioRetentionNotice details>summary:focus-visible{outline:2px solid var(--soa-focus);outline-offset:2px;border-radius:4px}
@media(min-width:721px) and (max-width:960px){html.soa #studioRetentionNotice{max-height:none;overflow:visible}}
/* fix-r3 #7: in Edit video / Upscale (html[data-soa-pinned="edit"]) the old OUTPUT summary repeated the model's reservation
   length ("15 s") although the clip sets the length (its own price line says so); the summary text and label are not shown
   there. The model-change notice in the same box (#studioVariantNotice) stays visible. */
html.soa[data-soa-pinned="edit"] #studioPromptCard>.studio-output-summary>#studioModelSummary,html.soa[data-soa-pinned="edit"] #studioPromptCard>.studio-output-summary>.studio-output-summary-label{display:none}
html.soa[data-soa-pinned="edit"] #studioPromptCard>.studio-output-summary:not(:has(>#studioVariantNotice:not([hidden]))){display:none}
html.soa[data-soa-pinned="edit"] #studioPromptCard>.studio-output-summary{grid-template-columns:minmax(0,1fr)}
/* fix-r3 #8: the maximum is above the prepaid balance (shown, not blocked) */
html.soa .soa-overbal{flex-basis:100%;grid-column:1/-1;margin:0 0 4px;font-size:12px;line-height:18px;color:#fcd34d;white-space:normal}
html.soa .soa-overbal .soa-funds-link{min-height:28px;padding:2px 10px;font-size:12px}
/* fix-r3 #5: phones - Pause motion sits in the bar's right gutter above Help (bottom computed by studio-oa-panel.js) */
@media(max-width:720px){
  html.soa[data-soa-motion="bar"] #elabsMotionToggle{bottom:var(--soa-motion-bottom)!important}
  html.soa #svcPreview>summary{padding-right:56px}
}

@media(prefers-reduced-motion:reduce){html.soa .soa-chev,html.soa .soa-tab{transition:none}}

/* left-panel-gen-r1 G1/G2 (owner: the action button must be easy to see on every tool). The tools with their own action
   (Sound effects / Music .am-create, Edit video / Upscale video .sev-go) get the same full-width primary action as Generate,
   with their price line directly above it; on phones the pinned row keeps clear of the floating Pause / Help buttons
   (the 74 px reserve at <=720 px was undone by the later <=1100 px inset rule). */
html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions{flex-direction:column;align-items:stretch;flex-wrap:nowrap}
html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot>.am-create,html.soa .tool-panel #studioEditVideoActions>.sev-actions>.sev-go{order:2;width:100%;min-height:48px}
html.soa .tool-panel #studioEditVideoActions>.sev-actions>:not(.sev-go){order:1}
@media(max-width:720px){
  html.soa .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa .tool-panel #studioEditVideoActions>.sev-actions{padding-right:calc(74px + env(safe-area-inset-right,0px))}
}
@media(min-width:641px) and (max-width:1279px){
  /* left-panel-gen-r1 G1b: same Help-launcher reserve as Generate's bar */
  html.soa:has(.elh-launch.elh-studio:not([hidden])) .tool-panel #fAudioOptions:has(.am-foot) .am-foot,html.soa:has(.elh-launch.elh-studio:not([hidden])) .tool-panel #studioEditVideoActions>.sev-actions{padding-right:calc(128px + env(safe-area-inset-right,0px))}
}

/* left-panel-gen-r1 C/R: disabled actions keep >= 4.5:1 (solid colours, no opacity dimming); the disabled reason is visible */
html.soa .tool-panel #fAudioOptions .am-create:disabled{opacity:1;background:#302c39;color:#dcd8e4;box-shadow:inset 0 0 0 1px #62596f}
html.soa .tool-panel .gen-bar #genBtn:disabled{opacity:1!important;color:#dcd8e4}
html.soa .tool-panel .gen-bar #studioGenReason{order:-1;margin:0;font-size:12.5px;line-height:17px;font-weight:600;color:#ffd27a}
html.soa .tool-panel .gen-bar #studioGenReason[hidden]{display:none}

/* studio-generate-visible-r1 (owner: "Generate disappears; the page doesn't fit the window"). At 721-1100 CSS px (a desktop
   browser at 125-150% zoom on a 1280-1536 px screen, or a narrow window) the shell stacks two screens (panel, then results)
   and scrolls. Scrolling the tool form past its end chained into the shell, which then rested part-way (proximity snap) or on
   the results screen: the whole panel, Generate included, left the window. The panel now keeps its own scroll (no chaining
   into the shell); the results screen stays reachable (sidebar or shell scroll, Gallery links). The sticky bar is unchanged. */
@media(min-width:721px){html.soa .tool-panel{overscroll-behavior-y:contain}}

/* ---- /css/studio-oa-flyout.css ---- */
/* Studio OpenArt-aligned layer - generic flyout (lane C). Inert without html.soa. */
html.soa .soa-flyout-backdrop{display:none}
html.soa .soa-flyout{
  position:fixed;z-index:9001;box-sizing:border-box;display:flex;flex-direction:column;
  width:480px;max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);
  background:#16161f;color:var(--text,#e8e8f0);
  border:1px solid rgba(255,255,255,.09);border-radius:12px;
  box-shadow:0 18px 48px rgba(0,0,0,.55),0 2px 8px rgba(0,0,0,.4);
  font-family:inherit;line-height:1.35;outline:none;
  animation:soa-flyout-in .14s ease-out;
}
html.soa .soa-flyout:focus-visible{outline:2px solid var(--accent,#6c63ff);outline-offset:2px}
html.soa .soa-flyout-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 4px;flex:0 0 auto}
html.soa .soa-flyout-title{margin:0;font-size:14px;font-weight:600;letter-spacing:0;color:var(--text,#e8e8f0)}
html.soa .soa-flyout-close{
  display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:-4px -6px -4px 0;padding:0;
  border:0;border-radius:8px;background:transparent;color:var(--muted,#8888a8);font-size:20px;line-height:1;cursor:pointer;
}
html.soa .soa-flyout-close:hover{background:rgba(255,255,255,.08);color:var(--text,#e8e8f0)}
html.soa .soa-flyout-close:focus-visible{outline:2px solid var(--accent,#6c63ff);outline-offset:2px}
html.soa .soa-flyout-body{flex:1 1 auto;min-height:0;min-width:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:8px 16px 16px;overflow-wrap:anywhere}
html.soa .soa-flyout-body>*{min-width:0;max-width:100%;box-sizing:border-box}
html.soa .soa-flyout-title{min-width:0;overflow-wrap:anywhere}
@keyframes soa-flyout-in{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:none}}
@keyframes soa-flyout-up{from{opacity:.4;transform:translateY(24px)}to{opacity:1;transform:none}}
@keyframes soa-flyout-fade{from{opacity:0}to{opacity:1}}

/* Bottom sheet below 1100 px. */
html.soa .soa-flyout[data-soa-mode="sheet"]{
  left:0;right:0;bottom:0;top:auto;width:auto;max-width:none;max-height:70vh;
  border-radius:16px 16px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom,0);
  animation:soa-flyout-up .18s ease-out;
}
html.soa .soa-flyout[data-soa-mode="sheet"] .soa-flyout-head{padding:14px 16px 6px}
html.soa .soa-flyout[data-soa-mode="sheet"] .soa-flyout-head::before{
  content:"";position:absolute;top:6px;left:50%;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:rgba(255,255,255,.22);
}
html.soa .soa-flyout[data-soa-mode="sheet"] .soa-flyout-close{width:44px;height:44px;margin:-8px -10px -8px 0;font-size:24px}
html.soa .soa-flyout-backdrop[data-soa-mode="sheet"]{
  display:block;position:fixed;inset:0;z-index:9000;background:rgba(5,5,10,.6);animation:soa-flyout-fade .18s ease-out;
}
html.soa.soa-flyout-lock,html.soa.soa-flyout-lock body{overflow:hidden;overscroll-behavior:none}
@media (prefers-reduced-motion:reduce){
  html.soa .soa-flyout,html.soa .soa-flyout[data-soa-mode="sheet"],html.soa .soa-flyout-backdrop[data-soa-mode="sheet"]{animation:none}
}
/* mobile-r1: a sheet that ends above the pinned Generate / price bar (bottom set by js/studio-oa-flyout.js) is a floating card
   with all corners rounded and a clear edge, so the bar below it reads as separate and stays fully visible. */
html.soa .soa-flyout[data-soa-mode="sheet"][data-soa-above-bar="true"]{left:8px;right:8px;border-radius:16px;border-bottom:1px solid rgba(255,255,255,.09);margin-bottom:8px}
@media (min-width:600px){
  html.soa .soa-flyout[data-soa-mode="sheet"]{left:50%;right:auto;width:min(560px,calc(100vw - 32px));max-width:none;transform:translateX(-50%)}
  html.soa .soa-flyout[data-soa-mode="sheet"][data-soa-above-bar="true"]{left:50%;right:auto}
  html.soa .soa-flyout[data-soa-mode="sheet"]{animation:none}
}

/* studio-journey-defects-r2: 44 px touch target for the dialog close control on touch screens (drawn size unchanged) */
@media (pointer:coarse){html.soa .soa-flyout-close{position:relative}html.soa .soa-flyout-close::after{content:"";position:absolute;inset:-8px}}
/* ---- /css/studio-oa-output.css ---- */
/* Studio OpenArt-aligned layer - Output row + model-specific controls (lane C). Inert without html.soa. */
html.soa .soa-out{display:block;min-width:0;--soa-sel-bg:#412858;--soa-sel-border:#df86ff;--soa-surface:rgba(255,255,255,.045);--soa-line:rgba(255,255,255,.09)}
html.soa .soa-out[hidden],html.soa .soa-out [hidden],html.soa .soa-out-controls [hidden]{display:none !important}
html.soa .soa-out-own{margin:8px 0}
/* fix-c2: a host that holds only the hidden wrapper takes no space (no blank gap in modes without an Output row). */
html.soa [data-soa-output-row]:has(>.soa-out[hidden]:only-child){display:none !important}

/* Summary row: label 12/500 muted over value 14/500. */
html.soa .soa-out-row{
  display:flex;align-items:center;gap:12px;width:100%;min-height:50px;box-sizing:border-box;padding:7px 12px 7px 8px;
  border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-surface);color:var(--text,#e8e8f0);
  font:inherit;text-align:left;cursor:pointer;transition:background .15s,border-color .15s;
}
html.soa .soa-out-row:hover{background:rgba(255,255,255,.075)}
html.soa .soa-out-row[aria-expanded="true"]{border-color:var(--soa-sel-border);background:rgba(223,134,255,.09)}
html.soa .soa-out-row:focus-visible{outline:2px solid var(--accent,#6c63ff);outline-offset:2px}
html.soa .soa-out-row-icon{position:relative;flex:0 0 36px;width:36px;height:36px;border-radius:9px;background:rgba(255,255,255,.06)}
html.soa .soa-out-row-icon i{position:absolute;left:10px;right:10px;height:1.5px;background:currentColor;opacity:.85}
html.soa .soa-out-row-icon i::after{content:"";position:absolute;top:-3px;width:6px;height:6px;border-radius:50%;border:1.5px solid currentColor;background:#1b1b25;box-sizing:border-box}
html.soa .soa-out-row-icon i:first-child{top:13px}
html.soa .soa-out-row-icon i:first-child::after{left:3px}
html.soa .soa-out-row-icon i:last-child{top:22px}
html.soa .soa-out-row-icon i:last-child::after{right:3px}
html.soa .soa-out-row-text{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;gap:1px}
html.soa .soa-out-row-label{font-size:12px;font-weight:500;line-height:1.3;color:var(--muted,#8888a8)}
html.soa .soa-out-row-value{font-size:14px;font-weight:500;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.soa .soa-out-row[data-soa-pending] .soa-out-row-value{color:#ffd27a}
html.soa .soa-out-row-chevron{flex:0 0 auto;font-size:18px;line-height:1;color:var(--muted,#8888a8)}

/* Inline mode (voice / sound / music) and the no-flyout fallback. */
html.soa .soa-out-inline{padding:12px;border:1px solid var(--soa-line);border-radius:12px;background:var(--soa-surface)}
html.soa .soa-out[data-soa-mode="flyout"] .soa-out-inline{margin-top:8px}

/* Controls. */
html.soa .soa-out-controls{display:flex;flex-direction:column;gap:16px;min-width:0;color:var(--text,#e8e8f0);font-size:13px;
  --soa-sel-bg:#412858;--soa-sel-border:#df86ff;--soa-surface:rgba(255,255,255,.045);--soa-line:rgba(255,255,255,.09)}
html.soa .soa-out-ctl{min-width:0}
html.soa .soa-out-ctl-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:0 0 8px}
html.soa .soa-out-ctl-label{font-size:13px;font-weight:500;color:#c9c9d8}
html.soa .soa-out-ctl-value{font-size:12px;font-weight:500;color:var(--muted,#8888a8);font-variant-numeric:tabular-nums;margin-left:auto}
html.soa .soa-out-ctl[data-soa-unset] .soa-out-ctl-value{color:#ffd27a}
html.soa .soa-out-ctl[data-soa-invalid] .soa-out-ctl-label{color:#ffb4a8}

html.soa .soa-out-opt{
  display:flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;margin:0;padding:0 6px;border:1px solid transparent;border-radius:8px;
  background:transparent;color:#b9b9cb;font:inherit;font-size:12px;font-weight:500;line-height:1.2;cursor:pointer;transition:background .12s,color .12s,border-color .12s;
}
html.soa .soa-out-opt:hover{background:rgba(255,255,255,.07);color:var(--text,#e8e8f0)}
html.soa .soa-out-opt[aria-checked="true"]{background:var(--soa-sel-bg);border-color:var(--soa-sel-border);color:#fff}
html.soa .soa-out-opt[aria-disabled="true"]{opacity:.38;cursor:not-allowed;text-decoration:line-through}
html.soa .soa-out-opt[aria-disabled="true"]:hover{background:transparent;color:#b9b9cb}
html.soa .soa-out-opt:focus-visible,html.soa .soa-out-switch:focus-visible,html.soa .soa-out-step:focus-visible,
html.soa .soa-out-select:focus-visible,html.soa .soa-out-number:focus-visible,html.soa .soa-out-reset:focus-visible{outline:2px solid var(--accent,#6c63ff);outline-offset:2px}
html.soa .soa-out-opt[data-soa-adjusts]:not([aria-checked="true"]) .soa-out-opt-text::after{content:"\2022";margin-left:3px;color:#ffd27a}

/* Aspect ratio chips: icon shaped like the ratio over the label, ~46x56. */
html.soa .soa-out-ratio{display:grid;grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:2px;padding:4px;border-radius:10px;background:var(--soa-surface)}
html.soa .soa-out-ratio .soa-out-opt{flex-direction:column;gap:7px;min-height:56px;padding:6px 2px;font-size:12px}
html.soa .soa-out-ratio-icon{display:block;box-sizing:border-box;width:14px;height:14px;border:1.5px solid currentColor;border-radius:3px}
html.soa .soa-out-ratio-icon.soa-out-ratio-auto{border-style:dashed}
html.soa .soa-out-ratio .soa-out-opt>i{flex:0 0 auto}
html.soa .soa-out-ratio .soa-out-opt{justify-content:flex-end}
html.soa .soa-out-ratio .soa-out-opt-text{white-space:nowrap}

/* Segmented control, full width, ~36 high. */
html.soa .soa-out-segment{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:2px;padding:4px;border-radius:10px;background:var(--soa-surface)}
html.soa .soa-out-segment .soa-out-opt{min-height:36px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html.soa .soa-out-chips{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:2px;padding:4px;border-radius:10px;background:var(--soa-surface)}
html.soa .soa-out-chips .soa-out-opt{min-height:36px}
html.soa .soa-out-hint{margin:6px 0 0;font-size:11px;color:var(--muted,#8888a8)}

/* Switch row. */
html.soa .soa-out-ctl-switch{display:flex;align-items:center;gap:10px;min-height:36px}
html.soa .soa-out-ctl-switch .soa-out-ctl-value{margin-left:auto}
html.soa .soa-out-switch{position:relative;flex:0 0 auto;width:40px;height:22px;padding:0;border:0;border-radius:999px;background:rgba(255,255,255,.18);cursor:pointer;transition:background .15s}
html.soa .soa-out-switch-knob{position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .15s}
html.soa .soa-out-switch[aria-checked="true"]{background:#c35cf0}
html.soa .soa-out-switch[aria-checked="true"] .soa-out-switch-knob{transform:translateX(18px)}
html.soa .soa-out-switch:disabled{opacity:.45;cursor:not-allowed}

/* Slider with value at right and min/max captions. */
html.soa .soa-out-slider-box{padding:12px 12px 8px;border:1px solid var(--soa-line);border-radius:10px;background:rgba(255,255,255,.02)}
html.soa .soa-out-range{-webkit-appearance:none;appearance:none;display:block;width:100%;height:20px;margin:0;padding:0;background:transparent;cursor:pointer;--soa-fill:0%}
html.soa .soa-out-range::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:linear-gradient(to right,#e07cf5 0,#e07cf5 var(--soa-fill),rgba(255,255,255,.14) var(--soa-fill),rgba(255,255,255,.14) 100%)}
html.soa .soa-out-range::-moz-range-track{height:4px;border-radius:2px;background:rgba(255,255,255,.14)}
html.soa .soa-out-range::-moz-range-progress{height:4px;border-radius:2px;background:#e07cf5}
html.soa .soa-out-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;margin-top:-6px;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.5)}
html.soa .soa-out-range::-moz-range-thumb{width:16px;height:16px;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.5)}
html.soa .soa-out-range:focus-visible{outline:2px solid var(--accent,#6c63ff);outline-offset:4px;border-radius:6px}
html.soa .soa-out-range:disabled{opacity:.45;cursor:not-allowed}
html.soa .soa-out-ctl[data-soa-unset] .soa-out-range::-webkit-slider-thumb{background:#8c8ca0}
html.soa .soa-out-caps{display:flex;justify-content:space-between;gap:10px;margin-top:6px;font-size:11px;color:var(--muted,#8888a8);font-variant-numeric:tabular-nums}
html.soa .soa-out-reset{margin:0 0 0 auto;padding:2px 8px;border:1px solid var(--soa-line);border-radius:999px;background:transparent;color:var(--muted,#8888a8);font:inherit;font-size:11px;cursor:pointer}
html.soa .soa-out-reset+.soa-out-ctl-value{margin-left:0}
html.soa .soa-out-reset:hover{color:var(--text,#e8e8f0);border-color:rgba(255,255,255,.25)}

/* Stepper. */
html.soa .soa-out-ctl-stepper{display:flex;align-items:center;justify-content:space-between;gap:12px}
html.soa .soa-out-ctl-stepper .soa-out-ctl-head{margin:0}
html.soa .soa-out-stepper{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:10px;background:var(--soa-surface)}
html.soa .soa-out-step{width:34px;height:34px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--text,#e8e8f0);font:inherit;font-size:16px;line-height:1;cursor:pointer}
html.soa .soa-out-step:hover{background:rgba(255,255,255,.08)}
html.soa .soa-out-step:disabled{opacity:.35;cursor:not-allowed;background:transparent}
html.soa .soa-out-step-value{min-width:54px;text-align:center;font-size:13px;font-weight:500;font-variant-numeric:tabular-nums}

/* Select / number proxies. */
html.soa .soa-out-select,html.soa .soa-out-number{
  display:block;width:100%;min-height:38px;box-sizing:border-box;padding:6px 10px;border:1px solid var(--soa-line);border-radius:10px;
  background:#1d1d28;color:var(--text,#e8e8f0);font:inherit;font-size:13px;
}
html.soa .soa-out-select:disabled,html.soa .soa-out-number:disabled{opacity:.5;cursor:not-allowed}

/* Fixed values and notes. */
html.soa .soa-out-ctl-fixed{display:flex;align-items:baseline;justify-content:space-between;gap:12px;min-height:24px}
html.soa .soa-out-fixed-value{font-size:13px;font-weight:500;color:var(--text,#e8e8f0);text-align:right}
html.soa .soa-out-note{margin:-6px 0 0;font-size:11.5px;line-height:1.45;color:var(--muted,#8888a8)}
html.soa .soa-out-status{margin:0;padding:8px 10px;border-radius:8px;background:rgba(255,255,255,.04)}

/* Existing blocks: hidden only while the new row represents them. Never removed. */
/* fix-c2: the fully represented block is taken out of view WITHOUT display:none, so a computed display of none on it
   always means the existing page hid it (Edit video / Upscale video / Music modes) and the layer then shows no Output row. */
html.soa.soa-out-on #studioCapabilitySettings.soa-out-all{
  position:absolute !important;width:0 !important;height:0 !important;min-height:0 !important;margin:0 !important;padding:0 !important;border:0 !important;
  overflow:hidden !important;visibility:hidden !important;pointer-events:none !important;
}
html.soa.soa-out-on #studioCapabilityFields .soa-out-rep{display:none !important}
html.soa.soa-out-on .studio-output-summary{display:none !important}
html.soa.soa-out-on #genParamsToggle.native-output-entry{display:none !important}

/* Touch targets below 1100 px. */
@media (max-width:960px){
  html.soa .soa-out-row{min-height:56px}
  html.soa .soa-out-segment .soa-out-opt,html.soa .soa-out-chips .soa-out-opt{min-height:44px}
  html.soa .soa-out-ratio{grid-template-columns:repeat(auto-fill,minmax(48px,1fr))}
  html.soa .soa-out-ratio .soa-out-opt{min-height:60px}
  html.soa .soa-out-step{width:44px;height:44px}
  html.soa .soa-out-switch{width:48px;height:28px}
  html.soa .soa-out-switch-knob{top:4px;left:4px;width:20px;height:20px}
  html.soa .soa-out-switch[aria-checked="true"] .soa-out-switch-knob{transform:translateX(20px)}
  html.soa .soa-out-ctl-switch{min-height:44px}
  html.soa .soa-out-range{height:32px}
  html.soa .soa-out-range::-webkit-slider-thumb{width:22px;height:22px;margin-top:-9px}
  html.soa .soa-out-select,html.soa .soa-out-number{min-height:44px;font-size:16px}
  html.soa .soa-out-reset{min-height:32px;padding:4px 12px}
}
@media (prefers-reduced-motion:reduce){
  html.soa .soa-out-row,html.soa .soa-out-opt,html.soa .soa-out-switch,html.soa .soa-out-switch-knob{transition:none}
}

/* fix-c2: long hints, notices, labels and values wrap; nothing inside the controls can be wider than its container. */
html.soa .soa-out-controls,html.soa .soa-out-ctl,html.soa .soa-out-inline{max-width:100%;box-sizing:border-box}
html.soa .soa-out-note,html.soa .soa-out-hint,html.soa .soa-out-status,html.soa .soa-out-ctl-label,html.soa .soa-out-ctl-value,
html.soa .soa-out-fixed-value,html.soa .soa-out-reset{min-width:0;overflow-wrap:anywhere;word-break:normal;white-space:normal}
html.soa .soa-out-ctl-head{flex-wrap:wrap}
html.soa .soa-out-select,html.soa .soa-out-number{max-width:100%;min-width:0}
html.soa .soa-out-textarea{
  display:block;width:100%;max-width:100%;min-width:0;min-height:96px;box-sizing:border-box;padding:8px 10px;border:1px solid var(--soa-line);border-radius:10px;
  background:#1d1d28;color:var(--text,#e8e8f0);font:inherit;font-size:13px;line-height:1.45;resize:vertical;
}
html.soa .soa-out-textarea:focus-visible{outline:2px solid var(--accent,#6c63ff);outline-offset:2px}
html.soa .soa-out-textarea:disabled{opacity:.5;cursor:not-allowed}
@media (max-width:960px){
  html.soa .soa-out-textarea{font-size:16px}
}
/* mobile-r1: on tablets and phones a long option label (e.g. "Fixed Square 480p · 4 s · Silent") wraps inside its segment
   instead of being cut with an ellipsis: nothing is clipped. */
@media (max-width:960px){
  html.soa .soa-out-segment .soa-out-opt{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.25;padding-top:6px;padding-bottom:6px;height:auto}
}

/* ---- /css/studio-motion-panel.css ---- */
/* studio-motion-panel (S2M-r1 B8): Studio Video -> Motion. Inert unless js/studio-motion-panel.js adds html.smo-on.
   Same tokens as the left-panel layer (studio-oa-panel.css): cards #16161f, line rgba(210,211,242,.10), accent #6c63ff,
   radius 12, 480 px panel, pinned bar sticky at the bottom of the tool panel. */
.smo-panel[hidden]{display:none!important}
html.smo-on .tool-panel>:not(.smo-panel):not(.tool-head):not(.soa-tabs):not(.mob-bar):not(.soa-nav-m):not(.studio-workspace-switch){display:none!important}
html.smo-on .tool-panel>.smo-panel{order:2}
html.smo-on .tool-panel>.soa-tabs{order:1}
html.smo-on .tool-panel>.tool-head{order:0}
html.smo-on #studioFeatureLanding{display:none!important}
/* review r2 D4: wide screens, Motion open: the right column shows Motion only (heading, steps, result, library moves); the unrelated
   Viral presets / Public Gallery content below it is hidden while Motion is open and returns when another tool is chosen. */
@media (min-width:961px){html.smo-on #gb>:not(#smoLanding){display:none!important}html.smo-on #studio-results-panel>.gallery-head,html.smo-on #galleryFilterBar{display:none!important}}
.smo-lmoves{display:flex;flex-direction:column;gap:10px}
.smo-lmoves[hidden]{display:none}
.smo-lmoves-title{margin:6px 0 0;font-size:16px;font-weight:700;color:#fff}
.smo-lmoves-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-width:760px}
.smo-lmove{display:flex;flex-direction:column;gap:6px;width:100%;padding:6px;border-radius:12px;border:1px solid var(--smo-line);background:var(--smo-card);color:var(--text,#e8e8f0);cursor:pointer;text-align:left}
.smo-lmove[aria-pressed="true"]{border-color:var(--smo-accent);box-shadow:0 0 0 1px var(--smo-accent) inset}
.smo-lmove:disabled{cursor:not-allowed;opacity:.7}
.smo-landing{display:none}
html.smo-on .smo-landing{display:flex;flex-direction:column;gap:14px;padding:4px 0 18px}
.smo-lhead{display:flex;flex-direction:column;gap:6px}
.smo-eyebrow{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#c6f432}
.smo-ltitle{margin:0;font-size:30px;font-weight:800;letter-spacing:-.01em;color:#fff}
.smo-lsub{margin:0;font-size:16px;line-height:1.45;color:#b9b8cf;max-width:640px}
.smo-lslot:empty{display:none}
.smo-lslot .smo-resultcard{padding:12px}
.smo-lslot .smo-rmedia video{max-height:min(62vh,560px)}
.smo-steps{margin:0;padding:0 0 0 20px;display:flex;flex-direction:column;gap:8px;color:#d9d8ea;font-size:14px;line-height:1.45;max-width:640px}
.smo-steps li::marker{color:#a5a0ff;font-weight:700}
.smo-tile img{width:100%;height:100%;object-fit:cover}
.smo-panel,.smo-landing,.smo-sheet{--smo-card:#16161f;--smo-card2:#1c1c28;--smo-line:rgba(210,211,242,.10);--smo-accent:#6c63ff;--smo-soft:#a5a0ff;--smo-focus:#c9c4ff;--smo-muted:var(--muted,#8888a8)}
.smo-landing :focus-visible,.smo-sheet :focus-visible{outline:2px solid var(--smo-focus);outline-offset:2px}
.smo-panel{display:flex;flex-direction:column;gap:8px;flex:1 0 auto;min-width:0;color:var(--text,#e8e8f0);font-size:14px}
.smo-panel :focus-visible{outline:2px solid var(--smo-focus);outline-offset:2px}
.smo-panel button{font-family:inherit}
/* tool row: same geometry as .soa-toolrow */
.smo-toolrow{display:flex;align-items:center;gap:12px;width:100%;min-height:62px;padding:8px 14px 8px 9px;border:1px solid var(--smo-line);border-radius:12px;color:var(--text,#f1f0f8);cursor:pointer;text-align:left;
  background:linear-gradient(100deg,rgba(108,99,255,.16),rgba(56,189,248,.05) 70%),var(--smo-card)}
.smo-toolthumb{flex:none;width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#2a1f5c,#14304a);color:#c4f1ff;border:1px solid var(--smo-line)}
.smo-toolthumb svg{width:24px;height:24px}
.smo-tooltext{display:flex;flex-direction:column;min-width:0;flex:1}
.smo-kicker{font-size:12px;font-weight:500;color:var(--smo-muted);line-height:1.3}
.smo-tooltitle{font-size:16px;font-weight:600;line-height:1.3}
.smo-chev{flex:none;width:16px;height:16px;color:var(--smo-muted)}.smo-chev svg{width:16px;height:16px}
.smo-project{margin:0;padding:0 4px;font-size:12px;color:var(--smo-muted)}
.smo-project.smo-warn{color:#ffd27a}
.smo-card{background:var(--smo-card);border:1px solid var(--smo-line);border-radius:12px;padding:12px;display:flex;flex-direction:column;gap:8px;min-width:0}
.smo-h{margin:0;font-size:14px;font-weight:600;color:var(--text,#e8e8f0)}
.smo-sub{margin:0;font-size:12px;line-height:1.45;color:var(--smo-muted)}
/* character */
.smo-slots{display:flex;flex-direction:column;gap:8px}
.smo-pick,.smo-addref{display:flex;align-items:center;justify-content:center;gap:8px;min-height:120px;border:1.5px dashed rgba(165,160,255,.45);border-radius:12px;background:rgba(108,99,255,.06);color:#ddd9ff;font-size:14px;font-weight:600;cursor:pointer}
.smo-addref{min-height:44px;font-size:13px;font-weight:500;padding:0 12px;width:auto;flex:1 1 140px}
.smo-pick:disabled{opacity:.55;cursor:not-allowed}
.smo-pick-icon{width:18px;height:18px;display:inline-flex}.smo-pick-icon svg{width:18px;height:18px}
.smo-thumb{position:relative;margin:0;border-radius:12px;overflow:hidden;background:#0d0d14;border:1px solid var(--smo-line)}
.smo-thumb img{display:block;width:100%;height:100%;object-fit:contain;background:radial-gradient(ellipse at center,#22203a 0%,#0d0d14 75%)}
.smo-thumb-main{height:168px}
.smo-thumb-main .smo-cap{position:absolute;left:0;right:0;bottom:0;padding:18px 10px 8px;font-size:12px;font-weight:600;background:linear-gradient(transparent,rgba(0,0,0,.75));color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.smo-extras{display:flex;flex-wrap:wrap;gap:8px;align-items:stretch}
.smo-thumb-extra{width:72px;height:72px;flex:none}
.smo-x{position:absolute;top:6px;right:6px;width:32px;height:32px;border-radius:999px;border:1px solid rgba(255,255,255,.25);background:rgba(10,10,15,.78);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.smo-thumb-extra .smo-x{top:3px;right:3px;width:26px;height:26px}
.smo-x svg{width:14px;height:14px}.smo-x:hover{background:#2b2540}
/* tabs */
.smo-tabs{display:flex;gap:4px;padding:3px;border-radius:12px;background:rgba(255,255,255,.04);border:1px solid var(--smo-line)}
.smo-tab{flex:1;min-height:36px;border:0;border-radius:9px;background:transparent;color:var(--smo-muted);font-size:13px;font-weight:600;cursor:pointer}
.smo-tab[aria-selected="true"]{background:rgba(108,99,255,.22);color:#fff}
.smo-pane[hidden]{display:none}
/* library */
.smo-movegrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.smo-move{display:flex;flex-direction:column;gap:6px;padding:6px;border-radius:12px;background:var(--smo-card2);border:1px solid var(--smo-line);min-width:0}
.smo-move.is-chosen{border-color:var(--smo-accent);box-shadow:0 0 0 1px var(--smo-accent) inset}
.smo-movemedia{position:relative;display:block;border-radius:8px;overflow:hidden;background:#000;aspect-ratio:1/1}
/* review r2 D6: square tiles zoomed on the figure. Measured over every frame of the 7 landscape previews (428x240): the figure stays inside
   x 168-268, y 86-223, so cover + scale(1.35) about (50%, 64%) keeps every limb in view while it fills about 3/4 of the tile height. */
.smo-preview{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 50%;transform:scale(1.35);transform-origin:50% 64%;background:#000}
.smo-secs{position:absolute;right:6px;bottom:6px;padding:2px 6px;border-radius:6px;font-size:11px;font-weight:600;background:rgba(0,0,0,.7);color:#fff}
.smo-movename{font-size:12px;font-weight:600;line-height:1.3;min-height:2.6em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.smo-use{min-height:32px;padding:0 6px;border-radius:9px;border:1px solid rgba(165,160,255,.4);background:rgba(108,99,255,.14);color:#ece9ff;font-size:12px;font-weight:600;cursor:pointer}
.smo-use.is-chosen{background:var(--smo-accent);border-color:var(--smo-accent);color:#fff}
.smo-use:disabled:not(.is-chosen){opacity:.55;cursor:not-allowed}
/* clip */
.smo-cliphead{display:flex;align-items:center;justify-content:space-between;gap:8px}
.smo-clipname{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.smo-link{background:none;border:0;color:#c9c2ff;text-decoration:underline;font-size:12px;cursor:pointer;padding:6px 2px;min-height:32px}
.smo-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.smo-fig{margin:0;display:flex;flex-direction:column;gap:4px;min-width:0}
.smo-fig video{width:100%;aspect-ratio:16/9;background:#000;border-radius:8px;object-fit:contain}
.smo-fig figcaption,.smo-reading figcaption{font-size:11px;color:var(--smo-muted)}
.smo-reading{margin:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;aspect-ratio:16/9;border-radius:8px;background:repeating-linear-gradient(135deg,#15151f,#15151f 10px,#191926 10px,#191926 20px);border:1px solid var(--smo-line)}
.smo-reading figcaption{font-size:13px;font-weight:600;color:#ece9ff}
.smo-elapsed{font-size:11px;color:var(--smo-muted)}
.smo-person{margin:0;font-size:12px;color:#b8f5c8}
.smo-trim{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.smo-range{display:grid;grid-template-columns:56px 1fr 40px;align-items:center;gap:8px;font-size:12px}
.smo-range input{width:100%;min-height:32px;accent-color:var(--smo-accent)}
.smo-range output{text-align:right;font-variant-numeric:tabular-nums}
.smo-spinner{width:18px;height:18px;border-radius:50%;border:2px solid rgba(165,160,255,.3);border-top-color:#c9c4ff;animation:smo-spin .9s linear infinite;flex:none}
@keyframes smo-spin{to{transform:rotate(360deg)}}
/* scene */
.smo-textarea{width:100%;box-sizing:border-box;min-height:96px;resize:vertical;padding:10px 12px;border-radius:10px;border:1px solid var(--smo-line);background:#0f0f16;color:var(--text,#e8e8f0);font:inherit;font-size:13px;line-height:1.45}
/* output row: same geometry as the left-panel Output row */
.smo-outrow{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:7px 12px 7px 8px;border-radius:12px;border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.043);color:var(--text,#e8e8f0);cursor:pointer;text-align:left}
.smo-outicon{flex:none;width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:var(--smo-card2);color:var(--smo-soft)}.smo-outicon svg{width:18px;height:18px}
.smo-outtext{display:flex;flex-direction:column;min-width:0;flex:1}
.smo-outvalue{font-size:14px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.smo-err{display:none;padding:8px 10px;border-radius:10px;background:rgba(255,92,92,.08);border:1px solid rgba(255,120,120,.25);color:#ffb3b3;font-size:13px;line-height:1.4}
.smo-err.show{display:block}
.smo-err button{margin-top:8px}
.smo-secondary{min-height:44px;padding:0 16px;border-radius:12px;border:1px solid rgba(165,160,255,.45);background:rgba(108,99,255,.16);color:#f1efff;font-weight:600;font-size:13px;cursor:pointer}
.smo-secondary:disabled{opacity:.55;cursor:not-allowed}
/* result card */
.smo-result[hidden]{display:none}
.smo-progress{display:flex;align-items:center;gap:10px;padding:12px;border-radius:12px;background:linear-gradient(100deg,rgba(108,99,255,.18),rgba(56,189,248,.06));border:1px solid rgba(165,160,255,.3);font-size:13px;font-weight:600}
.smo-progress .smo-elapsed{margin-left:auto}
.smo-resultcard{display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:12px;background:var(--smo-card);border:1px solid rgba(165,160,255,.35)}
.smo-rmedia{display:grid;grid-template-columns:1fr;gap:6px}
.smo-rmedia.is-compare{grid-template-columns:1fr 1fr}
.smo-rmedia video{width:100%;aspect-ratio:16/9;object-fit:contain;background:#000;border-radius:8px}
.smo-rmeta{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;font-size:12px;color:var(--smo-muted)}
.smo-saved{color:#b8f5c8;font-weight:600}
.smo-switch{margin-left:auto;display:inline-flex;align-items:center;gap:8px;min-height:32px;background:none;border:0;color:var(--text,#e8e8f0);font-size:12px;cursor:pointer;padding:0}
.smo-switch-knob{display:inline-block;position:relative;width:30px;height:18px;border-radius:999px;background:#3a3550;flex:none}
.smo-switch-knob::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:left .15s}
.smo-switch[aria-checked="true"] .smo-switch-knob{background:var(--smo-accent)}
.smo-switch[aria-checked="true"] .smo-switch-knob::after{left:14px}
.smo-ractions{display:flex;flex-wrap:wrap;gap:6px}
.smo-act{min-height:36px;padding:0 12px;border-radius:9px;border:1px solid var(--smo-line);background:var(--smo-card2);color:var(--text,#e8e8f0);font-size:12px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;text-decoration:none}
.smo-act.is-primary{background:var(--smo-accent);border-color:var(--smo-accent);color:#fff}
/* pinned bar: Generate is always rendered and sticky at the bottom of the tool panel */
.smo-bar{position:sticky;bottom:0;z-index:7;margin:auto calc(-1 * var(--soa-inset,9px)) 0;padding:8px var(--soa-inset,9px) 12px;display:flex;flex-direction:column;gap:6px;
  background:var(--bg2,#111118);border-top:1px solid var(--border,#2e2e44);box-shadow:0 -10px 24px rgba(10,10,15,.65)}
.smo-hint{margin:0;font-size:12px;line-height:1.35;color:var(--smo-muted);min-height:16px}
.smo-hint.smo-hint-reason{color:#e6e2ff;font-weight:500}
.smo-over{margin:0;font-size:12px;color:#ffd27a}.smo-over a{color:#ffd27a;font-weight:700}
.smo-generate{width:100%;min-height:48px;padding:12px 16px;border-radius:12px;border:1px solid #b49ae5;background:#7040c4;color:#fff;font-size:15px;font-weight:800;letter-spacing:.01em;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.smo-generate:hover:not(:disabled){background:#6032ac;border-color:#ffc1ff;box-shadow:0 0 24px rgba(230,70,255,.5)}
.smo-generate:disabled{background:#302c39;color:#c9c4d6;border-color:#62596f;cursor:not-allowed}
.smo-notice{font-size:12px;color:#b4b2cc;line-height:1.4}
.smo-notice[hidden]{display:none}
/* review r2 D6: the stored-video disclosure sits directly under Generate and wraps instead of truncating */
.smo-notice>summary{cursor:pointer;list-style-position:inside;white-space:normal;text-decoration:underline;text-decoration-color:rgba(180,178,204,.45);text-underline-offset:2px}
.smo-notice-body{margin:4px 0 0;max-height:min(24vh,140px);overflow:auto}
/* sheets reuse the left-panel flyout look (.soa-flyout); these are the Motion contents */
.smo-sheet{z-index:9002}
.smo-sheet-back[data-soa-mode="flyout"]{display:none}
.smo-osec{display:flex;flex-direction:column;gap:8px;padding:8px 0;border-bottom:1px solid var(--smo-line,rgba(210,211,242,.10))}
.smo-osec:last-child{border-bottom:0}
.smo-oh{margin:0;font-size:12px;font-weight:500;color:var(--muted,#8888a8)}
.smo-radios{display:flex;flex-wrap:wrap;gap:6px}
.smo-radio{min-height:40px;min-width:56px;padding:4px 12px;border-radius:10px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);color:var(--text,#e8e8f0);font-size:13px;font-weight:600;cursor:pointer;display:inline-flex;flex-direction:column;align-items:center;justify-content:center}
.smo-radio[aria-checked="true"]{background:#6c63ff;border-color:#6c63ff;color:#fff}
.smo-radio:disabled{opacity:.4;cursor:not-allowed}
.smo-radio-note{font-size:11px;font-weight:500;opacity:.8}
.smo-ppane{display:flex;flex-direction:column;gap:8px;padding-top:8px}
.smo-pgrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.smo-pitem{display:flex;flex-direction:column;gap:4px;width:100%;padding:4px;border-radius:10px;border:1px solid rgba(255,255,255,.1);background:#1c1c28;color:var(--text,#e8e8f0);cursor:pointer;text-align:left}
.smo-pitem img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:7px;background:#0d0d14}
.smo-pitem:disabled{opacity:.45;cursor:not-allowed}
.smo-pname{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.smo-upload{display:flex;flex-direction:column;gap:6px;padding:14px;border-radius:12px;border:1.5px dashed rgba(165,160,255,.45);background:rgba(108,99,255,.06)}
.smo-upload-title{font-weight:600;font-size:14px}
.smo-upload input{min-height:44px;color:var(--text,#e8e8f0)}
.smo-tile svg,.smo-nm-icon svg{width:22px;height:22px}
.smo-nm-icon{color:#7dd3fc}
@media (max-width:960px){.smo-thumb-main{height:160px}}
/* The floating Help / Pause-motion buttons get a gutter INSIDE the pinned bar (same reserves the native Generate bar uses:
   128 px at 821-1279 px, 74 px on phones), so they never cover Generate or any panel control. */
@media (min-width:821px) and (max-width:1279px){html:has(.elh-launch.elh-studio:not([hidden])) .smo-bar{padding-right:128px}}
@media (max-width:820px){
  .smo-panel{font-size:15px}
  .smo-bar{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .smo-pgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .smo-movegrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .smo-tab,.smo-use,.smo-act,.smo-radio{min-height:44px}
  .smo-bar{padding-right:calc(74px + env(safe-area-inset-right,0px));min-height:118px;justify-content:flex-end}
  html.soa.smo-on .tool-panel::before{display:none}
  html.soa.smo-on:not(.smo-x) .elh-launch.elh-studio{bottom:calc(14px + env(safe-area-inset-bottom,0px))!important}
  html.soa.smo-on:not(.smo-x) #elabsMotionToggle{bottom:calc(70px + env(safe-area-inset-bottom,0px))!important}
  .smo-x{width:36px;height:36px}
}
@media (prefers-reduced-motion:reduce){.smo-spinner{animation:none;border-top-color:rgba(165,160,255,.3)}.smo-switch-knob::after{transition:none}}
/* formations-r8 */
.smo-formations{margin-top:14px}.smo-formgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;list-style:none;margin:6px 0 0;padding:0}
.smo-form{display:flex;flex-direction:column;gap:4px;min-width:0}.smo-form.is-chosen{grid-column:1/-1}
.smo-formmedia{position:relative;display:block;border-radius:8px;overflow:hidden;background:#0d0d14;aspect-ratio:16/9}
.smo-formposter,.smo-form .smo-formvid{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;transform:none;background:#0d0d14}
.smo-form .smo-formvid{z-index:1}.smo-formnoresult{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:12px;opacity:.7}
.smo-forminset{position:absolute;z-index:2;left:5px;bottom:5px;width:46px;height:26px;border-radius:5px;overflow:hidden;background:#000;border:1px solid rgba(255,255,255,.4);box-shadow:0 1px 5px rgba(0,0,0,.5);pointer-events:none}
.smo-forminset img{display:block;width:100%;height:100%;object-fit:contain}
.smo-formcount{position:absolute;z-index:2;right:5px;top:5px;padding:2px 6px;border-radius:999px;background:rgba(8,8,14,.72);color:#fff;font:600 11px/1.3 Inter,system-ui,sans-serif}
.smo-form .smo-movename{min-width:0}.smo-formmeta{display:block;font-size:12px;line-height:1.3;opacity:.85}
.smo-formsel{display:grid;grid-template-columns:132px 1fr;gap:4px 10px;align-items:center}.smo-formguide{width:132px;height:74px;object-fit:contain;background:#000;border-radius:6px;grid-row:1/3}
.smo-formsel .smo-sub{margin:0}@media (max-width:480px){.smo-formsel{grid-template-columns:1fr}.smo-formguide{grid-row:auto;width:100%;height:auto;aspect-ratio:16/9}}

/* motion-r9: too-small picture message (was unstyled: bare 12px text touching the tile) and failed-thumbnail tile */
.smo-sub.smo-warn{margin:8px 0 0;padding:9px 12px;border-radius:10px;background:rgba(255,210,122,.1);border:1px solid rgba(255,210,122,.38);color:#ffd27a;font-size:13px;line-height:1.45}
.smo-sub.smo-warn[hidden]{display:none}
.smo-thumb.smo-thumb-failed{min-height:88px;display:flex;align-items:flex-end;background:repeating-linear-gradient(135deg,#12121c,#12121c 10px,#171724 10px,#171724 20px)}
.smo-thumb.smo-thumb-failed .smo-cap{position:static;padding:8px 40px 8px 10px;width:100%;box-sizing:border-box}
/* solo-shoulder-r1: the K-pop Solo tile (portrait result) sits in the same row as the group tiles; narrower media box so it stays <320 px tall */
.smo-form--tall .smo-formmedia{aspect-ratio:9/16;width:60%;margin:0 auto}
.smo-form--tall .smo-forminset{width:22px;height:38px}
.smo-form--tall .smo-formcount{right:4px;top:4px}

/* motion-create-r1: "Create your character" step (Character card). Media-first: a gradient-framed card with a live shape line, price before the click. */
.smo-create{display:flex;flex-direction:column;gap:8px;margin-top:2px}
.smo-create[hidden],.smo-create-box[hidden],.smo-create-toggle[hidden],.smo-create-progress[hidden]{display:none}
.smo-create-toggle{display:flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:0 14px;border-radius:12px;border:1px solid rgba(165,160,255,.45);background:rgba(108,99,255,.12);color:#e9e6ff;font-size:13px;font-weight:600;cursor:pointer}
.smo-create-toggle:hover{background:rgba(108,99,255,.2)}
.smo-create-box{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:14px;border:1px solid rgba(165,160,255,.4);background:linear-gradient(135deg,rgba(108,99,255,.2),rgba(56,189,248,.07) 65%),#12121b;box-sizing:border-box;min-width:0}
.smo-create-head{display:flex;align-items:flex-start;gap:10px}
.smo-create-icon{flex:none;width:36px;height:36px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#6c63ff,#38bdf8);color:#fff}
.smo-create-icon svg{width:18px;height:18px}
.smo-create-headtext{min-width:0}
.smo-create-title{margin:0 0 2px;font-size:15px;font-weight:700;color:var(--text,#f1f0f8)}
.smo-create-guide{font-size:12.5px;line-height:1.5;color:#c9c8e0}
.smo-create-label{font-size:12px;font-weight:600;color:var(--smo-soft)}
.smo-create-text{min-height:108px;font-size:14px}
.smo-create-shape{font-size:12px;color:var(--smo-muted)}
.smo-create-go{width:100%;min-height:46px;font-size:14px;background:linear-gradient(135deg,#6c63ff,#4f8cff);border-color:transparent;color:#fff}
.smo-create-go:disabled{background:rgba(108,99,255,.22);color:#cfcdf0}
.smo-create-hint{min-height:0}
.smo-create-progress{display:flex;flex-direction:column;gap:6px}
.smo-create-bar{display:block;height:6px;border-radius:99px;background:rgba(255,255,255,.08);position:relative;overflow:hidden}
.smo-create-bar::after{content:"";position:absolute;inset:0 auto 0 -40%;width:40%;border-radius:99px;background:linear-gradient(90deg,#6c63ff,#38bdf8);animation:smoCreateSlide 1.3s ease-in-out infinite}
.smo-create-progtext{font-size:12.5px;color:#d8d6f3}
@keyframes smoCreateSlide{to{left:100%}}
@media (prefers-reduced-motion:reduce){.smo-create-bar::after{animation:none;inset:0;width:100%;opacity:.55}}
/* ---- /css/studio-motion-sources.css ---- */
/* studio-motion-sources (WP-A): add-on styles. Uses the Motion panel's own tokens; no inline styles anywhere. */
.smo-panel .sms-sub,.smo-sheet .sms-sub{margin:0;font-size:12px;line-height:1.45;color:var(--smo-muted,#8888a8)}
.sms-err{margin:0;padding:8px 10px;border-radius:9px;background:rgba(248,113,113,.12);color:#fecaca;font-size:12px;line-height:1.4}
.sms-pick,.sms-read{min-height:44px;padding:0 14px;border-radius:10px;border:1px dashed var(--smo-line,rgba(210,211,242,.2));background:var(--smo-card2,#1c1c28);color:var(--text,#e8e8f0);font-size:13px;font-weight:600;cursor:pointer}
.sms-read{border-style:solid;border-color:rgba(165,160,255,.35)}
.sms-pick:disabled,.sms-read:disabled{opacity:.5;cursor:not-allowed}
.sms-pick:focus-visible,.sms-read:focus-visible,.sms-link:focus-visible,.sms-pitem:focus-visible{outline:2px solid var(--smo-focus,#c9c4ff);outline-offset:2px}
.sms-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.sms-name{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sms-link{background:none;border:0;padding:6px 4px;min-height:32px;color:var(--smo-soft,#a5a0ff);font-size:12px;text-decoration:underline;cursor:pointer}
.sms-fig,.sms-pfig{margin:0;display:flex;flex-direction:column;gap:4px;min-width:0}
.sms-fig video,.sms-pfig video,.sms-pfig img{width:100%;aspect-ratio:16/9;object-fit:contain;background:#000;border-radius:10px}
.sms-fig figcaption,.sms-pfig figcaption{font-size:11px;color:var(--smo-muted,#8888a8)}
.sms-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sms-empty{display:flex;align-items:center;justify-content:center;aspect-ratio:16/9;border-radius:10px;border:1px dashed var(--smo-line,rgba(210,211,242,.2));font-size:12px;color:var(--smo-muted,#8888a8);text-align:center;padding:6px}
.sms-line,.sms-ok,.sms-reading{margin:0;font-size:12px}
.sms-ok{color:#86efac}
.sms-trim{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.sms-kicker{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--smo-muted,#8888a8);padding:0}
.sms-range{display:grid;grid-template-columns:56px 1fr 40px;align-items:center;gap:8px;font-size:12px}
.sms-range input{min-height:32px;width:100%}
.sms-pgrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.sms-pitem{width:100%;min-height:44px;padding:8px;border-radius:10px;border:1px solid var(--smo-line,rgba(210,211,242,.2));background:var(--smo-card2,#1c1c28);color:var(--text,#e8e8f0);font-size:12px;text-align:left;cursor:pointer;overflow:hidden;text-overflow:ellipsis}
.sms-upload{display:flex;flex-direction:column;gap:6px;margin-top:10px;font-size:13px;font-weight:600}
@media (max-width:520px){.sms-pair{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){.sms-fig video,.sms-pfig video{scroll-behavior:auto}}

/* ---- /css/studio-motion-save.css ---- */
/* studio-motion-save: classes only (CSP: no inline style attributes). Lead links this file next to the Motion panel css. */
.smv-box{margin:.6rem 0 0;padding:.7rem;border:1px solid rgba(255,255,255,.14);border-radius:12px;background:rgba(255,255,255,.04)}
.smv-row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.smv-input,.smv-select{flex:1 1 12rem;min-height:44px;padding:.4rem .7rem;border-radius:10px;border:1px solid rgba(255,255,255,.2);background:transparent;color:inherit;font:inherit}
.smv-range{flex:1 1 12rem;min-height:44px}
.smv-btn{min-height:44px;padding:.4rem .9rem;border-radius:10px;border:1px solid rgba(255,255,255,.25);background:transparent;color:inherit;font:inherit;cursor:pointer}
.smv-btn:disabled{opacity:.55;cursor:default}
.smv-input:focus-visible,.smv-select:focus-visible,.smv-range:focus-visible,.smv-btn:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.smv-msg{margin:.4rem 0 0;font-size:.9rem;min-height:1.2em}

/* ---- /css/studio-motion-integration.css ---- */
/* motion-studio-r1 integration (lead): styles the add-ons need together. Panel tokens only; no inline styles. */
/* .smo-card sets display:flex, which beat the [hidden] attribute: an empty Preview card showed as a blank bar. */
.smo-panel .smo-card[hidden],.smo-panel [data-smo-previewer][hidden]{display:none}
/* WP-B "How to use your clip": two stacked option cards (the add-on ships no stylesheet). */
.smo-route{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;border:0;min-width:0}
.smo-route-opt{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid var(--smo-line,rgba(210,211,242,.10));border-radius:10px;background:var(--smo-card2,#1c1c28);cursor:pointer;min-width:0}
.smo-route-opt:has(input:checked){border-color:var(--smo-accent,#6c63ff);background:rgba(108,99,255,.10)}
.smo-route-opt input{flex:0 0 auto;width:18px;height:18px;margin:1px 0 0;accent-color:var(--smo-accent,#6c63ff)}
.smo-route-opt input:focus-visible{outline:2px solid var(--smo-focus,#c9c4ff);outline-offset:2px}
.smo-route-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.smo-route-text strong{font-size:13px;font-weight:600;line-height:1.35;color:var(--text,#e8e8f0)}
.smo-route-text .smo-sub{display:block}
/* WP-C preset note sits before .smo-panel inside .tool-panel; the panel's Motion-mode rule hid every sibling, so the preset note
   ("Closest move…", "needs a new move…") was invisible. :is(#…) lifts specificity above that rule; it shows just above the panel. */
html.smo-on .tool-panel>:is([data-smo-preset-note],#smo-preset-note-x){display:block!important;order:2;margin:0 0 10px;padding:10px 12px;border:1px solid rgba(165,160,255,.35);border-radius:10px;background:rgba(108,99,255,.10);color:var(--text,#e8e8f0);font-size:13px;line-height:1.45}

/* ---- /css/studio-motion-r2.css ---- */
/* motion-studio-r2: result title, preset proof labels, preset strip in the Motion panel. No inline styles. */
.smo-rtitle{margin:2px 0 0;font:700 15px/1.3 Inter,system-ui,sans-serif;color:#f4f2ff;overflow-wrap:anywhere}
.ep-proof{position:absolute;top:8px;left:8px;z-index:2;display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;font:700 11.5px/1 Inter,system-ui,sans-serif;letter-spacing:.01em;border:1px solid rgba(255,255,255,.25);background:rgba(10,10,15,.72);color:#fff}
.ep-proof--proven{background:rgba(22,101,52,.88);border-color:rgba(134,239,172,.55);color:#eafff0}
.ep-proof--new{background:rgba(67,56,202,.85);border-color:rgba(199,210,254,.5);color:#eef0ff}
.smo-pstrip{margin:0 0 10px;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.08);min-width:0}
.smo-pstrip[hidden]{display:none}
.smo-pstrip-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:0 0 8px}
.smo-pstrip-title{margin:0;font:700 13px/1.2 Inter,system-ui,sans-serif;color:#ece9ff}
.smo-pstrip-all{font:600 12px/1 Inter,system-ui,sans-serif;color:#b9b2ff;text-decoration:none}
.smo-pstrip-all:hover,.smo-pstrip-all:focus-visible{text-decoration:underline}
.smo-pstrip-list{display:flex;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;margin:0;padding:0 0 4px;list-style:none;scrollbar-width:thin}
.smo-pstrip-item{flex:0 0 auto;scroll-snap-align:start}
.smo-pchip{position:relative;display:flex;flex-direction:column;width:104px;padding:0;border:1px solid rgba(255,255,255,.12);border-radius:10px;background:#12121a;color:#f1efff;cursor:pointer;overflow:hidden;text-align:left;font:inherit}
.smo-pchip:hover{border-color:rgba(168,85,247,.6)}
.smo-pchip:focus-visible{outline:2px solid #a855f7;outline-offset:2px}
.smo-pchip.is-soon{opacity:.72}
.smo-pchip-img{display:block;width:100%;height:84px;object-fit:cover;background:#000}
.smo-pchip-media{position:relative;display:block}
.smo-pchip-vid{position:absolute;left:0;top:0;width:100%;height:100%;object-fit:cover;background:#000;opacity:0;transition:opacity .15s;pointer-events:none}
.smo-pchip.is-playing .smo-pchip-vid{opacity:1}
.smo-pchip-name{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;padding:6px 7px 2px;min-height:calc(2 * 1.25em);font:600 12px/1.25 Inter,system-ui,sans-serif;overflow:hidden;overflow-wrap:anywhere}
.smo-pchip-tag{display:inline-block;margin:0 7px 7px;padding:2px 7px;border-radius:999px;font:700 10.5px/1.3 Inter,system-ui,sans-serif;background:rgba(255,255,255,.12);color:#e9e7ff;align-self:flex-start}
.smo-pchip-tag.is-proven{background:rgba(22,101,52,.9);color:#eafff0}
.smo-pchip-tag.is-new{background:rgba(67,56,202,.9);color:#eef0ff}
@media (max-width:480px){.smo-pchip{width:84px}.smo-pchip-img{height:72px}}
/* the Motion mode rule hides tool-panel siblings; keep the strip, ordered with the preset note (DOM order: strip, note, panel) */
html.smo-on .tool-panel>:is([data-smo-pstrip],#smo-pstrip-x):not([hidden]){display:block!important;order:2}/* :is(#id) lifts specificity over the Motion-mode hide rule, as for the preset note */
/* motion-studio-r3: no hidden chips. Wider panels wrap into a 4-up grid; phones keep one row with "Show all N" to wrap. */
.smo-pstrip-acts{display:inline-flex;align-items:baseline;gap:12px}
.smo-pstrip-more{padding:0;border:0;background:none;color:#b9b2ff;font:600 12px/1 Inter,system-ui,sans-serif;cursor:pointer}
.smo-pstrip-more:hover,.smo-pstrip-more:focus-visible{text-decoration:underline}
.smo-pstrip.is-open .smo-pstrip-list{flex-wrap:wrap;overflow:visible}
@media (min-width:600px){.smo-pstrip-more{display:none}.smo-pstrip-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;overflow:visible;padding:0}.smo-pchip{width:auto}.smo-pchip-img{height:64px}}
/* r3 sheets: status line on top, video kept small enough that the button stays in view, Director target choice */
.smv-msg--top{margin:0 0 8px;min-height:1.2em;font-weight:600}
.smv-msg.is-ok{color:#b8f5c8}.smv-msg.is-error{color:#ffb4b4}
.smo-sheet .smv-video{display:block;width:100%;height:min(36vh,300px);object-fit:contain;background:#000;border-radius:8px}/* r3: fixed height so the sheet is placed at its real size (it is placed before the video loads) and the button stays in view */
.smv-hint{margin:0 0 10px;font-size:12.5px;line-height:1.4;color:var(--smo-muted,#b5b2c8)}
.smv-choice{display:grid;gap:8px;margin:0 0 10px}
.smv-opt{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid rgba(255,255,255,.14);border-radius:10px;cursor:pointer}
.smv-opt:has(input:checked){border-color:#a855f7;background:rgba(168,85,247,.10)}
.smv-opt input{margin-top:3px;accent-color:#a855f7}
.smv-opt-text{display:grid;gap:2px}.smv-opt-sub{font-size:12.5px;color:var(--smo-muted,#b5b2c8);overflow-wrap:anywhere}
.dao-offer{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 10px;padding:10px 12px;border:1px solid rgba(255,255,255,.14);border-radius:10px;background:rgba(168,85,247,.10)}
.dao-text{margin:0;flex:1 1 200px;overflow-wrap:anywhere}
.dao-btn{min-height:40px;padding:0 14px;border-radius:8px;border:1px solid #a855f7;background:#a855f7;color:#fff;cursor:pointer}.dao-btn:disabled{opacity:.6;cursor:default}
.smo-pstrip-item,.smo-pchip{min-width:0}
.smo-pchip-mode{display:block;padding:0 7px 4px;font:600 10px/1.25 Inter,system-ui,sans-serif;color:#c4b5fd;overflow-wrap:anywhere}


/* motion-landing-r4 v3: project picker under the Motion "can't open a project" message */
.smo-err .smo-projchoice{display:flex;flex-direction:column;gap:4px;margin-top:8px;color:#ece9ff}
.smo-err .smo-projselect{min-height:40px;border-radius:9px;border:1px solid rgba(165,160,255,.4);background:#16161f;color:#ece9ff;font-size:13px;padding:0 8px}

/* motion-p4 (owner 11-20): the Motion graphics composer does not belong in the Motion (dance) tool view */
html.smo-on #hfStudioCompose{display:none!important}

/* size-fix-r1 (2026-11-24): (1) phones: a count stepper (Enhance and other multi-output models) gets its own row above Generate, so the
   button keeps its full label and "up to $x" price (it was cut to "enerate / up t$0.04" beside the stepper at 390/360); (2) Motion's pinned bar
   reserves the 128px Help gutter at 641-820px too (the <=820px rule only reserved the 74px phone gutter, which the labelled Help pill covers). */
@media (max-width:480px){
  html.soa .tool-panel>.gen-bar.soa-has-count>.soa-count{grid-column:1 / -1;justify-content:space-between;height:40px}
  html.soa .tool-panel>.gen-bar.soa-has-count>#genBtn{grid-column:1 / -1}
  html.soa .tool-panel>.gen-bar .btn-gen{white-space:normal;min-width:0;line-height:1.2}
}
@media (min-width:641px) and (max-width:820px){html:has(.elh-launch.elh-studio:not([hidden])) .smo-bar{padding-right:calc(128px + env(safe-area-inset-right,0px))}}

/* motion-phone-landing-r1: sticky primary action on the Motion landing (Results pane); hidden where the landing sits beside Create */
.smo-landing-cta{display:none}
@media (max-width:960px){html.smo-on .smo-landing-cta{display:block;position:sticky;bottom:12px;z-index:5;margin:6px 64px 0 0;padding:0}
html.smo-on .smo-cta-btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;border:0;border-radius:12px;background:#c8ff3d;color:#0b0b12;font-weight:700;font-size:1rem;line-height:1.2;font-family:inherit;text-decoration:none;cursor:pointer;box-shadow:0 6px 22px rgba(0,0,0,.45)}
html.smo-on .smo-cta-btn:focus-visible{outline:2px solid #fff;outline-offset:2px}}

/* studio-director-responsive-r1 (late bundle) */
/* D1 (P2): 721-820 px (tablet portrait, e.g. 768 / 810 / 820) - the Studio home panel kept its hard-coded left:332px although the sidebar is a drawer
   below 821 px, so the landing sat in a 490 px column beside a 332 px blank band. Phones already reset it at 720 px; the soa layer follows the sidebar from 821 px. */
@media (min-width:721px) and (max-width:820px){html.soa #homePanel{left:0}}
/* D2 (P2): >=821 px and shorter than 760 px (the owner's 1280x571 window): the fixed "Pause animations" chip (left:12px;bottom:12px) sat on the last
   sidebar rows. The sidebar now ends above the chip (its own scroll is unchanged), so the chip rests on bare background. >=760 px already reserves 104 px. */
@media (min-width:821px) and (max-height:759px){html.soa #sidebar{max-height:calc(100vh - 65px - 52px);max-height:calc(100dvh - 65px - 52px)}}
/* D5 (P2): the "signed out because your session ended" notice is left:50% + translateX(-50%) with shrink-to-fit width, so it can only grow to half the
   viewport: on a phone it wrapped to one word per line and covered the tool panel. Fit its content; on phones span the width and sit under the header,
   clear of the pinned Generate bar. (Doubled class: the header injects its own <style> later at runtime. Same fix belongs in js/elabs-header.js: see SHARED-HUNKS.) */
.el-session-notice.el-session-notice{width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box}
@media (max-width:820px){.el-session-notice.el-session-notice{left:16px;right:16px;transform:none;width:auto;max-width:none;top:76px;bottom:auto}.el-session-notice.el-session-notice>span{flex:1 1 0;min-width:0}}

/* swap-panel-polish-r3: Character Swap custom panel on short windows (e.g. 1280x571): the action bar stays in the flow at the end of the panel instead of floating over the Upload / Gallery buttons */
@media (max-height:760px){html .csw-custom .csw-actbar{position:static;margin-top:12px}html .csw-custom{scroll-padding-bottom:24px}}

/* frontend-nits-r3: character slot states, earlier results, move preview */
.smo-creating{display:flex;align-items:center;justify-content:center;min-height:72px;padding:12px;border-radius:10px;border:1px dashed rgba(165,160,255,.5);background:rgba(165,160,255,.08);color:#ece9ff;font-size:13px;font-weight:600}
.smo-using{margin:6px 0 0;font-size:12px;color:var(--smo-muted,#b8b4d6)}
.smo-link{background:none;border:0;padding:0;margin:0;color:#c9c4ff;font:inherit;font-weight:600;text-decoration:underline;cursor:pointer}
.smo-link:focus-visible{outline:2px solid #c9c4ff;outline-offset:2px;border-radius:3px}
.smo-earlier{margin-top:10px}
.smo-earlier-list{list-style:none;margin:6px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}
.smo-earlier-item{display:flex;flex-direction:column;gap:4px;min-width:0}
.smo-earlier-item video{width:100%;max-height:200px;aspect-ratio:9/16;background:#000;border-radius:8px;object-fit:contain}
.smo-selrow{display:flex;align-items:center;gap:8px;margin:0 0 4px}
.smo-selrow .smo-selmove{margin:0;min-width:0}
.smo-selprev{flex:0 0 auto;width:30px;height:44px;border-radius:6px;overflow:hidden;background:#000;display:block}
.smo-selprev video{width:100%;height:100%;object-fit:cover;display:block}

/* formations-r1: layout selector (Solo | Duo | Trio | Five | Seven), guide, and the one-picture block in the Character card */
.smo-layouts{display:flex;flex-direction:column;gap:6px;margin:10px 0 0;padding:8px 10px;border-radius:12px;background:var(--smo-card2);border:1px solid var(--smo-line);min-width:0}
.smo-layouts .smo-h{margin:0}.smo-layouts .smo-sub{margin:0}
.smo-layoutrow{display:flex;flex-wrap:wrap;gap:6px}
.smo-layout{min-height:40px;padding:0 14px;border-radius:999px;border:1px solid var(--smo-line);background:transparent;color:inherit;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.smo-layout.is-chosen{background:rgba(108,99,255,.28);border-color:rgba(165,160,255,.7)}
.smo-layout:disabled{opacity:.6;cursor:default}.smo-layout:focus-visible{outline:2px solid #c9c4ff;outline-offset:2px}
.smo-layoutguide{display:grid;grid-template-columns:132px 1fr;gap:4px 10px;align-items:center}.smo-layoutguide .smo-formguide{grid-row:1/3}
.smo-formpic{display:flex;flex-direction:column;gap:6px;margin:0 0 10px;padding:8px 10px;border-radius:12px;background:var(--smo-card2);border:1px solid var(--smo-line)}
.smo-formpic p{margin:0}.smo-formpic-title{font-size:13px;font-weight:700}
.smo-formpic-actions{display:flex;flex-wrap:wrap;gap:8px 14px;align-items:center}.smo-formpic-actions .smo-secondary{min-height:40px}
@media (max-width:480px){.smo-layout{min-height:44px}.smo-layoutguide{grid-template-columns:1fr}.smo-layoutguide .smo-formguide{grid-row:auto;width:100%;height:auto;aspect-ratio:16/9}.smo-formpic-actions .smo-secondary{min-height:44px}}
.smo-layoutresult{margin:8px 0 0}.smo-layoutresult .smo-formmedia{aspect-ratio:640/368;width:100%;max-width:420px}.smo-layoutresult .smo-formposter,.smo-layoutresult .smo-formvid{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;transform:none;background:#0d0d14}.smo-layoutresult .smo-formvid{z-index:1}
