* { box-sizing: border-box; }
[hidden] { display: none !important; }
#utility-bar { position: absolute; right: 24px; top: 25px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; width: 440px; max-width: calc(100% - 320px); }
#utility-bar button { background: #fffdf2; min-height: 44px; }
#sound-toggle { background: #e4e7e5 !important; color: #35413b; font-weight: 700; }
.sound-on, #sound-toggle.sound-on { background: #17624e !important; color: white; border-color: #104936; font-weight: 800; }
#volume-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 270px; max-width: calc(100vw - 24px); padding: 16px; background: #fffdf5; border: 1px solid #9eb4a4; border-radius: 8px; box-shadow: 0 6px 24px #29463e30; }
#volume-panel label { font-size: 14px; font-weight: 700; }
.volume-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; }
#room-volume { width: 175px; accent-color: #17624e; cursor: pointer; }
#volume-value { min-width: 42px; text-align: right; font-size: 14px; }
#volume-hint { color: #52645b; line-height: 1.5; }
#monitor-controls { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; max-width: 100%; padding: 8px 12px; background: #fffdf5ed; border: 1px solid #9eb4a4; border-radius: 6px; }
#monitor-controls span { font-size: 12px; font-weight: 700; }
#monitor-controls > div { display: flex; flex-wrap: wrap; gap: 6px; }
#monitor-controls button { min-width: 54px; margin: 0; }
#utility-bar #monitor-controls button[aria-pressed="true"] { color: white; background: #25473f; font-weight: 800; }
#utility-bar #pv-toggle[data-playback="playing"] { background: #25473f; border-color: #9eb4a4; color: #fff; font-weight: 700; }
#utility-bar #pv-toggle[data-playback="paused"] { background: #e0e3e2; border-color: #929c98; color: #293832; font-weight: 700; }
#sound-note { flex-basis: 100%; max-width: 430px; color: #8f2424; background: #fffdf5; padding: 8px; }
#sound-note:empty { display: none; }
.setup-dialog { position: fixed; inset: 0; margin: auto; width: 610px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 32px; color: #29463e; background: #fffdf5; border: 1px solid #9eb4a4; border-radius: 12px; box-shadow: 0 12px 60px #0005; }
.setup-dialog::backdrop, #media-dialog::backdrop, #image-dialog::backdrop { background: rgb(12 25 28 / 62%); }
.setup-dialog h2 { font-size: 26px; line-height: 1.5; margin: 16px 0 24px; }
.setup-brand { font-size: 14px; font-weight: 800; letter-spacing: .1em; }
.choices button { flex: 1; min-height: 58px; font-size: 19px; font-weight: 700; background: #eef2ed; }
.setup-dialog .actions { margin-bottom: 24px; }
#sound-warning { color: #9c1c24; border-left: 4px solid #b51f2c; background: #fff0ec; padding: 16px; margin-bottom: 22px; font-weight: 750; line-height: 1.7; }
#sound-warning p { white-space: pre-line; font-size: 16px; }
#sound-warning strong { font-size: 18px; }
#media-dialog, #image-dialog { width: 1100px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 20px; background: #fffdf5; color: #29463e; border-radius: 12px; border: 1px solid #9eb4a4; }
.media-heading { display: flex; justify-content: space-between; align-items: center; }
.media-heading h2 { font-size: 20px; margin: 0 10px 12px 0; }
.media-heading button { margin-bottom: 12px; }
#media-dialog { padding: 12px; max-width: 95vw; max-height: 90dvh; }
.media-picture { position: relative; }
#media-content video { display: block; width: 100%; object-fit: contain; background: #152829; }
/* Keep the bottom control area and its menus separate from picture-size clicks. */
#media-picture-toggle { position: absolute; inset: 0 0 max(80px, 35%) 0; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: zoom-out; }
#media-dialog[data-size="compact"] #media-picture-toggle { cursor: zoom-in; }
#media-picture-toggle:focus-visible { outline: 2px solid #e9dbb8; outline-offset: -4px; }
#image-content, #image-canvas { display: block; width: 100%; height: calc(100dvh - 150px); object-fit: contain; cursor: default; }
#image-error { padding: 24px; text-align: center; }
#media-error { color: #9c1c24; margin: 10px 0; }
#media-error:empty, #image-error:empty { display: none; }
@media (max-width: 780px) { #utility-bar { top: 102px; right: 12px; max-width: calc(100% - 24px); } .setup-dialog { padding: 24px; } }
#tutorial { position: fixed; inset: 0; margin: auto; width: 610px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; color: #29463e; background: #fffdf5; border: 1px solid #9eb4a4; border-radius: 12px; box-shadow: 0 12px 60px #0005; }
#tutorial::backdrop { background: transparent; }
#tutorial { inset: auto 0 16px; margin: 0 auto; max-height: calc(55dvh - 16px); }
#tour-spotlight { position: fixed; inset: 0; width: 100vw; height: 100dvh; margin: 0; padding: 0; border: 0; background: transparent; pointer-events: none; overflow: hidden; }
#tour-spotlight svg { width: 100%; height: 100%; display: block; }
#door-toast { position: fixed; z-index: 5; left: 50%; top: 42%; transform: translate(-50%, -50%) translateY(8px); width: 620px; max-width: calc(100vw - 32px); padding: 24px 28px; border: 2px solid #d4b36e; border-radius: 16px; background: #fffdf5; color: #183d32; box-shadow: 0 10px 42px #0005; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s, transform .35s, visibility .35s; text-align: center; }
#door-toast span { display: block; margin-bottom: 8px; font-size: clamp(18px, 2.5vw, 22px); }
#door-toast strong { display: block; font-size: clamp(22px, 3.2vw, 32px); line-height: 1.35; font-weight: 750; text-wrap: balance; }
#door-toast.visible { opacity: 1; visibility: visible; transform: translate(-50%, -50%); }
#tutorial h2 { font-size: 24px; margin: 12px 0 18px; }
#tour-copy { white-space: pre-line; font-size: 16px; line-height: 1.75; }
#tour-progress { font-size: 12px; font-weight: 700; letter-spacing: .12em; }
#tour-next { background: #386c5d; color: white; }
#tutorial button { min-height: 44px; font-size: 14px; }
#tutorial .actions { margin-bottom: 0; }
button:disabled { opacity: .4; cursor: default; }
body { margin: 0; font-family: 'Yu Gothic UI', system-ui, sans-serif; color: #29463e; background: #c6e7f5; overflow: hidden; }
#viewport { width: 100%; height: 100dvh; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
canvas { cursor: grab; }
canvas:active { cursor: grabbing; }
#status { margin-top: 10px; }
#exhibit-status:empty { display: none; }
#debug { position: absolute; bottom: 12px; right: 12px; max-width: 440px; white-space: pre-wrap; font: 11px monospace; background: #fffE; padding: 10px; pointer-events: none; }
header { position: absolute; top: 25px; left: 30px; pointer-events: none; padding: 14px 20px; background: #fffdf0e6; border-radius: 3px; border-left: 3px solid #61947f; }
header { pointer-events: auto; touch-action: manipulation; user-select: none; }
#exhibition-notice { position: fixed; inset: auto; margin: 0; padding: 3px 8px; border: 1px solid #9eb4a4; border-radius: 6px; background: #fffdf5; color: #29463e; font-size: 11px; line-height: 14px; pointer-events: none; }
#idle-warning, #inactivity-dialog { min-height: min(300px, calc(100dvh - 32px)); }
#idle-warning::backdrop, #inactivity-dialog::backdrop { background: rgb(35 38 40 / 62%); }
#idle-warning h2 { color: #ac303e; margin-block: 64px; }
#inactivity-dialog p { font-size: 22px; line-height: 1.7; }
#inactivity-dialog #inactivity-question { color: #ac303e; font-size: 26px; font-weight: 700; margin: 20px 0 28px; }
.brand { font-size: 23px; font-weight: 800; letter-spacing: .05em; }
.brand span { color: #c49a50; }
.subtitle { margin-top: 4px; font-size: 10px; letter-spacing: .24em; }
.room-label { position: absolute; right: 30px; top: 29px; background: #fffdf0df; padding: 12px 18px; border-radius: 3px; font-weight: 600; }
.room-label span { display: block; font-size: 10px; margin-top: 4px; font-weight: normal; }
aside { position: absolute; bottom: 22px; left: 30px; width: 370px; max-width: calc(100% - 36px); padding: 18px 22px; border-radius: 6px; background: #fffdf2ed; box-shadow: 0 6px 24px #29463e16; }
h1 { font-size: 17px; font-weight: 600; margin: 0 0 5px; }
p { margin: 0; font-size: 12px; }
#status { color: #687b6b; font-size: 11px; }
.actions { display: flex; gap: 8px; margin: 15px 0 12px; }
button { padding: 10px 16px; font: inherit; font-size: 12px; border: 1px solid #9eb4a4; border-radius: 4px; background: transparent; color: inherit; cursor: pointer; }
#start { background: #386c5d; color: white; border-color: #386c5d; }
button:hover { filter: brightness(1.1); }
.hint { margin-top: 8px; font-size: 10px; line-height: 1.8; color: #6a796e; }
.crosshair { display: none; position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: #fff9; box-shadow: 0 0 2px #264c41; pointer-events: none; }
.walking .crosshair { display: block; }
.walking aside { opacity: .85; }
#mobile-menu-toggle { display: block; position: fixed; z-index: 16; top: max(8px, env(safe-area-inset-top)); right: env(safe-area-inset-right); min-height: 44px; padding: 10px 8px; color: white; background: #25473f; border-color: #25473f; border-radius: 4px 0 0 4px; opacity: .55; touch-action: manipulation; }
#mobile-menu-toggle[aria-expanded="true"] { opacity: 1; }
body:not([data-mobile-open="true"]) > header,
body:not([data-mobile-open="true"]) > aside,
body:not([data-mobile-open="true"]) #exhibition-notice,
body:not([data-mobile-open="true"]) .room-label,
body:not([data-mobile-open="true"]) #debug,
body:not([data-mobile-open="true"]) .crosshair { display: none !important; }
#utility-bar { --menu-top: max(64px, calc(env(safe-area-inset-top) + 56px)); top: var(--menu-top); right: max(12px, env(safe-area-inset-right)); max-height: max(88px, min(45dvh, calc(100dvh - var(--menu-top) - 180px - env(safe-area-inset-bottom)))); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-gutter: stable; }
#utility-bar[data-mobile-open="false"] { display: none; }
#utility-bar > button { flex-shrink: 0; }
#utility-bar #volume-panel { position: static; flex-basis: 100%; width: 100%; max-width: 100%; }
#utility-bar #room-volume { min-width: 0; min-height: 44px; flex: 1; }
#aiko-loading { position: fixed; inset: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 16px; background: rgb(40 44 46 / 48%); color: #29463e; pointer-events: none; }
#aiko-loading:popover-open { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; }
#aiko-loading section { width: min(610px, 100%); min-width: 0; padding: 32px 24px; border: 1px solid #9eb4a4; border-radius: 12px; background: #fffdf5; text-align: center; box-shadow: 0 12px 50px #0003; }
#aiko-loading h2 { color: #ac303e; font-size: clamp(22px, 4vw, 32px); margin: 0 0 18px; }
#aiko-loading p { font-size: clamp(18px, 3vw, 24px); }
#aiko-loading strong { display: block; margin-top: 16px; font-size: clamp(24px, 4vw, 36px); }
/* Tutorial owns the dim/mask; only the loading card belongs above it. */
#aiko-loading[data-tutorial="true"] { align-items: start; background: transparent; }
#aiko-loading[data-tutorial="true"] section { justify-self: start; width: min(320px, 100%); max-height: 36dvh; overflow-y: auto; padding: 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
#aiko-loading[data-tutorial="true"] h2 { grid-column: 1 / -1; font-size: 20px; line-height: 1.2; margin: 0; }
#aiko-loading[data-tutorial="true"] p { font-size: 16px; }
#aiko-loading[data-tutorial="true"] strong { font-size: 22px; margin: 0; }
body[data-aiko-loading="true"] #status { display: none; }
@media (max-width: 768px) {
  #monitor-controls { padding: 8px; }
}
@media (max-width: 780px) {
  #utility-bar { --menu-top: max(104px, calc(env(safe-area-inset-top) + 96px)); width: 440px; max-width: calc(100% - 24px - env(safe-area-inset-right)); padding: 4px; background: #fffdf5ed; border-radius: 6px; }
}
@media (max-height: 500px) {
  #utility-bar[data-tutorial-target="controls"], #utility-bar[data-tutorial-target="help"] { --menu-top: max(56px, calc(env(safe-area-inset-top) + 48px)); max-height: max(72px, calc(45dvh - var(--menu-top) - 12px)); }
}
@media (max-width: 600px) { header { top: 12px; left: 12px; padding: 10px 13px; } .room-label { right: 12px; top: 12px; } aside { left: 18px; bottom: 14px; padding: 12px 16px; } }
