html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, sans-serif;
  font-size: 13px;
}

/* ---------------------------------------------------------------------
   Info affordance & panel -- everything meant to be tuned lives here.
   ------------------------------------------------------------------- */
:root {
  /* Affordance (the icon button, lower left) -- info-btn.svg bakes in its
     own background chip, so there's no separate fill-colour/radius to
     expose here any more (see the .affordance-btn comment in this file). */
  --info-affordance-size: 24px; /* button renders 30x24 -- width follows this via the asset's 25:20 aspect ratio, see .affordance-btn below */
  --info-affordance-gap: 8px; /* between stacked affordances */
  --info-affordance-offset-x: 20px; /* distance from left edge */
  --info-affordance-offset-y: 20px; /* distance from bottom edge */

  /* Panel (the overlay that opens from the affordance) */
  --info-panel-width: 416px; /* gallery info panel; was 320px (the info-overlay.svg asset's width) */
  --welcome-panel-width: 386px; /* reception's welcome panel -- its own width, apart from the info panel's */
  --info-panel-radius: 15px; /* the asset's right-corner radius */
  --info-panel-bleed: 24px; /* flat extra width bled off the left edge, so no seam ever shows at the join */
  --info-panel-padding-y: 60px;
  --info-panel-padding-x: 32px;
  --welcome-panel-padding-left: 47px; /* reception's welcome panel: text inset from the left edge (32px + 15px) */
  --welcome-panel-padding-right: 32px;
  --info-panel-bg-rgb: 255, 255, 255; /* white by default -- the comp; will need an inverted set for a black gallery */
  --info-panel-bg-alpha: 0.8;
  --info-panel-blur: 12px; /* blurs the scene showing through the panel's translucent background */
  --panel-text-color: #4d4d4d; /* one text gray for the info, welcome and directory panels */
  --info-panel-transition-ms: 250ms;
}

/* ---------------------------------------------------------------------
   Navigation pad -- bottom-centre strip (global icon placeholders, the
   eye joystick, zoom in/out). The icon SVGs already bake in their own
   background chip and glyph colour (unlike info.svg), so there's no
   separate fill-colour variable to expose here the way there is for the
   info affordance -- what's tunable instead is overall alpha and a
   brightness bump on hover/press, since recolouring a baked-in SVG fill
   from outside it would mean inlining all six assets for little benefit.
   ------------------------------------------------------------------- */
:root {
  --nav-pad-offset-y: 20px; /* distance from bottom edge */
  --nav-pad-gap: 20px; /* gap between the three zones */
  --nav-zone-gap: 8px; /* gap between elements within a zone */
  --nav-icon-touch-min: 44px; /* minimum tappable footprint, both axes */
  --nav-icon-opacity: 1;
  --nav-icon-hover-brightness: 1.3; /* CSS filter, hover/active feedback */

  --nav-joystick-field-width: 119px; /* matches pitch-yaw-bg.svg */
  --nav-joystick-field-height: 90px;
  --nav-joystick-handle-size: 31px; /* matches eye-icon.svg */
}

/* #nav-panel/#readout-panel/#limits-panel set display:flex below, which
   otherwise beats the UA [hidden] rule on specificity -- toggling visibility
   via the "hidden" property needs this to actually win. */
[hidden] {
  display: none !important;
}

/* PSV's own loading spinner. setPanorama() calls pass showLoader: false for
   node transitions, but that option doesn't exist on the very first load
   (the Viewer constructor's own panorama) -- so it's hidden here too, for
   both cases. */
.psv-loader-container {
  display: none !important;
}

/* Sits above everything (including #transition-overlay's z-index: 5) until
   clicked away. Deliberately plain white, not tied to the transition
   panel's fill-colour variable -- this is the fixed first-impression
   screen, not a curatorial per-exhibit parameter. */
#intro-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

#intro-text {
  margin: 0;
  opacity: 0; /* faded in by runIntro() in main.js */
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 12pt;
  color: #000;
  text-align: center;
}

#viewer {
  position: fixed;
  inset: 0;
}

