/* /keyboard-polling-rate-test/ — page-specific rules only.
   Everything else comes from /assets/css/design-system.css. */

/* --------------------------------------------------------------- mode bar */
/* Segmented control built on real radio inputs so keyboard behaviour and
   screen-reader semantics are native. The inputs stay in the accessibility
   tree and keep a visible focus ring via :focus-visible on the label. */

.modebar {
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.7rem 0.85rem 0.85rem;
  margin: 0 0 var(--space);
  min-inline-size: 0;
}

.modebar__opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 0.5rem;
  margin-block-start: 0.5rem;
}

.modeopt {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "radio title" "radio desc";
  align-items: center;
  column-gap: 0.6rem;
  min-block-size: 44px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-ui);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  min-inline-size: 0;
}

.modeopt input[type="radio"] {
  grid-area: radio;
  inline-size: 18px;
  block-size: 18px;
  min-block-size: 0;
  margin: 0;
  accent-color: var(--accent);
  /* The design system resets appearance on text inputs only; radios keep the
     native control so the checked state is never colour-only. */
  -webkit-appearance: radio;
  appearance: auto;
  cursor: pointer;
}

.modeopt__t {
  grid-area: title;
  font-weight: 650;
  color: var(--text);
  line-height: 1.25;
}

.modeopt__d {
  grid-area: desc;
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.modeopt:hover { border-color: var(--accent); }

.modeopt:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.modeopt:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ stage */
/* The stage is a <button> here so activation, focus and naming are native.
   Reset the UA button chrome that would otherwise fight .stage. */

button.stage {
  inline-size: 100%;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.stage__big { min-block-size: 1em; }

/* ---------------------------------------------------------------- results */

.res-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-block: var(--space) 0.75rem;
  font-size: 1.0625rem;
}

.chartpair {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .chartpair { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------- disclose */

.disclose__body > * + * { margin-block-start: 0.75rem; }

.disclose__body h4 {
  font-size: 0.9375rem;
  margin-block-end: 0.4rem;
}

/* The intervals table is narrow enough that the 30rem floor from .tbl is the
   only thing forcing a scroller; keep the scroller but let it settle wider. */
#rowsBody td,
#statsBody td { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .modeopt { transition: none; }
}
