/* Phone wallpaper column and detail (docs/wallpapers.md §6–§7). Tokens only; the phone
   frame and Duo model are product mock-ups, the wallpaper itself is never filtered. */

/* ---- Column ---- */
.gallery-ui .wp-intro h1{margin:0}
/* Filters (2026-11-16): everything left-aligned — device · price · sort segments in one row,
   category chips below; the list keeps the full width for larger tiles. */
.gallery-ui .wp-toolbar{display:grid;justify-items:start;gap:var(--ac-space-3)}
.gallery-ui .wp-toolbar-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ac-space-3)}
.gallery-ui .wp-categories{max-width:100%;padding:2px 0}
.gallery-ui .wp-count{margin:var(--ac-space-5) 0;color:var(--ac-fg-muted);font-size:var(--ac-text-sm)}
.gallery-ui .wp-section .community-empty a{color:var(--ac-accent)}
/* Three columns on desktop (user 2026-11-16: larger showcases), two between 761 and 1023px;
   phones keep the shared one/two-column switch. */
@media(width >= 1024px){.gallery-ui .wp-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:48px 32px}}
@media(width < 1024px) and (width > 760px){.gallery-ui .wp-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:40px 24px}}
/* Caption (no author, no Tags): title with the price beneath it on the left, like · cart on the right. */
.gallery-ui .wp-card .wp-card-meta{display:flex;align-items:center;justify-content:space-between;gap:var(--ac-space-3);padding-top:var(--ac-space-4)}
.gallery-ui .wp-card-caption{display:grid;gap:2px;min-width:0;flex:1 1 auto}
.gallery-ui .wp-card-caption h3{font-size:var(--ac-text-base,16px)}
.gallery-ui .wp-card-caption .card-price{justify-content:flex-start;color:var(--ac-fg-muted);font-weight:var(--ac-weight-regular)}
.gallery-ui .wp-card-caption .card-price[data-free]{color:var(--ac-fg)}
.gallery-ui .wp-card-actions{display:flex;align-items:center;flex:none;gap:2px;color:var(--ac-fg-muted)}
.gallery-ui .wp-card-meta .wp-card-actions .community-like{margin-left:0}
/* List tiles reuse the shared card grid (.community-grid) and card meta; only the art differs. */
/* Showcase module (public/wallpaper-showcase.js): card-ratio stage + pure-CSS device shells.
   One thumbnail request per tile; no frame images. Each shell is the screen element itself
   (thumbnail as its <img>) plus a border, so it costs two boxes and no extra paint layers.
   Proportions measured on the real assets (2026-11-11, docs/wallpapers.md §6.1):
   - iPhone 18 Pro frame PNG 1301×2716: frame 3.65% of body width (titanium edge + black
     glass border), body radius 18.1% of width, screen radius 15.6% of screen width,
     Dynamic Island 23.4%×4.1% of the screen, 1.6% from its top.
   - Duo open (live model): titanium edge + grey bezel ≈1.8% of width, four corners r≈7.4%,
     hinge in the middle.
   - Duo closed (live model, outer display 1398×2034): titanium edge ≈2.6% + black bezel
     ≈1.5% of width; hinge side (left) square, free side (right) r≈14.6% of width; punch-hole
     camera at 90%/6.6% of the screen, Ø 3% of its width.
   Screen aspect ratios equal the thumbnail regions, so object-position selects them exactly:
   iPhone 360:782; Duo inner = left 432:304, outer = right 208:304 of the 640×304 thumbnail. */
