.lab {
  border: 1px solid #ffffff30;
  border-radius: 7px;
  overflow: hidden;
  background: #f3f4eb;
  color: var(--ink)
}

.labtabs {
  display: flex;
  background: #244a40;
  border-bottom: 1px solid #ffffff30;
  padding: 0 18px;
  gap: 10px
}

.labtabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: #c5d5ca;
  padding: 19px 18px;
  font-size: 16px;
  flex: 1
}

.labtabs button[aria-selected=true] {
  color: var(--lime);
  border-color: var(--lime)
}

.labbody {
  display: grid;
  grid-template-columns: 285px 1fr
}

.labcontrols {
  padding: 27px 24px;
  border-right: 1px solid #d0d8c8;
  background: #f6f5ef
}

.labcontrols h3 {
  font-size: 24px !important;
  margin-bottom: 12px !important;
  line-height: 1.2
}

.labcontrols .introtext {
  font-size: 16px;
  color: #576e60;
  line-height: 1.7;
  margin-bottom: 23px
}

.control {
  margin: 19px 0
}

.control label,
.control .controltitle {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  gap: 10px
}

.control label output {
  color: #a9512d;
  font-family: monospace
}

.control input[type=range] {
  width: 100%;
  accent-color: #b65d32;
  cursor: pointer;
  min-height: 22px
}

.control input[type=number],
.control select {
  background: white;
  width: 100%;
  padding: 11px;
  border: 1px solid #cbd4c2;
  border-radius: 4px;
  font: 17px monospace;
  color: var(--ink)
}

.control .twoval {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px
}

.control small {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
  line-height: 1.5
}

.labtools {
  display: flex;
  gap: 8px;
  margin-top: 24px
}

.labtools button {
  border: 1px solid #bccbb5;
  background: transparent;
  color: var(--ink);
  border-radius: 4px;
  padding: 10px;
  font-size: 15px
}

.labtools button:first-child {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
  flex: 1
}

.labtools button:hover {
  filter: brightness(.9)
}

.labcontrols .lesson {
  font-size: 15px;
  padding-top: 20px;
  line-height: 1.7;
  border-top: 1px solid #d0d8c8;
  margin-top: 24px
}

.labcontrols .lesson b {
  color: #a9512d;
  font-weight: 500
}

.labcontrols a {
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px
}

.labvisual {
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative
}

.labbar {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #d0d8c8;
  font: 14px monospace;
  background: #e8eddf;
  min-height: 53px
}

.labbar .views {
  display: flex;
  gap: 3px
}

.views button {
  font: 14px Arial, sans-serif;
  padding: 7px 10px;
  border: 1px solid #becbb4;
  color: var(--ink);
  border-radius: 3px;
  background: transparent
}

.views button[aria-pressed=true] {
  background: var(--ink);
  color: white;
  border-color: var(--ink)
}

.stage {
  width: 100%;
  aspect-ratio: 1.25;
  display: block;
  touch-action: none;
  background: #eef0e4;
  cursor: crosshair
}

.stage .target {
  cursor: grab
}

.stage .target:active {
  cursor: grabbing
}

.stage:focus-visible {
  outline: 3px solid #be6739;
  outline-offset: -3px
}

.labreadout {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  background: #e5ebda;
  border-top: 1px solid #c8d4be;
  align-items: center
}

.labreadout strong {
  font: 20px monospace;
  letter-spacing: -.4px
}

.labreadout small {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 190px;
  text-align: right
}

.labhint {
  font-size: 15px;
  color: #576e60;
  padding: 14px 18px;
  margin: 0;
  line-height: 1.5;
  background: #f5f5ee
}

.labfoot {
  padding: 14px 20px;
  background: #e8eddf;
  border-top: 1px solid #ccd7c0;
  font-size: 14px;
  color: #597060;
  line-height: 1.65;
  display: flex;
  gap: 22px;
  justify-content: space-between
}

.labfoot a {
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px
}

