.entry-launch {
  margin-top: 16px;
}
.entry-dialog {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 16px;
  padding: 24px;
  width: min(700px, calc(100% - 24px));
  max-height: 90dvh;
  overflow: auto;
}
.entry-dialog::backdrop {
  background: #080604da;
}
.entry-dialog h2 {
  font-size: 32px;
  margin: 20px 0;
}
.entry-dialog p {
  color: var(--muted);
  margin-bottom: 16px;
}
.entry-close,
.entry-choice,
.brain-choice {
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 12px;
  min-height: 48px;
}
.entry-close {
  float: right;
}
.entry-options,
.brain-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
  clear: both;
}
.entry-choice {
  text-align: left;
  padding: 24px;
}
.entry-choice strong,
.entry-choice span {
  display: block;
}
.entry-choice span {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}
.brain-choice[aria-pressed='true'] {
  border: 2px solid var(--accent);
  background: var(--selected);
}
.entry-dialog.viewing {
  width: calc(100% - 24px);
  max-width: 1500px;
}
.entry-dialog iframe {
  width: 100%;
  height: 65dvh;
  border: 1px solid var(--rule);
  margin-top: 16px;
}
.entry-error {
  color: var(--highlight) !important;
}
@media (max-width: 500px) {
  .entry-options {
    grid-template-columns: 1fr;
  }
  .entry-dialog {
    padding: 16px;
  }
  .entry-choice {
    padding: 16px;
  }
}
/* New lab stills reuse the approved site's room layout and controls. */
.entry-dialog h2 {
  clear: both;
}
#lab-art {
  transition: transform 0.65s cubic-bezier(0.22, 0.7, 0.2, 1);
}
.station-still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #263842;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.station-still.visible {
  opacity: 1;
}
.station-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  font-size: 14px;
}
@media (prefers-reduced-motion: reduce) {
  #lab-art,
  .station-still {
    transition: none;
  }
}
/* Existing model portraits, lossless at original resolution; fetched on intent. */
[data-room='oilfield'] {
  --brain-portrait: url('/lab/portrait-oilfield.webp');
}
[data-room='games'] {
  --brain-portrait: url('/lab/portrait-social.webp');
}
[data-room='ai'] {
  --brain-portrait: url('/lab/portrait-coordinator.webp');
}
[data-room='toys'] {
  --brain-portrait: url('/lab/portrait-clerk.webp');
}
[data-room] .room-peek {
  background-image: none;
  background-size: 100% auto;
  background-position: center center;
}
[data-room='oilfield'] .room-peek {
  background-position: center -5px;
}
[data-room]:focus-visible .room-peek {
  background-image: var(--brain-portrait);
}
@media (hover: hover) and (pointer: fine) {
  [data-room]:hover .room-peek {
    background-image: var(--brain-portrait);
  }
}
/* Picker portraits are created only after the visitor chooses Control. */
.brain-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.brain-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 142px;
  text-align: center;
}
.brain-portrait {
  display: block;
  width: 88px;
  height: 88px;
  max-width: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--edge);
}
.brain-choice span {
  overflow-wrap: anywhere;
  font-size: 14px;
}
.brain-choice[aria-pressed='true'] {
  box-shadow: inset 0 0 0 1px var(--accent);
}
@media (max-width: 600px) {
  .brain-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .brain-choice {
    min-height: 124px;
  }
  .brain-portrait {
    width: 76px;
    height: 76px;
  }
}
/* The approved relit overview and its station buttons share one coordinate
   space. Small screens scroll this larger scene instead of shrinking the lab. */
.scene-stage {
  position: relative;
}
.lab-pan-hint {
  display: none;
}
body:not(.room-open) .lab-space:not(.image-missing) .lab-scene .scene-viewport {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  aspect-ratio: auto;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: var(--edge) var(--paper);
  scroll-padding-inline: 8px;
  filter: drop-shadow(0 12px 16px var(--shadow));
}
body:not(.room-open) .lab-space:not(.image-missing) .scene-stage {
  width: 100%;
  min-width: 1200px;
  aspect-ratio: 8/5;
  overflow: hidden;
}
body:not(.room-open) .lab-space:not(.image-missing) .lab-scene #lab-art {
  position: absolute;
  width: 135%;
  max-width: none;
  left: -17.5%;
  top: -16%;
  height: auto;
  clip-path: polygon(
    30.6% 21.1%,
    80.4% 28.3%,
    85.6% 70.5%,
    82.3% 86.7%,
    82.6% 91.1%,
    10.6% 71%,
    10.6% 70.4%,
    12.2% 67.8%,
    8.8% 52.6%
  );
  filter: sepia(0.5) saturate(0.88) brightness(0.9) contrast(1.06);
}
body:not(.room-open) .lab-space:not(.image-missing) .lab-scene .room-markers {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
body:not(.room-open) .lab-space:not(.image-missing) .room-directory {
  display: none;
}
.room-markers .marker {
  --portal-size: 132px;
  font-size: 18px;
  padding: 12px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.room-markers .oilfield {
  left: 36%;
  right: auto;
  top: 21%;
  bottom: auto;
}
.room-markers .games {
  left: 91%;
  right: auto;
  top: 61%;
  bottom: auto;
}
.room-markers .ai {
  left: 61%;
  right: auto;
  top: 25%;
  bottom: auto;
}
.room-markers .toys {
  left: 16%;
  right: auto;
  top: 29%;
  bottom: auto;
}
.room-markers .marker::after {
  display: none;
}
.room-markers .marker .control-label {
  width: calc(100% - 4px);
  padding: 2px;
  line-height: 1.2;
  overflow-wrap: normal;
  transform: translate(-50%, -50%);
}
.room-markers .marker:focus-visible .control-label {
  transform: translate(-50%, -50%);
}
@media (hover: hover) and (pointer: fine) {
  .room-markers .marker:hover .control-label {
    transform: translate(-50%, -50%);
  }
}
@media (max-width: 1247px) {
  body:not(.room-open) .lab-space:not(.image-missing) .lab-pan-hint {
    display: block;
    color: var(--accent);
    margin-top: var(--s2);
    font-size: 13px;
  }
}
