/* ================================================
   COHORT FOUNDATION — the cohort root's element
   registration, plus the four criterion-referenced band
   colours.

   Split out of eval-cohort.css (857 lines). The palette
   is the one block genuinely shared across that file's
   summary/list seam: each rule pairs a distribution bar
   (.band-bar--*, summary) with a row chip
   (.cohort-band--*, list). Splitting the pairs would
   duplicate the palette; keeping them together here
   keeps "one source of truth" literally true.

   .band-bar--empty MUST stay directly after the colour
   rules — it wins on source order at equal specificity,
   so separating them across files would make the ghost
   styling depend on stylesheet load order.

   Loaded first of the cohort stylesheets, which is why
   the root registration lives here: <cohort-results> is
   a custom element, so without `display: block` it is
   inline and the whole panel's layout collapses. It must
   not depend on the summary or list file being present.
   ================================================ */

@layer components {
  .cohort-root {
    display: block;
  }
}

@layer theme {
  .cohort-root {
    /* Band palette — one source of truth for the four bands, shared by the
       distribution bars and the row chips. Kept as explicit paired selectors
       (not a nested &--mod under a comma list, which would expand to an invalid
       :is(...)--mod and match nothing). */
    .band-bar--strong,
    .cohort-band--strong {
      background: oklch(from var(--color-success) l c h / 0.14);
      border: 1px solid oklch(from var(--color-success) l c h / 0.3);
      color: var(--color-success);
    }

    .band-bar--adequate,
    .cohort-band--adequate {
      background: oklch(from var(--color-info) l c h / 0.14);
      border: 1px solid oklch(from var(--color-info) l c h / 0.3);
      color: var(--color-info);
    }

    .band-bar--limited,
    .cohort-band--limited {
      background: oklch(from var(--color-warning) l c h / 0.14);
      border: 1px solid oklch(from var(--color-warning) l c h / 0.3);
      color: var(--color-warning);
    }

    .band-bar--none,
    .cohort-band--none {
      background: oklch(from var(--text-secondary) l c h / 0.1);
      border: 1px solid oklch(from var(--text-secondary) l c h / 0.25);
      color: var(--text-secondary);
    }

    /* A band with zero candidates recedes to a neutral ghost so the
       populated bands lead the eye. Wins over the colour rules above by
       source order (same specificity). */
    .band-bar--empty {
      background: oklch(from var(--text-secondary) l c h / 0.05);
      border: 1px solid oklch(from var(--text-secondary) l c h / 0.14);
      color: var(--text-secondary);
      opacity: 0.6;
    }
  }
}