.archive {
  margin-top: 25px;
  border: 1px solid #ffffff30;
  border-radius: 4px;
  padding: 18px 22px
}

.archive summary {
  font-size: 16px;
  cursor: pointer
}

.archive p {
  font-size: 15px;
  color: #bbcebd
}

.archive img {
  max-width: 100%;
  max-height: 380px;
  display: block;
  margin: 18px auto 10px;
  background: white
}

.productvisual img.ensa-product {
  height: 380px;
  max-width: 100%;
  width: auto;
  mix-blend-mode: normal;
  transform: rotate(-7deg);
  filter: drop-shadow(12px 12px 8px #193d3520)
}

.productvisual.ensa-visual {
  min-height: 460px;
  background-color: #e1e8da
}

.mini img.ensa-mini {
  height: 65px;
  width: 48px;
  object-fit: contain;
  mix-blend-mode: normal;
  transform: rotate(-8deg)
}

.ensalabel {
  font: 14px monospace;
  display: inline-block;
  background: #d9e8bf;
  border: 1px solid #bdd398;
  border-radius: 30px;
  padding: 6px 10px;
  margin-bottom: 5px
}

.lab [hidden] {
  display: none !important
}

@media(max-width:1050px) {
  .labbody {
    grid-template-columns: 245px 1fr
  }

  .labcontrols {
    padding: 22px 18px
  }

  .labreadout strong {
    font-size: 19px
  }

  .labreadout small {
    max-width: 125px
  }

  .labtabs button {
    padding: 18px 8px;
    font-size: 15px
  }

  .labbar {
    flex-wrap: wrap
  }
}

@media(max-width:760px) {
  .labbody {
    display: flex;
    flex-direction: column
  }

  .labcontrols {
    border-right: 0;
    border-bottom: 1px solid #ccd7c0
  }

  .labcontrols .introtext {
    margin-bottom: 10px
  }

  .labcontrols .control {
    margin: 12px 0
  }

  .labtools {
    margin-top: 14px
  }

  .labcontrols .lesson {
    margin-top: 15px;
    padding-top: 12px
  }

  .labvisual {
    min-height: 0
  }

  .labtabs {
    gap: 0;
    padding: 0 4px
  }

  .labtabs button {
    font-size: 14px;
    padding: 17px 3px
  }

  .labreadout {
    padding: 15px 13px
  }

  .labreadout strong {
    font-size: 20px
  }

  .labfoot {
    display: block
  }

  .labfoot a {
    display: inline-block;
    margin-top: 8px
  }

  .stage {
    aspect-ratio: 1.1
  }

  .productvisual img.ensa-product {
    height: 315px
  }

  .productvisual.ensa-visual {
    min-height: 390px
  }
}

.mapcredit {
  padding: 7px 16px;
  background: #faf9f2;
  border-top: 1px solid #d6d9c9;
  font: 14px Arial, sans-serif;
  color: #556452;
  text-align: right
}

.mapcredit a {
  text-decoration: underline;
  text-underline-offset: 2px
}

.inputerror {
  font-size: 15px;
  color: #a44325;
  line-height: 1.5;
  margin: 8px 0
}

.stage {
  background: #faf9f2
}

#instrument {
  cursor: grab
}

#instrument:active {
  cursor: grabbing
}

/* Keep each MN95 axis on its own complete line, including narrow screens. */
.labreadout {
  flex-wrap: wrap
}

.labreadout strong {
  white-space: pre;
  line-height: 1.4;
  flex-shrink: 0
}

.labreadout small {
  margin-left: auto
}

.reportmethod {
  padding: 20px;
  background: #f5f5ee;
  border-top: 1px solid #ccd7c0;
  color: var(--ink)
}

.reportmethod h3 {
  font-size: 19px;
  margin: 0 0 14px
}

.reportsteps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 12px
}

.reportstep {
  border: 1px solid #ccd7c0;
  padding: 14px;
  background: #fff;
  min-width: 0
}

