:root {
  color-scheme: light;
  --ink: #173e35;
  --muted: #587268;
  --line: #d6e0da;
  --paper: #f6f8f4;
  --green: #215c47;
  font-family: Inter, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  padding: 10px 13px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
button:hover {
  background: #e5eee7;
  border-color: #9bad9e;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #b5823c;
  outline-offset: 3px;
}
.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
button.quiet {
  background: transparent;
  border-color: transparent;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: var(--muted);
}
#lab {
  height: 100dvh;
  min-height: 420px;
  display: grid;
  grid-template-rows: 74px minmax(0, 1fr) 32px;
}
header {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}
.brand {
  font-size: 18px;
  letter-spacing: 1.1px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span {
  color: #a17332;
}
.brand small {
  display: block;
  font-size: 8px;
  letter-spacing: 1.9px;
  font-weight: 600;
  color: var(--muted);
}
nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex: 1;
}
nav button {
  border-color: transparent;
  background: transparent;
  padding: 11px 13px;
}
nav button[aria-pressed="true"] {
  background: #e2ece4;
  border-color: #c9d9cd;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  min-height: 0;
}
#stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #e7efeb;
}
#stage > canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.stage-heading {
  position: absolute;
  left: 30px;
  top: 20px;
  z-index: 2;
  pointer-events: none;
}
.stage-heading p {
  margin: 0 0 7px;
}
.stage-heading h1 {
  font:
    400 clamp(24px, 2.6vw, 38px) / 1.1 Georgia,
    serif;
  margin: 0 0 9px;
  letter-spacing: -0.7px;
}
#question {
  font-size: 12px;
  color: var(--muted);
}
.view-tools {
  position: absolute;
  right: 18px;
  top: 22px;
  display: flex;
  gap: 5px;
  z-index: 3;
}
.view-tools button {
  font-size: 11px;
  padding: 8px;
  background: #f8faf6e8;
}
.stage-footer {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  z-index: 3;
}
.stage-footer > span {
  font-size: 12px;
  background: #edf3eddd;
  padding: 5px 12px;
  border-radius: 20px;
  max-width: 92%;
  text-align: center;
}
.actions {
  display: flex;
  gap: 6px;
  padding: 7px;
  background: #f9fbf7f2;
  border: 1px solid #c9d8cc;
  border-radius: 12px;
  box-shadow: 0 8px 28px #1d3f3510;
}
.scene-label {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  font-size: 10px;
  letter-spacing: 0.7px;
  color: #38584b;
  white-space: nowrap;
  background: #edf3edcc;
  border-radius: 3px;
  padding: 3px 5px;
}
#evidence {
  padding: 25px 22px 18px;
  border-left: 1px solid var(--line);
  background: #f8faf6;
  overflow: auto;
  min-height: 0;
}
.evidence-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
#phase {
  font-size: 10px;
  color: #467961;
}
#readings {
  padding: 19px 0 10px;
  display: grid;
  gap: 15px;
}
.reading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.reading span {
  font-size: 12px;
  color: var(--muted);
}
.reading strong {
  font-weight: 500;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.7px;
}
.reading small {
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
}
.graph-title {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.graph-title h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
#point-count {
  font-size: 10px;
  color: var(--muted);
}
#graph {
  width: 100%;
  height: 215px;
  display: block;
  margin-top: 8px;
}
#graph-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  margin: 4px 0 20px;
}
#detail {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 12px;
  line-height: 1.8;
}
#detail .component {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.component button {
  font-size: 11px;
  padding: 4px 6px;
}
#compare {
  margin-top: 12px;
  padding-left: 0;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px;
  font-size: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
