/* The Competencies tile: what the class's work has covered. Everything here
   sits inside .dash-comp-tile (its box, title and sliding pages are in
   dashboard.css). A line under the title says what the numbers count, then
   one row for each competency: its name, how many assessments carried it,
   and one tick for each student. Sizes follow the approved boards (Comp2 D1
   to D3); colours are the app's tokens. */

/* ── Under the title: the period, a link, the column's heading ─────── */
.dash-comp-sub {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
}
.dash-comp-span .seg-btn {
  font-size: 13px;
  white-space: nowrap;
}
.dash-comp-sub-link {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
  text-decoration: none;
  cursor: pointer;
}
.dash-comp-sub-link:hover {
  text-decoration: underline;
}
/* A dark word, never grey. */
.dash-comp-colhead {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

/* ── The list: scrolls inside the tile, a fade at its foot while there is more ── */
.dash-comp-listbox {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  /* 6 px past the tile's padding on each side, given back inside the list: a scroller cuts what
     sticks out of it, and a tick's ring (2 px, or its focus outline, 4 px) at either end of a bar
     was cut at the list's edge (Colin, Nov 29). */
  margin-inline: -6px;
}
.dash-comp-list {
  height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 6px 18px;
}
.dash-comp-list:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: -2px;
}
.dash-comp-fade {
  position: absolute;
  inset: auto 0 0;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
  opacity: 0;
}
.dash-comp-listbox.has-more .dash-comp-fade {
  opacity: 1;
}

/* A folder's name over its rows. */
.dash-comp-fold {
  margin: 12px 0 2px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--divider-subtle);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.dash-comp-fold:first-child {
  margin-top: 0;
}

/* One competency: the name, the count, and under them the ticks (or the bar). */
.dash-comp-it {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 12px;
  padding: 7px 0;
}
.dash-comp-it-name {
  display: block;
  justify-self: start;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.dash-comp-it-name {
  cursor: pointer;
}
button.dash-comp-it-name:hover {
  text-decoration: underline;
}
button.dash-comp-it-name:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
  border-radius: 3px;
}
.dash-comp-it-n {
  min-width: 20px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* One assessment is thin coverage: amber, as the assessment picker marks it. */
.dash-comp-it-n.is-thin {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--score-2-bg);
  color: var(--score-2-text);
}

/* One tick for each student, in their level's colour; hollow with no mark.
   The ticks share the row's whole width, under the name and the count:
   a class of 20 has wider ticks than a class of 30 (Colin, 2026-11-25:
   "the number of students by the width of the space they have"). */
.dash-comp-ticks {
  grid-column: 1 / -1;
  display: flex;
  gap: 2px;
  height: 12px;
}
.dash-comp-tick {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 2.5px;
  cursor: pointer;
}
.dash-comp-tick::after {
  content: '';
  position: absolute;
  inset: -6px 0;
}
.dash-comp-tick.is-none {
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--text);
}
.dash-comp-tick:hover,
.dash-comp-tick[aria-expanded='true'] {
  box-shadow: 0 0 0 2px var(--text);
}
.dash-comp-tick.is-none:hover {
  box-shadow:
    inset 0 0 0 1.5px var(--text),
    0 0 0 2px var(--text);
}
.dash-comp-tick:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}

/* Core: a plain dark bar as long as its count against the most tagged. */
.dash-comp-bar {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 5px;
  background: var(--divider-subtle);
  overflow: hidden;
}
.dash-comp-bar i {
  display: block;
  /* As long as its count against the most tagged (--n of --top), never a sliver. */
  width: max(4%, calc(var(--n) / var(--top) * 100%));
  height: 100%;
  border-radius: 5px;
  background: var(--text);
}

/* An empty page says so in one plain sentence. */
.dash-comp-plain {
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text);
}

/* The foot: one quiet line, and the names it opens. */
.dash-comp-quiet-box {
  margin-top: 8px;
  border-top: 1px solid var(--divider-subtle);
}
.dash-comp-quiet {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 0 2px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.dash-comp-quiet svg {
  flex: none;
  transition: transform 150ms var(--ease-out);
}
.dash-comp-quiet[aria-expanded='true'] svg {
  transform: rotate(90deg);
}
.dash-comp-quiet:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
  border-radius: 3px;
}
.dash-comp-na {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.dash-comp-na[hidden] {
  display: none;
}
.dash-comp-na-name {
  display: block;
  padding: 5px 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
}
button.dash-comp-na-name {
  cursor: pointer;
}
button.dash-comp-na-name:hover {
  text-decoration: underline;
}
button.dash-comp-na-name:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── The students at a tick's level: on the window, outside the tile,
   which clips. Hidden at rest. ─────────────────────────────────────── */
.dash-comp-pop {
  position: fixed;
  z-index: var(--z-fab);
  top: 8px;
  left: 8px;
  box-sizing: border-box;
  width: 320px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--divider-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--text);
}
.dash-comp-pop[hidden] {
  display: none;
}
.dash-comp-pop button:focus-visible,
.dash-comp-pop a:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 1px;
}