/* Sits above the viewer's canvas (see the z-index below) and covers it
   exactly. Never intercepts input -- pointer-events stays off at every
   phase, including full white. Both animated values (--overlay-saturate,
   --overlay-alpha) are written from JS every frame during a transition;
   --overlay-fill-rgb only changes when the fill-colour swatch does. */
#transition-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  backdrop-filter: saturate(var(--overlay-saturate, 1));
  -webkit-backdrop-filter: saturate(var(--overlay-saturate, 1));
  background-color: rgba(var(--overlay-fill-rgb, 255, 255, 255), var(--overlay-alpha, 0));
}

/* Shared panel look -- just legible, not designed */
#nav-panel,
#readout-panel,
#limits-panel,
#transition-panel,
#navigation-panel,
#focus-panel,
#map-panel {
  position: fixed;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 10px 12px;
  border-radius: 4px;
  z-index: 10;
}

#nav-panel {
  top: 10px;
  left: 10px;
  max-width: 220px;
}

#nav-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

#node-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#node-list button.active {
  outline: 2px solid #4ea1ff;
}

#readout-panel {
  top: 10px;
  right: 10px;
  width: 200px;
}

#readout-panel dl {
  margin: 6px 0;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 2px 6px;
}

#readout-panel dt {
  opacity: 0.7;
}

#readout-panel dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

#copy-status {
  margin-left: 6px;
}

#btn-calibrate-hotspot {
  margin-top: 8px;
}

#calibrate-status {
  margin-top: 4px;
  opacity: 0.85;
}

#limits-panel {
  bottom: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
}

#limits-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#limits-panel label > input[type='range'] {
  flex: 1;
}

#limits-panel output {
  width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#transition-panel {
  bottom: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
}

#transition-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#transition-panel label > input[type='range'] {
  flex: 1;
}

#transition-panel input[type='number'] {
  width: 48px;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#transition-panel select {
  flex: 1;
  font: inherit;
}

/* Sits to the right of #limits-panel along the same bottom edge. */
#navigation-panel {
  bottom: 10px;
  left: 290px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
}

#navigation-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#navigation-panel label > input[type='range'] {
  flex: 1;
}

#navigation-panel input[type='number'] {
  width: 48px;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#navigation-panel select {
  flex: 1;
  font: inherit;
}

/* Moved off the bottom row -- at narrower viewports the bottom-anchored
   panels (Limits/Navigation/Focus/Map, left:10/290/570/850) run into the
   nav pad's own icons, which sit horizontally centred regardless of
   viewport width. Top-right, to the left of #readout-panel, instead. */
#focus-panel {
  top: 10px;
  right: 230px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
}

#focus-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#focus-panel label > input[type='range'] {
  flex: 1;
}

#focus-panel input[type='number'] {
  width: 48px;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#focus-panel select {
  flex: 1;
  font: inherit;
}

/* Right-anchored, immediately left of #transition-panel (right:10px, width
   260px) -- its old left:570/850px slots both sat under the centred map
   overlay itself, obstructing clicks on the hotspot being placed. */
#map-panel {
  bottom: 10px;
  right: 280px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
}

#map-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#map-panel label > input[type='range'] {
  flex: 1;
}

#map-panel input[type='number'] {
  width: 48px;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#map-panel select {
  flex: 1;
  font: inherit;
}

#map-panel dl {
  margin: 6px 0;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 2px 6px;
}

#map-panel dt {
  opacity: 0.7;
}

#map-panel dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

#map-readout-status,
#map-readout-copy-status {
  opacity: 0.85;
}

/* ---------------------------------------------------------------------
   Info affordance -- screen-anchored (fixed), not sphere-anchored. Sits
   above the transition overlay (z-index: 5) but well under the intro
   screen (z-index: 20), which is fine since they're never on screen at
   the same time in practice.
   ------------------------------------------------------------------- */
#affordance-stack {
  position: fixed;
  left: var(--info-affordance-offset-x);
  bottom: var(--info-affordance-offset-y);
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: var(--info-affordance-gap);
}

/* info-btn.svg is self-contained (its own background chip baked in, 25x20,
   unlike the old info.svg glyph) -- same deal as the nav-pad icons, so the
   button itself carries no background/padding of its own any more, just
   sizing. Height matches the old --info-affordance-size; width follows the
   asset's own 25:20 aspect ratio instead of forcing it square, so the icon
   fills the button with no surrounding gap. */
