/* Three drawers preserve the original cabinet proportions. */
.cabinet{aspect-ratio:16/9;background-image:none}
.drawer{height:23.704%}
.drawer[data-drawer='0']{top:19.259%}.drawer[data-drawer='1']{top:50%}.drawer[data-drawer='2']{top:80.741%}
button{font-family:inherit}
button:focus-visible,summary:focus-visible{outline:2px solid #d6d7df;outline-offset:3px}
.gallery-panel{width:calc(100% - 40px);height:calc(100dvh - 40px);inset:20px 0}
.gallery-panel .document-well{padding:0}
.gallery-content{padding:0;overflow:hidden;background:#dde0e4}
#gallery-stage{width:100%;height:100%;touch-action:none;outline-offset:-3px;cursor:grab}
#gallery-stage:active{cursor:grabbing}
#gallery-stage canvas{display:block;width:100%;height:100%}
.gallery-hud{position:absolute;inset:18px 18px auto;display:flex;align-items:center;gap:10px;pointer-events:none;color:#e1e4e9;font-size:12px;letter-spacing:.07em}
.gallery-hud span{margin-right:auto;background:#25282deb;padding:10px}
.gallery-hud button,.gallery-touch button{pointer-events:auto;background:#292d34ed;color:#e1e4e9;border:1px solid #727784;padding:10px;font-size:11px;min-height:44px}
.gallery-help{position:absolute;bottom:14px;left:18px;margin:0;padding:10px;background:#25282deb;font-size:11px;pointer-events:none}
.gallery-touch{position:absolute;bottom:64px;left:18px;display:flex;gap:4px}
.gallery-touch button{font-size:20px;width:44px;touch-action:none}
#gallery-status{position:absolute;top:80px;left:18px;color:#e1e4e9;background:#25282deb;padding:10px;font-size:12px}
#gallery-status:empty{display:none}
@media(max-width:720px){.cabinet{min-height:0;margin-top:clamp(32px,7svh,72px)}main{padding-top:clamp(40px,8svh,72px);padding-bottom:28px}.gallery-panel{width:calc(100% - 16px);inset:8px 0;height:calc(100dvh - 16px);padding:0 8px 8px}.gallery-panel .window-bar h2{left:16px}.gallery-help{max-width:calc(100% - 36px);bottom:10px;font-size:10px}.gallery-hud{inset:12px 12px auto;gap:6px}.gallery-hud span{font-size:10px;padding:8px}.gallery-hud button{font-size:10px;padding:8px}.gallery-touch{bottom:54px}}
@media(prefers-reduced-motion:reduce){.backdrop video{display:none}.backdrop{background:url('/assets/media/poster.jpg') center/cover}}

.gallery-hud{justify-content:flex-end}
#gallery-help-toggle{min-width:44px;font-size:16px}
.gallery-index{position:absolute;right:18px;bottom:18px;background:#25282df5;color:#e1e4e9;padding:12px;max-width:290px;font-size:12px}
.gallery-index summary{cursor:pointer;min-height:22px}
#gallery-work-index{display:grid;gap:5px;max-height:40vh;overflow:auto;margin-top:12px}
#gallery-work-index a{text-align:left;background:#292d34;color:#e1e4e9;border:1px solid #727784;padding:10px;font-size:11px;min-height:44px}
.work-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 20px}
.work-card{margin:0 12px 20px;min-width:0}
.work-grid .work-card{margin:0}
.work-card h4{font-size:15px;font-weight:500;margin:12px 0 8px;line-height:1.5}
.work-preview{position:relative;display:block;width:100%;aspect-ratio:16/9;padding:0;background:#17191d;color:var(--ui-text);border:1px solid #575b64;font:inherit;cursor:pointer;overflow:hidden}
.work-preview img{width:100%;height:100%;object-fit:contain;background:#15181e}
.preview-play{position:absolute;bottom:12px;left:12px;font-size:12px;letter-spacing:.1em;background:#16181de8;padding:8px 12px}
.work-original{color:var(--ui-muted);font-size:11px;letter-spacing:.04em;text-underline-offset:4px}
#work-viewer{width:min(1000px,calc(100% - 24px));max-height:calc(100dvh - 24px);padding:20px;background:#22252c;color:#dddfe4;border:2px solid #727784;box-shadow:inset 0 0 0 3px #353a43}
#work-viewer::backdrop{background:#11131bdd}
#work-viewer header{display:flex;align-items:center;gap:16px;margin-bottom:20px}
#work-viewer h2{font-size:18px;font-weight:500;margin:0;flex:1}
#work-viewer button{background:#353a43;color:inherit;border:1px solid #777e8a;padding:12px;min-height:44px}
#viewer-media iframe,#viewer-media video{width:100%;aspect-ratio:16/9;max-height:calc(100dvh - 180px);object-fit:contain;border:0;display:block;background:#101216}
#work-viewer.viewer-portrait{width:min(520px,calc(100% - 24px))}
#work-viewer.viewer-portrait video{aspect-ratio:auto;height:calc(100dvh - 200px)}
#viewer-source{display:inline-block;margin-top:16px;color:inherit;font-size:12px}
@media(max-width:720px){.work-grid{grid-template-columns:1fr}.gallery-index{bottom:112px;right:12px;max-width:250px}.gallery-help{bottom:10px;width:calc(100% - 36px)}.gallery-touch{bottom:18px}.gallery-help:not([hidden])~.gallery-touch{bottom:66px}}
/* One baseline for movement and the work menu. The list opens upwards. */
.gallery-controls{position:absolute;left:18px;right:18px;bottom:18px;display:flex;justify-content:space-between;align-items:flex-end;gap:12px;pointer-events:none}
.gallery-controls .gallery-touch{position:static;display:flex;gap:4px;pointer-events:auto}
.gallery-controls .gallery-touch button{height:48px;min-height:48px;width:44px;padding:0}
.gallery-controls .gallery-index{position:relative;inset:auto;max-width:none;padding:0;background:transparent;pointer-events:auto}
.gallery-controls .gallery-index summary{height:48px;min-height:48px;display:flex;gap:8px;align-items:center;justify-content:center;padding:0 14px;border:1px solid #727784;background:#292d34ed;color:#e1e4e9;list-style:none;font-size:11px}
.gallery-index summary::-webkit-details-marker{display:none}
.gallery-controls .gallery-index summary::before{content:'▸';font-size:12px}
.gallery-controls .gallery-index[open] summary::before{content:'▾'}
.gallery-controls #gallery-work-index{position:absolute;right:0;bottom:58px;width:min(290px,calc(100vw - 64px));margin:0;padding:8px;border:1px solid #727784;background:#25282df5;max-height:min(420px,55vh)}
.gallery-controls #gallery-work-index a{padding:10px;font-size:11px}
.gallery-help{bottom:82px}
#gallery-video-bank{position:absolute;inset:0 auto auto 0;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}
#gallery-video-bank video{position:absolute;width:1px;height:1px}
@media(max-width:720px){.gallery-controls{left:12px;right:12px;bottom:16px}.gallery-controls .gallery-touch button{height:44px;min-height:44px}.gallery-controls .gallery-index summary{height:44px;min-height:44px;padding:0 12px}.gallery-help{bottom:72px}.gallery-controls #gallery-work-index{bottom:54px;max-height:45vh}}
.player-message{font-size:13px;line-height:1.6;color:var(--ui-muted);margin:16px 0 0}
/* Keep browser save menus out of the artwork interface. */
.work-preview img, #viewer-media video, #gallery-stage canvas {
  -webkit-touch-callout: none;
  user-select: none;
}

.gallery-work-group{display:grid;gap:5px}
.gallery-work-group h3{margin:10px 2px 4px;color:#c7cbd5;font-size:12px;font-weight:500;letter-spacing:.04em}
.gallery-work-group:first-child h3{margin-top:2px}
/* Artwork rows use the same selection colors as MUSIC. */
@media (hover:hover) and (pointer:fine){
  #gallery-work-index a:hover{background:var(--ui-selection);color:#fff}
}
#gallery-work-index a:focus-visible{background:var(--ui-selection);color:#fff;outline:2px solid var(--ui-focus);outline-offset:-2px}
#gallery-work-index a:active{background:var(--ui-selection);color:#fff}

#gallery-work-index a{display:block;text-decoration:none;box-sizing:border-box}
.work-preview{text-decoration:none}
/* Center artwork titles within the WORKS rows. */
#gallery-work-index a{display:flex;align-items:center;justify-content:center;text-align:center;min-height:44px;line-height:1.4}
/* Center series headings too; status shares the RESET VIEW baseline. */
.gallery-work-group h3{text-align:center}
.gallery-hud #gallery-status{position:static;display:flex;align-items:center;min-height:44px;box-sizing:border-box;margin:0 auto 0 0;padding:10px;font-size:11px;letter-spacing:normal;border:1px solid #727784}
.gallery-hud #gallery-status:empty{display:none}
#gallery-status a{pointer-events:auto;color:inherit}
@media(max-width:720px){.gallery-hud #gallery-status{font-size:10px;padding:8px}}

/* Hide the WORKS scrollbar while preserving scrolling. */
#gallery-work-index{scrollbar-width:none}
#gallery-work-index::-webkit-scrollbar{display:none}

/* Keep keyboard focus active without framing the whole room. */
#gallery-stage:focus,#gallery-stage:focus-visible{outline:none}

/* Nearby bench interaction, styled externally for the site's CSP. */
#gallery-sit{position:absolute;left:50%;bottom:80px;transform:translateX(-50%);min-height:44px;padding:0 16px;border:1px solid #727784;background:#292d34ed;color:#e1e4e9;font:11px Tektur,Arial,sans-serif;cursor:pointer;z-index:2;touch-action:manipulation}
@media(hover:hover) and (pointer:fine){#gallery-sit:hover{background:var(--ui-selection);color:#fff}}
#gallery-sit:focus-visible{background:var(--ui-selection);color:#fff;outline:2px solid var(--ui-focus);outline-offset:3px}
@media(max-width:720px){#gallery-sit{bottom:72px}}
/* Keep the room reveal available when inline styles are blocked by hosting. */
.gallery-content{background:#17191d}
#gallery-stage canvas{opacity:0;transition:none}
#enter.room-ready #gallery-stage canvas{opacity:1}
@media(prefers-reduced-motion:reduce){#gallery-stage canvas{transition:none}}

/* Startup styles are external to respect the published hosting policy. */

    html.ui-starting #study-home,
    html.ui-starting footer,
    html.ui-starting .section-panel { opacity: 0; pointer-events: none; }
    html.ui-visible #study-home,
    html.ui-visible footer,
    html.ui-visible .section-panel { transition: opacity .16s ease; }
    html .backdrop { background: #25252d; }
    html.ui-fallback .cabinet { background: #333740; border: 2px solid #717780; }
    html.ui-fallback .drawer { background: #41464e; box-shadow: inset 0 1px #737984, inset 0 -2px #14171d; }
    html.ui-fallback .section-panel { visibility: visible; background: #50545d; }
    html.ui-fallback .document-well,
    html.ui-fallback .back-button { background: #191b20; }
    html.ui-fallback .cabinet > canvas,
    html.ui-fallback .panel-geometry { visibility: hidden; }
    @media (prefers-reduced-motion: reduce) {
      html.ui-visible #study-home,
      html.ui-visible footer,
      html.ui-visible .section-panel { transition: none; }
    }


/* Preserve a still only when the visitor requests reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html .backdrop { background: #25252d url('/assets/media/poster.jpg') center / cover no-repeat; }
}

/* Hide the seat action immediately while the work index is open. */
.gallery-content:has(.gallery-index[open]) #gallery-sit{display:none}
