/* Quantum-Like Lab by Ethan Dickey. */
/* State inspection follows normal document scrolling. Up to thirty-two rows and controls
   must not disappear inside the fixed-height network viewport. */
#alternative-view:has(.ql-state-view) {
  height: auto;
  min-height: 390px;
  max-height: none;
}
.ql-state-view {
  padding: 20px 22px;
  color: var(--text, #edf5f8);
  line-height: 1.55;
  font-size: 0.87rem;
  overflow-wrap: anywhere;
}
.ql-state-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ql-state-heading h2 {
  margin: 0;
  font-size: 1.12rem;
}
.ql-state-view p {
  margin: 10px 0;
}
.ql-state-intro {
  max-width: 68ch;
}
.ql-state-actions {
  margin: 12px 0 18px;
}
.ql-state-actions button {
  min-height: 40px;
}
.ql-state-retention {
  border: 1px solid #345363;
  border-radius: 9px;
  background: #10232f;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.ql-state-retention-labels {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.84rem;
}
.ql-state-retention-labels strong {
  font-weight: 650;
}
.ql-state-retention-labels > :first-child {
  color: #81eed5;
}
.ql-state-retention-labels > :last-child {
  color: #ffb0bb;
}
.ql-state-retention-track {
  height: 12px;
  background: #ff8494;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 10px;
}
.ql-state-retention-track > span {
  display: block;
  height: 100%;
  background: #61e2c4;
}
.ql-state-retention p {
  margin-bottom: 0;
  font-size: 0.82rem;
  color: #d0e0e8;
}
.ql-state-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.8rem;
  margin-bottom: 9px;
  color: #d8e8ef;
}
.ql-state-key > span {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ql-state-key i {
  width: 22px;
  height: 9px;
  display: inline-block;
  border-radius: 2px;
}
.ql-current-key {
  background: #61e2c4;
}
.ql-target-key {
  border: 2px solid #ffc175;
}
.ql-state-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  align-items: center;
  border-bottom: 1px solid #203946;
}
.ql-state-pattern {
  white-space: nowrap;
  overflow-wrap: normal;
  min-width: calc(5ch + 0.4em);
  font:
    600 0.93rem ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
  letter-spacing: 0.08em;
}
.ql-state-bars {
  min-width: 0;
}
.ql-state-bar-line {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 10px;
  align-items: center;
}
.ql-state-track {
  display: block;
  height: 12px;
  background: #263d49;
  border-radius: 3px;
  overflow: hidden;
}
.ql-state-track > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #61e2c4;
}
.ql-state-weight {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-size: 0.82rem;
  color: #edf5f8;
}
.ql-state-target {
  margin-top: 2px;
}
.ql-state-target .ql-state-track {
  height: 7px;
  background: #1d303c;
}
.ql-state-target .ql-state-track > span {
  background: transparent;
  border: 1.5px solid #ffc175;
}
.ql-state-target .ql-state-weight {
  font-size: 0.73rem;
  color: #ffd8a5;
}
.ql-state-footnote {
  color: #c2d3dc;
  font-size: 0.8rem;
  max-width: 76ch;
}
.ql-state-view summary {
  cursor: pointer;
  font-size: 0.86rem;
  color: #e2eef3;
  padding: 9px 0;
}
.ql-state-view details {
  margin-top: 15px;
  border-top: 1px solid #345363;
}
.ql-state-view details p {
  max-width: 78ch;
}
.ql-state-view .ql-state-equation {
  overflow-x: auto;
  padding: 3px 0;
}
.ql-state-view .ql-state-table-scroll {
  overflow-x: auto;
  max-width: 100%;
  margin: 14px 0;
}
.ql-state-view table {
  min-width: 540px;
  font-size: 0.78rem;
}
.ql-state-view table th {
  text-transform: none;
  letter-spacing: normal;
}
.ql-state-view sub {
  vertical-align: sub;
  font-size: 0.75em;
}
.ql-state-view sup {
  vertical-align: super;
  font-size: 0.75em;
}
.ql-state-bloch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.ql-state-bloch-item {
  text-align: center;
  flex: 0 1 170px;
}
.ql-state-bloch-item canvas {
  width: 170px;
  height: 170px;
}
.ql-state-bloch-item canvas[hidden] {
  display: none;
}
.ql-state-bloch-error {
  color: #ffd8a5;
}
.ql-state-notice,
.ql-state-error {
  background: #352633;
  color: #ffe8ed;
  border: 1px solid #936074;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}
.ql-state-error {
  margin: 16px;
}
@media (max-width: 600px) {
  #alternative-view:has(.ql-state-view) {
    min-height: 280px;
  }
  .ql-state-view {
    padding: 16px 14px;
  }
  .ql-state-heading h2 {
    font-size: 1rem;
  }
  .ql-state-row {
    gap: 8px;
    grid-template-columns: max-content minmax(0, 1fr);
  }
  .ql-state-bar-line {
    gap: 8px;
    grid-template-columns: 1fr 46px;
  }
  .ql-state-actions button {
    flex: 1 1 auto;
  }
  .ql-state-error {
    margin: 10px;
  }
}
/* Relative phase is part of the basic state picture, not an advanced-only diagnostic. */
.ql-state-bar-line {
  grid-template-columns: minmax(0, 1fr) 54px 78px;
}
.ql-state-phase-story {
  background: #132e38;
  border: 1px solid #3c6470;
  border-radius: 9px;
  padding: 12px 15px;
  margin-bottom: 15px;
}
.ql-state-phase-story strong {
  color: #e1f5f2;
}
.ql-state-phase-story p {
  color: #d0e5e7;
  margin-bottom: 0;
}
.ql-state-phase-reference {
  color: #aebfc9;
  font-size: 0.76rem;
  max-width: 80ch;
}
.ql-phase-marker {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  color: #61e2c4;
  vertical-align: middle;
}
.ql-phase-marker svg {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  overflow: visible;
}
.ql-phase-marker circle {
  fill: #102731;
  stroke: currentColor;
  stroke-opacity: 0.4;
  stroke-width: 1;
}
.ql-phase-marker .ql-phase-shaft,
.ql-phase-marker .ql-phase-head {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ql-phase-sign {
  font-size: 0.78rem;
  min-width: 20px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ql-phase-target {
  color: #ffc175;
}
.ql-phase-target svg {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
  margin-left: 2.5px;
  margin-right: 2.5px;
}
.ql-phase-empty {
  color: #70838d;
}
.ql-phase-zero {
  stroke: currentColor;
  stroke-width: 1.5;
}
@media (max-width: 600px) {
  .ql-state-bar-line {
    grid-template-columns: minmax(0, 1fr) 46px 64px;
    gap: 7px;
  }
  .ql-phase-marker svg {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .ql-phase-target svg {
    width: 21px;
    height: 21px;
    flex-basis: 21px;
    margin-left: 1.5px;
    margin-right: 1.5px;
  }
  .ql-phase-sign {
    font-size: 0.7rem;
  }
}