.affordance-btn {
  width: calc(var(--info-affordance-size) * 25 / 20);
  height: var(--info-affordance-size);
  padding: 0;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.affordance-btn img {
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------------------------------------------------------------
   Info panel -- see the comment on #info-overlay in index.html for why
   this is CSS geometry rather than the SVG asset itself.

   Deliberately never uses the [hidden] attribute: it needs to stay in
   normal flow (display: flex) throughout the open/close transition, only
   becoming invisible via opacity + pointer-events. The bleed technique --
   extra flat width pushed off-screen with a matching negative left offset
   -- keeps the visible rounded corner pinned at exactly --info-panel-width
   from the edge no matter how large --info-panel-bleed is.
   ------------------------------------------------------------------- */
/* The two panels share every rule below; only their width and text insets
   differ, fed in through these per-panel values. */
#info-overlay {
  --panel-width: var(--info-panel-width);
  --panel-padding-left: var(--info-panel-padding-x);
  --panel-padding-right: var(--info-panel-padding-x);
}

#welcome-panel {
  --panel-width: var(--welcome-panel-width);
  --panel-padding-left: var(--welcome-panel-padding-left);
  --panel-padding-right: var(--welcome-panel-padding-right);
}

#info-overlay,
#welcome-panel {
  position: fixed;
  top: 50%;
  left: calc(-1 * var(--info-panel-bleed));
  width: calc(var(--panel-width) + var(--info-panel-bleed));
  z-index: 15;
  display: flex;
  background-color: rgba(var(--info-panel-bg-rgb), var(--info-panel-bg-alpha));
  backdrop-filter: blur(var(--info-panel-blur));
  -webkit-backdrop-filter: blur(var(--info-panel-blur));
  border-radius: 0 var(--info-panel-radius) var(--info-panel-radius) 0;
  color: var(--panel-text-color);
  font-family: 'Open Sans', system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-16px);
  transition: opacity var(--info-panel-transition-ms) ease, transform var(--info-panel-transition-ms) ease;
}

#info-overlay.open,
#welcome-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

#info-overlay-content,
#welcome-content {
  /* Pushes content past the bled-off portion so it starts exactly at the
     visible (on-screen) left edge, and pins its width to the asset's
     320px regardless of how much bleed is added. */
  margin-left: var(--info-panel-bleed);
  width: var(--panel-width);
  padding: var(--info-panel-padding-y) var(--panel-padding-right) var(--info-panel-padding-y) var(--panel-padding-left);
  box-sizing: border-box;
}

#info-overlay-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: #323f77;
  font-weight: 600;
}

#info-overlay-body {
  margin: 0;
  font-size: 13px;
  line-height: 24px;
  /* infoBody is plain text (not HTML) -- pre-line turns its literal blank
     lines into paragraph breaks and single newlines into line breaks,
     instead of the browser default of collapsing all of that to nothing. */
  white-space: pre-line;
}

h2 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

button {
  font: inherit;
  cursor: pointer;
}

/* ---------------------------------------------------------------------
   Navigation pad -- primary input (see main.js), always visible, no
   hover-to-reveal. Three zones in a row: global-icon placeholders, the
   eye joystick, zoom in/out. Not chrome -- unaffected by "c".
   ------------------------------------------------------------------- */
#nav-pad {
  position: fixed;
  left: 50%;
  bottom: var(--nav-pad-offset-y);
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: flex-end;
  gap: var(--nav-pad-gap);
}

#nav-pad-global-icons,
#nav-pad-zoom {
  display: flex;
  flex-direction: column;
  gap: var(--nav-zone-gap);
}

/* Shared by the global-icon placeholders and the zoom buttons: the SVGs
   are self-contained (background chip + glyph already baked in, unlike
   info.svg), so the button itself carries no visible background of its
   own -- only the touch-target sizing and the hover/press feedback. */
.nav-icon-btn {
  min-width: var(--nav-icon-touch-min);
  min-height: var(--nav-icon-touch-min);
  padding: 0;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: var(--nav-icon-opacity);
  filter: brightness(1);
  transition: filter 150ms ease;
}

