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

/* --- verdict line ------------------------------------------------------- */

/* The verdict is a live region that swaps between neutral / warn / flagged.
   State is never colour-only: the text itself always names the state. */
.chatter-verdict {
  margin-block-start: var(--space);
}

.chatter-verdict > span { display: block; }
.chatter-verdict > span + span { margin-block-start: 0.35rem; font-size: 0.875rem; }

/* Flagged state. The heading text itself says "Possible chatter detected", so the
   colour is reinforcement, never the only signal. */
.chatter-verdict.is-flagged { border-color: var(--bad); }
.chatter-verdict.is-flagged .note__title { color: var(--bad); }

/* --- controls ----------------------------------------------------------- */

.chatter-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem var(--space);
  align-items: end;
  margin-block-start: var(--space);
  padding: var(--space);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

@media (min-width: 720px) {
  /* The slider carries its own help text, so it gets twice the width of the two
     selects and everything bottom-aligns on one baseline. */
  .chatter-controls {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  }
}

.chatter-controls__actions { align-self: end; }

/* Range input has no design-system rule: it is only used on this page. */
.chatter-thresh input[type="range"] {
  inline-size: 100%;
  min-block-size: 44px;         /* touch target */
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.chatter-thresh input[type="range"]::-webkit-slider-runnable-track {
  block-size: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-ui);
}

.chatter-thresh input[type="range"]::-moz-range-track {
  block-size: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-ui);
}

.chatter-thresh input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  inline-size: 20px;
  block-size: 20px;
  margin-block-start: -8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.chatter-thresh input[type="range"]::-moz-range-thumb {
  inline-size: 20px;
  block-size: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.chatter-thresh input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- keyboard map mount ------------------------------------------------- */

/* The mount is the focusable region (role="region"); KLT.keyboard puts the
   .kbd-map inside it and that element owns the horizontal scroller. */
.kbd-wrap {
  border-radius: var(--r);
}

.kbd-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Suspected-chatter marker. Colour is paired with the "!n" count that tool.js
   writes into .kbd-key__stat, so the state is never colour-only. */
.kbd-key--chatter,
.kbd-key--chatter.kbd-key--hit {
  color: var(--bad);
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 22%, var(--surface-2));
}

.kbd-key--chatter .kbd-key__stat {
  color: var(--bad);
  font-weight: 700;
}

.chatter-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin-block-start: 0.6rem;
}

/* --- flagged rows ------------------------------------------------------- */

/* Paired with a literal "!" written into the row by tool.js — never colour alone. */
.tbl tr.is-flagged th,
.tbl tr.is-flagged td { color: var(--bad); }