/* The art link does not clip: devices may grow past the frame on hover (frame = ::before). */
.gallery-ui .wp-card .wp-card-art{display:block;overflow:visible;text-decoration:none}
/* No frame shadow on hover (user 2026-11-12): override the shared card-tile hover shadow. */
.gallery-ui .wp-card .wp-card-art,.gallery-ui .wp-card:hover .wp-card-art{box-shadow:none}
.gallery-ui .wp-card{position:relative}
.gallery-ui .wp-showcase{--wp-ti:#c9c6c0;position:relative;display:block;aspect-ratio:1536/969;border-radius:var(--ac-radius-card);container-type:size;isolation:isolate}
.gallery-ui .wp-showcase::before{content:"";position:absolute;inset:0;z-index:0;border-radius:inherit;background:var(--ac-surface);pointer-events:none;transition:background-color 520ms var(--ac-ease-standard)}
:root[data-theme="dark"] .gallery-ui .wp-showcase{--wp-ti:#77757a}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .gallery-ui .wp-showcase{--wp-ti:#77757a}}
.gallery-ui .wp-sc-stage{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;perspective:140cqh}
/* Device = screen box; border = glass bezel (--wp-bw, --wp-bezel); outline ring = titanium edge.
   Real thickness (user 2026-11-14: "looks like paper"): the device is a preserve-3d box with two
   titanium layers behind the glass (::before at half depth, ::after at full --wp-depth), so the
   metal side frame shows whenever the device turns; the back layer casts the drop shadow. The
   frame is lit from the left (light → titanium → dark) and the bezel has a faint glass sheen. */
.gallery-ui .wp-sc-device{position:relative;display:block;flex:none;box-sizing:content-box;--wp-bezel:#0b0b0c;
 background:linear-gradient(135deg,color-mix(in srgb,var(--wp-bezel),#fff 18%),var(--wp-bezel) 34%,var(--wp-bezel) 72%,color-mix(in srgb,var(--wp-bezel),#fff 8%)) border-box;
 border:var(--wp-bw) solid transparent;box-shadow:0 0 0 var(--wp-edge) var(--wp-ti);transform-style:preserve-3d;transform:var(--wp-rest,none);transition:transform 520ms cubic-bezier(.2,.8,.2,1)}
.gallery-ui .wp-sc-device::before,.gallery-ui .wp-sc-device::after{content:"";position:absolute;inset:calc(-1 * (var(--wp-bw) + var(--wp-edge)));border-radius:inherit;pointer-events:none;
 background:linear-gradient(90deg,color-mix(in srgb,var(--wp-ti),#fff 60%),var(--wp-ti) 42%,color-mix(in srgb,var(--wp-ti),#000 42%))}
.gallery-ui .wp-sc-device::before{transform:translateZ(calc(var(--wp-depth) * -.5))}
.gallery-ui .wp-sc-device::after{transform:translateZ(calc(var(--wp-depth) * -1));box-shadow:0 1.6cqh 4cqh -1cqh rgb(0 0 0 / .28);transition:box-shadow 520ms cubic-bezier(.2,.8,.2,1)}
.gallery-ui .wp-sc-screen{position:relative;display:block;width:100%;height:100%;overflow:hidden;border-radius:inherit;background:#1c1c1e}
.gallery-ui .wp-sc-screen img{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-drag:none;user-select:none;pointer-events:none}
.gallery-ui .wp-sc-device[data-crop="left"] img{object-position:0% 50%}
.gallery-ui .wp-sc-device[data-crop="right"] img{object-position:100% 50%}
.gallery-ui .wp-sc-time{position:absolute;z-index:1;left:0;right:0;text-align:center;color:#fff;font-weight:600;line-height:1;letter-spacing:-.02em;text-shadow:0 .2cqh 1.2cqh rgb(0 0 0 / .3);font-family:var(--ac-font-sans)}
/* iPhone 18 Pro: screen 80cqh tall → 36.83cqh wide; body 39.6cqh: black border 2.2% (.87cqh) + titanium 1.4% (.55cqh). */
.gallery-ui .wp-sc-phone{--wp-edge:.55cqh;--wp-bw:.87cqh;--wp-depth:3.6cqh;height:80cqh;aspect-ratio:360/782;border-radius:6.6cqh}
.gallery-ui .wp-sc-phone .wp-sc-screen{border-radius:5.75cqh}
.gallery-ui .wp-sc-phone .wp-sc-screen::before{content:"";position:absolute;z-index:2;top:1.6%;left:38.3%;width:23.4%;height:4.1%;border-radius:99px;background:#000}
.gallery-ui .wp-sc-phone .wp-sc-time{top:10.5%;font-size:8.6cqh}
/* iPhone pair (user 2026-11-14, option A): Home Screen phone behind (90 % size, raised, left),
   Lock Screen phone in front (lowered, right) — the Duo pair's rhythm. Border, radii and edge
   scale with the height so both match the measured iPhone 18 Pro frame. */
.gallery-ui .wp-showcase[data-device="iphone"] .wp-sc-stage{padding-left:3cqh}
.gallery-ui .wp-sc-phone.wp-sc-home{--wp-edge:.5cqh;--wp-bw:.78cqh;--wp-depth:3.2cqh;height:72cqh;border-radius:5.94cqh;margin-right:-9cqh;--wp-rest:translateY(-6cqh)}
.gallery-ui .wp-sc-phone.wp-sc-home .wp-sc-screen{border-radius:5.18cqh}
.gallery-ui .wp-sc-phone.wp-sc-lock{z-index:1;--wp-rest:translateY(5cqh)}
/* Home Screen: 4 × 4 app grid + Dock, frosted white so any artwork stays readable. */
.gallery-ui .wp-sc-icons{position:absolute;z-index:1;inset:13% 10% auto;display:grid;grid-template-columns:repeat(4,1fr);column-gap:13%;row-gap:4.2cqh}
.gallery-ui .wp-sc-dock{position:absolute;z-index:1;left:5%;right:5%;bottom:2.4%;height:10%;display:grid;grid-template-columns:repeat(4,1fr);align-items:center;column-gap:11%;padding:0 7%;border-radius:3cqh;background:rgb(255 255 255 / .3)}
.gallery-ui :is(.wp-sc-icons,.wp-sc-dock) i{display:block;aspect-ratio:1;border-radius:26%;background:rgb(255 255 255 / .62);box-shadow:inset 0 0 0 .12cqh rgb(255 255 255 / .5),0 .3cqh .8cqh rgb(0 0 0 / .22)}
/* iPhone Duo: open device behind, folded device (outer display) in front, offset to the right. */
.gallery-ui .wp-showcase[data-device="duo"] .wp-sc-stage{padding-left:4cqh}
/* Open: screen 56cqh tall → 79.6cqw-equivalent width; bezel ≈1.8% of width ≈1.45cqh. */
.gallery-ui .wp-sc-open{--wp-edge:.25cqh;--wp-bw:1.2cqh;--wp-depth:1.8cqh;--wp-bezel:#2b2b2e;height:56cqh;aspect-ratio:432/304;border-radius:6cqh;--wp-rest:translateY(-5cqh)}
.gallery-ui .wp-sc-open .wp-sc-screen{border-radius:4.8cqh}
/* Folded: screen 60cqh tall → 41cqh wide; titanium 1.1% (.5cqh) + bezel 1.5% (.65cqh) of width; hinge side square. */
.gallery-ui .wp-sc-outer{--wp-edge:.5cqh;--wp-bw:.65cqh;--wp-depth:3.4cqh;z-index:1;height:60cqh;aspect-ratio:208/304;margin-left:-14cqh;border-radius:0 6.4cqh 6.4cqh 0;--wp-rest:translateY(7cqh)}
.gallery-ui .wp-sc-outer .wp-sc-screen{border-radius:0 5.8cqh 5.8cqh 0}
.gallery-ui .wp-sc-outer .wp-sc-screen::before{content:"";position:absolute;z-index:2;top:6.6%;left:90%;width:3%;aspect-ratio:1;border-radius:50%;background:#050505;box-shadow:0 0 0 .3cqh #1a1a1c;transform:translate(-50%,-50%)}
.gallery-ui .wp-sc-outer .wp-sc-time{top:11%;font-size:8cqh}
/* Tile actions: author · like · add-to-cart. The cart button copies the shared
   card action (favorites.css / gallery.css: 44px target, muted 16px icon, accent on hover). */
.gallery-ui .card-meta .wp-card-cart{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:44px;min-height:44px;padding:0 var(--ac-space-2);border:0;border-radius:var(--ac-radius-full);background:transparent;color:var(--ac-fg-muted);font:inherit;cursor:pointer;transition:color var(--ac-duration-fast) var(--ac-ease-standard)}
.gallery-ui .card-meta .wp-card-cart>svg{display:block;width:16px;height:16px;flex:none}
.gallery-ui .card-meta .wp-card-cart[aria-pressed="true"]{color:var(--ac-accent)}
@media(hover:hover) and (pointer:fine){:where(:root:not([data-input-kind="touch"])) .gallery-ui .card-meta .wp-card-cart:hover{color:var(--ac-accent)}}
.gallery-ui .card-meta .wp-card-cart:focus-visible{outline:2px solid var(--ac-focus);outline-offset:-2px}
/* Hover / keyboard focus (pointer devices only; none for touch or reduced motion):
   - the frame (::before) darkens slightly — neutral, no glow or outline;
   - the devices grow past the frame (enlarged 2026-11-14): the iPhone pair fans out upwards
     (Lock Screen ×1.42 forward-right, Home Screen ×1.36 back-left), clear of the title row; iPhone Duo's
     open and folded devices turn outwards like a book opening and break out at top/bottom-right;
   - a light sweep crosses the glass once. Transform/opacity only; layers are promoted only
     while hovered, and the hovered tile is raised above its neighbours. */
.gallery-ui .wp-sc-screen::after{content:"";position:absolute;inset:-10% -60%;z-index:3;pointer-events:none;background:linear-gradient(105deg,transparent 40%,rgb(255 255 255 / .28) 50%,transparent 60%);transform:translateX(-70%);opacity:0}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 :where(:root:not([data-input-kind="touch"])) .gallery-ui .wp-card:is(:hover,:focus-within){z-index:2}
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-showcase::before{background-color:var(--ac-secondary-hover)}
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-sc-device{will-change:transform}
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-sc-device::after{box-shadow:0 4cqh 8cqh -2cqh rgb(0 0 0 / .34)}
 /* iPhone pair fans out like the Duo pair: Home Screen swings back-left and up so its grid
    shows, Lock Screen comes forward-right; the back phone starts a beat later. */
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-sc-home{transform:translate(-13cqh,-17cqh) rotateY(20deg) rotateX(4deg) scale(1.36);transition-delay:40ms}
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-sc-lock{transform:translate(9cqh,-7cqh) rotateY(-16deg) rotateX(4deg) scale(1.42)}
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-sc-open{transform:translate(-9cqh,-17cqh) rotateY(16deg) scale(1.38)}
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-sc-outer{transform:translate(10cqh,12cqh) rotateY(-20deg) scale(1.5)}
 :where(:root:not([data-input-kind="touch"])) .gallery-ui :is(.wp-card:hover,.wp-card-art:focus-visible) .wp-sc-screen::after{opacity:1;transform:translateX(70%);transition:transform 900ms cubic-bezier(.3,.7,.2,1) 80ms,opacity 200ms}
}
@media(prefers-reduced-motion:reduce){.gallery-ui .wp-sc-device,.gallery-ui .wp-sc-device::after,.gallery-ui .wp-showcase::before{transition:none}}
@media(width <= 760px){.gallery-ui .wp-toolbar-row{gap:var(--ac-space-2)}.gallery-ui .wp-toolbar-row .ac-tabs{max-width:100%;overflow-x:auto;scrollbar-width:none}
 /* Mobile (user 2026-11-14): devices larger by default. Uniform scale of the stage keeps the
    measured proportions; iPhone stays inside the frame, Duo fills more of the width. */
 .gallery-ui .wp-showcase[data-device="iphone"] .wp-sc-stage{scale:1.1}
 .gallery-ui .wp-showcase[data-device="duo"] .wp-sc-stage{scale:1.22}
 /* The scaled Duo pair may reach a few px past the tile; never let it widen the page. */
 .gallery-ui .wp-grid{overflow-x:clip;overflow-y:visible}
 /* Two-column tiles: caption on top, like · cart below as equal columns. */
 :root:not([data-mobile-columns="1"]) .gallery-ui .wp-card .wp-card-meta{flex-direction:column;align-items:stretch;gap:0;padding-top:var(--ac-space-3)}
 :root:not([data-mobile-columns="1"]) .gallery-ui .wp-card-caption h3{font-size:14px}
 :root:not([data-mobile-columns="1"]) .gallery-ui .wp-card-actions{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);margin-top:2px}
 :root:not([data-mobile-columns="1"]) .gallery-ui .wp-card-actions>*{width:100%;min-width:0;padding:0;justify-content:center}}

/* ---- Detail stage ---- */
/* Same frame as the paid 3D detail: no panel behind the device; the model sits on the page. */
.gallery-ui .wp-media{min-width:0}
.gallery-ui .wp-stage{position:relative;display:grid;place-items:center;width:100%;aspect-ratio:4/3;min-height:360px;max-height:min(78vh,760px);background:transparent;overflow:hidden;isolation:isolate}
.gallery-ui .wp-media[data-device="iphone"] .wp-stage{aspect-ratio:1/1}
.gallery-ui .wp-stage>[hidden]{display:none!important}
.gallery-ui .wp-live,.gallery-ui .wp-flat{position:absolute;inset:0;display:grid;place-items:center;transition:opacity 260ms var(--ac-ease-standard)}
.gallery-ui .wp-stage[data-switching] .wp-live,.gallery-ui .wp-stage[data-switching] .wp-flat{opacity:0}
/* Loading (JS only): the paid stage loader, centred; the device fades in when its first frame
   is ready, so the large outer-display image never flashes before the folded model. */
.gallery-ui .wp-loading{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:var(--ac-space-3);color:var(--ac-fg-muted);font-size:var(--ac-text-xs);pointer-events:none;transition:opacity var(--ac-duration-slow) var(--ac-ease-standard)}
.gallery-ui .wp-loading svg{width:22px;height:22px;animation:cs-spin .9s linear infinite}
.gallery-ui .wp-loading::before{content:"";position:absolute;left:50%;top:66%;width:52%;aspect-ratio:5/1;border-radius:50%;background:radial-gradient(closest-side,color-mix(in srgb,var(--ac-fg) 7%,transparent),transparent);transform:translateX(-50%);animation:cs-breathe 1.6s var(--ac-ease-standard) infinite alternate}
:root:not(.image-reveal-enabled) .gallery-ui .wp-loading,.gallery-ui .wp-stage:not([data-state="loading"]) .wp-loading{opacity:0}
:root.image-reveal-enabled .gallery-ui .wp-stage[data-state="loading"] :is(.wp-live,.wp-flat){opacity:0}
@keyframes cs-spin{to{transform:rotate(360deg)}}
@keyframes cs-breathe{from{opacity:.5}to{opacity:1}}
/* Flat view: the watermarked previews themselves, no frame. */
.gallery-ui .wp-flat{display:flex;align-items:center;justify-content:center;padding:var(--ac-space-8);box-sizing:border-box;container-type:size}
/* Flat view, Duo (user 2026-11-12): outer (closed) and inner (open, landscape window) screens,
   each in the same black glass border + titanium edge as the list showcase. Heights share one
   row; widths follow each screen's aspect so the pair fits the stage. Same materials in both
   themes (device colours, not UI tokens). */
/* Both screens share one height (the Duo's inner and outer displays are the same height):
   limited by the stage height and by the row width (outer 0.687 + open landscape 2670/1878 ≈ 1.4217 + gap). */
.gallery-ui .wp-cases{--wp-ti:#c9c6c0;--wp-case-h:min(64cqh,calc((100cqw - 10cqh) / (.6873 + 1.4217 + .08)));display:flex;align-items:flex-start;justify-content:center;gap:6cqh;width:100%;height:auto}
:root[data-theme="dark"] .gallery-ui .wp-cases{--wp-ti:#77757a}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .gallery-ui .wp-cases{--wp-ti:#77757a}}
.gallery-ui .wp-case{display:flex;flex-direction:column;align-items:center;gap:2.4cqh;margin:0;min-width:0}
.gallery-ui .wp-case-shell{position:relative;display:block;box-sizing:content-box;aspect-ratio:var(--wp-ratio);background:#0b0b0c;border:solid #0b0b0c;box-shadow:0 0 0 var(--wp-edge) var(--wp-ti),0 2cqh 5cqh -1.4cqh rgb(0 0 0 / .3)}
.gallery-ui .wp-case-screen{position:relative;display:block;width:100%;height:100%;overflow:hidden;border-radius:inherit;background:#1c1c1e}
/* Flat-view screens are canvases painted from the watermarked preview (2026-11-14). */
.gallery-ui :is(.wp-case-screen,.wp-iphone-screen)>canvas{display:block;width:100%;height:100%;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.gallery-ui .wp-case-screen img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% var(--wp-crop-y,50%);-webkit-user-drag:none;user-select:none;pointer-events:none}
.gallery-ui .wp-case figcaption{color:var(--ac-fg-muted);font-size:var(--ac-text-xs);white-space:nowrap}
/* Folded: outer display, square hinge edge on the left, punch-hole camera top right. */
.gallery-ui .wp-case--outer .wp-case-shell{--wp-edge:.3cqh;height:var(--wp-case-h);border-width:1.4cqh;border-radius:0 6.6cqh 6.6cqh 0}
.gallery-ui .wp-case--outer .wp-case-screen{border-radius:0 6cqh 6cqh 0}
.gallery-ui .wp-case--outer .wp-case-screen::before{content:"";position:absolute;z-index:2;top:6.6%;left:90%;width:3%;aspect-ratio:1;border-radius:50%;background:#050505;box-shadow:0 0 0 .3cqh #1a1a1c;transform:translate(-50%,-50%)}
/* Open: inner display in landscape, one continuous image (no hinge line drawn; user decision 2026-11-13). */
.gallery-ui .wp-case--open .wp-case-shell{--wp-edge:.3cqh;height:var(--wp-case-h);border-width:1.4cqh;border-color:#2b2b2e;border-radius:6.6cqh}
.gallery-ui .wp-case--open .wp-case-screen{border-radius:5.4cqh}
/* iPhone no-JS fallback: the same framed phone as the live preview, static. */
.gallery-ui .wp-flat .wp-iphone--static{height:88%}
/* Duo flat: closed and open at one shared height so their real proportions compare. */
/* iPhone 18 Pro mock-up: frame PNG 1350×2760, screen opening 72,69 → 1277,2690 (1206×2622, 1:1 with the display). */
.gallery-ui .wp-iphone{position:relative;height:88%;aspect-ratio:1350/2760;filter:drop-shadow(0 18px 30px rgb(0 0 0 / .18))}
/* The screen runs ≈4 frame px under the opaque black bezel on every side (2026-11-14): when the
   bezel's inner edge and the screen edge land on the same sub-pixel, two half-covered layers let
   the white page show through as a 1-px light line. Opening 72,69 → 1277,2690 of 1350×2760;
   the bezel's black band is ≈12 px wide, so the overlap is always hidden. */
.gallery-ui .wp-iphone-screen{position:absolute;left:5.037%;top:2.355%;width:89.926%;height:95.29%;overflow:hidden;border-radius:15.9% / 7.35%;background:#000;container-type:inline-size}
.gallery-ui .wp-iphone-screen>canvas{display:block;width:100%;height:100%}
.gallery-ui .wp-iphone-screen>img{display:block;width:100%;height:100%;object-fit:cover;-webkit-user-drag:none;user-select:none}
.gallery-ui .wp-iphone-bezel{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;-webkit-user-drag:none}
/* Lock Screen overlay (fixed white type, as on iOS); toggled by the control. */
.gallery-ui .wp-lock{position:absolute;inset:0;pointer-events:none;color:#fff;text-shadow:0 1px 8px rgb(0 0 0 / .28);font-family:var(--ac-font-sans);transition:opacity 220ms var(--ac-ease-standard)}
.gallery-ui [data-lockscreen="off"] .wp-lock{opacity:0}
.gallery-ui .wp-lock-date{position:absolute;left:0;right:0;top:13%;text-align:center;font-size:5.4cqi;font-weight:600;letter-spacing:.01em;opacity:.92}
.gallery-ui .wp-lock-time{position:absolute;left:0;right:0;top:15.5%;text-align:center;font-size:24cqi;line-height:1;font-weight:600;letter-spacing:-.02em}
.gallery-ui .wp-lock-buttons{position:absolute;left:10%;right:10%;bottom:6%;display:flex;justify-content:space-between}
.gallery-ui .wp-lock-buttons span{display:grid;place-items:center;width:13cqi;height:13cqi;border-radius:50%;background:rgb(0 0 0 / .32);backdrop-filter:blur(8px)}
.gallery-ui .wp-lock-buttons svg{width:6cqi;height:6cqi}
.gallery-ui .wp-lock-bar{position:absolute;left:35%;right:35%;bottom:1.8%;height:.9cqi;min-height:3px;border-radius:9px;background:#fff;opacity:.9}
/* Duo live model: canvas stage owned by the fold controller. */
.gallery-ui .wp-duo{position:absolute;inset:0}
.gallery-ui .wp-duo .duo-webgl{position:absolute;inset:0;transform:translateX(var(--duo-intro-x,0%))}
.gallery-ui .wp-duo .duo-webgl canvas{display:block;width:100%;height:100%}
.gallery-ui .wp-duo-rotor{position:absolute;inset:0;transition:transform 450ms cubic-bezier(.42,0,.58,1)}
.gallery-ui .wp-duo[data-orientation="portrait"] .wp-duo-rotor{transform:rotate(90deg) scale(var(--wp-portrait-scale,.75))}
.gallery-ui .wp-fallback-note{position:absolute;left:var(--ac-space-4);right:var(--ac-space-4);bottom:var(--ac-space-3);margin:0;text-align:center;color:var(--ac-fg-muted);font-size:var(--ac-text-xs)}
/* Controls: the paid 3D detail bar — view pills on the left, tool pills on the right. */
.gallery-ui .wp-media .ac-detail-media-bar{margin-top:var(--ac-space-6)}
.gallery-ui .wp-controls{flex:1 1 100%;display:flex;align-items:center;flex-wrap:wrap;gap:var(--ac-space-2) var(--ac-space-3)}
.gallery-ui .wp-tools{margin-left:auto}
.gallery-ui .wp-controls .dw-tab svg{width:16px;height:16px;flex:none}
.gallery-ui .wp-controls .dw-tab[aria-pressed="true"]{background:var(--ac-bg);color:var(--ac-fg);box-shadow:0 1px 4px #00000012}
.gallery-ui .wp-controls .dw-tab:disabled{opacity:.45;cursor:default}
.gallery-ui .wp-controls [hidden]{display:none!important}
.gallery-ui .wp-media .detail-image-source{flex-basis:100%;margin:0}
/* iPhone has no view tabs (2026-11-12): the notice moves up into the same row as the Lock
   Screen button (left), instead of leaving an empty row above it. */
.gallery-ui .wp-media[data-device="iphone"] .ac-detail-media-bar{display:flex;align-items:center;gap:var(--ac-space-3);flex-wrap:nowrap}
.gallery-ui .wp-media[data-device="iphone"] .wp-controls{order:2;flex:0 0 auto;margin-left:auto}
.gallery-ui .wp-media[data-device="iphone"] .detail-image-source{order:1;flex:1 1 auto;min-width:0}
@media(width < 480px){.gallery-ui .wp-media[data-device="iphone"] .ac-detail-media-bar{align-items:flex-start}}
.gallery-ui .wp-detail .ac-detail-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(width < 1024px){.gallery-ui .wp-detail .ac-detail-actions{grid-template-columns:minmax(0,1fr) max-content max-content}}
.gallery-ui .wp-detail .paid-price-line{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ac-space-2)}
.gallery-ui .wp-downloads{display:grid;gap:var(--ac-space-2);width:100%}
@media(width < 768px){.gallery-ui .wp-tools{margin-left:0}}
@media(width < 480px){.gallery-ui .wp-tools .wp-tool-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.gallery-ui .wp-tools .dw-tab{width:36px;padding:0}}
@media(width < 480px) and (pointer:coarse){.gallery-ui .wp-tools .dw-tab{width:44px;height:44px}}
@media(width <= 760px){.gallery-ui .wp-stage{aspect-ratio:1/1;min-height:300px}.gallery-ui .wp-media[data-device="duo"] .wp-stage{aspect-ratio:4/3.4;min-height:0}.gallery-ui .wp-flat{gap:var(--ac-space-3);padding:var(--ac-space-4)}}
@media(prefers-reduced-motion:reduce){.gallery-ui .wp-live,.gallery-ui .wp-flat,.gallery-ui .wp-lock,.gallery-ui .wp-duo-rotor,.gallery-ui .wp-loading{transition:none}.gallery-ui .wp-loading svg,.gallery-ui .wp-loading::before{animation:none}}

/* Detail-only controls: never mounted on homepage/list showcases. */
.gallery-ui .wp-interaction{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ac-space-3);flex-basis:100%;min-width:0}
.gallery-ui .wp-interaction[hidden]{display:none}
.gallery-ui .wp-interaction .dw-tab[aria-pressed="true"]{background:var(--ac-bg);color:var(--ac-fg);box-shadow:var(--ac-shadow-sm)}
/* Fold angle: shadcn/ui Slider in a pill matching the dw-tab toolbar (no native range). */
.gallery-ui .wp-angle{display:flex;align-items:center;gap:var(--ac-space-3);flex:1 1 260px;min-width:0;min-height:44px;padding:0 var(--ac-space-4);border-radius:var(--ac-radius-full);background:var(--ac-surface);font-size:var(--ac-text-sm)}
.gallery-ui .wp-angle[hidden]{display:none}
.gallery-ui .wp-angle-label{flex:none;color:var(--ac-fg-muted);white-space:nowrap}
.gallery-ui .wp-angle-host{flex:1;min-width:0}
.gallery-ui .wp-angle-slider{display:flex;align-items:center;gap:var(--ac-space-3)}
.gallery-ui .wp-angle-slider .ac-slider{flex:1;min-height:36px;cursor:pointer}
.gallery-ui .wp-angle-slider [data-slot=slider-track]{height:6px;background:var(--ac-border)}
.gallery-ui .wp-angle-slider [data-slot=slider-range]{background:var(--ac-fg)}
:root[data-theme="dark"] .gallery-ui .wp-angle-slider [data-slot=slider-thumb]{background:var(--ac-fg)}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .gallery-ui .wp-angle-slider [data-slot=slider-thumb]{background:var(--ac-fg)}}
.gallery-ui .wp-angle-slider [data-slot=slider-thumb]{width:22px;height:22px;border:0;background:var(--ac-bg);box-shadow:0 0 0 1px var(--ac-border-strong),var(--ac-shadow-sm);transition:transform var(--ac-duration-fast) var(--ac-ease-standard);cursor:grab}
.gallery-ui .wp-angle-slider [data-slot=slider-thumb]:active{transform:scale(1.12);cursor:grabbing}
.gallery-ui .wp-angle-slider .ac-slider[data-disabled]{cursor:default}
.gallery-ui .wp-angle-value{flex:none;min-width:4ch;color:var(--ac-fg);font-variant-numeric:tabular-nums;font-weight:var(--ac-weight-medium);text-align:end}
@media(prefers-reduced-motion:reduce){.gallery-ui .wp-angle-slider [data-slot=slider-thumb]{transition:none}}
/* One-time drag hint over the model (fine pointers only); fades in after the first unfold. */
.gallery-ui .wp-rotate-hint{position:absolute;left:50%;bottom:var(--ac-space-4);z-index:2;display:inline-flex;align-items:center;gap:var(--ac-space-2);padding:var(--ac-space-2) var(--ac-space-4);border-radius:var(--ac-radius-full);background:color-mix(in srgb,var(--ac-fg) 78%,transparent);color:var(--ac-bg);font-size:var(--ac-text-sm);line-height:1.2;white-space:nowrap;pointer-events:none;opacity:0;transform:translate(-50%,6px);transition:opacity var(--ac-duration-base) var(--ac-ease-standard),transform var(--ac-duration-base) var(--ac-ease-standard)}
.gallery-ui .wp-rotate-hint[hidden]{display:none}
.gallery-ui .wp-rotate-hint[data-visible="true"]{opacity:1;transform:translate(-50%,0)}
.gallery-ui .wp-rotate-hint svg{flex:none}
@media(prefers-reduced-motion:reduce){.gallery-ui .wp-rotate-hint{transition:none;transform:translate(-50%,0)}}
.gallery-ui .wp-interaction [role="status"]:empty{display:none}
@media(hover:hover) and (pointer:fine){.gallery-ui .wp-duo .duo-webgl{cursor:grab}.gallery-ui .wp-duo .duo-webgl:active{cursor:grabbing}}
@media(pointer:coarse){.gallery-ui .wp-interaction .dw-tab{min-height:44px}}

/* ---- Admin publishing (P3, /admin/commerce/?section=wallpapers) ---- */
.gallery-ui .wp-admin-actions{display:flex;flex-wrap:wrap;gap:var(--ac-space-2);justify-content:flex-end}

/* ---- Whitelisted creators (§5.1): admin allowlist, creator tokens + MCP setup ---- */
.gallery-ui .wp-access-grant{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) auto;gap:var(--ac-space-3) var(--ac-space-4);align-items:start}
/* Fields align on the label row; the action sits level with the inputs (label height + gap). */
.gallery-ui .wp-access-grant>div:last-child{padding-top:calc(var(--ac-text-sm) * 1.5 + var(--ac-space-2))}
.gallery-ui .wp-access-list,.gallery-ui .wp-access-history{display:grid;gap:0;margin:0;padding:0;list-style:none}
.gallery-ui .wp-access-row{display:flex;align-items:center;justify-content:space-between;gap:var(--ac-space-4);padding:var(--ac-space-3) 0;border-bottom:1px solid var(--ac-border)}
.gallery-ui .wp-access-row p{margin:var(--ac-space-1) 0 0}
.gallery-ui .wp-access-history li{padding:var(--ac-space-1) 0}
.gallery-ui .wp-access-tokens h3,.gallery-ui .wp-access h3{display:flex;align-items:center;gap:var(--ac-space-2);margin:var(--ac-space-4) 0 0}
.gallery-ui .wp-access-fresh{display:grid;gap:var(--ac-space-2);padding:var(--ac-space-4);border:1px solid var(--ac-border);border-radius:var(--ac-radius-md);background:var(--ac-surface)}
.gallery-ui .wp-access-fresh p{margin:0}
.gallery-ui .wp-access-secret{display:block;padding:var(--ac-space-2) var(--ac-space-3);border-radius:var(--ac-radius-sm);background:var(--ac-bg);font-family:var(--ac-font-mono,ui-monospace,monospace);font-size:var(--ac-text-sm);word-break:break-all;user-select:all}
.gallery-ui .wp-access-config{margin:0;padding:var(--ac-space-3) var(--ac-space-4);border-radius:var(--ac-radius-md);background:var(--ac-surface);overflow:auto;font-size:var(--ac-text-xs);line-height:1.6}
@media(width <= 760px){.gallery-ui .wp-access-grant{grid-template-columns:minmax(0,1fr)}.gallery-ui .wp-access-row{align-items:flex-start;flex-direction:column}}

/* Wallpaper editor (§5.3): 90 % of the viewport width and height (user request 2026-11-12). Settings panel left, large stage right;
   header and footer fixed, each column scrolls on its own. Neutral tokens; the stage uses a
   checkerboard so transparent edges and the watermark are visible on any wallpaper. */
.ac-dialog.wpe-dialog{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:var(--ac-z-modal);display:block;width:90vw;height:90dvh;max-width:none;max-height:none;margin:0;padding:0;overflow:hidden;border-radius:var(--ac-radius-xl)}
.wpe{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0}
.wpe-head{display:flex;align-items:center;justify-content:space-between;gap:var(--ac-space-4);padding:var(--ac-space-4) var(--ac-space-6);border-bottom:1px solid var(--ac-border)}
.wpe-head .ac-dialog-title{margin:0;font-size:var(--ac-text-lg);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wpe-head .ac-help{margin:2px 0 0;font-size:var(--ac-text-xs)}
.wpe-body{display:grid;grid-template-columns:clamp(340px,26vw,420px) minmax(0,1fr);min-height:0}
.wpe-panel{display:grid;align-content:start;gap:var(--ac-space-6);min-height:0;overflow:auto;padding:var(--ac-space-5) var(--ac-space-6);border-right:1px solid var(--ac-border);overscroll-behavior:contain}
.wpe-section{display:grid;gap:var(--ac-space-3)}
.wpe-section h3{margin:0;font-size:var(--ac-text-sm);font-weight:var(--ac-weight-semibold);color:var(--ac-fg)}
.wpe-section .ac-field{margin:0}
.wpe-row{display:grid;gap:var(--ac-space-2)}
.wpe-row--slider{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:0 var(--ac-space-3)}
.wpe-row--slider .ac-label{grid-column:1/-1}
.wpe-value{min-width:3.5em;text-align:end;color:var(--ac-fg-muted);font-size:var(--ac-text-sm);font-variant-numeric:tabular-nums}
.wpe-two{display:grid;grid-template-columns:1fr 1fr;gap:var(--ac-space-3)}
/* Segmented choice (radio) — same look as the detail-page pill tabs. */
.wpe-seg{display:flex;gap:2px;padding:3px;border:1px solid var(--ac-border);border-radius:var(--ac-radius-full);background:var(--ac-surface)}
.wpe-seg-item{position:relative;flex:1;min-width:0}
.wpe-seg-item input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}
.wpe-seg-item span{display:flex;align-items:center;justify-content:center;min-height:32px;padding:0 var(--ac-space-3);border-radius:var(--ac-radius-full);color:var(--ac-fg-muted);font-size:var(--ac-text-sm);font-weight:var(--ac-weight-medium);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wpe-seg-item input:checked+span{background:var(--ac-bg);color:var(--ac-fg);box-shadow:0 1px 4px #00000012}
.wpe-seg-item input:focus-visible+span{outline:2px solid var(--ac-focus);outline-offset:1px}
.wpe-seg-item input:disabled{cursor:default}.wpe-seg-item input:disabled+span{opacity:.55}
/* Upload drop zones. */
.wpe-drop{position:relative;display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:var(--ac-space-3);padding:var(--ac-space-3);border:1px dashed var(--ac-border-strong);border-radius:var(--ac-radius-lg);background:var(--ac-bg);transition:border-color var(--ac-duration-fast),background-color var(--ac-duration-fast)}
.wpe-drop.has-file{border-style:solid;border-color:var(--ac-border)}
.wpe-drop.has-issue{border-color:var(--ac-danger)}
.wpe-drop.is-over{border-color:var(--ac-accent);background:var(--ac-accent-soft)}
.wpe-drop-empty{grid-column:1/-1;display:grid;justify-items:center;gap:var(--ac-space-1);padding:var(--ac-space-4) var(--ac-space-2);color:var(--ac-fg-muted);font-size:var(--ac-text-sm);text-align:center;cursor:pointer}
.wpe-drop-empty strong{color:var(--ac-fg);font-weight:var(--ac-weight-medium)}
.wpe-drop-thumb{width:56px;height:56px;object-fit:contain;border-radius:var(--ac-radius-sm);background:var(--ac-surface)}
.wpe-drop-meta{display:grid;gap:1px;min-width:0;font-size:var(--ac-text-xs);color:var(--ac-fg-muted)}
.wpe-drop-meta>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.wpe-drop-meta strong{color:var(--ac-fg);font-size:var(--ac-text-sm);font-weight:var(--ac-weight-medium)}
.wpe-check{display:inline-flex;align-items:center;gap:4px;color:var(--ac-success);white-space:normal}
.wpe-check--bad{color:var(--ac-danger)}
.wpe-check--hint{color:var(--ac-warning)}
.wpe-drop.has-hint{border-color:var(--ac-warning)}
.wpe-checks-off{margin:0;padding:var(--ac-space-2) var(--ac-space-3);border-radius:var(--ac-radius-md);background:var(--ac-warning-bg);color:var(--ac-warning)}
.wpe-drop:focus-within{outline:2px solid var(--ac-focus);outline-offset:2px}
/* Stage. */
.wpe-stage{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-width:0;min-height:0;background:var(--ac-surface)}
.wpe-toolbar{display:flex;align-items:center;justify-content:space-between;gap:var(--ac-space-2) var(--ac-space-3);flex-wrap:wrap;padding:var(--ac-space-3) var(--ac-space-5);border-bottom:1px solid var(--ac-border);background:var(--ac-bg)}
.wpe-stage-title{font-size:var(--ac-text-sm)}
.wpe-tools{display:flex;align-items:center;gap:var(--ac-space-1)}
.wpe-guides{display:inline-flex;align-items:center;gap:var(--ac-space-2);margin-right:var(--ac-space-3);color:var(--ac-fg-muted);font-size:var(--ac-text-sm);white-space:nowrap;cursor:pointer}
.wpe-zoom{min-width:56px;height:36px;border:0;border-radius:var(--ac-radius-md);background:transparent;color:var(--ac-fg-muted);font:inherit;font-size:var(--ac-text-sm);font-variant-numeric:tabular-nums;cursor:pointer}
@media(hover:hover) and (pointer:fine){:where(:root:not([data-input-kind="touch"])) .wpe-zoom:hover{background:var(--ac-secondary);color:var(--ac-fg)}}
.wpe-canvas{min-height:0;overflow:auto;padding:var(--ac-space-4) var(--ac-space-6);display:flex;overscroll-behavior:contain;
 background-color:var(--ac-surface);background-image:linear-gradient(45deg,var(--ac-secondary-hover) 25%,transparent 25%,transparent 75%,var(--ac-secondary-hover) 75%),linear-gradient(45deg,var(--ac-secondary-hover) 25%,transparent 25%,transparent 75%,var(--ac-secondary-hover) 75%);background-size:20px 20px;background-position:0 0,10px 10px}
.wpe-note{margin:0;padding:var(--ac-space-2) var(--ac-space-5);min-height:36px;border-top:1px solid var(--ac-border);background:var(--ac-bg);color:var(--ac-fg-muted);font-size:var(--ac-text-xs)}
.wpe-empty{display:grid;justify-items:center;gap:var(--ac-space-2);color:var(--ac-fg-muted);font-size:var(--ac-text-sm);text-align:center}
.wpe-empty p{margin:0}
/* Original with zones/frames: fills the stage (zoom 100 % = fit), scrolls when zoomed in. */
.wpe-source{margin:auto;display:grid;gap:var(--ac-space-2);justify-items:center}
.wpe-empty{margin:auto}
.wpe-source-img{position:relative;aspect-ratio:var(--wpe-ratio);width:min(calc(100cqw * var(--wpe-zoom,1)),calc((100cqh - 32px) * var(--wpe-ratio) * var(--wpe-zoom,1)));box-shadow:var(--ac-shadow-md);touch-action:none;user-select:none}
.wpe-canvas{container-type:size}
.wpe-source-img[data-draggable]{cursor:crosshair}
.wpe-source-img img{display:block;width:100%;height:100%;-webkit-user-drag:none;pointer-events:none}
.wpe-source figcaption,.wpe-shot figcaption{display:flex;gap:var(--ac-space-2);justify-content:center;color:var(--ac-fg-muted);font-size:var(--ac-text-xs);font-variant-numeric:tabular-nums}
.wpe-shot figcaption strong{color:var(--ac-fg);font-weight:var(--ac-weight-medium)}
.wpe-zone,.wpe-frame{position:absolute;pointer-events:none;box-sizing:border-box}
.wpe-zone b,.wpe-frame b{position:absolute;top:6px;left:6px;padding:2px 8px;border-radius:var(--ac-radius-full);background:var(--ac-overlay);color:var(--ac-white);font-size:11px;font-weight:var(--ac-weight-medium);white-space:nowrap}
.wpe-zone--outer{background:color-mix(in srgb,var(--ac-white) 22%,transparent);outline:2px dashed var(--ac-white);outline-offset:-2px;box-shadow:inset 0 0 0 1px rgb(0 0 0 / .35)}
.wpe-zone--inner{outline:1px solid color-mix(in srgb,var(--ac-white) 70%,transparent);outline-offset:-1px}
.wpe-zone--inner b{left:auto;right:6px}
.wpe-frame--land{border:2px solid var(--ac-warning);box-shadow:0 0 0 9999px rgb(0 0 0 / .18)}
.wpe-frame--land b{background:var(--ac-warning);color:var(--ac-bg)}
.wpe-frame--port{border:2px solid var(--ac-success)}
.wpe-frame--port b{top:auto;bottom:6px;background:var(--ac-success);color:var(--ac-bg)}
.wpe-frame--cut{border:2px solid var(--ac-white);box-shadow:0 0 0 9999px rgb(0 0 0 / .45)}
/* Rendered results: one row, equal heights, widths ∝ aspect; the row fits the stage at 100 %
   (bounded by stage width and by stage height minus captions) and grows with zoom. */
.wpe-shots{--wpe-gap:24px;display:flex;align-items:flex-start;gap:var(--wpe-gap);margin:auto;flex:none;
 width:calc(min(100cqw - 48px,(100cqh - 84px) * var(--wpe-sum,1) + (var(--wpe-n,1) - 1) * var(--wpe-gap)) * var(--wpe-zoom,1))}
.wpe-shot{flex:var(--wpe-a,1) 1 0;min-width:0;display:grid;gap:var(--ac-space-2);margin:0}
.wpe-shot :is(canvas,img){display:block;width:100%;height:auto;aspect-ratio:var(--wpe-ratio);border-radius:var(--ac-radius-md);box-shadow:var(--ac-shadow-md);background:var(--ac-bg)}
.wpe-shot figcaption{flex-wrap:nowrap;white-space:nowrap;text-align:center;overflow:visible}
.wpe-foot{display:flex;align-items:center;justify-content:space-between;gap:var(--ac-space-3);padding:var(--ac-space-3) var(--ac-space-6);border-top:1px solid var(--ac-border);background:var(--ac-surface-raised)}
.wpe-foot .ac-alert{flex:1;margin:0}
.wpe-actions{display:flex;gap:var(--ac-space-2);margin-left:auto}
@media(width < 1024px){.wpe-body{grid-template-columns:320px minmax(0,1fr)}}
@media(width < 760px){
 /* Phones: full-screen sheet; the body scrolls as one column — stage first, settings below. */
 .ac-dialog.wpe-dialog{top:0;left:0;transform:none;width:100vw;height:100dvh;border-radius:0}
 .wpe-body{display:flex;flex-direction:column;overflow:auto;overscroll-behavior:contain}
 .wpe-stage{order:-1;flex:none;height:62dvh;border-bottom:1px solid var(--ac-border)}
 .wpe-panel{flex:none;overflow:visible;border-right:0;padding:var(--ac-space-4)}
 .wpe-guides{margin-right:0;font-size:var(--ac-text-xs)}.wpe-toolbar{padding:var(--ac-space-2) var(--ac-space-3)}
 .wpe-canvas{padding:var(--ac-space-3)}.wpe-two{grid-template-columns:1fr}
 .wpe-actions{width:100%}.wpe-actions .ac-btn{flex:1}
}
@media(prefers-reduced-motion:reduce){.ac-dialog.wpe-dialog{animation:none}}
/* Wallpaper tables (shadcn/ui Table → .ac-table). */
.gallery-ui .wp-table td{height:64px}
.gallery-ui .wp-table .wp-table-art{width:112px;padding-inline:var(--ac-space-3)}
.gallery-ui .wp-admin-thumb{display:block;max-width:96px;height:48px;width:auto;object-fit:contain;border-radius:var(--ac-radius-sm);background:var(--ac-surface)}
.gallery-ui .wp-table .wp-table-title{max-width:260px}
.gallery-ui .wp-table .wp-table-title strong{display:block;overflow:hidden;text-overflow:ellipsis;font-weight:var(--ac-weight-medium)}
.gallery-ui .wp-table :is(.wp-table-title,td) .ac-help{display:block;font-size:var(--ac-text-xs)}
.gallery-ui .wp-table .wp-table-sub{margin-top:2px}
.gallery-ui .wp-table .wp-table-note{max-width:200px;overflow:hidden;text-overflow:ellipsis}
.gallery-ui .wp-table .wp-admin-actions{flex-wrap:nowrap;justify-content:flex-end}
/* Actions stay reachable when the table scrolls horizontally: pinned to the right edge. */
.gallery-ui .wp-table :is(th,td):last-child{position:sticky;right:0;z-index:1;background:var(--ac-bg);box-shadow:-1px 0 0 var(--ac-border)}
.gallery-ui .wp-table thead th:last-child{z-index:2;background:var(--ac-surface)}
@media(hover:hover) and (pointer:fine){:where(:root:not([data-input-kind="touch"])) .gallery-ui .wp-table tbody tr:hover td:last-child{background:var(--ac-secondary)}}
/* Allowlist search result. */
.gallery-ui .wp-access-found{display:grid;gap:var(--ac-space-4);padding:var(--ac-space-4);border:1px solid var(--ac-border);border-radius:var(--ac-radius-lg);background:var(--ac-bg)}
.gallery-ui .wp-access-person{display:flex;flex-wrap:wrap;align-items:center;gap:var(--ac-space-2) var(--ac-space-4)}
.gallery-ui .wp-access-state{display:inline-flex;flex-wrap:wrap;gap:var(--ac-space-1)}
.gallery-ui .wp-access-add{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--ac-space-3) var(--ac-space-4);align-items:start}
.gallery-ui .wp-access-add>div:last-child{padding-top:calc(var(--ac-text-sm) * 1.5 + var(--ac-space-2))}
.gallery-ui .wp-access-grant[role=search]{grid-template-columns:minmax(0,1fr) auto}
@media(width <= 760px){.gallery-ui .wp-access-add,.gallery-ui .wp-access-grant[role=search]{grid-template-columns:minmax(0,1fr)}.gallery-ui :is(.wp-access-add,.wp-access-grant)>div:last-child{padding-top:0}}
.gallery-ui .wp-th-help{display:inline-flex;align-items:center;gap:4px;cursor:help}

/* ---- Product introduction images (2026-11-18, docs/wallpapers.md §5.4) ----
   Desktop: a stack in the preview column under the stage. The info panel spans both rows and
   is sticky below the header; when it is taller than the viewport it scrolls with the page until
   its bottom is visible and sticks there (computed top), so it never scrolls internally. Below 1024px the panel dissolves into the grid (gallery.css), so the
   images simply follow the panel content. */
@media(width >= 1024px){
 .gallery-ui .wp-detail--intro .wp-media{grid-column:1;grid-row:1}
 /* top comes from public/wallpaper-intro.js when the panel is taller than the viewport (no inner scroll). */
 .gallery-ui .wp-detail--intro>.ac-detail-panel{grid-column:2;grid-row:1 / span 2;align-self:start;top:var(--wp-panel-top,calc(var(--ac-header-height) + var(--ac-space-6)))}
 .gallery-ui .wp-detail--intro .wp-intro-images{grid-column:1;grid-row:2}
}
.gallery-ui .wp-intro-images{display:grid;gap:0;min-width:0;padding-top:var(--ac-space-8);border-top:1px solid var(--ac-border)}
.gallery-ui .wp-intro-images h2{margin:0 0 var(--ac-space-5);font-size:var(--ac-text-lg);font-weight:var(--ac-weight-semibold);line-height:1.3}
/* Items stack edge to edge like e-commerce detail images; the natural aspect is kept. */
.gallery-ui .wp-intro-item{position:relative;width:100%;max-width:900px;margin:0 auto;overflow:hidden}
.gallery-ui .wp-intro-item picture{display:contents}
.gallery-ui .wp-intro-item img,.gallery-ui .wp-intro-item .wp-live-video{display:block;width:100%;height:auto;user-select:none;-webkit-user-drag:none}
.gallery-ui .wp-intro-item:first-of-type{border-radius:var(--ac-radius-lg) var(--ac-radius-lg) 0 0}
.gallery-ui .wp-intro-item:last-of-type{border-radius:0 0 var(--ac-radius-lg) var(--ac-radius-lg)}
.gallery-ui .wp-intro-item:only-of-type{border-radius:var(--ac-radius-lg)}
/* Live: the clip lies exactly over the cover and fades in only while playing. */
.gallery-ui .wp-intro-item .wp-live-video{position:absolute;inset:0;height:100%;object-fit:cover;opacity:0;pointer-events:none;transition:opacity var(--ac-duration-base,180ms) var(--ac-ease-standard,ease)}
.gallery-ui .wp-intro-item[data-playing] .wp-live-video{opacity:1}
.gallery-ui .wp-live-badge{position:absolute;top:var(--ac-space-3);left:var(--ac-space-3);display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:0 10px;border:0;border-radius:var(--ac-radius-full);background:#000000a6;color:#fff;font:600 11px/1 var(--ac-font-sans,inherit);letter-spacing:.06em;cursor:pointer;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
/* 44px hit area around the compact badge. */
.gallery-ui .wp-live-badge::before{content:"";position:absolute;inset:-6px}
.gallery-ui .wp-live-badge[aria-pressed="true"]{background:#fff;color:#000}
.gallery-ui .wp-live-badge:focus-visible{outline:2px solid var(--ac-focus);outline-offset:2px}
.gallery-ui .wp-intro-item[data-live-error] .wp-live-badge{display:none}
@media(prefers-reduced-motion:reduce){.gallery-ui .wp-intro-item .wp-live-video{transition:none}}
@media(width < 1024px){.gallery-ui .wp-intro-images{order:10;padding-top:var(--ac-space-6)}}
/* Editor: ordered introduction image list (shadcn ghost icon buttons for order/remove). */
.wpe-count{margin-left:var(--ac-space-1);color:var(--ac-fg-muted);font-size:var(--ac-text-xs);font-weight:var(--ac-weight-regular)}
.wpe-intro-list{display:grid;gap:var(--ac-space-2);margin:0;padding:0;list-style:none}
.wpe-intro-item{display:grid;grid-template-columns:56px minmax(0,1fr) auto;align-items:center;gap:var(--ac-space-3);padding:var(--ac-space-2);border:1px solid var(--ac-border);border-radius:var(--ac-radius-md)}

.wpe-intro-meta{display:grid;gap:1px;min-width:0;color:var(--ac-fg-muted);font-size:var(--ac-text-xs)}
.wpe-intro-meta strong{color:var(--ac-fg);font-weight:var(--ac-weight-medium)}
.wpe-intro-actions{display:flex;gap:2px}
.wpe-intro-thumb{position:relative;display:block;width:56px;height:56px}
.wpe-intro-thumb img,.wpe-intro-thumb video{display:block;width:56px;height:56px;object-fit:cover;border-radius:var(--ac-radius-sm);background:var(--ac-surface)}
.wpe-intro-kind{position:absolute;left:3px;bottom:3px;padding:1px 4px;border-radius:4px;background:#000000b3;color:#fff;font-size:9px;font-weight:600;letter-spacing:.04em;line-height:1.4}
.wpe-intro-link{justify-self:start;padding:0;border:0;background:none;color:var(--ac-accent);font:inherit;font-size:var(--ac-text-xs);cursor:pointer;text-decoration:underline;text-underline-offset:2px}
.wpe-intro-link:disabled{opacity:.55;cursor:default}

/* Detail facts (2026-11-18): label and value on one row, spread apart, so the info panel stays
   short enough to fit the viewport while sticky. Long values (licence) wrap and stay right-aligned
   in their own column; the label never wraps. Also used by the refund row below. */
/* Rows are separated by a hairline: a 1px line scaled to 0.5px on 2x+ screens (Chromium snaps a
   0.5px border-width to 1px; the transform renders a true device-pixel line in every engine) and
   a plain 1px line on 1x screens. The list's top border already separates it from the actions,
   so the last row has no line. */
.gallery-ui .wp-detail .paid-terms{gap:0;padding-top:var(--ac-space-2)}
.gallery-ui .wp-detail .paid-terms>div{position:relative;display:flex;align-items:baseline;justify-content:space-between;gap:var(--ac-space-4);padding-block:var(--ac-space-3)}
.gallery-ui .wp-detail .paid-terms>div:not(:last-child)::after{content:"";position:absolute;inset:auto 0 0;height:1px;background:var(--ac-border);transform-origin:0 100%;pointer-events:none}
@media(min-resolution:2dppx){.gallery-ui .wp-detail .paid-terms>div:not(:last-child)::after{transform:scaleY(.5)}}
.gallery-ui .wp-detail .paid-terms dt{flex:none;white-space:nowrap}
.gallery-ui .wp-detail .paid-terms dd{min-width:0;text-align:right}
.gallery-ui .wp-detail .paid-terms dd .tag-chips{justify-content:flex-end}