footer button {
  font-size: 10px;
  padding: 3px 5px;
  background: transparent;
  border: 0;
}
#status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
dialog {
  border: 1px solid #c8d8cb;
  border-radius: 14px;
  box-shadow: 0 24px 80px #193e3540;
  padding: 0;
  width: min(390px, calc(100% - 24px));
  max-height: 85dvh;
  color: var(--ink);
  background: #fafbf8;
  margin: auto 20px auto auto;
}
dialog::backdrop {
  background: #14392c17;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: #fafbf8;
  z-index: 2;
}
.dialog-head h2 {
  font:
    400 23px Georgia,
    serif;
  margin: 0;
}
.dialog-head button {
  padding: 3px 10px;
  font-size: 24px;
  border: 0;
  background: transparent;
}
#drawer-content {
  padding: 20px;
}
#drawer-content label {
  display: block;
  font-size: 12px;
  margin-bottom: 16px;
  color: var(--muted);
}
input:not([type="checkbox"]),
select {
  width: 100%;
  margin-top: 6px;
  padding: 9px;
  border: 1px solid #c8d8cb;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
input[type="range"] {
  padding: 0;
  accent-color: var(--green);
}
#drawer-content h3 {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 20px 0 10px;
}
#drawer-content h3:first-child {
  margin-top: 0;
}
#drawer-content p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.choices {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.choices button {
  flex: 1;
  min-width: 75px;
}
.choices button[aria-pressed="true"] {
  background: #e0ebe2;
}
.load-list {
  display: grid;
  gap: 8px;
}
.load-row {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
}
.load-row span {
  flex: 1;
}
.full {
  width: 100%;
  margin: 6px 0;
}
.fine {
  font-size: 11px !important;
}
#wire-inset {
  position: absolute;
  left: 24px;
  bottom: 142px;
  width: 300px;
  background: #f8faf6ee;
  padding: 15px;
  border: 1px solid #c3d3c6;
  border-radius: 8px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}
