/* The teacher's Progress tab (web/progress-view.js). Built for 70 rows on a
   1366×768 laptop at the front of the room: compact rows, a header and a
   codename column that stay put while the table scrolls both ways. Theme
   variables only; the four --status-* tones and a hollow dot for "no
   information" (ADR 0002). */

.wrap.wrap--full {
  max-width: none;
}

/* The tab takes the whole width; "All events" brings the sidebar back. */
.dash.dash--full {
  grid-template-columns: minmax(0, 1fr);
}

.dash--full .dash__side {
  display: none;
}

.dash--full .dash__back {
  display: inline-flex;
}

.pv {
  display: grid;
  gap: var(--sp-2);
}

.pv-top {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--sp-2) var(--sp-4);
}

.pv-top h2 {
  margin: 0;
}

.pv-top .pv-controls {
  flex: 1;
}

.pv-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--sp-2) var(--sp-3);
}

.pv-control {
  display: grid;
  gap: 2px;
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.pv-control select {
  max-width: 24rem;
  font: inherit;
  font-weight: 400;
  color: var(--color-ink);
}

.pv-spacer {
  flex: 1;
}

.pv-muted {
  color: var(--color-muted);
}

.pv-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The scroll box holds both sticky edges. Its height leaves the page's bar
   and the controls in view on a 768px screen. */
.pv-scroll {
  max-height: calc(100vh - 10rem);
  min-height: 16rem;
  overflow: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--r-ctl);
  background: var(--color-bg);
}

.pv-scroll:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.pv-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  line-height: 1.3;
}

.pv-table th,
.pv-table td {
  padding: var(--sp-1) var(--sp-1);
  border-bottom: 1px solid var(--color-line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.pv-table thead th {
  position: sticky;
  z-index: 2;
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 600;
}

/* Two header rows: the day groups, then each column. The first row has a
   fixed height so the second knows where to stick. */
.pv-head-1 th {
  top: 0;
  height: 1.75rem;
}

.pv-head-2 th {
  top: 1.75rem;
  border-bottom-color: var(--color-line-strong);
  font-weight: 500;
  color: var(--color-ink-soft);
}

.pv-head-1 th[rowspan] {
  border-bottom-color: var(--color-line-strong);
}

.pv-day {
  text-align: center;
  border-left: 1px solid var(--color-line-strong);
}

.pv-edge {
  border-left: 1px solid var(--color-line-strong);
}

.pv-sort {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.pv-sort:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.pv-sticky {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--color-bg);
  border-right: 1px solid var(--color-line-strong);
}

.pv-table thead .pv-sticky {
  z-index: 3;
  background: var(--color-surface);
}

.pv-codename {
  min-width: 12rem;
  font-weight: 400;
}

.pv-codename .mono {
  color: var(--color-ink);
  font-weight: 600;
}

.pv-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pv-table tbody tr:hover > * {
  background: var(--color-surface-2);
}

.pv-cohort,
.pv-notes,
.pv-offered {
  color: var(--color-muted);
  font-size: 0.75rem;
}

/* A choice and what was offered, on one line, cut with an ellipsis; the
   cell's title has the whole of it. A table cell ignores max-width, so the
   limit sits on a block inside it. */
.pv-clip {
  display: block;
  max-width: 22rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-chose {
  color: var(--color-ink);
}

.pv-dir {
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.pv-tag,
.pv-flag {
  padding: 0 var(--sp-1);
  border: 1px solid currentColor;
  border-radius: var(--r-ctl);
  font-size: 0.6875rem;
  font-weight: 600;
}

.pv-tag {
  color: var(--status-neutral);
}

/* A disabled student stays in the table, quieter. */
.pv-disabled > td {
  color: var(--color-muted);
}

.pv-disabled .pv-codename .mono {
  color: var(--color-muted);
  text-decoration: line-through;
}

/* The dot: filled in the cell's tone, hollow for "no information". */
.pv-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: var(--sp-1);
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0;
}

.pv-dot--positive {
  color: var(--status-positive);
}

.pv-dot--neutral {
  color: var(--status-neutral);
}

.pv-dot--warning {
  color: var(--status-warning);
}

.pv-dot--critical {
  color: var(--status-critical);
}

.pv-dot--none {
  color: var(--status-neutral);
  background: transparent;
}

/* A profile cell: the student's line in words, on one line. The counts
   show on hover or keyboard focus. */
.pv-line-head {
  min-width: 13rem;
  max-width: 14rem;
  white-space: normal !important;
  vertical-align: bottom !important;
}

/* A table cell ignores max-width, so .pv-words carries the limit. */
.pv-line {
  width: 14rem;
}

.pv-words {
  position: relative;
  display: flex;
  align-items: baseline;
  min-width: 0;
  max-width: 14rem;
  border-radius: 3px;
}

.pv-words:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.pv-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pv-counts {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 4;
  width: max-content;
  max-width: 16rem;
  margin-top: 2px;
  padding: var(--sp-1) var(--sp-1);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--r-ctl);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 0.75rem;
  white-space: normal;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  pointer-events: none;
}

.pv-words:hover .pv-counts,
.pv-words:focus .pv-counts {
  clip: auto;
  clip-path: none;
}

.pv-login {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* Row actions are kept small so a row stays one line of text tall. */
.pv-login .btn--sm {
  min-height: 0;
  padding: 0 var(--sp-1);
  font-size: 0.75rem;
  line-height: 1.3;
}

/* The sitting-difference report. */
.pv-report summary {
  cursor: pointer;
  color: var(--color-ink);
  font-weight: 600;
}

.pv-report__table {
  max-width: 60rem;
}

.pv-report__table th,
.pv-report__table td {
  text-align: left;
}

.pv-differences {
  margin: 2px 0 0;
  padding-left: var(--sp-4);
  font-size: 0.75rem;
}

/* ---------- Reflections ---------- */

.pv-reflections__group {
  margin-top: var(--sp-4);
}

.pv-reflections__prompt {
  margin-top: var(--sp-1);
  color: var(--color-ink);
}

.pv-reflections {
  margin: var(--sp-2) 0 0;
  padding: 0;
  list-style: none;
}

.pv-reflections li {
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--color-line);
}

/* A student's line breaks are their own. */
.pv-reflections__text {
  max-width: 72ch;
  color: var(--color-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