.nav-icon-btn:not(:disabled):hover,
.nav-icon-btn:not(:disabled):active {
  filter: brightness(var(--nav-icon-hover-brightness));
}

.nav-icon-btn:disabled {
  cursor: default;
}

.nav-icon-btn img {
  display: block;
  width: 32px;
  height: 40px;
}

/* Backup for the draggable="false" attribute already on every nav-pad img:
   suppresses the browser's own native image-drag (ghosted/dimmed source
   element) and text-selection cursor during a press-drag, most visibly on
   the joystick's background graphic while the eye handle is grabbed. */
#nav-pad img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Sits above the joystick, in its own column so the two stay centred on
   each other regardless of the joystick field's width. */
#nav-pad-joystick-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--nav-zone-gap);
}

/* next-icon.svg is a wide pill (82x53), not the 32x40 portrait shape the
   other nav icons share -- .nav-icon-btn's own img sizing would distort
   it, so it gets its own, aspect-correct size here instead. The button
   itself takes the same 48x60 box as the map/zoom icons (the wider image
   just overflows it, centred) so it sits level with zoom-in and doesn't
   widen the left column -- which would push the joystick off-centre. */
#next-node-btn {
  width: 48px;
  height: 60px;
}

#nav-pad-global-icons #next-node-btn img {
  width: 100px;
  height: auto;
  flex-shrink: 0;
}

/* Zoom, wayfinding and global icons all share this larger size -- 1.5x the
   shared .nav-icon-btn size (32x40 -> 48x60). The global menu icon keeps this
   size too, even though it now lives outside the nav pad. */
#nav-pad-zoom img,
#nav-pad-global-icons img,
#global-menu-affordance img {
  width: 48px;
  height: 60px;
}

/* The joystick field -- the whole box is the hit area (well over the
   44x44 minimum on its own), not just the handle graphic. touch-action:
   none stops the browser's own touch-scroll/zoom gestures from competing
   with pointer-driven dragging on this element. */
#eye-joystick-field {
  position: relative;
  top: -10px;
  width: var(--nav-joystick-field-width);
  height: var(--nav-joystick-field-height);
  opacity: var(--nav-icon-opacity);
  touch-action: none;
  cursor: pointer;
}

#eye-joystick-bg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Positioned by JS via left/top (px from the field's centre) every frame
   while dragging or springing back -- not transform, so the same numbers
   driving the rotation math can be read straight off the element without
   also parsing a transform string. */
#eye-joystick-handle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--nav-joystick-handle-size);
  height: var(--nav-joystick-handle-size);
  margin-left: calc(var(--nav-joystick-handle-size) / -2);
  margin-top: calc(var(--nav-joystick-handle-size) / -2);
  pointer-events: none;
}

#eye-joystick-handle img {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------------
   Artwork focus view -- above everything else in the stacking order,
   including the intro screen (z-index: 20). Opacity is written from JS
   every frame during the fade (see setFocusOpacity() in main.js), same
   pattern as the transition overlay -- but this is the only property
   animated here: no desaturation, no touching the viewer underneath.
   pointer-events only turns on once a fade has actually started, so the
   whole screen isn't an accidental click target while fully invisible.
   ------------------------------------------------------------------- */
#focus-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}

#focus-view.open {
  pointer-events: auto;
}

#focus-view-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

/* ---------------------------------------------------------------------
   Shared by every fixed, centred, fade-driven image overlay toggled from
   a nav-pad icon -- currently the wayfinding map (see #map-overlay in
   index.html). Sits above the nav pad/affordances (z-index: 8) but below
   the debug panels and info overlay (10 / 15), same as those two. Opacity is written from JS every
   frame during the fade (e.g. setMapOpacity() in main.js), same pattern
   as #transition-overlay and #focus-view. left/bottom/max-width/max-height
   are all set from JS too (sizeAndPositionOverlay()) since they depend on
   the nav pad's actual rendered height, not a fixed constant.
   ------------------------------------------------------------------- */
.overlay-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9;
  opacity: 0;
  pointer-events: none;
}

.overlay-panel.open {
  pointer-events: auto;
}