#wire-inset[hidden],
#wire-weights[hidden],
#spring-weights[hidden] {
  display: none;
}
#wire-inset > span {
  font-size: 9px;
  letter-spacing: 1.3px;
  display: block;
}
#wire-reading {
  display: block;
  font: 500 19px monospace;
  margin: 0;
}
#wire-magnifier {
  grid-column: 1/-1;
  width: 100%;
  height: 86px;
  margin: 10px 0 5px;
}
.magnifier-footer {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.magnifier-footer button {
  padding: 4px 12px;
  font-size: 11px;
}
#wire-weights,
#spring-weights {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border-radius: 10px;
  background: #f8faf6ef;
  border: 1px solid #c9d8cc;
}
#spring-weights {
  max-width: calc(100% - 24px);
}
#spring-weights label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 5px;
  font-size: 12px;
}
#spring-mass {
  width: 90px;
  margin: 0;
  font-size: 12px;
}
#wire-weights > span {
  font-size: 11px;
  padding: 0 6px;
}
#wire-weights button,
#spring-weights button {
  padding: 8px 12px;
  font-size: 12px;
}
#lab[data-bench="wire"] #hint {
  display: none;
}
#lab[data-bench="wire"] .stage-footer {
  gap: 7px;
}
#lab[data-bench="springs"] .stage-footer {
  gap: 7px;
}
#wire-inset small {
  font-size: 10px;
  color: var(--muted);
}
#error {
  position: absolute;
  inset: 35% 15%;
  background: #fff;
  padding: 24px;
  z-index: 5;
  border-radius: 12px;
}
#toast {
  position: fixed;
  bottom: 45px;
  left: 50%;
  transform: translateX(-50%);
  background: #143f30;
  color: #fff;
  padding: 12px 20px;
  border-radius: 9px;
  max-width: 90%;
  font-size: 13px;
  z-index: 20;
}
table {
  font-size: 11px;
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
td,
th {
  text-align: right;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
}
.energy-bar {
  height: 7px;
  background: #e2e9e1;
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.energy-bar i {
  display: block;
  height: 100%;
  background: #bb8a45;
}
.help-list {
  padding-left: 17px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  main {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
  #graph {
    height: 260px;
  }
  .scene-label {
    font-size: 12px;
  }
  .reading strong {
    font-size: 32px;
  }
}
@media (max-width: 1100px) {
  header {
    padding: 0 12px;
    gap: 12px;
  }
  nav button {
    padding: 9px 7px;
    font-size: 12px;
  }
  .view-tools {
    top: 105px;
    right: 12px;
  }
  main {
    grid-template-columns: minmax(0, 1fr) 255px;
  }
  .stage-heading {
    left: 20px;
  }
  .actions {
    gap: 3px;
  }
  .actions button {
    padding: 9px;
    font-size: 11px;
  }
  #evidence {
    padding: 20px 14px;
  }
}
@media (max-width: 760px) {
  #lab {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  header {
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 12px;
  }
  .brand {
    font-size: 14px;
    flex: 1;
  }
  .brand small {
    font-size: 7px;
  }
  nav {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
  nav button {
    flex: 1;
    font-size: 11px;
    padding: 8px 5px;
  }
  main {
    grid-template-columns: 1fr;
    grid-template-rows: 540px auto;
  }
  #evidence {
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 15px;
    padding: 15px;
  }
  .evidence-title {
    grid-column: 1/-1;
  }
  #readings {
    grid-column: 1;
    grid-row: 2 / 5;
    padding: 4px 0;
    gap: 8px;
    align-content: start;
  }
  .reading {
    display: block;
  }
  .reading strong {
    display: block;
    font-size: 22px;
  }
  .graph-title {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    padding: 0;
    border: 0;
  }
  #graph {
    grid-column: 2;
    grid-row: 3;
    height: 170px;
    margin: 0;
  }
  #graph-note {
    grid-column: 2;
    grid-row: 4;
    margin: 0;
  }
  #detail {
    grid-column: 1/-1;
  }
  #compare {
    margin: 0;
  }
  .stage-heading h1 {
    font-size: 28px;
  }
  .stage-heading {
    top: 18px;
    left: 18px;
  }
  .stage-footer {
    bottom: 12px;
  }
  .actions {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 96%;
  }
  .stage-footer > span {
    font-size: 11px;
  }
  .view-tools {
    top: 104px;
  }
  #wire-inset {
    left: 12px;
    bottom: 115px;
    width: 230px;
    padding: 10px;
  }
  .scene-label {
    font-size: 9px;
  }
  footer {
    padding: 8px 12px;
    flex-wrap: wrap;
  }
  footer > span:first-child {
    display: none;
  }
  dialog {
    margin: auto;
  }
  #question {
    max-width: 280px;
  }
  #point-count {
    display: none;
  }
}
@media (max-height: 600px) and (min-width: 761px) {
  #lab {
    grid-template-rows: 56px minmax(340px, 1fr) 26px;
    min-height: 430px;
  }
  .stage-heading h1 {
    font-size: 25px;
  }
  .stage-heading {
    top: 12px;
  }
  .view-tools {
    top: 95px;
  }
  .stage-footer {
    bottom: 10px;
  }
  .stage-footer > span {
    display: none;
  }
  #evidence {
    padding-top: 14px;
  }
  .reading strong {
    font-size: 21px;
  }
  #graph {
    height: 170px;
  }
  #readings {
    gap: 7px;
    padding-top: 10px;
  }
}
.primary:hover {
  background: #154734;
  color: #fff;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
@media (max-width: 760px) {
  #lab {
    height: 100dvh;
    min-height: 580px;
    grid-template-rows: auto minmax(0, 1fr) 28px;
  }
  main {
    grid-template-rows: minmax(280px, 1fr) 195px;
  }
  #evidence {
    grid-template-rows: 15px 18px 105px auto;
    overflow: auto;
    padding: 10px 14px;
  }
  #readings {
    gap: 5px;
  }
  .reading strong {
    font-size: 19px;
  }
  .reading span {
    font-size: 10px;
  }
  #graph {
    height: 115px;
  }
  #graph-note {
    font-size: 10px;
  }
  #detail {
    font-size: 11px;
  }
  .stage-heading h1 {
    font-size: 25px;
  }
  .stage-heading p {
    margin-bottom: 4px;
  }
  #question {
    font-size: 10px;
  }
  .view-tools {
    top: 92px;
    gap: 3px;
  }
  .view-tools button {
    padding: 5px;
    font-size: 10px;
  }
  .scene-label {
    display: none;
  }
  .stage-footer > span {
    display: none;
  }
  .stage-footer {
    gap: 5px;
  }
  .actions button {
    padding: 8px 6px;
    font-size: 10px;
  }
  #wire-inset {
    width: 220px;
    bottom: 110px;
    left: 12px;
    padding: 8px;
  }
  #wire-reading {
    font-size: 15px;
  }
  #wire-inset > span {
    font-size: 7px;
    letter-spacing: 0.6px;
  }
  #wire-magnifier {
    height: 56px;
    margin: 5px 0;
  }
  #wire-weights {
    gap: 4px;
    padding: 5px;
  }
  #wire-weights button {
    padding: 6px;
    font-size: 10px;
  }
  #wire-weights > span {
    font-size: 9px;
    padding: 0 2px;
  }
  #spring-weights {
    gap: 4px;
    padding: 5px;
  }
  #spring-weights label {
    font-size: 10px;
    gap: 4px;
    padding: 0;
  }
  #spring-mass {
    width: 68px;
    padding: 6px 4px;
    font-size: 11px;
  }
  #spring-weights button {
    padding: 7px;
    font-size: 10px;
  }
  .magnifier-footer button {
    font-size: 10px;
    padding: 3px 8px;
  }
  #wire-inset small {
    font-size: 9px;
  }
  footer {
    padding: 4px 10px;
  }
}
#lab,
header,
nav,
main,
#stage,
#evidence {
  min-width: 0;
}
nav {
  max-width: 100%;
}
.reading {
  min-width: 0;
}
@media (max-width: 760px) {
  nav {
    width: 100%;
    flex-basis: 100%;
    gap: 0;
  }
  nav button {
    flex: 0 0 auto;
    font-size: 10px;
  }
  #lab {
    width: 100%;
  }
  .view-tools {
    max-width: 95%;
  }
}
.instrument-body {
  padding: 20px;
}
.micrometer-dialog {
  margin: auto;
  width: min(480px, calc(100vw - 24px));
}
.instrument-body svg {
  width: 100%;
  display: block;
}
.instrument-body label,
.instrument-body p {
  font-size: 12px;
  line-height: 1.6;
}
.instrument-body input {
  width: 100%;
}
.drag-hint {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #215c47;
  color: white;
  padding: 10px 16px;
  border-radius: 20px;
  pointer-events: none;
  font-size: 12px;
  z-index: 5;
}
.brand img {
  display: block;
  width: 124px;
  height: auto;
  max-width: 100%;
}
/* Stress testing pairs a large physical specimen with a legible evidence panel. */
#lab[data-bench="stress"] main {
  grid-template-columns: minmax(0, 3fr) minmax(420px, 2fr);
}
#lab[data-bench="stress"] #evidence {
  padding: 20px 24px;
}
#lab[data-bench="stress"] #readings {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 0 8px;
}
#lab[data-bench="stress"] .reading {
  display: block;
}
#lab[data-bench="stress"] .reading span,
#lab[data-bench="stress"] .reading strong {
  display: block;
}
#lab[data-bench="stress"] .reading strong {
  font-size: 25px;
  margin-top: 3px;
}
#lab[data-bench="stress"] .graph-title {
  margin-top: 12px;
  padding-top: 12px;
}
#lab[data-bench="stress"] #graph {
  height: clamp(250px, 36vh, 360px);
  margin: 6px 0;
}
#lab[data-bench="stress"] #graph-note {
  font-size: 11px;
  line-height: 1.5;
  margin: 6px 0 12px;
}
#lab[data-bench="stress"] .view-tools {
  top: 20px;
  right: 12px;
}
#lab[data-bench="stress"] #question {
  max-width: 370px;
}
#stress-materials {
  position: absolute;
  top: 126px;
  left: 30px;
  z-index: 3;
  display: flex;
  padding: 4px;
  background: #f8faf6ed;
  border: 1px solid #cbd9ce;
  border-radius: 12px;
  gap: 4px;
}
#stress-materials[hidden],
#stress-caption[hidden],
#stress-legend[hidden],
#expand-graph[hidden] {
  display: none;
}
#stress-materials button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 14px;
}
#stress-materials button small {
  display: block;
  font-size: 10px;
  color: #638174;
  margin-top: 4px;
  font-weight: 400;
}
#stress-materials button[aria-pressed="true"] {
  background: #245d48;
  color: #fff;
}
#stress-materials button[aria-pressed="true"] small {
  color: #d0e5d9;
}
#stress-caption {
  position: absolute;
  left: 24px;
  bottom: 130px;
  max-width: 260px;
  padding: 13px 16px;
  background: #f8faf6eb;
  border-left: 3px solid #9a7c42;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  pointer-events: none;
}
#stress-caption strong,
#stress-caption span,
#stress-caption small {
  display: block;
}
#stress-caption span {
  margin: 7px 0;
  line-height: 1.5;
  color: #4c6b5f;
}
#stress-caption small {
  font-size: 9px;
  color: #688376;
  line-height: 1.5;
}
#stress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 11px;
  margin: 10px 0 8px;
}
.key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.key::before {
  content: "";
  width: 15px;
  height: 4px;
  background: #137c69;
}
.key.load::before {
  background: #7453a1;
}
.key.unload::before {
  background: repeating-linear-gradient(
    90deg,
    #137c69 0 5px,
    transparent 5px 7px
  );
}
.key.loss::before {
  height: 11px;
  background: repeating-linear-gradient(45deg, #f4dba5 0 3px, #ba852d 3px 4px);
}
.key.return::before {
  height: 11px;
  background: #99d2b9;
}
.key.neck::before {
  height: 11px;
  background: #d9c6e6;
}
.key.kept::before {
  background: repeating-linear-gradient(
    90deg,
    #8b9692 0 5px,
    transparent 5px 7px
  );
}
.key.break {
  color: #b23940;
}
.key.break::before {
  display: none;
}
.energy-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.energy-cards > div {
  background: #e9eeea;
  border: 1px solid #d8e1da;
  border-radius: 8px;
  padding: 10px;
}
.energy-cards .returned {
  background: #e3f0e7;
  border-color: #bcd8c8;
}
.energy-cards .dissipated {
  background: #fbefd7;
  border-color: #e8ce97;
}
.energy-cards span {
  display: block;
  font-size: 10px;
  margin-bottom: 5px;
}
.energy-cards strong {
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.energy-cards small {
  font-size: 12px;
}
.balance {
  font-size: 11px;
  line-height: 1.7;
  margin: 10px 0;
}
.area-note {
  font-size: 11px;
  line-height: 1.6;
  color: #5e776b;
}
.test-milestones {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.test-milestones span {
  border: 1px solid #d6e0da;
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 10px;
  color: #718176;
}
.test-milestones .reached {
  background: #e2ede5;
  color: #245c48;
  border-color: #b6d0c0;
}
.test-milestones .failed {
  background: #f7e3df;
  color: #a3353d;
  border-color: #e3b7b2;
}
.fracture-card {
  border-left: 3px solid #b23940;
  background: #fbefea;
  padding: 13px 16px;
  border-radius: 0 7px 7px 0;
}
.fracture-card b {
  color: #a3353d;
  font-size: 12px;
}
.fracture-card strong {
  display: block;
  font-size: 23px;
  font-weight: 500;
  margin: 7px 0;
}
.fracture-card strong span {
  font-size: 12px;
}
.fracture-card small {
  font-size: 10px;
}
.graph-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.graph-actions #compare {
  margin: 0;
}
.graph-actions button {
  font-size: 11px;
}
#lab[data-bench="stress"].graph-expanded main {
  grid-template-columns: minmax(0, 2fr) minmax(420px, 3fr);
}
#lab[data-bench="stress"].graph-expanded #graph {
  height: clamp(300px, 48vh, 550px);
}
#lab[data-bench="stress"].graph-expanded .actions {
  flex-wrap: wrap;
  justify-content: center;
}
@media (max-height: 820px) and (min-width: 761px) {
  #lab[data-bench="stress"] #evidence {
    padding: 14px 20px;
  }
  #lab[data-bench="stress"] #readings {
    padding: 10px 0 4px;
  }
  #lab[data-bench="stress"] .reading strong {
    font-size: 21px;
  }
  #lab[data-bench="stress"] .graph-title {
    margin-top: 4px;
    padding-top: 6px;
  }
  #lab[data-bench="stress"] #graph {
    height: 210px;
  }
  #lab[data-bench="stress"] #stress-legend {
    margin: 7px 0 4px;
  }
  #lab[data-bench="stress"] #graph-note {
    margin: 3px 0 7px;
  }
  #lab[data-bench="stress"] .fracture-card {
    padding: 8px 12px;
  }
  #lab[data-bench="stress"] .fracture-card strong {
    margin: 3px 0;
    font-size: 20px;
  }
  #lab[data-bench="stress"] .energy-cards > div {
    padding: 7px;
  }
  #lab[data-bench="stress"] .energy-cards strong {
    font-size: 19px;
  }
  #lab[data-bench="stress"] .balance,
  #lab[data-bench="stress"] .area-note {
    margin: 6px 0;
  }
  #lab[data-bench="stress"] .graph-actions {
    margin-top: 5px;
  }
}
@media (max-width: 1100px) and (min-width: 761px) {
  #lab[data-bench="stress"] main {
    grid-template-columns: minmax(0, 1fr) 410px;
  }
  #lab[data-bench="stress"] #evidence {
    padding: 15px;
  }
  #lab[data-bench="stress"] .view-tools {
    top: 95px;
  }
  #stress-materials {
    top: 136px;
    left: 15px;
  }
  #stress-materials button {
    padding: 9px;
    font-size: 11px;
  }
  #stress-caption {
    max-width: 220px;
    left: 14px;
    bottom: 105px;
  }
  #lab[data-bench="stress"] .actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}
