.lab-catalog, .lab-experiment {
  font-family: "Nunito", "Segoe UI", sans-serif;
  color: #30283d;
}
.lab-catalog main { margin-bottom: clamp(24px, 5vw, 58px); }
.lab-catalog .intro h1 { font-size: clamp(30px, 4vw, 46px); }
.experiment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(15px, 2.3vw, 28px);
}
.experiment-card {
  --tape: #c8b4d8;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 12px;
  color: #352a40;
  background: #fffefb;
  border: 1px solid #d8cbe2;
  border-radius: 9px 16px 11px 13px;
  box-shadow: 0 3px 0 #ddd0df88, 0 8px 22px #5236600a;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.experiment-card:nth-child(2) { --tape: #bdd0b3; }
.experiment-card.halides-card { --tape: #e4c985; }
.experiment-photo {
  position: relative;
  border: 1px solid #d9d3cf;
  border-radius: 6px;
  background: #c4bfb6;
}
.experiment-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}
.experiment-photo::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 22px;
  width: 48px;
  height: 13px;
  background: var(--tape);
  opacity: .9;
  transform: rotate(-4deg);
}
.experiment-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 8px 8px;
}
.experiment-copy :is(h2,h3) {
  margin: 0;
  font: 800 clamp(21px, 2.15vw, 29px)/1.17 "Nunito", "Segoe UI", sans-serif;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.experiment-copy p { margin: 0 0 5px; color: #62546b; font-size: 16px; line-height: 1.5; }
.experiment-action {
  margin-top: auto;
  padding: 10px 16px;
  background: #694380;
  color: #fff;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 800;
}
.experiment-card:focus-visible, .lab-experiment a:focus-visible {
  outline: 3px solid #82579e;
  outline-offset: 4px;
}
@media (hover: hover) {
  .experiment-card:hover { transform: translateY(-2px); border-color: #b498c1; box-shadow: 0 4px 0 #d9ccdf, 0 10px 22px #52366015; }
  .experiment-card:hover .experiment-action { background: #553469; }
}
.lab-experiment .app { max-width: 1220px; margin-inline: auto; }
.lab-experiment .app > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #d8cbe2;
}
.lab-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #383044;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 800;
  text-decoration: none;
}
.lab-brand img { width: 38px; height: 38px; }
.lab-brand small { display: block; margin-top: 3px; color: #756782; font-size: 13px; font-weight: 600; }
.lab-experiment .intro { margin: 10px 0 16px; padding: 0; text-align: left; }
.lab-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  width: fit-content;
  color: #694380;
  font-size: 14px;
  font-weight: 780;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lab-experiment .intro h1 {
  max-width: 42ch;
  margin: 3px 0 6px;
  font-size: clamp(27px, 3.15vw, 42px);
  line-height: 1.14;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.lab-experiment .intro p {
  max-width: 84ch;
  margin: 0;
  color: #65586f;
  font-size: 16px;
  line-height: 1.5;
}
.lab-experiment :is(.viewer,.panel,.control-card,.book,.notebook,.explain) {
  border-color: #d8cbe2;
  box-shadow: 0 3px 0 #ddd0df60;
}
.lab-experiment :is(.primary,.quick:not(.linklike)) { background-color: #70488a; border-color: #70488a; }
.lab-experiment .lab-skip {
  position: fixed;
  z-index: 150;
  left: 12px;
  top: 8px;
  padding: 9px 12px;
  transform: translateY(-150%);
  background: #fffefb;
  color: #493456;
}
.lab-experiment .lab-skip:focus { transform: none; }
.lab-full .lab-experiment .app > header { display: none; }
@media (max-width: 680px) {
  .experiment-list { grid-template-columns: minmax(0,1fr); gap: 17px; }
  .experiment-card { padding: 10px; }
  .experiment-copy { padding: 13px 5px 5px; gap: 8px; }
  .lab-catalog .intro { margin-bottom: 19px; }
  .lab-experiment .app > header { padding: 6px 0; }
  .lab-experiment .intro { margin: 3px 0 10px; }
  .lab-experiment .intro p { font-size: 15px; }
  .lab-experiment .lab-back { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .experiment-card { transition: none; }
  .experiment-card:hover { transform: none; }
}

.screen-toggle {
  margin-inline-start: auto;
  gap: 8px;
  min-height: 44px;
  color: var(--purple);
  background: #f1eaf5;
  border-color: #d5c4dd;
  white-space: nowrap;
}
.screen-icon {
  flex: none;
  width: 17px;
  height: 17px;
  --corner: linear-gradient(currentColor,currentColor);
  background: var(--corner) top left / 6px 2px, var(--corner) top left / 2px 6px,
              var(--corner) top right / 6px 2px, var(--corner) top right / 2px 6px,
              var(--corner) bottom left / 6px 2px, var(--corner) bottom left / 2px 6px,
              var(--corner) bottom right / 6px 2px, var(--corner) bottom right / 2px 6px;
  background-repeat: no-repeat;
}
.screen-toggle[aria-pressed="true"] .screen-icon {
  width: 14px;
  height: 14px;
  background: linear-gradient(45deg,transparent 44%,currentColor 46% 54%,transparent 56%),
              linear-gradient(-45deg,transparent 44%,currentColor 46% 54%,transparent 56%);
}

.lime-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 6px; }
.lime-bar #deskBook { display: none; }
.limewater-lab #deskJournal {
  width: min(710px, calc(100% - 20px));
  max-height: 88vh;
  max-height: min(88dvh,calc(var(--bench-height,100dvh) - 16px));
  overflow: auto;
  background: #fffefb;
  color: #30283d;
  padding: 12px;
  border: 1px solid #d8cbe2;
  border-radius: 13px;
}
.limewater-lab #deskJournal::backdrop { background: #2d243c91; }
.journal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: -12px; padding-block: 4px; background: #fffefb; z-index: 2; }
.lab-full, .lab-full body { overflow: hidden; overscroll-behavior: none; }
.lab-full .limewater-lab .app > :not(.lime-desk) { display: none; }
.lab-full .lime-desk {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  height: 100vh;
  height: var(--bench-height,100dvh);
  padding: max(6px,env(safe-area-inset-top)) max(6px,env(safe-area-inset-right))
           max(6px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left));
  background: #faf9f5;
}
.lab-full .lime-bar #deskBook { display: inline-flex; min-height: 44px; }
.lab-full .lime-desk .workspace {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  grid-template-rows: min(54%,calc(75vw + 58px)) minmax(0,1fr);
  min-height: 0;
  align-items: stretch;
  gap: 7px;
}
.lab-full .lime-desk .viewer { display: flex; flex-direction: column; min-height: 0; align-items: center; }
.lab-full .lime-desk .viewport { flex: 0 0 auto; width: 100%; max-width: 100%; margin-block: auto; }
.lab-full .lime-desk .selection { width: 100%; }
.lab-full .lime-desk .manual { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.lab-full .lime-desk .manual > * { flex-shrink: 0; }
.lab-full .lime-desk button, .lab-full #deskJournal button { min-height: 44px; }
@media (orientation: landscape) and (min-width: 480px) {
  .lab-full .lime-desk .workspace { grid-template-columns: minmax(0,1fr) clamp(220px,34vw,370px); grid-template-rows: minmax(0,1fr); }
}

.experiment-list .copper-iron-card { --tape:#a1c9c7; }
.experiment-list [href="/virtual-lab/limewater/"] { --tape:#bdd0b3; }
@media(min-width:1000px) {
  .experiment-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .experiment-copy :is(h2,h3) { font-size:clamp(21px,1.9vw,26px); }
}
@media(min-width:681px) and (max-width:999px) {
  .experiment-list > :last-child:nth-child(odd) { grid-column:1/-1;grid-template-columns:1fr 1fr;grid-template-rows:auto;align-items:center; }
}

.lab-sections { display:flex; flex-wrap:wrap; gap:6px; width:fit-content; padding:5px; margin:0 0 22px; background:#f2edf4; border:1px solid #ddd1e2; border-radius:14px; }
.lab-sections a { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:7px clamp(20px,4vw,36px); border-radius:9px; color:#594a62; text-decoration:none; font-weight:800; }
.lab-sections a[aria-current="true"] { background:#634277; color:#fff; box-shadow:0 2px 4px #3e294421; }
.lab-sections a[data-section="organic"][aria-current="true"] { background:#40665c; }
.lab-sections a:focus-visible { outline:3px solid #725688; outline-offset:2px; }
.lab-section { margin-bottom:24px; scroll-margin-top:16px; }
.lab-section[hidden] { display:none; }
.lab-section > h2 { margin:0 0 15px; color:#40364a; font:800 clamp(21px,2.5vw,30px)/1.2 Nunito,sans-serif; }
.organic-feature { --tape:#a3c3b8; grid-template-columns:minmax(0,1.12fr) minmax(0,1fr); grid-template-rows:auto; align-items:center; max-width:900px; border-color:#c2d3ca; }
.organic-feature .experiment-copy { padding:clamp(12px,3vw,36px); }
.organic-feature .experiment-photo img { aspect-ratio:864/508; object-fit:cover; }
.organic-feature .experiment-action { background:#40665c; }
@media (hover:hover) { .organic-feature:hover .experiment-action { background:#304e46; } }
@media (max-width:640px) { .organic-feature { grid-template-columns:1fr; } .lab-sections { margin-bottom:16px; } }
