.gallery-page { background: #15162c; }
.gallery-main { min-height: calc(100svh - 82px); }
.gallery-shell { position: relative; height: max(560px, calc(100svh - 82px)); overflow: hidden; background: radial-gradient(circle at 50% 45%, #fff9ee, #d9d2c6); }
.gallery-viewport, .gallery-viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gallery-viewport { cursor: grab; touch-action: none; }
.gallery-viewport.is-paint { cursor: crosshair; }
.gallery-viewport:active { cursor: grabbing; }
.gallery-ui { position: absolute; inset: 0; pointer-events: none; color: #fffdf8; }
.gallery-ui button, .gallery-ui input, .gallery-exhibits { pointer-events: auto; }
.gallery-heading { position: absolute; top: clamp(1rem, 3vw, 2rem); left: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.gallery-heading > div { max-width: min(36rem, calc(100% - 1rem)); padding: .85rem 1.2rem 1rem; border: 1px solid rgba(255,255,255,.25); border-radius: 1.25rem; background: rgba(22,24,49,.88); box-shadow: 0 16px 40px rgba(12,12,28,.22); backdrop-filter: blur(16px); }
.gallery-kicker { margin-bottom: .15rem; color: #f5ca71; font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gallery-heading h1 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.6rem); line-height: 1.1; }
.gallery-subtitle { margin: .3rem 0 0; max-width: 33rem; color: #f2ece6; font-size: .9rem; line-height: 1.4; }
.gallery-return, .gallery-mode button, .gallery-paint-controls button { border: 1px solid rgba(255,255,255,.26); border-radius: 999px; background: rgba(23,26,52,.92); color: #fffdf8; cursor: pointer; font-weight: 800; }
.gallery-return { padding: .65rem 1rem; box-shadow: 0 8px 30px rgba(12,12,28,.22); white-space: nowrap; }
.gallery-return:hover, .gallery-mode button:hover, .gallery-paint-controls button:hover { border-color: #f4c34e; }
.gallery-return:focus-visible, .gallery-mode button:focus-visible, .gallery-paint-controls button:focus-visible, .gallery-exhibit:focus-visible, .gallery-move-pad button:focus-visible { outline: 3px solid #f4c34e; outline-offset: 3px; }
.gallery-museum-help { position: absolute; right: clamp(1rem, 3vw, 2rem); top: 11rem; display: grid; gap: .25rem; padding: .6rem .85rem; border-radius: .85rem; background: rgba(22,24,49,.78); font-size: .72rem; line-height: 1.4; }
.gallery-museum-help strong { color: #f5ca71; }
.gallery-exhibit-rail { position: absolute; left: clamp(.75rem, 2vw, 1.5rem); right: clamp(.75rem, 2vw, 1.5rem); bottom: clamp(.75rem, 2vw, 1.5rem); padding: .75rem; border: 1px solid rgba(255,255,255,.22); border-radius: 1.2rem; background: rgba(22,24,49,.91); box-shadow: 0 15px 40px rgba(12,12,28,.3); backdrop-filter: blur(16px); }
.gallery-rail-heading { display: flex; justify-content: space-between; padding: 0 .3rem .5rem; color: #f5ca71; font-size: .72rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.gallery-exhibits { display: flex; gap: .65rem; overflow-x: auto; padding: .15rem .2rem .4rem; scrollbar-color: #f5ca71 rgba(255,255,255,.15); }
.gallery-exhibit { display: flex; flex: 0 0 172px; align-items: center; gap: .65rem; min-height: 74px; padding: .45rem; border: 1px solid rgba(255,255,255,.2); border-radius: .8rem; background: rgba(255,255,255,.08); color: #fffdf8; text-align: left; cursor: pointer; }
.gallery-exhibit:hover, .gallery-exhibit.is-current { border-color: #f5ca71; background: rgba(244,195,78,.18); }
.gallery-exhibit img { flex: 0 0 47px; width: 47px; height: 60px; object-fit: cover; border-radius: .25rem; background: white; }
.gallery-exhibit strong { display: block; font-family: "Iowan Old Style", Georgia, serif; font-size: .83rem; line-height: 1.1; }
.gallery-exhibit small { display: block; margin-top: .3rem; color: #d3d1db; font-size: .61rem; line-height: 1.2; }
.gallery-paintbar { position: absolute; left: clamp(.75rem, 2vw, 1.5rem); right: clamp(.75rem, 2vw, 1.5rem); bottom: clamp(.75rem, 2vw, 1.5rem); padding: .75rem; border: 1px solid rgba(255,255,255,.25); border-radius: 1.2rem; background: rgba(22,24,49,.92); box-shadow: 0 15px 40px rgba(12,12,28,.3); backdrop-filter: blur(16px); }
.gallery-mode, .gallery-paint-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem .65rem; }
.gallery-mode button, .gallery-paint-controls button { min-height: 38px; padding: .4rem .8rem; font-size: .75rem; }
.gallery-mode .is-current, .gallery-paint-controls .is-current, .gallery-paint-controls .gallery-save { border-color: #f4c34e; background: #f4c34e; color: #202035; }
.gallery-paint-controls { margin-top: .65rem; padding-top: .65rem; border-top: 1px solid rgba(255,255,255,.2); }
.gallery-paint-controls label { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.gallery-paint-controls input[type="range"] { width: 85px; accent-color: #f4c34e; }
.gallery-paint-controls input[type="color"] { width: 38px; height: 35px; padding: 2px; border: 1px solid #fff; border-radius: .4rem; background: transparent; cursor: pointer; }
.gallery-paint-controls button:disabled { opacity: .42; cursor: not-allowed; }
.gallery-paint-help { margin: .4rem 0 0; color: #e0dce5; font-size: .7rem; line-height: 1.35; }
.gallery-status { position: absolute; top: .35rem; left: 50%; transform: translateX(-50%); max-width: min(30rem, 60vw); padding: .2rem .55rem; border-radius: .5rem; background: rgba(22,24,49,.68); color: #fffdf8; font-size: .65rem; line-height: 1.2; text-align: center; }
.gallery-move-pad { display: none; position: absolute; left: .75rem; bottom: 9rem; pointer-events: auto; }
.gallery-move-pad > button { display: block; margin: 0 auto .25rem; }
.gallery-move-pad > div { display: flex; gap: .25rem; }
.gallery-move-pad button { width: 43px; height: 43px; border: 1px solid rgba(255,255,255,.5); border-radius: .6rem; background: rgba(22,24,49,.82); color: white; font-size: 1.15rem; line-height: 1; touch-action: none; }
.gallery-fallback { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 2rem; background: #f8f1e6; color: #24243b; text-align: center; }
.gallery-fallback[hidden], .gallery-paintbar[hidden], .gallery-exhibit-rail[hidden], .gallery-paint-controls[hidden], .gallery-return[hidden] { display: none; }
.gallery-no-script { padding: 1rem; background: #fffdf8; color: #24243b; text-align: center; }
@media (max-width: 760px) {
    .gallery-main { min-height: calc(100svh - 72px); }
    .gallery-shell { height: max(560px, calc(100svh - 72px)); }
    .gallery-heading { top: .6rem; left: .6rem; right: .6rem; }
    .gallery-heading > div { max-width: calc(100% - 7.5rem); padding: .65rem .75rem; border-radius: .8rem; }
    .gallery-heading h1 { font-size: 1.25rem; }
    .gallery-kicker { font-size: .56rem; }
    .gallery-subtitle { font-size: .68rem; }
    .gallery-return { padding: .5rem .55rem; max-width: 7rem; white-space: normal; font-size: .63rem; line-height: 1.1; }
    .gallery-status { top: auto; bottom: 8.5rem; left: auto; right: .6rem; transform: none; max-width: min(8.4rem, 36vw); }
    .gallery-museum-help { top: 6rem; right: .6rem; font-size: .57rem; }
    .gallery-move-pad { display: block; }
    .gallery-paintbar, .gallery-exhibit-rail { left: .5rem; right: .5rem; bottom: .5rem; padding: .55rem; }
    .gallery-exhibit { flex-basis: 145px; min-height: 68px; }
    .gallery-exhibit img { width: 40px; height: 54px; flex-basis: 40px; }
    .gallery-paint-controls { max-height: 21vh; overflow-y: auto; }
    .gallery-shell:has(.gallery-paint-controls:not([hidden])) .gallery-move-pad { display: none; }
    .gallery-shell:has(.gallery-paint-controls:not([hidden])) .gallery-status { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: reduce) { .gallery-ui *, .gallery-viewport * { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
