/* Module 6 stations (CHO): the evidence sorter and the four-lever trade. Same shape
   as the other lab boxes, nothing fixed-width, every grid track minmax(min(100%, N), 1fr)
   so the whole thing survives a 360 px phone. */
.ql-box {
  background: #0c202b;
  border: 1px solid var(--ch-rule, #27424a);
  border-radius: 8px;
  padding: clamp(12px, 2vw, 20px);
  min-width: 0;
}
.ql-box h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.ql-box > p {
  margin: 0 0 1rem;
  max-width: 76ch;
}
.ql-box canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  background: #091a23;
  border-radius: 6px;
}
.ql-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.8rem 1.3rem;
  align-items: end;
  margin: 0 0 1rem;
}
.ql-slider {
  display: block;
  min-width: 0;
}
.ql-slider > span {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.88rem;
  flex-wrap: wrap;
}
.ql-slider b {
  font-weight: 600;
  color: #e3f1f0;
}
.ql-slider output {
  font: 500 0.86rem var(--mono, ui-monospace, monospace);
  color: var(--ch-amber, #edc077);
}
.ql-slider input[type='range'] {
  width: 100%;
  margin: 0.3rem 0 0;
}
.ql-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.9rem;
  color: #d7e7e6;
}
.ql-toggle span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ql-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}
.ql-axis {
  margin: 0.9rem 0 0.3rem;
  font: 600 0.8rem var(--mono, ui-monospace, monospace);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9fe3d2;
}
.ql-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin: 0.55rem 0 0;
  font-size: 0.87rem;
  color: #c2d6da;
}
.ql-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.ql-legend i {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
  flex: 0 0 auto;
}
.ql-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 0.8rem;
  margin: 1rem 0 0;
}
.ql-tile {
  background: #0f2630;
  border: 1px solid var(--ch-rule, #27424a);
  border-radius: 7px;
  padding: 0.7rem 0.9rem;
  min-width: 0;
}
.ql-tile b {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9db7c2;
}
.ql-tile strong {
  display: block;
  font: 600 1.35rem var(--mono, ui-monospace, monospace);
  color: var(--ch-mint, #7fdcc9);
  overflow-wrap: anywhere;
}
.ql-tile span {
  font-size: 0.76rem;
  color: #8fa8b0;
}

/* Quality attributes against their windows */
.ql-specs {
  display: grid;
  gap: 5px;
  margin: 0.3rem 0 0;
}
.ql-spec {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) auto;
  grid-template-areas: 'label value' 'target state';
  gap: 0.15rem 0.8rem;
  align-items: baseline;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  background: #0f2630;
  border-left: 3px solid var(--ch-mint, #7fdcc9);
  min-width: 0;
}
.ql-spec[data-state='out'] {
  border-left-color: var(--ch-warn, #e59b6b);
  background: #231810;
}
.ql-spec b {
  grid-area: label;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e3f1f0;
}
.ql-spec strong {
  grid-area: value;
  font: 600 0.98rem var(--mono, ui-monospace, monospace);
  color: var(--ch-mint, #7fdcc9);
  white-space: nowrap;
}
.ql-spec[data-state='out'] strong {
  color: var(--ch-warn, #e59b6b);
}
.ql-spec span {
  grid-area: target;
  font-size: 0.78rem;
  color: #8fa8b0;
}
.ql-spec small {
  grid-area: state;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8fa8b0;
  text-align: right;
}
.ql-spec[data-state='out'] small {
  color: var(--ch-warn, #e59b6b);
}

/* Evidence sorter */
.ql-claims {
  display: grid;
  gap: 0.7rem;
}
.ql-claim {
  padding: 0.7rem 0.9rem;
  border-radius: 7px;
  background: #0f2630;
  border-left: 3px solid #3a5663;
  min-width: 0;
}
.ql-claim[data-state='right'] {
  border-left-color: var(--ch-mint, #7fdcc9);
}
.ql-claim[data-state='wrong'] {
  border-left-color: var(--ch-warn, #e59b6b);
}
.ql-claim > p:first-child {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: #e3f1f0;
  max-width: 72ch;
}
.ql-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.ql-choices button {
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--ch-rule, #27424a);
  background: #091a23;
  color: #c2d6da;
  cursor: pointer;
}
.ql-choices button:hover,
.ql-choices button:focus-visible {
  border-color: var(--ch-mint, #7fdcc9);
  color: #e3f1f0;
}
.ql-choices button[aria-pressed='true'] {
  background: #15323c;
  color: #e3f1f0;
  border-color: var(--ch-amber, #edc077);
}
.ql-choices button[data-correct='true'][aria-pressed='true'] {
  border-color: var(--ch-mint, #7fdcc9);
}
.ql-claim-note:not(:empty) {
  margin: 0.6rem 0 0;
  font-size: 0.87rem;
  color: #c9dde0;
  max-width: 76ch;
}
.ql-readout {
  margin: 0.9rem 0 0;
  padding: 0.65rem 0.85rem;
  border-left: 3px solid var(--ch-amber, #edc077);
  background: #1d170e;
  color: #f0e4d2;
  font-size: 0.93rem;
  border-radius: 0 5px 5px 0;
  max-width: 80ch;
}
.ql-foot {
  margin: 0.7rem 0 0;
  font-size: 0.84rem;
  color: #9db4bc;
  max-width: 78ch;
}
@media print {
  .ql-box {
    background: white;
    border: 1px solid #999;
  }
  .ql-readout {
    background: white;
    color: black;
  }
}
