/* Reading happens on the objects. This layer contains only navigation controls. */
.story-dialog[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
body.exhibit-open .story-dialog {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none;
  pointer-events: none; overflow: visible; display: block;
}
body.exhibit-open .story-dialog:before { display: none; }
body.exhibit-open .story-content-inner { padding: 0; }
body.exhibit-open .drawer-top { position: fixed; top: 98px; right: 38px; display: flex; gap: 24px; padding: 0; border: 0; background: none; pointer-events: auto; }
body.exhibit-open #close-story { padding: 6px 0 6px 12px; text-shadow: 0 1px 8px #100905; }
body.exhibit-open .room-footer { opacity: 0; visibility: hidden; pointer-events: none; }
.exhibit-meta { position: fixed; top: 107px; left: 39px; max-width: 230px; color: #e1c6a5; text-shadow: 0 2px 14px #100a06bb; }
.exhibit-meta #story-title { font-size: 25px; line-height: 1.15; margin: 12px 0 10px; }
.exhibit-meta p { color: #bda080; font-size: 10px; line-height: 1.7; max-width: 180px; }
.exhibit-tools { position: fixed; bottom: max(32px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 30px); display: flex; flex-direction: column; gap: 10px; align-items: center; color: #dec6a4; pointer-events: auto; font-family: var(--sans,Arial,sans-serif); }
.page-tools, .mechanism-tools { display: flex; align-items: center; gap: 15px; padding: 5px 12px; border: 1px solid #a68c5938; background: #211a14d9; border-radius: 4px; box-shadow: 0 6px 24px #140d0824; }
.exhibit-tools button { color: inherit; min-width: 42px; min-height: 42px; padding: 7px 9px; font-size: 17px; border-radius: 2px; }
.exhibit-tools button:hover:not(:disabled) { background: #cba7781c; color: #ffe8c1; }
.exhibit-tools button:disabled { opacity: .25; cursor: default; }
.exhibit-tools button:focus-visible { outline: 1px solid #e2ba85; outline-offset: 2px; }
#page-count { font-size: 10px; letter-spacing: 2px; min-width: 60px; text-align: center; font-variant-numeric: tabular-nums; }
.tool-divider { height: 18px; width: 1px; background: #bca17b38; }
.exhibit-tools #next-object { font-size: 10px; white-space: nowrap; }
.mechanism-tools { gap: 6px; padding-block: 0; }
.mechanism-tools > span:first-child { padding-left: 10px; font-size: 10px; }
.mechanism-tools output { width: 32px; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.mechanism-tools #release { border-left: 1px solid #bca17b38; padding-left: 16px; margin-left: 5px; font-size: 11px; }
.exhibit-link { font-size: 10px; text-decoration: none; }
/* If WebGL is unavailable, the same pages remain readable inline, without a modal. */
body.exhibit-fallback #exhibit-description { position: fixed !important; top: 25%; left: 50%; transform: translateX(-50%); width: min(480px,calc(100vw - 48px)) !important; height: auto !important; max-height: 50dvh; overflow: auto !important; clip: auto !important; white-space: normal !important; margin: 0 !important; padding: 28px !important; background: #dfd0b2; color: #322c23; pointer-events: auto; }
body.exhibit-fallback #exhibit-description h2 { color: #3f3025; font-size: 28px; }
body.exhibit-fallback #exhibit-description p { font-size: 15px; line-height: 1.6; margin: 14px 0; }
@media (max-width: 1000px) {
  body.exhibit-open .drawer-top { top: 91px; right: 28px; }
  .exhibit-meta { top: 96px; left: 28px; max-width: 185px; }
  .exhibit-meta #story-title { font-size: 22px; }
  .exhibit-meta p { max-width: 150px; }
}
@media (max-width: 600px) {
  body.exhibit-open .drawer-top { top: 82px; right: 21px; }
  body.exhibit-open #drawer-index { display: none; }
  body.exhibit-open #close-story { font-size: 9px; gap: 7px; }
  .exhibit-meta { top: 86px; left: 23px; max-width: 175px; }
  .exhibit-meta .story-kicker { font-size: 6px; letter-spacing: 1.2px; }
  .exhibit-meta #story-title, html[lang=zh-CN] .exhibit-meta #story-title { font-size: 19px; margin: 7px 0; }
  .exhibit-meta p { display: none; }
  .exhibit-tools { bottom: max(20px,env(safe-area-inset-bottom)); gap: 8px; }
  .page-tools { gap: 6px; padding-inline: 8px; }
  .exhibit-tools button { padding: 7px; }
  #page-count { min-width: 50px; font-size: 9px; }
  .exhibit-tools #next-object { max-width: 145px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
}
@media (max-height: 550px) and (min-width: 601px) {
  body.exhibit-open .drawer-top { top: 66px; right: 24px; }
  .exhibit-meta { top: 68px; left: 26px; }
  .exhibit-meta #story-title { font-size: 19px; margin-block: 6px; }
  .exhibit-meta p { display: none; }
  .exhibit-tools { bottom: 9px; flex-direction: row; gap: 7px; }
  .exhibit-tools button { min-height: 34px; min-width: 34px; }
  .page-tools, .mechanism-tools { gap: 5px; padding: 2px 6px; }
}
body.exhibit-open .exhibit-meta { display: none; }
body.exhibit-open .room-vignette { background: linear-gradient(180deg,#1b140cd9,transparent 135px),linear-gradient(0deg,#211b19c9,transparent 160px); }
body.exhibit-open .drawer-top { backdrop-filter: none; }
body.exhibit-open #drawer-index { display: none; }
body.exhibit-open #close-story { background: #211a14b3; border: 1px solid #a68c592e; border-radius: 3px; padding: 8px 12px; color: #e6d1b2; }
#try-mechanism { display: none; }
@media (max-aspect-ratio: 85/100) {
  body.exhibit-open:not(.mechanism-view) .mechanism-tools { display: none; }
  body.exhibit-open:not(.mechanism-view) #try-mechanism { display: block; font-size: 12px; padding: 10px 18px; background: #211a14d9; border: 1px solid #a68c5938; border-radius: 4px; }
}
@media (max-width:600px) { .header-link { display:block; font-size:9px; } .header-actions { gap:12px; } .header-divider { display:none; } }
