/* Same-distribution W1 baseline figure (_includes/w1-baseline-viz.html) */

.w1b {
  display: block;
  margin: 2em 0;
  padding: 1rem;
  border: 1px solid #e3e6e8;
  border-radius: 10px;
  background: #fff;
  color: #494e52;
  font-family: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  container-type: inline-size;
}

.w1b [hidden] {
  display: none !important;
}

.w1b__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.w1b__chart-title {
  margin: 0 0 0.3rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2d3236;
}

.w1b__canvas {
  display: block;
  width: 100%;
  border-radius: 6px;
  background: #fbfcfc;
}

.w1b__canvas--main {
  aspect-ratio: 16 / 11;
}

.w1b__canvas--mini {
  aspect-ratio: 16 / 10;
}

.w1b__side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.w1b__legend {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #6b7378;
}

.w1b__legend-item {
  display: inline-block;
  margin-right: 0.9em;
}

.w1b__key {
  display: inline-block;
  width: 18px;
  height: 0;
  margin-right: 0.35em;
  vertical-align: middle;
}

.w1b__key--base {
  border-top: 2.5px solid #0f766e;
}

.w1b__key--shift {
  border-top: 2.5px solid #b45309;
}

.w1b__key--pop {
  border-top: 2px dashed #1f2a30;
}

.w1b__key--exp {
  border-top: 1.5px dashed rgba(31, 42, 48, 0.65);
}

.w1b__key--clip {
  width: 0;
  height: 0;
  margin: 0 0.5em 0 0.25em;
  border-right: 4px solid transparent;
  border-bottom: 7px solid rgba(15, 118, 110, 0.8);
  border-left: 4px solid transparent;
}

.w1b__mini-legend {
  grid-column: 1 / -1;
  margin-top: -0.45rem;
}

.w1b__key--half {
  width: 8px;
  height: 8px;
  border: 1.5px solid #1f2a30;
  background: #fff;
}

.w1b__key--other {
  border-top: 1px solid rgba(15, 118, 110, 0.45);
}

.w1b__key--bands {
  width: 18px;
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(to top, rgba(15, 118, 110, 0.18) 0 33%, rgba(180, 83, 9, 0.17) 33% 66%, rgba(185, 28, 28, 0.15) 66% 100%);
}

.w1b__controls {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.w1b__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.w1b__row:first-child {
  flex-wrap: nowrap;
}

.w1b__control-label {
  flex: none;
  font-size: 0.8125rem;
  color: #5d656a;
  white-space: nowrap;
}

.w1b__play,
.w1b__dim,
.w1b__half {
  flex: none;
  margin: 0;
  border: 1px solid #c9d0d4;
  border-radius: 6px;
  background: #fff;
  color: #2d3236;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.w1b__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
}

.w1b__play svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.w1b__play:hover,
.w1b__dim:hover,
.w1b__half:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.w1b__play:focus-visible,
.w1b__dim:focus-visible,
.w1b__half:focus-visible,
.w1b .w1b__range:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 1px;
}

.w1b .w1b__range {
  flex: 1;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
  accent-color: #0f766e;
}

.w1b__n-out {
  flex: none;
  min-width: 2.2em;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: #2d3236;
  text-align: right;
}

.w1b__dims {
  display: inline-flex;
  flex: none;
}

.w1b__dim {
  height: 2.25rem;
  min-width: 2.6rem;
  padding: 0 0.55rem;
  border-radius: 0;
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.w1b__dim + .w1b__dim {
  margin-left: -1px;
}

.w1b__dim:first-child {
  border-radius: 6px 0 0 6px;
}

.w1b__dim:last-child {
  border-radius: 0 6px 6px 0;
}

.w1b__dim[aria-pressed="true"] {
  position: relative;
  border-color: #0f766e;
  background: #eff8f6;
  color: #0f766e;
  font-weight: 600;
}

.w1b__half {
  height: 2.25rem;
  margin-left: auto;
  padding: 0 0.75rem;
  white-space: nowrap;
}

.w1b__half[aria-pressed="true"] {
  border-color: #0f766e;
  background: #eff8f6;
  color: #0f766e;
}

.w1b__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.6rem;
  min-height: 1.2rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #5d656a;
  visibility: hidden;
}

.w1b__status.is-busy {
  visibility: visible;
}

.w1b__status-count {
  font-family: "IBM Plex Mono", monospace;
  font-variant-numeric: tabular-nums;
}

.w1b__bar {
  flex: 1 1 6rem;
  max-width: 12rem;
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #e6ebec;
}

.w1b__bar-fill {
  display: block;
  width: 0;
  height: 100%;
  background: #0f766e;
  transition: width 160ms linear;
}

.w1b__readout {
  margin-top: 0.4rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  background: #f6f8f8;
}

.w1b__readout-head {
  margin-bottom: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2d3236;
}

.w1b__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.3rem 1.4rem;
}

.w1b__stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  min-width: 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #e6ebec;
}

.w1b__stat--half {
  grid-column: 1 / -1;
}

.w1b__stat-label {
  min-width: 0;
  font-size: 0.8125rem;
  color: #5d656a;
}

.w1b__stat-value {
  flex: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: #1f2a30;
  text-align: right;
}

.w1b__stat-note {
  display: block;
  font-size: 0.6875rem;
  color: #6b7378;
}

.w1b__verdict {
  min-height: 3em;
  margin-top: 0.6rem;
  font-size: 0.8125rem;
  color: #3c4347;
}

.w1b__verdict strong {
  color: #1f2a30;
}

.w1b figcaption,
.w1b > figcaption {
  margin: 0.8rem 0 0;
  font-family: inherit;
  font-size: 0.8125rem;
  color: #6b7378;
}

/* Panels side by side only when the figure itself is wide enough (the post column is 550-770px). */
@container (min-width: 700px) {
  .w1b__body {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  }

  .w1b__canvas--main {
    aspect-ratio: 4 / 3.3;
  }

  .w1b__side {
    grid-template-columns: minmax(0, 1fr);
  }
}

@container (max-width: 460px) {
  .w1b__canvas--main {
    aspect-ratio: 1 / 1;
  }
}

@media (max-width: 640px) {
  .w1b__half {
    margin-left: 0;
  }
}

@media (max-width: 480px) {
  .w1b__side {
    grid-template-columns: minmax(0, 1fr);
  }

  .w1b__canvas--mini {
    aspect-ratio: 16 / 8;
  }

  .w1b__half {
    width: 100%;
  }
}