.reportstep b {
  display: block;
  font-size: 16px;
  margin-bottom: 10px
}

.reportstep p {
  font-size: 16px;
  line-height: 1.6;
  margin: 8px 0 0
}

.reportstep .axis {
  display: block;
  font: 17px/1.8 monospace;
  white-space: nowrap
}

.reportstep em {
  font-style: normal;
  color: #a14f2b;
  font-weight: bold
}

.reportmethod .boundarynote {
  font-size: 15px;
  line-height: 1.5;
  margin: 12px 0 0
}

.reportstep.active {
  border-color: #a14f2b;
  box-shadow: inset 0 3px #a14f2b
}

.reportprogress {
  font-size: 16px;
  margin: 14px 0 0;
  line-height: 1.5
}

@media(max-width:1050px) {
  .reportsteps {
    grid-template-columns: 1fr
  }

  .reportstep {
    padding: 12px 14px
  }
}

/* Readable, numbered report guidance beside the map. */
.labcontrols #pickstatus {
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-line;
  padding: 12px;
  background: #e3eef3;
  color: #204e62;
  border-left: 4px solid #39738b;
  margin-top: 14px
}

.labcontrols #reportcontrols label {
  font-size: 18px
}

.labcontrols #reportcontrols input {
  font-size: 20px
}

.labtools button {
  font-size: 17px;
  min-height: 44px
}

.reportmethod h3 {
  font-size: 22px
}

.reportstep b {
  font-size: 20px
}

.reportstep p,
.reportprogress {
  font-size: 19px
}

.reportstep .axis {
  font-size: 19px;
  line-height: 1.9
}

.reportstep em {
  background: #f8dfa2;
  color: #513b17;
  padding: 2px 4px
}

.reportstep {
  background: #edf3ef
}

.reportmethod .boundarynote {
  font-size: 18px
}

.reportstep .axis {
  white-space: normal;
  overflow-wrap: normal
}

/* Allow larger text to reflow without narrowing the map or clipping values. */
.labbody {
  grid-template-columns: 320px minmax(0, 1fr)
}

.labbar,
.labtools,
.labfoot {
  flex-wrap: wrap
}

.labbar .views {
  flex-wrap: wrap
}

.labcontrols .twoval {
  grid-template-columns: 1fr
}

.labtabs button {
  white-space: normal;
  line-height: 1.45
}

.labreadout strong {
  font-size: 20px
}

.labreadout small {
  max-width: 240px
}

.reportstep .axis {
  font-size: 18px
}

.reportsteps {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr))
}

@media(max-width:1050px) {
  .labbody {
    grid-template-columns: 285px minmax(0, 1fr)
  }

  .labtabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .labcontrols {
    padding: 22px 18px
  }
}

@media(max-width:760px) {
  .labbody {
    display: flex
  }

  .labreadout strong {
    font-size: 18px
  }

  .labtabs button {
    font-size: 16px;
    padding: 16px 8px
  }

  .labreadout small {
    text-align: left;
    margin-left: 0;
    max-width: none
  }

  .labfoot {
    overflow-wrap: anywhere
  }
}

/* Réglage précis, placé au-dessus de la carte pour garder les traits en vue. */
.slope-fine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #c8d4be;
  background: #f5f5ee;
}

.slope-fine span {
  margin-right: auto;
  font-size: 14px;
  font-weight: 600;
}

.slope-fine button {
  min-width: 76px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid #a6b59b;
  border-radius: 3px;
  background: white;
  color: var(--ink);
  font-size: 16px;
  touch-action: manipulation;
}

.slope-fine button:active {
  background: var(--lime);
}

.slope-fine button:disabled {
  opacity: .45;
  cursor: default;
}

/* Explications placées après la simulation de pente sur téléphone. */
.labvisual > .lesson {
  margin: 0;
  padding: 20px 16px;
  border-top: 1px solid #c8d4be;
  background: #f5f5ee;
  font-size: 16px;
  line-height: 1.7;
}
