/* /demos/sba-lab — page chrome.
 *
 * Scoped to .sba-* so nothing here can reach another page. The two scroll
 * regions carry tabindex in the markup and are given a visible focus ring here,
 * because a scrollable region that only a mouse can reach is one a keyboard user
 * cannot read at all.
 */

.sba-scorecard {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem;
  border: 1px solid var(--border-color, #d8dde3);
  border-radius: 8px;
  background: var(--surface-2, rgba(127, 127, 127, 0.06));
}

.sba-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.sba-score {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sba-score__value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sba-score--lead .sba-score__value {
  font-size: 2.6rem;
}

.sba-score__label {
  font-size: 0.9rem;
  opacity: 0.8;
}

.sba-score__note {
  margin: 0;
  font-size: 0.95rem;
}

.sba-explorer {
  margin: 1rem 0 2rem;
  padding: 1.25rem;
  border: 1px solid var(--border-color, #d8dde3);
  border-radius: 8px;
}

.sba-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.6rem 1rem;
  align-items: center;
  max-width: 640px;
}

.sba-picker select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-color, #d8dde3);
  border-radius: 6px;
  background: inherit;
  color: inherit;
  font: inherit;
}

.sba-readout {
  margin-top: 1.25rem;
}

.sba-readout__empty {
  margin: 0;
  opacity: 0.75;
}

.sba-readout__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.sba-readout__grid div {
  display: flex;
  flex-direction: column;
}

.sba-readout__grid dt {
  font-size: 0.85rem;
  opacity: 0.8;
}

.sba-readout__grid dd {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sba-verdictline {
  margin: 0.5rem 0;
  padding: 0.6rem 0.8rem;
  border-left: 4px solid var(--border-color, #d8dde3);
  border-radius: 0 6px 6px 0;
  background: var(--surface-2, rgba(127, 127, 127, 0.06));
}

.sba-verdict {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  white-space: nowrap;
  border: 1px solid currentcolor;
}

/* The three result states are distinguished by BORDER WEIGHT AND TEXT as well as
 * by hue: the words "exact", "one tier out" and "N tiers out" are in the cell,
 * so nothing here is the only carrier of the meaning. */
.sba-verdict--exact { border-width: 2px; font-weight: 700; }
.sba-verdict--near { opacity: 0.9; }
.sba-verdict--far { opacity: 0.75; font-style: italic; }

.sba-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color, #d8dde3);
  border-radius: 8px;
}

.sba-scroll:focus-visible {
  outline: 3px solid var(--link-color, #2563eb);
  outline-offset: 2px;
}

.sba-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.sba-table--narrow {
  max-width: 640px;
}

.sba-table th,
.sba-table td {
  padding: 0.45rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #d8dde3);
  vertical-align: top;
}

.sba-table td {
  font-variant-numeric: tabular-nums;
}

.sba-table thead th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.sba-code {
  opacity: 0.6;
  font-size: 0.8rem;
  white-space: nowrap;
}

.sba-ticker {
  margin: 1rem 0 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-color, #d8dde3);
  border-radius: 8px;
}

.sba-ticker__bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2, rgba(127, 127, 127, 0.15));
}

.sba-ticker__fill {
  display: block;
  height: 100%;
  width: 0;
  background: currentcolor;
  opacity: 0.55;
}

.sba-ticker__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0;
}

.sba-ticker__stats div {
  display: flex;
  flex-direction: column;
}

.sba-ticker__stats dt {
  font-size: 0.82rem;
  opacity: 0.8;
}

.sba-ticker__stats dd {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The method box carries the page's central claim in the only form the copy law
 * permits: a numbered list of what was done, rather than an adjective asserting
 * what kind of experiment it was. */
.sba-method {
  margin: 1.25rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-color, #d8dde3);
  border-left-width: 4px;
  border-radius: 8px;
}

.sba-method h3 {
  margin-top: 0;
  font-size: 1rem;
}

.sba-method ol {
  margin: 0.4rem 0 0;
  padding-left: 1.4rem;
}

.sba-method li {
  margin-bottom: 0.45rem;
}

.sba-honesty {
  margin: 1.25rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-color, #d8dde3);
  border-radius: 8px;
  background: var(--surface-2, rgba(127, 127, 127, 0.06));
}

.sba-honesty h3 {
  margin-top: 0.75rem;
  font-size: 1rem;
}

.sba-honesty h3:first-child {
  margin-top: 0;
}

.sba-honesty ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.sba-honesty li {
  margin-bottom: 0.35rem;
}

.sba-provenance dt {
  font-weight: 600;
  margin-top: 0.6rem;
}

.sba-provenance dd {
  margin: 0.15rem 0 0;
}

.sba-provenance code {
  word-break: break-all;
}

.sba-note {
  font-size: 0.94rem;
  opacity: 0.9;
}

.sba-prompt {
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border-color, #d8dde3);
  border-radius: 8px;
  background: var(--surface-2, rgba(127, 127, 127, 0.06));
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

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

  .sba-score--lead .sba-score__value {
    font-size: 2.1rem;
  }
}

/* The ticker animates; a reader who has asked for less motion gets the final
 * state immediately instead. */
@media (prefers-reduced-motion: reduce) {
  .sba-ticker__fill {
    transition: none;
  }
}
