/* F15 — the control that says what the analysis looks for, and the dialog it
   opens.

   It used to be a disclosure under the findings line whose summary read "What to
   look for". The words were right and the affordance was wrong: a line of small
   grey text in a column of small grey text, among the disclaimers, which is the
   one part of the page nobody reads looking for a control. So it is an icon in
   the bar now, beside the Dictionary button — what gets masked, and what gets
   pointed out, offered as the same kind of thing — and the list it used to push
   into the pane is a modal, framed like Help and the dictionary.

   The count stays on the trigger's face. It is the part worth knowing without
   opening anything, and it is what tells a passing reader that the icon is about
   a set of things that can be on or off. */

/* Shaped like the Dictionary button it sits next to rather than like the round
   controls at the far end: those two are page-level (help, profile), this one
   governs the workspace, and matching the button next to it says so. */
.detectors__open {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--colour-border-strong);
  border-radius: 9px;
  background: var(--colour-surface);
  color: var(--colour-text-muted);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

/* An author `display` beats the user-agent rule for [hidden], and this button is
   hidden by that attribute on the way back, where nothing is analysed. */
.detectors__open[hidden] {
  display: none;
}

.detectors__open svg {
  width: 1.05rem;
  height: 1.05rem;
}

.detectors__open:hover {
  border-color: var(--colour-accent);
  color: var(--colour-accent-ink);
}

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

/* The same chip the keyword count wears on the Dictionary button, for the same
   reason: it is a count riding on a control, not part of its label. */
.detectors__status {
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-pill);
  background: rgb(0 0 0 / 6%);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
}

/* The dialog. Sized for the checkbox columns rather than for prose, which is why
   it is wider than help.css's measure and shorter: three columns of families,
   plus the gaps and the panel's padding. */
.detectors {
  width: min(46rem, calc(100vw - 2rem));
  max-height: min(36rem, calc(100vh - 3rem));
  padding: 0;
  border: 1px solid var(--colour-border);
  border-radius: 12px;
  background: var(--colour-shell);
  color: var(--colour-text);
  box-shadow: 0 18px 48px rgb(0 0 0 / 24%);
  overflow: hidden;
}

.detectors::backdrop {
  background: rgb(26 26 25 / 45%);
}

.detectors__panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: inherit;
  padding: 0 1.25rem 1.25rem;
  overflow: auto;
}

.detectors__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 -1.25rem;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--colour-border-soft);
  background: var(--colour-shell);
}

.detectors__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.detectors__close {
  margin-left: auto;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--colour-border);
  border-radius: 50%;
  background: var(--colour-surface);
  color: var(--colour-text-muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.detectors__close:hover {
  border-color: var(--colour-accent);
  color: var(--colour-accent-ink);
}

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

/* Three columns: the families are short lists, and one column of nine of them
   made the dialog scroll for no reason. minmax(0, 1fr) rather than a bare 1fr,
   so a long detector name shrinks its column instead of pushing the grid wider
   than the dialog. */
.detectors__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  font-size: 0.8rem;
}

/* Three columns need the width for three. The dialog is capped at the viewport
   less a margin, so below that it steps down rather than squeezing three columns
   into a phone — 40rem is the breakpoint the bar and the footer already use. */
@media (max-width: 48rem) {
  .detectors__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 40rem) {
  .detectors__list {
    grid-template-columns: 1fr;
  }
}

.detectors__group {
  margin: 0;
  padding: 0;
  border: 0;
}

.detectors__legend {
  padding: 0 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--colour-text-muted);
}

.detectors__item {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.15rem 0;
  cursor: pointer;
  color: var(--colour-text);
}

.detectors__box {
  accent-color: var(--colour-accent);
}

.detectors__note {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--colour-text-muted);
}
