/* Mobile composition is a single override, shared by portrait and landscape. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px)}
html{overflow-x:clip}#scene{touch-action:pan-y pinch-zoom}.mobile-only,#menuToggle{display:none}
.scene-loading{position:fixed;z-index:7;left:50%;top:50%;transform:translate(-50%,-50%);width:max-content;max-width:85vw;padding:14px 18px;background:#0b1c2ef2;color:#f6f1e8;border-radius:12px;text-align:center;font-size:14px;line-height:1.5;pointer-events:none}
.scene-loading a{display:block;color:#e3c48e;min-height:44px;padding:10px;pointer-events:auto}.scene-loading.is-ready{opacity:0;transition:opacity .25s}.scene-loading[hidden]{display:none}
.detail-topbar{display:flex;justify-content:flex-end;align-items:center}.detail-topbar>span{display:none}.detail-topbar .close{margin:0;float:none;position:static;background:#f6f1e8;border:1px solid #b8ad95;border-radius:50%;width:44px;height:44px;line-height:1}
@media(max-width:650px),(max-width:950px) and (max-height:550px){
 body{overflow-x:clip}button,a,input,select{-webkit-tap-highlight-color:#e3c48e40}button{touch-action:manipulation}
 header{padding:calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) 8px calc(16px + var(--safe-left));align-items:center;gap:12px;pointer-events:none}
 header>*{pointer-events:auto}.brand{display:flex;flex-direction:column;justify-content:center;min-height:44px;font-size:14px;letter-spacing:.14em;white-space:nowrap;margin:0;line-height:1.2}.brand span{display:block;font-size:9px;letter-spacing:.21em;margin-top:6px;white-space:nowrap}
 #menuToggle{display:block;min-width:64px;min-height:44px;padding:10px 14px;border:1px solid #ffffff38;border-radius:24px;background:#0b1c2ef2;color:#f6f1e8;font-size:14px}
 header nav{display:none;position:absolute;right:calc(16px + var(--safe-right));top:calc(68px + var(--safe-top));width:235px;max-width:calc(100vw - 32px);padding:10px;background:#0b1c2ef7;border:1px solid #ffffff30;border-radius:16px;box-shadow:0 10px 30px #08162e55;gap:4px;align-items:stretch;flex-direction:column}
 .menu-open header nav{display:flex}header nav button,header nav a,#motion{display:flex;align-items:center;justify-content:space-between;min-height:48px;font-size:14px;text-align:left;margin:0;padding:10px 12px;text-decoration:none;color:#f6f1e8;letter-spacing:0;opacity:1}
 header nav button span{margin-left:8px}#motion::before{content:none}.mobile-only{display:block}header nav .mobile-only{border-top:1px solid #ffffff20}
 footer{display:none}.progress{height:3px;bottom:0;z-index:5}
 .intro{top:auto;left:calc(16px + var(--safe-left));right:calc(16px + var(--safe-right));bottom:calc(26px + var(--safe-bottom));width:auto;max-width:none;padding:12px 16px;background:#0b1c2ef2;border:1px solid #ffffff20;border-radius:12px;backdrop-filter:none}
 .intro h1{font-size:clamp(20px,5.5vw,25px);line-height:1.2;letter-spacing:-.02em}.intro h1 br{display:none}.intro .eyebrow,.introcopy{display:none}.intro .enter{display:block;min-height:44px;margin:4px 0 0;padding:10px 0;font-size:14px}.intro .enter span{margin-left:14px}
 .chapter{top:auto;left:calc(16px + var(--safe-left));right:calc(16px + var(--safe-right));bottom:calc(86px + var(--safe-bottom));width:auto;max-width:none;padding:10px 14px;background:#0b1c2ef5;border:0;border-left:2px solid #e3c48e;border-radius:8px;backdrop-filter:none;box-shadow:0 5px 20px #08162e25}
 .chapter #chapterNum{font-size:11px;line-height:1.4;letter-spacing:.1em}.chapter h2{font-size:clamp(20px,5.4vw,24px);line-height:1.15;margin:5px 0 8px;max-width:none;overflow-wrap:break-word}
 .chapter-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}.chapter button,.chapter #priceToggle{min-height:44px;padding:8px 0;font-size:14px;line-height:1.25;margin:0;text-align:left}.chapter button span{margin-left:4px}.chapter #priceToggle{border-bottom:0}.chapter #view{border-bottom:0}
 .journey-nav{left:calc(16px + var(--safe-left));right:calc(16px + var(--safe-right));top:auto;bottom:calc(16px + var(--safe-bottom));display:flex;justify-content:space-between;align-items:center;gap:10px;padding:5px 8px;background:#0b1c2ef5;border:1px solid #ffffff20;border-radius:28px;color:#f6f1e8}
 .journey-nav button{min-height:44px;min-width:72px;padding:8px 12px;border-radius:22px;font-size:14px}.journey-nav span{font-size:13px;writing-mode:horizontal-tb;transform:none;letter-spacing:.08em}.journey-nav button:disabled{opacity:.42}
 button:active,a:active{background-color:#e3c48e30}button:focus-visible,a:focus-visible{outline-color:#e3c48e;outline-offset:2px}
 .visit-hint{max-width:calc(100vw - 48px);font-size:14px;letter-spacing:0;background:#0b1c2ef0;border-radius:12px;padding:12px 16px;backdrop-filter:none}
 dialog,#works,#detail{position:fixed;inset:var(--viewport-top,0px) 0 auto;margin:0;width:100%;max-width:100%;height:var(--visible-height,100dvh);max-height:var(--visible-height,100dvh);padding:calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(16px + var(--safe-left));border:0;border-radius:0;overscroll-behavior:contain;scroll-padding-top:80px;background:#f6f1e8}
 dialog::backdrop{background:#08162ee6;backdrop-filter:none}
 .detail-topbar,.dialoghead{position:sticky;top:calc(-12px - var(--safe-top));z-index:6;margin:-12px -16px 12px;padding:12px 16px;background:#f6f1e8;gap:10px;border-bottom:1px solid #18273920}
 .detail-topbar{justify-content:space-between}.detail-topbar>span{display:block;font-size:14px;color:#182739}.detail-topbar .close,.dialoghead .close{flex:0 0 44px;min-height:44px;width:44px;background:#f6f1e8;border:1px solid #b8ad95;border-radius:50%;font-size:28px}
 .detail-layout{display:flex;flex-direction:column;gap:16px;align-items:stretch;clear:none}.detail-copy{padding:0}.detail-stage{width:100%;min-width:0}
 .detail-visual{height:clamp(190px,43svh,430px);min-height:0;overscroll-behavior:contain;touch-action:pan-x pan-y pinch-zoom;border-radius:4px;background:#e8e3da;scrollbar-width:thin}
 #detail .detail-visual img{max-width:100%;max-height:100%;width:auto;height:auto;margin:0;object-fit:contain;border-width:3px}.zoom-tools{gap:6px;margin-bottom:10px;flex-wrap:wrap}.zoom-tools button{min-height:44px;padding:8px;font-size:14px}.zoom-tools output{font-size:14px;min-width:46px}.zoom-tools #zoomReset{margin-left:auto}
 #detail .detail-kicker{font-size:11px;letter-spacing:.12em;opacity:.8;margin:8px 0}#detail .detail-copy h2{font-size:30px;line-height:1.15;margin:12px 0 8px}#detail .detail-size{font-size:16px;line-height:1.5;margin:0 0 16px}#detail .detail-status{font-size:12px;line-height:1.5;letter-spacing:.05em;margin:16px 0 8px}
 .scale-box{height:120px}.scale-human{height:65px;width:14px}.scale-human:before{height:13px;width:13px;top:-17px}.scale-box small{font-size:11px;line-height:1.3;max-width:75%}.scale-work{max-height:84px}
 #detailPriceToggle{min-height:48px;font-size:16px;width:100%;text-align:left}#detail .detail-price{font-size:22px;line-height:1.4;letter-spacing:0}.acquire{font-size:15px;min-height:48px}.acquire-note{display:block;font-size:13px;line-height:1.5;margin-top:8px}.detail-actions{gap:10px;margin-top:18px}.detail-actions button{font-size:14px;min-height:48px}#detail #shareStatus,#detail #favoriteStatus{font-size:14px!important;line-height:1.5;letter-spacing:0!important}
 .dialoghead{align-items:center}.dialoghead>div{min-width:0}.dialoghead span{font-size:11px;letter-spacing:.1em}.dialoghead p{font-size:13px;letter-spacing:0;opacity:1;margin:5px 0 0}
 .catalogtools{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin:10px 0;padding:12px 0}.catalogtools label:first-child{grid-column:1/-1}.catalogtools label{font-size:11px;letter-spacing:.06em;gap:7px}.catalogtools input,.catalogtools select{width:100%;min-height:48px;padding:10px 12px;font-size:16px;border:1px solid #b8ad95;background:#fffdf7;border-radius:6px}.catalogtools #catalogFavorites{font-size:13px;padding:10px;min-height:48px}
 .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 12px;margin-top:20px}.work-image{padding:8px}.work-card strong{font-size:18px;line-height:1.25;margin-top:6px}.work-meta{font-size:13px!important;line-height:1.4}.work-index{font-size:11px!important;opacity:.8}.catalog-empty{padding:18px;font-size:15px;line-height:1.5}
 .resource-notice{font-size:15px;line-height:1.5;max-width:calc(100vw - 32px);padding:20px;border-radius:12px}.resource-notice a,.resource-notice button{min-height:48px;font-size:14px;margin:6px 0 0}
}
@media(max-width:950px) and (max-height:550px) and (orientation:landscape){
 .brand span{display:none}header{padding-top:calc(8px + var(--safe-top))}.intro,.chapter{left:auto;right:calc(16px + var(--safe-right));width:250px;max-width:calc(100vw - 32px);bottom:calc(82px + var(--safe-bottom));padding:10px 14px}.intro h1{font-size:20px}.chapter h2{font-size:20px}.chapter-actions{grid-template-columns:1fr}.chapter button,.chapter #priceToggle{min-height:44px}.chapter h2{margin:4px 0}.chapter #chapterNum{font-size:10px}
 .detail-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,.7fr);gap:20px}.detail-visual{height:calc(var(--visible-height,100dvh) - 140px);min-height:150px}.detail-topbar>span{font-size:13px}.grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:350px){.chapter-actions{gap:10px}.chapter button,.chapter #priceToggle{font-size:13px}.brand{font-size:12px;letter-spacing:.13em}.brand span{font-size:8px}.grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.scene-loading.is-ready{transition:none}}
