/* Lab 2: the scene and its evidence share the available viewport. */
body {
  background: #f4f8f5;
}
body .lab {
  height: 100dvh;
  min-height: 520px;
  max-width: none;
  padding: 0;
  gap: 0;
  grid-template-rows: 60px minmax(0, 1fr) auto !important;
  align-content: stretch !important;
}
.topbar {
  min-height: 0;
  padding: 0 18px;
  gap: 14px;
  background: #fbfdfb;
}
.lab-name {
  font-size: 13px;
  white-space: nowrap;
}
.lab-name span {
  display: block;
  font-size: 11px;
}
#workspace-switch {
  max-width: 210px;
  font-weight: 650;
  margin-left: 12px;
}
.compare-link {
  font-size: 11px;
  white-space: nowrap;
  text-decoration: none;
}
.toolbar {
  margin-left: auto;
  gap: 5px;
}
body .workbench {
  min-height: 0 !important;
  grid-template-columns: minmax(0, 1fr) 340px !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 0;
  overflow: hidden;
}
body.graph-focus .workbench {
  grid-template-columns: minmax(300px, 0.7fr) minmax(500px, 1fr) !important;
}
.scene-card {
  border: 0 !important;
  border-radius: 0;
  min-width: 0;
  overflow: hidden;
}
.scene-title {
  flex: none;
  background: #07121e;
  color: #e9f5f4;
  padding: 14px 22px 10px;
}
.experiment-heading {
  min-height: 0;
  gap: 15px;
  align-items: center;
}
.experiment-heading h1 {
  font:
    500 clamp(17px, 1.8vw, 25px) / 1.25 Georgia,
    serif;
  margin-top: 4px;
}
.eyebrow {
  color: #84cfac;
  font-size: 10px;
}
.scene-title #capture {
  font-size: 11px;
  padding: 8px;
  min-height: 33px;
}
.scene-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #050d18;
}
.scene-viewport > .card-label {
  display: none;
}
#scene {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  background: transparent;
}
#star-surface {
  position: absolute;
  left: 0;
  z-index: 1;
  pointer-events: none;
}
.star-tools {
  position: absolute;
  top: 10px;
  left: 16px;
  right: 16px;
  z-index: 5;
  gap: 5px;
  flex-wrap: wrap;
}
.star-tools button {
  font-size: 11px;
  min-height: 29px;
  padding: 5px 8px;
}
#three-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
}
#three-stage canvas {
  width: 100%;
  height: 100%;
}
#spatial-tools {
  position: absolute;
  top: 10px;
  left: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
}
#spatial-tools button {
  font-size: 11px;
  padding: 6px 8px;
}
#spatial-note {
  font-size: 11px;
  color: #b9c9dc;
}
.evidence-dock {
  overflow: auto;
  min-height: 0;
  background: #f5f9f6;
  border-left: 1px solid #cdded4;
  padding: 14px;
  overscroll-behavior: contain;
}
.evidence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #52776a;
  margin-bottom: 10px;
}
.evidence-heading button {
  font-size: 10px;
  min-height: 29px;
  padding: 5px;
  letter-spacing: 0;
}
body .readings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 12px;
}
.reading {
  padding: 9px 10px;
  min-width: 0;
  border-radius: 8px;
}
.reading strong,
body.teacher .reading strong {
  font-size: 20px;
  overflow-wrap: anywhere;
}
.reading span {
  font-size: 10px;
  line-height: 1.3;
}
body .graph-card {
  height: 280px;
  min-height: 240px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.graph-card > .card-label {
  padding: 10px 12px 0 !important;
  font-size: 9px;
}
.graph-card > .card-label span {
  display: none;
}
.evidence-dock #hint {
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0;
  color: #36584c;
  display: block;
}
body #life-detail {
  display: block;
  padding: 12px 0;
  border-top: 1px solid #ccded3;
  max-height: none;
}
#life-detail label {
  display: block;
  font-size: 12px;
}
#life-layer {
  display: block;
  width: 100%;
  margin-top: 7px;
}
body #life-detail p {
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
  max-width: none;
  overflow: visible;
}
.survey-controls {
  display: flex;
  flex-wrap: wrap;
  padding: 8px 0;
}
.survey-controls button {
  white-space: normal;
}
.bench-guide {
  font-size: 12px;
  line-height: 1.6;
}
.bench-guide p {
  margin-top: 8px;
}
.command-dock {
  padding: 10px 18px;
  background: #fbfdfb;
  border-top: 1px solid #cdded4;
  max-height: 190px;
  overflow: auto;
}
body .quick-controls {
  display: flex;
  gap: 24px;
  padding: 0;
  margin: 0 0 8px;
  flex-wrap: wrap;
}
body .quick-controls .control {
  width: 300px;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 3px 8px;
}
.quick-controls label {
  font-size: 11px;
}
.quick-controls input[type="number"] {
  width: 82px;
  min-height: 30px;
  font-size: 13px;
}
.quick-controls select {
  min-height: 30px;
}
.bench-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0;
}
.transport {
  gap: 5px;
}
.actions {
  margin-left: auto;
  gap: 5px;
  flex-wrap: wrap;
}
#remnant-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#remnant-tools[hidden] { display: none; }
#remnant-tools small { display: block; color: #405768; font-size: 10px; line-height: 1.45; }
#remnant-tools strong { display: block; color: #1b5147; font-size: 11px; }
.actions button,
.transport button {
  font-size: 11px;
  min-height: 31px;
  padding: 5px 9px;
}
.stage-selector select {
  max-width: 235px;
  font-size: 11px;
  min-height: 31px;
}
#phase-label {
  font-size: 10px;
  max-width: 180px;
}
.star-camera-tools {
  margin-left: auto;
}
.layer-buttons {
  position: absolute;
  right: 18px;
  top: 70px;
  z-index: 4;
  display: grid;
  gap: 5px;
  width: 190px;
  max-height: calc(100% - 120px);
  overflow: auto;
}
.layer-buttons button {
  text-align: left;
  color: #dbe8f5;
  background: #102235dd;
  border-color: #385268;
  white-space: normal;
  font-size: 11px;
  min-height: 32px;
  padding: 7px 9px;
}
.layer-buttons button[aria-pressed="true"] {
  border-color: #f0cb79;
  background: #293b45;
}
.layer-buttons small {
  display: block;
  margin-top: 3px;
  color: #8fd4b2;
  font-size: 10px;
}
.layer-buttons .element-symbol {
  display: inline-block;
  color: var(--layer-colour);
  font-size: 15px;
  margin-right: 8px;
  letter-spacing: 0.02em;
}
.layer-buttons button > span {
  font-size: 11px;
}
.element-annotations {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}
.element-annotations .element-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  min-height: 22px;
  padding: 2px 5px;
  border: 1px solid #ffffff77;
  border-bottom: 2px solid var(--layer-colour);
  border-radius: 5px;
  background: #06111de8;
  color: #f5f7fc;
  font: 600 12px/1.2 system-ui;
  box-shadow: 0 1px 8px #0005;
  pointer-events: auto;
}
.element-tag[aria-pressed="true"] {
  outline: 2px solid #ffe6a6;
  outline-offset: 2px;
}
@media (max-width: 700px) {
  .element-annotations .element-tag {
    font-size: 10px;
    padding: 1px 3px;
    min-height: 19px;
  }
  .layer-buttons .element-symbol {
    font-size: 12px;
  }
}
.scene-caption {
  position: absolute;
  bottom: 14px;
  left: 20px;
  right: 20px;
  color: #adc3d5;
  font-size: 11px;
  z-index: 3;
  pointer-events: none;
  line-height: 1.5;
}
[hidden] {
  display: none !important;
}
.reading {
  display: block !important;
}
.reading span,
.reading strong {
  display: block !important;
}
.reading strong {
  margin-top: 5px;
}
@media (max-width: 700px) {
  body .readings {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .reading {
    padding: 7px 9px;
  }
  .reading strong {
    font-size: 17px !important;
    overflow-wrap: normal;
  }
  .reading span {
    font-size: 10px;
  }
  .evidence-dock {
    padding: 10px;
  }
  body.graph-focus .workbench {
    grid-template-rows: minmax(210px, 0.75fr) minmax(280px, 1fr) !important;
  }
}
@media (min-width: 1700px) {
  body .workbench {
    grid-template-columns: minmax(0, 1fr) 410px !important;
  }
  .graph-card {
    height: 350px !important;
  }
  .reading strong {
    font-size: 24px;
  }
  .evidence-dock {
    padding: 20px;
  }
  .layer-buttons {
    width: 225px;
  }
  .layer-buttons button {
    font-size: 13px;
  }
}
@media (max-width: 1050px) {
  .lab-name,
  .compare-link {
    display: none;
  }
  body .workbench {
    grid-template-columns: minmax(0, 1fr) 300px !important;
  }
  .layer-buttons {
    width: 155px;
    right: 10px;
  }
  .toolbar button {
    padding: 6px 8px;
  }
  #workspace-switch {
    margin-left: 0;
  }
  .topbar {
    gap: 8px;
  }
  .scene-title {
    padding: 10px 15px;
  }
  .scene-title #capture kbd {
    display: none;
  }
}
@media (max-width: 700px) {
  body .lab {
    min-height: 760px;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }
  .topbar {
    padding: 8px;
    flex-wrap: wrap;
    min-height: 90px;
  }
  .brand {
    width: 65px;
  }
  .toolbar {
    margin-left: 0;
  }
  .toolbar button {
    font-size: 11px;
  }
  #workspace-switch {
    max-width: 210px;
    flex: 1;
  }
  body .workbench,
  body.graph-focus .workbench {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(300px, 1fr) 200px !important;
    overflow: hidden;
  }
  .evidence-dock {
    border-left: 0;
    border-top: 1px solid #cdded4;
    display: block;
  }
  .evidence-heading {
    margin-bottom: 8px;
  }
  .reading strong {
    font-size: 17px;
  }
  body .readings {
    grid-template-columns: repeat(4, 1fr);
  }
  body .graph-card {
    height: 260px;
  }
  .scene-title .experiment-heading h1 {
    font-size: 17px;
  }
  .scene-title {
    padding: 10px 12px;
  }
  .layer-buttons {
    width: 128px;
    top: 92px;
    right: 8px;
    max-height: calc(100% - 130px);
  }
  .layer-buttons button {
    font-size: 10px;
    padding: 5px;
  }
  .layer-buttons small {
    display: none;
  }
  .star-tools {
    left: 8px;
    right: 8px;
    gap: 3px;
  }
  .star-tools button {
    font-size: 10px;
    padding: 4px;
  }
  .command-dock {
    padding: 8px;
    max-height: 175px;
  }
  body .quick-controls {
    gap: 8px;
    flex-wrap: nowrap;
  }
  body .quick-controls .control {
    width: 50%;
    grid-template-columns: minmax(0, 1fr) 64px;
  }
  .quick-controls input[type="number"] {
    width: 64px;
  }
  .bench-footer {
    gap: 7px;
  }
  .actions {
    margin-left: 0;
  }
  .scene-caption {
    font-size: 10px;
  }
  #spatial-note {
    width: 100%;
    font-size: 10px;
  }
}
@media (max-height: 550px) and (min-width: 701px) {
  body .lab {
    min-height: 440px;
  }
  .scene-title {
    padding: 6px 14px;
  }
  .experiment-heading h1 {
    font-size: 17px;
  }
  .command-dock {
    max-height: 115px;
    padding: 5px 12px;
  }
  body .quick-controls {
    margin-bottom: 3px;
  }
  .topbar {
    min-height: 45px;
  }
  body .lab {
    grid-template-rows: 45px minmax(0, 1fr) auto !important;
  }
  .layer-buttons {
    top: 100px;
    max-height: calc(100% - 125px);
  }
}
body .lab {
  min-height: 0 !important;
  overflow-y: auto;
}
@media (max-height: 550px) and (min-width: 701px) {
  body .lab {
    grid-template-rows: 45px minmax(310px, 1fr) auto !important;
  }
  .command-dock {
    min-height: 105px;
    max-height: 140px;
  }
}