/* Hugs the image's actual rendered box (not its natural size) so any
   percentage-based positioning inside it (e.g. #map-hotspots) lands
   exactly on the image regardless of how much sizeAndPositionOverlay()
   has scaled it down. */
.overlay-frame {
  position: relative;
  display: inline-block;
}

.overlay-frame img {
  display: block;
  width: auto;
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

#map-hotspots {
  position: absolute;
  inset: 0;
}

/* PLACEHOLDER -- David will style this later. Deliberately plain/obvious
   (not final visual design) so it reads as provisional during testing;
   width/height/margins are set from JS from the tunable hit-radius
   (mapHotspotHitRadiusPx in main.js), which doubles as this marker's
   visible size -- there's no separate, larger invisible hit-area. */
.map-hotspot {
  position: absolute;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.55);
  border: 1px solid #fff;
  cursor: pointer;
}

/* Debug-only label -- shown next to each hotspot while map readout mode is
   on, so authored positions can be checked/re-read against the image. */
.map-hotspot-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 2px;
  font-size: 9px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 1px 3px;
  border-radius: 2px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Scene panel (debug) -- sits left of #focus-panel along the top edge.
   ------------------------------------------------------------------- */
#scene-panel {
  top: 10px;
  right: 510px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 260px;
}

#scene-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#scene-panel label > input[type='range'] {
  flex: 1;
}

#scene-panel input[type='number'] {
  width: 48px;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

#scene-panel select {
  flex: 1;
  font: inherit;
}

/* ---------------------------------------------------------------------
   Scene-specific UI. Reception shows no UI at all -- just the pano -- until
   its own is designed: the whole nav pad (joystick, zoom, wayfinding, global
   menu, next) and the info affordance are hidden. Drag-to-look still works.
   The gallery is unaffected. The debug chrome ("c") is separate and stays.
   The classroom drops only the central nav pad -- it's a single node with
   nowhere to walk; the info affordance and global menu icon stay.
   ------------------------------------------------------------------- */
body[data-scene='classroom'] #nav-pad,
body[data-scene='reception'] #nav-pad,
body[data-scene='reception'] #affordance-stack,
body[data-scene='reception'] #global-menu-affordance {
  display: none;
}

/* Global menu icon -- its own bottom-right corner (see index.html), mirroring
   #affordance-stack's bottom-left placement. */
#global-menu-affordance {
  position: fixed;
  right: var(--info-affordance-offset-x);
  bottom: var(--info-affordance-offset-y);
  z-index: 8;
}

/* ---------------------------------------------------------------------
   Reception overlays. #welcome-panel shares every rule with #info-overlay
   above (position, bleed, blur, fade), so the two panels are identical in
   look; only its contents are styled here. Opened/closed by
   setReceptionOverlays() in main.js.
   ------------------------------------------------------------------- */
#welcome-content p {
  max-width: var(--welcome-text-width);
  margin: 0 0 1.2em;
  font-size: 13px;
  line-height: 24px;
}

/* The comp leaves a deliberate gap before the "learn more" line. */
#welcome-content #welcome-more {
  margin: 3em 0 0;
}

#welcome-content a {
  color: var(--reception-link);
  text-decoration: none;
}

#welcome-content a:hover {
  text-decoration: underline;
}

/* Classroom panel -- the welcome panel mirrored onto the right edge: same
   frosted background, blur, width, type and fade, with the bleed pushed off
   the right edge instead and the rounded corners on the left. 80% of the
   viewport tall and centred vertically, with its text block centred inside.
   z-index 7 keeps it above the pano and transition overlay (5) but under the
   corner icons (8), so on short windows it never covers the global menu
   icon. Opened/closed by setSceneOverlays() in main.js. */
:root {
  --classroom-panel-height: 80vh;
}

#classroom-panel {
  position: fixed;
  top: 50%;
  right: calc(-1 * var(--info-panel-bleed));
  z-index: 7;
  display: flex;
  justify-content: flex-start;
  width: calc(var(--welcome-panel-width) + var(--info-panel-bleed));
  height: var(--classroom-panel-height);
  background-color: rgba(var(--info-panel-bg-rgb), var(--reception-panel-bg-alpha));
  backdrop-filter: blur(var(--info-panel-blur));
  -webkit-backdrop-filter: blur(var(--info-panel-blur));
  border-radius: var(--info-panel-radius) 0 0 var(--info-panel-radius);
  color: var(--panel-text-color);
  font-family: 'Open Sans', system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(16px);
  transition: opacity var(--reception-fade-ms) ease, transform var(--reception-fade-ms) ease;
}

