/* Namespaced, self-contained lab styles. Core operation does not depend on
   any JS Bootstrap component; the shared site CSS is purely cosmetic. */
.lab {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  line-height: 1.45;
}
.lab h1 {
  font-size: 1.6rem;
  margin: 0.2rem 0;
}
.lab h2 {
  font-size: 1.15rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.25rem;
}
.lab .sub {
  color: #444;
  max-width: 70ch;
}
.lab .controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}
.lab fieldset {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}
.lab legend {
  font-weight: 600;
  padding: 0 0.4rem;
}
.lab label {
  display: inline-flex;
  flex-direction: column;
  font-size: 0.85rem;
  margin: 0.25rem 0.6rem 0.25rem 0;
  gap: 0.15rem;
}
.lab select,
.lab input[type="text"],
.lab input[type="number"] {
  padding: 0.2rem 0.3rem;
  font-size: 0.9rem;
}
.lab button {
  margin: 0.2rem 0.25rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid #0072b2;
  background: #0072b2;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.88rem;
}
.lab button:hover {
  background: #005b8f;
}
.lab button:focus-visible {
  outline: 3px solid #ffb000;
  outline-offset: 2px;
}
.lab .round {
  font-size: 0.95rem;
  margin-right: 0.5rem;
}
.lab .panel {
  margin: 1.5rem 0;
}
.lab .two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.lab figure {
  margin: 0;
  text-align: center;
}
.lab figcaption {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.lab svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  background: #fafafa;
  border: 1px solid #eee;
}
.lab canvas {
  max-width: 100%;
  height: auto;
  border: 1px solid #eee;
  background: #fff;
}
.lab .caption,
.lab .note {
  font-size: 0.82rem;
  color: #555;
  background: #f6f8fa;
  border-left: 3px solid #0072b2;
  padding: 0.4rem 0.6rem;
  max-width: 75ch;
}
.lab .note strong {
  color: #b00;
}
.lab .lab-table {
  border-collapse: collapse;
  font-size: 0.85rem;
}
.lab .lab-table th,
.lab .lab-table td {
  border: 1px solid #ddd;
  padding: 0.25rem 0.6rem;
  text-align: left;
}
.lab .lab-table caption {
  font-weight: 600;
  text-align: left;
  margin-bottom: 0.3rem;
}
@media (max-width: 700px) {
  .lab .controls,
  .lab .two-col {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lab * {
    animation: none !important;
    transition: none !important;
  }
}