/* Each investigation starts with the space its evidence needs. Choices stay
   with that investigation rather than changing every workspace. */
.layout-control { display: flex; align-items: center; gap: 5px; letter-spacing: 0; }
.layout-control select { min-height: 29px; max-width: 132px; font-size: 11px; padding: 3px; }
@media (min-width: 701px) {
  body[data-layout="balanced"] .workbench {
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, 1fr) !important;
  }
  body[data-layout="graph"] .workbench {
    grid-template-columns: minmax(300px, .85fr) minmax(360px, 1.15fr) !important;
  }
  body[data-layout="graph"] .graph-card,
  body[data-layout="balanced"] .graph-card {
    height: clamp(270px, 43vh, 450px);
  }
  body[data-layout="graph"] .readings,
  body[data-layout="balanced"] .readings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .layer-buttons { top: 106px; gap: 2px; width: 215px; max-height: calc(100% - 150px); overflow-x: hidden; }
  .layer-buttons button { min-height: 30px; padding: 3px 7px; line-height: 1.1; }
  .layer-buttons small { margin-top: 0; font-size: 9px; line-height: 1.1; }
  .layer-buttons .element-symbol { font-size: 13px; margin-right: 5px; }
}
@media (min-width: 701px) and (max-width: 1050px) {
  .layer-buttons { width: 155px; }
}
@media (max-width: 700px) {
  body .workbench { grid-template-rows: minmax(340px, 1fr) 240px !important; overflow: auto; }
  body[data-layout="graph"] .workbench { grid-template-rows: minmax(340px, .8fr) minmax(300px, 1fr) !important; }
  .layer-buttons { top: 106px; }
}
#still-mode[aria-pressed="true"] { background: #d8eddf; border-color: #36795a; }
body.still-mode *, body.still-mode *::before, body.still-mode *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