#classroom-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

#classroom-content {
  display: flex;
  flex-direction: column;
  width: var(--welcome-panel-width);
  box-sizing: border-box;
  /* Mirrored insets: the welcome panel's wider inset sits on the rounded
     (outer) side, which here is the left. */
  padding: 0 var(--welcome-panel-padding-left) 0 var(--welcome-panel-padding-right);
  overflow-y: auto; /* safety net for short windows -- the text normally fits */
}

#classroom-content p {
  margin: 0 0 1.2em;
  font-size: 13px;
  line-height: 24px;
}

/* Vertical centring via auto margins rather than justify-content: center,
   so if the text ever overflows (very short windows) it scrolls from the
   top instead of being clipped above the panel. */
#classroom-content p:first-child {
  margin-top: auto;
}

#classroom-content p:last-child {
  margin-bottom: auto;
}

/* Directory -- same frosted panel as the info panel, but floating (inset
   from the corner) so it is rounded on every side. Values read off the
   comp's directory PNG (336px wide). */
:root {
  --reception-link: #4b60ff;
  --welcome-text-width: 100%; /* fills the panel between its paddings (was the comp's narrower 254px column) */
  --reception-fade-ms: 1000ms; /* the reception panels' own fade, separate from the gallery info panel's 250ms */
  --reception-panel-bg-alpha: 0.7; /* the reception panels' background opacity; the gallery info panel keeps --info-panel-bg-alpha */
  --directory-width: 336px;
  --directory-offset: 28px;
}

#directory {
  position: fixed;
  right: var(--directory-offset);
  bottom: var(--directory-offset);
  z-index: 15;
  width: var(--directory-width);
  box-sizing: border-box;
  padding: 26px 32px 34px;
  background-color: rgba(var(--info-panel-bg-rgb), var(--info-panel-bg-alpha));
  backdrop-filter: blur(var(--info-panel-blur));
  -webkit-backdrop-filter: blur(var(--info-panel-blur));
  border-radius: var(--info-panel-radius);
  color: var(--panel-text-color);
  font-family: 'Open Sans', system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity var(--info-panel-transition-ms) ease, transform var(--info-panel-transition-ms) ease;
}

/* Reception panels have their own background alpha and fade clock, apart from
   the shared info-panel values (which #welcome-panel otherwise inherits). */
#welcome-panel,
#directory {
  background-color: rgba(var(--info-panel-bg-rgb), var(--reception-panel-bg-alpha));
  transition: opacity var(--reception-fade-ms) ease, transform var(--reception-fade-ms) ease;
}

#directory.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* In the gallery and classroom the same panel is the global menu, opened from
   the global icon rather than by the scene -- but it sits in the same
   bottom-right spot as reception's own directory, no per-scene override.
   --global-menu-fade-ms is a PLACEHOLDER, matching the map's 400ms. */
:root {
  --global-menu-fade-ms: 400ms;
}

body:not([data-scene='reception']) #directory {
  transition-duration: var(--global-menu-fade-ms);
}

#directory-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  text-align: center;
}

#directory-title {
  color: #fff; /* matches the white entry numbers */
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
}

#directory-subtitle {
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.directory-entry {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 30px;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.directory-entry[aria-disabled='true'] {
  cursor: default;
}

.directory-num {
  flex: 0 0 22px;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.directory-text {
  display: flex;
  flex-direction: column;
}

.directory-name {
  font-size: 24px;
  font-weight: 300;
  line-height: 1.2;
}

.directory-line {
  margin-top: 6px;
  font-size: 14px;
}

.directory-line-gap {
  margin-top: 12px;
}

.directory-link {
  font-size: 14px;
  color: var(--reception-link);
}

.directory-entry:not([aria-disabled='true']):hover .directory-link {
  text-decoration: underline;
}