@media (max-width: 760px) {
  #lab[data-bench="stress"] main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(330px, 1fr) minmax(260px, 0.9fr);
  }
  #lab[data-bench="stress"] #evidence {
    display: block;
    padding: 12px 16px;
  }
  #lab[data-bench="stress"] #readings {
    display: grid;
    padding: 10px 0 4px;
  }
  #lab[data-bench="stress"] .reading strong {
    font-size: 21px;
  }
  #lab[data-bench="stress"] #graph {
    height: 260px;
    width: 100%;
  }
  #lab[data-bench="stress"] .view-tools {
    top: 80px;
    right: 10px;
  }
  #lab[data-bench="stress"] #question {
    max-width: 330px;
  }
  #stress-materials {
    top: 112px;
    left: 12px;
    gap: 0;
    padding: 3px;
  }
  #stress-materials button {
    padding: 7px 10px;
    font-size: 11px;
  }
  #stress-materials button small {
    display: none;
  }
  #stress-caption {
    display: none;
  }
  #lab[data-bench="stress"] .stage-footer {
    bottom: 8px;
  }
  #lab[data-bench="stress"] .scene-label {
    display: none;
  }
  #lab[data-bench="stress"] .graph-title {
    margin: 5px 0;
    padding: 8px 0 0;
  }
  #lab[data-bench="stress"].graph-expanded main {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }
  #lab[data-bench="stress"].graph-expanded #stage {
    display: none;
  }
  #lab[data-bench="stress"].graph-expanded #graph {
    height: 300px;
  }
  #lab[data-bench="stress"] .graph-actions {
    position: sticky;
    bottom: -12px;
    padding: 7px 0;
    background: #f8faf6;
  }
}
@media (max-width: 760px) and (max-height: 760px) {
  #lab[data-bench="wire"] main {
    grid-template-rows: minmax(330px, 1fr) 170px;
  }
  #lab[data-bench="wire"] #evidence {
    grid-template-rows: 15px 18px 100px auto;
    row-gap: 4px;
  }
  #lab[data-bench="wire"] #graph {
    height: 100px;
  }
  #lab[data-bench="wire"] #readings {
    padding: 0;
    gap: 5px;
    grid-auto-rows: min-content;
  }
  #lab[data-bench="wire"] .reading span {
    display: block;
    font-size: 9px;
    line-height: 12px;
  }
  #lab[data-bench="wire"] .reading strong {
    font-size: 17px;
    line-height: 22px;
  }
  #lab[data-bench="wire"] #wire-inset {
    padding: 8px;
    grid-template-columns: 1fr auto 30px;
    column-gap: 4px;
  }
  #lab[data-bench="wire"] #wire-reading {
    font-size: 12px;
    margin: 0;
  }
  #lab[data-bench="wire"] #wire-magnifier {
    height: 40px;
    margin: 2px 0 0;
  }
  #lab[data-bench="wire"] .magnifier-footer {
    position: static;
    grid-column: 3;
    grid-row: 1;
  }
  #lab[data-bench="wire"] .magnifier-footer small {
    display: none;
  }
  #lab[data-bench="wire"] .magnifier-footer button {
    padding: 2px 5px;
    font-size: 9px;
  }
}
@media (max-width: 760px) {
  .brand img {
    width: 92px;
  }
}
/* Additional experiments keep the existing bench/evidence layout. */
#stress-view-controls { display: grid; gap: 7px; padding: 6px 0 10px; font-size: 12px; }
#stress-view-controls label { display: flex; align-items: center; gap: 8px; }
#stress-view-controls select { min-width: 0; flex: 1; padding: 5px; }
#bending-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 8px 0; }
#bending-controls label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
#beam-load { width: 150px; accent-color: #286e54; }
#bending-controls[hidden], #stress-view-controls[hidden] { display: none; }
#wire-graph { min-width: 0; max-width: 100%; margin-top: 0; font-size: 12px; padding: 4px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); }
#lab[data-bench="wire"] #point-count { white-space: nowrap; }
#wire-graph[hidden], #graph-title[hidden] { display: none; }
@media (max-width: 760px) {
  #lab[data-bench="wire"] #evidence { grid-template-rows: 15px 28px auto auto; }
  #wire-graph { width: 100%; font-size: 11px; }
  #lab[data-bench="wire"] .actions { display: grid; grid-template-columns: repeat(4, max-content); gap: 4px; padding: 6px; }
  #lab[data-bench="wire"] .actions button { font-size: 10px; padding: 8px 5px; }
  #beam-scale { flex-basis: 100%; text-align: center; font-size: 10px; }
}
