#signals-lab { min-width: 0; container-type: inline-size; }

.sig-lab {
  --sig-bg: #122c38;
  --sig-border: #38515b;
  --sig-wave: #afe1d6;
  --sig-warm: #f1a67d;
  padding: clamp(16px, 3.4%, 32px);
  border-radius: 10px;
  background: var(--sig-bg);
  color: #edf4ef;
  color-scheme: dark;
}

.sig-controls, .sig-plots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 4%, 44px);
}

.sig-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 8px;
}
.sig-control label, .sig-plot figcaption {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}
.sig-control > span {
  color: var(--sig-warm);
  font: 0.875rem/1.5 ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sig-control input {
  width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0;
  grid-column: 1 / -1;
  cursor: pointer;
  accent-color: var(--sig-warm);
}
.sig-lab :focus-visible { outline: 2px solid var(--sig-wave); outline-offset: 2px; }

.sig-plots {
  margin-top: 12px;
  padding-block: 22px 19px;
  border-top: 1px solid var(--sig-border);
  border-bottom: 1px solid var(--sig-border);
}
.sig-plot { margin: 0; min-width: 0; }
.sig-plot figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sig-plot figcaption span + span, .sig-axis {
  color: #b9cdcf;
  font: 0.8125rem/1.4 ui-monospace, monospace;
}
.sig-plot svg {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 10px;
  overflow: visible;
}
.sig-plot svg text { fill: #c5d6d6; font: 13px ui-monospace, monospace; }
.sig-axis { text-align: center; }
.sig-grid { stroke: var(--sig-border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sig-wave {
  fill: none;
  stroke: var(--sig-wave);
  stroke-width: 2.3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.sig-stem { stroke: var(--sig-warm); stroke-width: 4; stroke-linecap: butt; vector-effect: non-scaling-stroke; }
.sig-fixed { stroke: var(--sig-wave); }
.sig-reading { margin: 16px 0 8px; color: #edf4ef; font-size: 1rem; line-height: 1.55; }
.sig-details { font-size: 0.875rem; color: #c5d6d6; }
.sig-details summary { cursor: pointer; width: fit-content; padding-block: 6px; text-decoration: underline; text-underline-offset: 3px; }
.sig-details p { margin: 5px 0 0; max-width: 78ch; }

@container (max-width: 38rem) {
  .sig-plots { grid-template-columns: 1fr; gap: 22px; }
}
@container (max-width: 28rem) {
  .sig-controls { grid-template-columns: 1fr; gap: 6px; }
}
