.bootstrap-lab {
  --bootstrap-ink: #1d2633;
  --bootstrap-muted: #687386;
  --bootstrap-line: #d9dee7;
  --bootstrap-panel: #fffdfa;
  --bootstrap-orange: #ff7a1a;
  --bootstrap-orange-dark: #df5a00;
  --bootstrap-orange-soft: #ffc38f;
  --bootstrap-yellow: #f7c948;
  --bootstrap-yellow-soft: #ffe99a;
  box-sizing: border-box;
  container-type: inline-size;
  width: 100%;
  margin: 1.25rem 0 2rem;
  overflow: hidden;
  color: var(--bootstrap-ink);
  background: var(--bootstrap-panel);
  border: 1px solid #e6e0d8;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(69, 52, 32, 0.09);
}

.bootstrap-lab *,
.bootstrap-lab *::before,
.bootstrap-lab *::after {
  box-sizing: border-box;
}

.bootstrap-lab__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid #eee8df;
  background: linear-gradient(135deg, #fffaf3 0%, #fff 70%);
}

.bootstrap-lab__eyebrow {
  margin: 0 0 0.2rem !important;
  color: var(--bootstrap-orange-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.bootstrap-lab__header h3 {
  margin: 0 !important;
  color: var(--bootstrap-ink);
  font-size: clamp(1.08rem, 2.1vw, 1.38rem);
  line-height: 1.25;
}

.bootstrap-lab__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.bootstrap-lab__controls label {
  display: grid;
  gap: 0.22rem;
  color: var(--bootstrap-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.bootstrap-lab__controls select {
  min-width: 6.5rem;
  height: 2.25rem;
  padding: 0 2rem 0 0.7rem;
  color: var(--bootstrap-ink);
  font: inherit;
  font-size: 0.78rem;
  background: #fff;
  border: 1px solid #d9d3cb;
  border-radius: 8px;
  cursor: pointer;
}

.bootstrap-lab__controls label:first-child select {
  min-width: 9.5rem;
}

.bootstrap-lab__stage {
  position: relative;
  width: 100%;
  background: #fff;
}

.bootstrap-lab__stage svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 420px;
  max-height: 690px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bootstrap-lab__empty {
  position: absolute;
  top: 48%;
  left: 54%;
  transform: translate(-50%, -50%);
  padding: 0.4rem 0.75rem;
  color: #9a7861;
  font-size: 0.76rem;
  background: rgba(255, 253, 250, 0.88);
  border: 1px solid #f0dfd0;
  border-radius: 999px;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.bootstrap-lab.is-started .bootstrap-lab__empty {
  opacity: 0;
}

.bootstrap-lab__footer {
  display: grid;
  grid-template-columns: auto auto auto minmax(8rem, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.35rem 1.1rem;
  border-top: 1px solid #eee8df;
  background: #fffaf4;
}

.bootstrap-lab button {
  min-height: 2.35rem;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 9px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.bootstrap-lab button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.bootstrap-lab button:focus-visible,
.bootstrap-lab select:focus-visible {
  outline: 3px solid rgba(255, 122, 26, 0.25);
  outline-offset: 2px;
}

.bootstrap-lab button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.bootstrap-lab__run {
  color: #fff;
  background: var(--bootstrap-orange);
  border: 1px solid var(--bootstrap-orange);
  box-shadow: 0 8px 18px rgba(255, 122, 26, 0.22);
}

.bootstrap-lab__run-icon {
  display: inline-block;
  margin-right: 0.3rem;
  font-size: 0.7rem;
}

.bootstrap-lab[data-active-action="sample"] .bootstrap-lab__run-icon,
.bootstrap-lab[data-active-action="resample"] .bootstrap-lab__resample-icon {
  animation: bootstrap-pulse 900ms ease-in-out infinite;
}

.bootstrap-lab__resample-icon {
  display: inline-block;
  margin-right: 0.3rem;
}

.bootstrap-lab__secondary {
  color: var(--bootstrap-orange-dark);
  background: #fff;
  border: 1px solid #edc9ae;
}

.bootstrap-lab__status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  color: var(--bootstrap-muted);
  font-size: 0.74rem;
}

.bootstrap-lab__status-dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  background: #b9c0cb;
  border-radius: 50%;
}

.bootstrap-lab.is-running .bootstrap-lab__status-dot {
  background: var(--bootstrap-orange);
  box-shadow: 0 0 0 5px rgba(255, 122, 26, 0.12);
}

.bootstrap-lab__summary {
  display: flex;
  gap: 1rem;
  margin: 0;
}

.bootstrap-lab__summary div {
  display: grid;
  gap: 0.05rem;
}

.bootstrap-lab__summary dt {
  color: var(--bootstrap-muted);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.bootstrap-lab__summary dd {
  margin: 0;
  color: var(--bootstrap-ink);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.bootstrap-axis {
  stroke: #1f2329;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.bootstrap-guide {
  stroke: #c9cdd4;
  stroke-width: 1;
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.bootstrap-mean-line {
  stroke: #1f2329;
  stroke-width: 1.7;
  stroke-dasharray: 7 7;
  vector-effect: non-scaling-stroke;
}

.bootstrap-density-fill {
  fill: url(#bootstrap-density-gradient);
  opacity: 0.78;
}

.bootstrap-density-line {
  fill: none;
  stroke: var(--bootstrap-orange);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.bootstrap-row-label {
  fill: var(--bootstrap-ink);
  font-size: 17px;
  font-weight: 750;
}

.bootstrap-row-note {
  fill: var(--bootstrap-muted);
  font-size: 12px;
  font-weight: 550;
}

.bootstrap-mu-label {
  fill: var(--bootstrap-ink);
  font-size: 25px;
  font-family: Georgia, serif;
}

.bootstrap-sample-point {
  fill: var(--bootstrap-orange);
  stroke: #fff;
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  vector-effect: non-scaling-stroke;
}

.bootstrap-sample-point.is-picked {
  animation: bootstrap-source-pick 620ms ease-out;
}

.bootstrap-source-ring {
  fill: none;
  stroke: var(--bootstrap-orange);
  stroke-width: 3;
  opacity: 0.85;
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
  animation: bootstrap-source-ring 620ms ease-out forwards;
  vector-effect: non-scaling-stroke;
}

.bootstrap-resample-trail {
  fill: none;
  stroke: var(--bootstrap-yellow);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 220ms ease;
  vector-effect: non-scaling-stroke;
}

.bootstrap-resample-mover {
  fill: var(--bootstrap-yellow);
  stroke: var(--bootstrap-orange-dark);
  stroke-width: 3;
  filter: drop-shadow(0 3px 3px rgba(186, 101, 18, 0.24));
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.bootstrap-resample-point {
  fill: var(--bootstrap-yellow);
  stroke: #fff9da;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bootstrap-sample-stat-line {
  stroke: var(--bootstrap-orange-dark);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  opacity: 0.72;
  vector-effect: non-scaling-stroke;
}

.bootstrap-sample-stat-marker {
  fill: var(--bootstrap-orange);
  stroke: #fff;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bootstrap-sample-stat-label {
  fill: var(--bootstrap-orange-dark);
  font-size: 12px;
  font-weight: 800;
}

.bootstrap-stat-line {
  stroke: var(--bootstrap-orange-dark);
  stroke-width: 2;
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.bootstrap-stat-projection {
  stroke: var(--bootstrap-orange);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
  opacity: 0.42;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.bootstrap-latest-stat {
  fill: #fff7df;
  stroke: var(--bootstrap-orange);
  stroke-width: 1.5;
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.bootstrap-stat-marker {
  fill: #fff7df;
  stroke: var(--bootstrap-orange);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bootstrap-stat-label {
  fill: var(--bootstrap-orange-dark);
  font-size: 12px;
  font-weight: 800;
}

.bootstrap-count-badge {
  fill: var(--bootstrap-orange-dark);
  stroke: #fff;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.bootstrap-count-text {
  fill: #fff;
  font-size: 9px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
}

.bootstrap-hist-bar {
  fill: var(--bootstrap-yellow-soft);
  stroke: #fff7d7;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.bootstrap-hist-center {
  stroke: var(--bootstrap-orange);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bootstrap-hist-label {
  fill: var(--bootstrap-muted);
  font-size: 11px;
}

.bootstrap-confidence {
  pointer-events: none;
  opacity: 1;
  transition: opacity 180ms ease;
}

.bootstrap-confidence.is-provisional {
  opacity: 0.42;
}

.bootstrap-ci-range,
.bootstrap-ci-cap {
  stroke: var(--bootstrap-orange-dark);
  stroke-width: 2.5;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.bootstrap-confidence.is-provisional .bootstrap-ci-range {
  stroke-dasharray: 4 4;
}

.bootstrap-ci-estimate {
  fill: var(--bootstrap-orange);
  stroke: #fff;
  stroke-width: 2;
  filter: drop-shadow(0 2px 2px rgba(186, 101, 18, 0.2));
  vector-effect: non-scaling-stroke;
}

.bootstrap-ci-label {
  fill: var(--bootstrap-orange-dark);
  font-size: 11px;
  font-weight: 800;
}

.bootstrap-stage-caption {
  fill: var(--bootstrap-muted);
  font-size: 11px;
  font-weight: 650;
}

@keyframes bootstrap-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes bootstrap-source-pick {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.65); filter: drop-shadow(0 0 7px rgba(255, 122, 26, 0.7)); }
}

@keyframes bootstrap-source-ring {
  0% { opacity: 0.9; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(2.4); }
}

@media (max-width: 820px) {
  .bootstrap-lab__header {
    align-items: stretch;
    flex-direction: column;
  }

  .bootstrap-lab__controls {
    justify-content: flex-start;
  }

  .bootstrap-lab__footer {
    grid-template-columns: repeat(3, 1fr);
  }

  .bootstrap-lab__status {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .bootstrap-lab__summary {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 0.45rem;
    border-top: 1px solid #eee0d2;
  }
}

@container (max-width: 760px) {
  .bootstrap-lab__header {
    align-items: stretch;
    flex-direction: column;
  }

  .bootstrap-lab__controls {
    display: grid;
    grid-template-columns: 1.35fr 0.8fr;
    justify-content: stretch;
    width: 100%;
  }

  .bootstrap-lab__controls select,
  .bootstrap-lab__controls label:first-child select {
    width: 100%;
    min-width: 0;
  }

  .bootstrap-lab__footer {
    grid-template-columns: auto auto auto minmax(8rem, 1fr);
  }

  .bootstrap-lab__status {
    grid-column: auto;
    grid-row: auto;
  }

  .bootstrap-lab__summary {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 0.55rem;
    border-top: 1px solid #eee0d2;
  }
}

@container (max-width: 500px) {
  .bootstrap-lab__footer {
    grid-template-columns: 1fr 1fr;
  }

  .bootstrap-lab__status {
    grid-column: 1 / -1;
  }

  .bootstrap-lab [data-action="add"] {
    grid-column: 1 / -1;
  }

  .bootstrap-lab__stage svg {
    min-height: 0;
  }

  .bootstrap-row-label {
    font-size: 26px;
  }

  .bootstrap-row-note,
  .bootstrap-hist-label,
  .bootstrap-stage-caption {
    font-size: 19px;
  }

  .bootstrap-stat-label,
  .bootstrap-sample-stat-label {
    font-size: 17px;
  }

  .bootstrap-ci-label {
    font-size: 19px;
  }

  .bootstrap-hist-label {
    display: none;
  }
}

@media (max-width: 520px) {
  .bootstrap-lab {
    border-radius: 13px;
  }

  .bootstrap-lab__header,
  .bootstrap-lab__footer {
    padding-right: 0.85rem;
    padding-left: 0.85rem;
  }

  .bootstrap-lab__controls {
    display: grid;
    grid-template-columns: 1.35fr 0.8fr;
    width: 100%;
  }

  .bootstrap-lab__controls select,
  .bootstrap-lab__controls label:first-child select {
    width: 100%;
    min-width: 0;
    padding-right: 1.2rem;
  }

}

.theme-dark .bootstrap-lab {
  --bootstrap-ink: #f2f1ee;
  --bootstrap-muted: #adb4c0;
  --bootstrap-panel: #202124;
  border-color: #393a3d;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
}

.theme-dark .bootstrap-lab__header,
.theme-dark .bootstrap-lab__footer {
  background: #242529;
  border-color: #3b3c40;
}

.theme-dark .bootstrap-lab__stage {
  background: #1f2023;
}

.theme-dark .bootstrap-lab__controls select,
.theme-dark .bootstrap-lab__secondary {
  color: #f2f1ee;
  background: #2a2b2f;
  border-color: #4a4c52;
}

.theme-dark .bootstrap-lab__empty {
  color: #d6ae91;
  background: rgba(31, 32, 35, 0.9);
  border-color: #5b4434;
}

.theme-dark .bootstrap-lab__summary {
  border-color: #3b3c40;
}

.theme-dark .bootstrap-axis,
.theme-dark .bootstrap-mean-line {
  stroke: #f0efec;
}

.theme-dark .bootstrap-guide {
  stroke: #4d5057;
}

@media (prefers-reduced-motion: reduce) {
  .bootstrap-lab *,
  .bootstrap-lab *::before,
  .bootstrap-lab *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
