/* assignments.css — Assignments page styles */

/* Hide toolbar course picker when sidebar (which has its own picker) is visible */
.page-layout:not(.sidebar-hidden) .assess-course-select {
  display: none;
}

/* Page-specific styles */
.assess-card {
  background: var(--surface);
  border: none;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px var(--divider-medium);
  margin-bottom: 12px;
  overflow: visible;
  /* Scrolled to (from the Gradebook), the card stops just below the
     toolbar. */
  scroll-margin-top: 12px;
}
/* The header is a grid: grip | title, chips | actions | chevron. The
   actions stand beside both rows, centred on the card. */
.assess-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    'grip title actions chevron'
    'grip meta actions chevron';
  align-items: center;
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  padding: 12px 16px 12px var(--space-3);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
/* Open cards separate by their controls, not a blue outline. */
.assess-card.active {
  border-color: transparent;
}
/* No hover tint, as in the mockup. */
.assess-header:hover {
  background: transparent;
}
.assess-grip {
  grid-area: grip;
  width: 14px;
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  cursor: grab;
}
.assess-title {
  grid-area: title;
  justify-self: start;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.3;
}
.assess-header-info {
  display: contents;
}
.assess-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.assess-date {
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--text);
}
.assess-missing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--score-1-dark);
}
/* Dark: --score-1-dark is #ff453a there, 4.09:1 on --surface; the Emerging
   text red is 4.94:1. */
@media (prefers-color-scheme: dark) {
  .assess-missing {
    color: var(--score-1-text);
  }
}
/* Header actions: shown on the open card, on hover for a closed one. */
.assess-header-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  opacity: 0;
  transition: opacity 0.15s var(--ease-out);
}
.assess-header:hover .assess-header-actions,
.assess-card.open .assess-header-actions,
.assess-header-actions:focus-within {
  opacity: 1;
}
/* A closed card keeps no room for its hidden actions: they sit over the
   right end of the header, beside the chevron, so the title and chips use
   the full width and hovering moves nothing. */
.assess-card:not(.open) .assess-header {
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'grip title chevron'
    'grip meta chevron';
}
.assess-card:not(.open) .assess-header-actions {
  grid-area: auto;
  position: absolute;
  top: 50%;
  right: 42px;
  z-index: 1;
  transform: translateY(-50%);
  padding: 4px 0 4px 24px;
  background: linear-gradient(to right, transparent, var(--surface) 20px);
  /* Hidden, they take no clicks: a click there opens the card. */
  pointer-events: none;
}
.assess-header:hover .assess-header-actions > *,
.assess-header-actions:focus-within > * {
  pointer-events: auto;
}
/* A touch screen has no hover to show them: open the card for them. */
@media (hover: none) {
  .assess-card:not(.open) .assess-header-actions {
    display: none;
  }
}
/* A narrow window: a closed card shows no actions (open it for them), and an
   open card gives them their own row under the chips. */
@media (max-width: 900px) {
  .assess-card:not(.open) .assess-header-actions {
    display: none;
  }
}
@media (max-width: 1200px) {
  .assess-card.open .assess-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'grip title chevron'
      'grip meta chevron'
      'grip actions chevron';
  }
  .assess-card.open .assess-header-actions {
    flex-wrap: wrap;
    padding-top: 4px;
  }
}
.assess-chevron {
  grid-area: chevron;
  display: flex;
  color: var(--text);
  transition: transform 0.15s var(--ease-out);
}
.assess-card.open .assess-chevron {
  transform: rotate(90deg);
}
.assess-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 0.5px solid var(--divider-medium);
}
.assess-card.open .assess-body,
.assess-card.is-closing .assess-body {
  display: block;
}
/* Focus banner */
.focus-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) 20px;
  background: var(--focus-banner-bg);
  border-bottom: 1px solid var(--focus-banner-border);
}
.focus-banner-label {
  font-size: var(--text-md);
  color: var(--text-1);
}
/* Score grid */
.score-col-header {
  flex: 1;
  min-width: 90px;
  text-align: center;
  cursor: pointer;
  padding: var(--space-1) 2px;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
  position: relative;
}
.score-col-header:hover {
  background: rgba(0, 122, 255, 0.12);
}
.score-row-action {
  width: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Column fill dropdown — uses fixed positioning to escape overflow clipping */
.col-fill-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  padding: 4px;
  display: none;
  min-width: 140px;
}
.col-fill-menu.open {
  display: block;
}
.col-fill-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 8px;
  font-size: var(--text-base);
  cursor: pointer;
  border-radius: var(--radius-xs);
  font-family: var(--font-base);
  white-space: nowrap;
}
.col-fill-option:hover {
  background: var(--active-light);
}
.col-fill-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
}

/* Score rows */
.score-row {
  display: flex;
  align-items: start;
  gap: 0;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--overlay-hover);
  position: relative;
}
.score-row:last-child {
  border-bottom: none;
}
.score-row:hover {
  background: rgba(0, 122, 255, 0.03);
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 4px;
}

/* Multi-option score picker */
.score-opt {
  width: 28px;
  height: 26px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 0.1s,
    border-color 0.1s,
    color 0.1s,
    box-shadow 0.1s,
    transform 0.1s;
  border: 1.5px solid transparent;
}
.score-opt:hover {
  transform: scale(1.12);
}
/* Faint / unselected states */
.score-opt.s1 {
  background: rgba(211, 47, 47, 0.12);
  color: rgba(211, 47, 47, 0.35);
}
.score-opt.s2 {
  background: rgba(192, 122, 0, 0.12);
  color: rgba(192, 122, 0, 0.35);
}
.score-opt.s3 {
  background: rgba(46, 125, 50, 0.12);
  color: rgba(46, 125, 50, 0.35);
}
.score-opt.s4 {
  background: rgba(21, 101, 192, 0.12);
  color: rgba(21, 101, 192, 0.35);
}
/* Active / selected states */
.score-opt.s1.active {
  background: var(--score-1);
  color: #fff;
  border-color: var(--score-1-dark);
  box-shadow: 0 1px 4px rgba(211, 47, 47, 0.3);
}
.score-opt.s2.active {
  background: var(--score-2);
  color: #fff;
  border-color: var(--score-2-dark);
  box-shadow: 0 1px 4px rgba(192, 122, 0, 0.3);
}
.score-opt.s3.active {
  background: var(--score-3);
  color: #fff;
  border-color: var(--score-3-dark);
  box-shadow: 0 1px 4px rgba(46, 125, 50, 0.3);
}
.score-opt.s4.active {
  background: var(--score-4);
  color: #fff;
  border-color: var(--score-4-dark);
  box-shadow: 0 1px 4px rgba(21, 101, 192, 0.3);
}
/* Hover on unselected */
.score-opt.s1:not(.active):hover {
  background: rgba(211, 47, 47, 0.22);
  color: rgba(211, 47, 47, 0.7);
}
.score-opt.s2:not(.active):hover {
  background: rgba(192, 122, 0, 0.22);
  color: rgba(192, 122, 0, 0.7);
}
.score-opt.s3:not(.active):hover {
  background: rgba(46, 125, 50, 0.22);
  color: rgba(46, 125, 50, 0.7);
}
.score-opt.s4:not(.active):hover {
  background: rgba(21, 101, 192, 0.22);
  color: rgba(21, 101, 192, 0.7);
}

/* Row fill button */
.row-fill-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.1s,
    border-color 0.1s,
    color 0.1s;
  position: relative;
}
.row-fill-btn:hover {
  border-color: var(--active);
  color: var(--link);
  background: var(--surface);
}

/* ── Collaboration badge on assessment card ────────────────────── */
.collab-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  padding: 1px 8px;
  border-radius: var(--radius-xl);
  background: var(--overlay-hover);
}

/* ── Assessment Form ─────────────────────────────────────────── */
.af-field {
  margin-bottom: var(--space-4);
}
.af-label {
  display: block;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: var(--space-1);
}
.af-input {
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--text-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) 12px;
  color: var(--text);
  outline: none;
  transition: border 0.12s;
}
.af-input:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}
/* A field a stopped save points at stays red while focused: the global
   focus ring (styles.css, !important) would otherwise hide it. */
.af-input[aria-invalid='true'],
.af-input[aria-invalid='true']:focus {
  border-color: var(--score-1) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--score-1) 18%, transparent) !important;
}
.af-textarea {
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--text-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) 12px;
  color: var(--text);
  outline: none;
  resize: vertical;
  min-height: 36px;
  line-height: 1.5;
  transition:
    border 0.12s,
    min-height 0.2s;
}
.af-textarea:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
  min-height: 80px;
}
.af-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.af-row > .af-field {
  min-width: 140px;
}

/* Type toggles (.seg) in the assessment form fill their field */
.af-type-toggle {
  display: flex;
}
.af-type-toggle .seg-btn {
  flex: 1;
  /* At phone widths a long option ("Complete/Incomplete") wraps inside its
     segment instead of pushing the form past the screen. */
  padding-left: var(--space-3);
  padding-right: var(--space-3);
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Scoring Mode: a card per way to score, the chosen one outlined in blue. Its settings
   (Max Points, Factor) sit in a row below at one 36px height. */
.af-mode-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 640px;
}
.af-mode-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  text-align: left;
  /* Grey until chosen, then solid blue (redesign PR 14). */
  background: var(--divider-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    border-color var(--duration-micro) ease,
    background-color var(--duration-micro) ease;
}
.af-mode-card:hover {
  background: var(--overlay-pressed);
}
.af-mode-card[aria-checked='true'],
.af-mode-card[aria-checked='true']:hover {
  font-weight: 600;
  background: var(--active-fill);
  color: #fff;
}
.af-mode-card:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.af-mode-card svg {
  flex: 0 0 auto;
  color: var(--text-2);
}
.af-mode-card[aria-checked='true'] svg {
  color: #fff;
}
/* Each card sits in an item of the mode grid. */
.af-mode-item {
  position: relative;
  display: flex;
}
.af-mode-item .af-mode-card {
  flex: 1;
}
@media (max-width: 560px) {
  .af-mode-cards {
    grid-template-columns: 1fr;
  }
}
.af-score-settings .af-input {
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
}
.af-score-settings .seg-btn {
  line-height: 22px;
}

/* ── Collaboration panel (expanded below toggle) ────────────── */
.collab-panel {
  margin-top: var(--space-3);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.collab-panel.is-opening {
  animation: collabSlideIn 0.16s ease-out;
}
@keyframes collabSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.collab-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.collab-panel-title {
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-3);
}
.collab-panel-actions {
  display: flex;
  gap: var(--space-2);
}
.collab-panel-btn {
  padding: var(--space-1) 12px;
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-base);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition:
    background-color 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.collab-panel-btn:hover {
  border-color: var(--active);
  color: var(--link);
  background: rgba(0, 122, 255, 0.04);
}
.collab-panel-btn.active {
  background: var(--active-fill);
  color: #fff;
  border-color: var(--active-fill);
}
.collab-panel-btn.primary {
  background: var(--active-fill);
  color: #fff;
  border-color: var(--active-fill);
}
.collab-panel-btn.primary:hover {
  background: var(--btn-hover-blue);
}

/* Choose Students (Colin, Nov 11): a chip per student, like the group
   cards' members. Chosen: coloured initials, a blue tick. Not chosen: grey
   initials, an empty circle. A click changes the one chip. */
.collab-panel-heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  min-width: 0;
}
.collab-choose-count {
  font-size: 13px;
  color: var(--text-2);
}
.collab-choose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
}
.collab-choose-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-3);
  font-family: var(--font-base);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 0.12s ease-out,
    border-color 0.12s ease-out,
    color 0.12s ease-out;
}
.collab-choose-chip[aria-pressed='true'] {
  border-color: rgba(0, 122, 255, 0.35);
  background: rgba(0, 122, 255, 0.07);
  color: var(--text);
}
.collab-choose-chip:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.collab-choose-chip .member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--border);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  transition: background-color 0.12s ease-out;
}
.collab-choose-chip[aria-pressed='true'] .member-avatar {
  background: var(--avatar);
}
.collab-choose-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collab-choose-mark {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1.6px solid var(--border);
  border-radius: 50%;
  transition:
    background-color 0.12s ease-out,
    border-color 0.12s ease-out;
}
.collab-choose-chip[aria-pressed='true'] .collab-choose-mark {
  border-color: var(--active);
  background: var(--active);
}
.collab-choose-chip[aria-pressed='true'] .collab-choose-mark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Moving students between pairs and groups (board "Assessment Form" 3d):
   the picked-up student fades in place, the group under the pointer turns
   blue with a slot, and every student who moves glides to their new place. */
.collab-group-member.is-dragging {
  opacity: 0.35;
}
.collab-group-member.is-gliding {
  position: relative;
  z-index: 2;
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.collab-group-member.just-moved {
  animation: collabJustMoved 0.45s ease-out;
}
@keyframes collabJustMoved {
  from {
    background-color: #dbe9ff;
    border-color: #8fbcff;
  }
}
.collab-group-card.drag-over::after {
  content: 'Drop to move here';
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  margin: 2px 0;
  border: 1.5px dashed var(--active);
  border-radius: var(--radius-sm);
  background: rgba(0, 122, 255, 0.06);
  color: var(--link);
  font-size: var(--text-xs);
  font-weight: 600;
}
.collab-moved {
  font-size: 13px;
  color: var(--text);
}
.collab-undo {
  border: 0;
  background: transparent;
  padding: 0 4px;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .collab-panel.is-opening,
  .collab-group-member.just-moved {
    animation: none;
  }
  .collab-group-member.is-gliding,
  .collab-choose-chip,
  .af-students-caret {
    transition: none;
  }
}

/* Pairs / Groups: grouping UI */
.collab-groups-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  max-height: 360px;
  overflow-y: auto;
  padding: 2px;
}
.collab-group-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  min-height: 60px;
}
.collab-group-header {
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.collab-group-member {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px var(--space-2);
  margin: 2px 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  cursor: grab;
  transition:
    background-color 0.1s,
    border-color 0.1s,
    box-shadow 0.1s,
    opacity 0.1s;
}
.collab-group-member:active {
  cursor: grabbing;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.collab-group-member .member-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--active-fill);
  color: #fff;
  font-size: var(--text-2xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.collab-group-card {
  transition:
    background-color 0.1s ease-out,
    border-color 0.1s ease-out,
    box-shadow 0.1s ease-out;
}
.collab-group-card.drag-over {
  border-color: var(--active);
  background: rgba(0, 122, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Groups count stepper */
.collab-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.collab-stepper-label {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-2);
}
.collab-stepper-controls {
  display: flex;
  align-items: center;
  gap: 0;
}
.collab-stepper-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--text-xl);
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.1s;
}
.collab-stepper-btn:first-child {
  border-radius: 8px 0 0 8px;
}
.collab-stepper-btn:last-child {
  border-radius: 0 8px 8px 0;
}
.collab-stepper-btn:hover {
  background: var(--bg);
}
.collab-stepper-val {
  width: 40px;
  height: 32px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
}
.collab-stepper-info {
  font-family: var(--font-base);
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-left: 8px;
}

/* Tags container — vertical layout */
.af-tags-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.af-section-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.af-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-left: 4px solid #999;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.af-section-header:hover {
  background: var(--section-hover);
}
.af-section-badge {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  color: #fff;
  padding: 1px var(--space-2);
  border-radius: var(--radius);
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.af-select-all {
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--link);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  transition:
    background-color 0.1s,
    color 0.1s;
}
.af-select-all:hover {
  background: var(--active-light);
  color: var(--text);
}

/* Individual tag items — vertical list */
.af-tag-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--overlay-hover);
  cursor: pointer;
  transition: background 0.1s;
  font-size: var(--text-md);
}
.af-tag-item:last-child {
  border-bottom: none;
}
/* A competency row with its I Can toggle beside it (Nov 2 mockup, batch 2). */
.af-tag-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--overlay-hover);
}
.af-tag-row:last-of-type {
  border-bottom: none;
}
.af-tag-row .af-tag-item {
  flex: 1;
  min-width: 0;
  border-bottom: none;
}
.af-tag-ican-toggle {
  flex: none;
  margin-right: 8px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--active);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.af-tag-ican-toggle:hover {
  background: var(--overlay-hover);
}
.af-tag-ican-caret {
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.12s;
}
.af-tag-ican-toggle.open .af-tag-ican-caret {
  transform: rotate(90deg);
}
.af-tag-icans {
  margin: 2px 8px 8px var(--space-6);
  padding: var(--space-2) 12px var(--space-2) var(--space-6);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text);
}
.af-tag-icans li {
  margin: 2px 0;
}
.af-tag-item:hover {
  background: rgba(0, 122, 255, 0.03);
}
.af-tag-item.checked {
  background: rgba(26, 26, 46, 0.06);
}
.af-tag-item input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--text);
  flex-shrink: 0;
  cursor: pointer;
}
.af-tag-id {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  /* Sized to the code: a fixed 32px let codes like "Questioning" run into the name. */
  flex-shrink: 0;
  min-width: 32px;
  white-space: nowrap;
}
.af-tag-name {
  color: var(--text);
  flex: 1;
  line-height: 1.35;
}

/* Form actions */
.af-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ── The assessment form as cards (redesign PR 1, 2026-11-02) ──
   Grey ground inside the form's blue ring; each part of the form is a
   white card, 12px apart; card titles sit in one 136px column. */
.af-heading {
  margin: 0 2px 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.af-heading-note {
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-heading-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
}
.af-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 16px;
  margin-bottom: 12px;
}
.af-card > .af-field:last-child,
.af-card > .af-row:last-child,
.af-card > :last-child > .af-field:last-child {
  margin-bottom: 0;
}
.af-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.af-card-head:last-child {
  margin-bottom: 0;
}
.af-card-title {
  flex: 0 0 136px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
  color: var(--text);
}
.af-card-head .af-mode-cards {
  flex: 1 1 auto;
}
/* Students, in the top box under the dates (Colin, Nov 11): who it's for,
   then Individual, Pair or Group; their builder opens underneath. */
.af-students-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--divider-subtle);
}
.af-students-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 2fr);
  gap: 12px;
  align-items: center;
}
.af-students-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-base);
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}
.af-students-btn:hover {
  border-color: var(--text-3);
}
.af-students-btn:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.af-students-caret {
  flex: none;
  transition: transform 0.15s ease-out;
}
.af-students-btn[aria-expanded='true'] .af-students-caret {
  transform: rotate(180deg);
}
.af-collab-toggle {
  height: 40px;
}
.af-collab-toggle .seg-btn {
  line-height: 18px;
}
.af-students-names {
  margin-top: var(--space-2);
}
.af-students-row .collab-panel {
  margin-top: 12px;
}
@media (max-width: 900px) {
  .af-students-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}
.af-row-what {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.af-row-what > .af-field {
  min-width: 0;
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .af-row-what {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .af-row-what {
    grid-template-columns: minmax(0, 1fr);
  }
}
.af-card .af-input:not(textarea) {
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}
.af-card-what .af-copy-field {
  margin-bottom: var(--space-4);
}
.af-card-scoring .af-rubric-field {
  margin-top: 4px;
}
/* Scoring card: the title on its own line, then the ways to score as one
   toggle row like every other pick-one choice on the form (Colin, Nov 11),
   Factor at the row's end, then only what the mode needs. */
.af-card-scoring .af-card-head > .af-card-title {
  flex: 1 0 100%;
}
.af-card-scoring .af-card-head .af-mode-cards {
  display: flex;
  flex-wrap: wrap;
  flex: 0 1 auto;
  max-width: none;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-sm);
  background: rgba(118, 118, 128, 0.12);
}
.af-card-scoring .af-mode-item {
  flex: 0 0 auto;
}
.af-card-scoring .af-mode-card {
  min-height: 36px;
  white-space: nowrap;
  padding: 0 var(--space-4);
  gap: 8px;
  font-size: 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
}
.af-card-scoring .af-mode-card:hover {
  background: transparent;
  color: var(--text);
}
.af-card-scoring .af-mode-card[aria-checked='true'],
.af-card-scoring .af-mode-card[aria-checked='true']:hover {
  background: var(--surface);
  color: var(--text);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.04);
}
.af-card-scoring .af-mode-card[aria-checked='true'] svg {
  color: var(--text);
}
.af-weight-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 auto;
}
.af-weight-field[hidden],
.af-rubric-field[hidden],
.af-maxpoints-field[hidden],
.af-dibels-note[hidden] {
  display: none;
}
.af-weight-field .af-label {
  margin: 0;
}
/* Factor: [−][ 2.3 ][+], any value from 0.1 to 10 (2026-11-06). */
.af-factor-stepper {
  display: grid;
  grid-template-columns: 36px 56px 36px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border 0.12s;
}
.af-factor-stepper:focus-within {
  border-color: var(--active);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--active) 15%, transparent);
}
.af-factor-btn {
  border: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-base);
  font-size: var(--text-md);
  cursor: pointer;
}
.af-factor-btn:first-child {
  border-right: 1px solid var(--border);
}
.af-factor-btn:last-child {
  border-left: 1px solid var(--border);
}
.af-factor-btn:hover {
  background: var(--surface-2);
}
.af-factor-input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-base);
  font-size: var(--text-md);
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.af-factor-input::-webkit-outer-spin-button,
.af-factor-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.af-maxpoints-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}
.af-maxpoints-field .af-label {
  flex: 0 0 136px;
  margin: 0;
}
.af-maxpoints-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.af-maxpoints-controls .af-input {
  width: 80px;
  text-align: center;
}
.af-maxpoints-controls .seg {
  height: 40px;
}
.af-maxpoints-controls .seg-btn {
  min-width: 52px;
}
.af-dibels-note {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text);
  line-height: 1.45;
}
.af-card-scoring .af-score-settings:empty {
  display: none;
}
/* Competencies card (redesign PR 4): Codes and List. */
.af-card-competencies .af-card-head {
  align-items: center;
}
/* The field: the chosen competencies as chips, then Choose Competencies
   (Colin, Nov 4). The list itself is in the window below. */
.af-comp-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.af-comp-chosen {
  display: contents;
}
.af-comp-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: -4px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.af-comp-chip-x:hover {
  background: var(--overlay-pressed);
  color: var(--text);
}
.af-comp-chip-x:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 0;
}
.af-comp-choose {
  height: 32px;
  padding: 0 12px;
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--active);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.af-comp-choose:hover {
  background: var(--divider-subtle);
}
.af-comp-choose:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.af-comp-choose[hidden] {
  display: none;
}
.af-card-competencies .af-comp-rubric-note {
  margin: -8px 0 16px;
}
/* Choose Competencies: the list in a window over the form and the top
   bar, with the shared hover tip (#gb-tooltip) over it so the list's tips
   still show. */
.af-comp-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-popover) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: rgba(0, 0, 0, 0.35);
}
.af-comp-overlay[hidden] {
  display: none;
}
body.af-comp-open #gb-tooltip {
  z-index: calc(var(--z-popover) + 3);
}
.af-comp-dialog {
  display: flex;
  flex-direction: column;
  width: min(1000px, 100%);
  max-height: 100%;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.af-comp-dialog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
}
.af-comp-dialog-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
}
.af-comp-count {
  color: var(--text-2);
  font-size: var(--text-base);
  white-space: nowrap;
}
.af-comp-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 12px 20px;
}
.af-comp-dialog-body .af-comp-list {
  margin-bottom: 0;
}
.af-comp-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--divider);
}
.af-comp-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: 4px;
  background: #f2f2f4;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.af-comp-chip b,
.af-code b {
  color: #0e7490;
  font-weight: 700;
}
.af-comp-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
  min-width: 0;
  max-width: 100%;
}
.af-comp-find {
  width: 280px;
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 600px) {
  .af-comp-tools {
    flex: 1 1 100%;
  }
  .af-comp-find {
    /* Grows to fill; no width of its own to widen the form. */
    flex: 1 1 auto;
    width: 0;
  }
  .af-weight-field {
    margin-left: 0;
  }
}
.af-comp-view {
  height: 40px;
}
.af-comp-rubric-note {
  margin: -4px 0 12px;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-codes {
  display: grid;
  gap: 8px;
}
.af-codes-course {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-2);
  text-transform: none;
}
.af-codes-group {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.af-codes-group[hidden] {
  display: none;
}
.af-codes-group-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.af-codes-group-name,
.af-list-group-head {
  cursor: pointer;
}
/* A folder's checkbox: all, none, or a dash for some. */
.af-group-cb {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--text);
  cursor: pointer;
}
.af-group-cb:disabled,
.af-group-cb:disabled + * {
  cursor: default;
}
.af-codes-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.af-code {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #f2f2f4;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.af-code[hidden] {
  display: none;
}
.af-code:hover {
  background: var(--surface-2);
}
.af-code.on {
  background: var(--active-fill);
  color: #fff;
}
.af-code.on b {
  color: #fff;
}
.af-code.is-focus,
.af-code:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--active);
}
.af-code[aria-disabled='true'] {
  cursor: default;
}
.af-code[aria-disabled='true']:not(.on) {
  opacity: 0.45;
}
.af-codes-focus {
  position: relative;
  margin: 16px 0 var(--space-4);
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    0 0 0 2px var(--active),
    0 8px 24px rgba(0, 0, 0, 0.12);
}
.af-codes-focus::before {
  content: '';
  position: absolute;
  top: -9px;
  left: var(--af-point, 24px);
  width: 16px;
  height: 16px;
  background: var(--surface);
  transform: rotate(45deg);
  box-shadow: -2px -2px 0 0 var(--active);
}
.af-codes-focus-hint {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-codes-focus-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.af-codes-focus-code {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 var(--space-3);
  border-radius: 6px;
  background: var(--active-fill);
  color: #fff;
  font-weight: 700;
}
.af-codes-focus-name {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.af-codes-focus-group {
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-codes-focus-count {
  margin-left: auto;
  padding: 4px var(--space-3);
  border-radius: 6px;
  background: #f2f2f4;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.af-codes-focus-count.is-thin {
  background: var(--score-2-bg);
  color: #a06800;
}
.af-codes-focus-text {
  margin: var(--space-3) 0 0;
  max-width: 900px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
}
.af-codes-focus-label {
  margin-top: 12px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-2);
}
.af-codes-focus-icans {
  margin: var(--space-2) 0 0;
  padding: var(--space-3) var(--space-4) var(--space-3) 32px;
  border-radius: 8px;
  background: #f2f2f4;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text);
}
/* Codes shows the chips and the focus box; List shows the rows. */
.af-card-competencies[data-view='codes'] .af-comp-list,
.af-card-competencies[data-view='list'] .af-codes,
.af-card-competencies[data-view='list'] .af-codes-focus {
  display: none;
}
.af-card-competencies[data-view='list'] .af-tags-container {
  /* One row per competency, the whole wording on it (Colin, Nov 2), under
     its folder's name when the course has folders. The list takes the
     card's width and never widens the form. */
  display: block;
  contain: inline-size;
}
.af-card-competencies[data-view='list'] .af-tag-row,
.af-card-competencies[data-view='list'] .af-tag-item {
  min-width: 0;
}
.af-card-competencies[data-view='list'] .af-tag-row {
  align-items: flex-start;
}
.af-card-competencies[data-view='list'] .af-tag-item {
  /* Code, name and wording share their first line's baseline. */
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  margin-bottom: 0 !important;
  font-size: var(--text-base);
  line-height: 1.4;
}
.af-card-competencies[data-view='list'] .af-tag-item input[type='checkbox'] {
  align-self: flex-start;
  margin: var(--space-1) 0 0;
}
.af-card-competencies[data-view='list'] .af-tag-id {
  min-width: 40px;
}
.af-tag-short {
  flex: 0 0 auto;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}
.af-card-competencies[data-view='list'] .af-tag-short {
  flex: 0 0 180px;
  max-width: none;
  white-space: normal;
  overflow: visible;
}
.af-card-competencies[data-view='list'] .af-tag-name {
  flex: 1 1 0;
  min-width: 0;
  color: var(--text-2);
}
.af-card-competencies[data-view='list'] .af-tag-ican-toggle {
  margin-top: 4px;
}
.af-card-competencies[data-view='list'] .af-tag-row[hidden] {
  display: none;
}
.af-list-group + .af-list-group,
.af-tag-row + .af-list-group {
  margin-top: var(--space-3);
}
.af-list-group-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  /* The folder's box lines up with its competencies' boxes. */
  padding: 0 0 4px var(--space-3);
}
.af-list-group-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}
@media (max-width: 600px) {
  /* Narrow: code and name on one line, the wording under them. */
  .af-card-competencies[data-view='list'] .af-tag-item {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .af-card-competencies[data-view='list'] .af-tag-short {
    flex: 1 1 auto;
  }
  .af-card-competencies[data-view='list'] .af-tag-name {
    flex-basis: 100%;
    padding-left: var(--space-6);
  }
}
.af-card-competencies.is-rubric .af-comp-tools {
  display: none;
}
@media (max-width: 900px) {
  .af-codes-group {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
}

/* Rubric in the form (redesign PR 6): the chosen rubric as a card with its
   wording, the four starts, and the Competency Rubric. */
.af-rubric-field[hidden] {
  display: none;
}
/* Named for screen readers; the Rubric scoring card says it on screen. */
/* Read by a screen reader, never seen. Pinned to the corner of the box it
   is placed in (the page layout: no box between it and the page is
   positioned): left where it sits in the form, it lay ~1000px down the
   window, let the window itself scroll, and focusing the form's first
   field scrolled it, leaving a grey band under the page (Nov 13). */
.af-visually-hidden {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.af-rubric-last {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: var(--space-3) 2px 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-rubric-last b {
  color: var(--text);
  font-weight: 600;
}
.af-rubric-pick {
  display: flex;
  gap: 8px;
  align-items: center;
}
.af-rubric-pick[hidden] {
  display: none;
}
.af-rubric-pick .af-rubric-select {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
}
/* The rubric cards' and starts' greys (rubric starts PR 7): the light
   values are the Competency Rubric card's own; dark mode gets its own. */
:root {
  --af-grey: #f2f2f4;
  --af-grey-quiet: #f8f8fa;
  --af-line: #c7c7cc;
  --af-code: #0e7490;
  --af-card-edge: rgba(0, 0, 0, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --af-grey: #3a3a3c;
    --af-grey-quiet: #242426;
    --af-line: #636366;
    --af-code: #5ec4d8;
    --af-card-edge: rgba(255, 255, 255, 0.12);
  }
}
.af-rubric-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--af-card-edge);
  background: var(--surface);
}
.af-rubric-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-3) 12px;
  background: var(--af-grey);
}
.af-rubric-card-name {
  font-weight: 700;
  color: var(--text);
}
.af-rubric-card-meta {
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-gap {
  flex: 1;
}
.af-rubric-card-head .btn {
  min-height: 32px;
  padding: 0 var(--space-4);
  background: var(--surface);
}
.af-rubric-card-head .btn-primary {
  background: var(--active-fill);
  color: #fff;
}
.af-rubric-card .rb-grid {
  margin: 0;
  padding: 0 var(--space-2) 8px;
}
.af-rubric-card .rb-weight,
.af-rubric-card .rb-pie {
  display: none;
}
.af-rubric-card .rb-level-head.l1 {
  background: var(--score-1);
  color: #fff;
}
.af-rubric-card .rb-level-head.l2 {
  background: var(--score-2);
  color: #fff;
}
.af-rubric-card .rb-level-head.l3 {
  background: var(--score-3);
  color: #fff;
}
.af-rubric-card .rb-level-head.l4 {
  background: var(--score-4);
  color: #fff;
}
.af-rubric-card .rb-level-head .rb-level-value {
  color: #fff;
  opacity: 0.9;
}
.af-rubric-starts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
/* Under 900px the starts are one row of short names that scrolls
   sideways (rubric starts PR 7). */
.af-rubric-start .af-start-short {
  display: none;
}
@media (max-width: 900px) {
  .af-rubric-starts {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .af-rubric-starts::-webkit-scrollbar {
    display: none;
  }
  .af-rubric-start {
    flex: 0 0 auto;
    padding: var(--space-3) 16px;
  }
  .af-rubric-start .af-start-name,
  .af-rubric-start span {
    display: none;
  }
  .af-rubric-start .af-start-short {
    display: block;
    white-space: nowrap;
  }
}
.af-rubric-start {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 12px var(--space-4);
  border: 0;
  border-radius: 10px;
  background: var(--af-grey);
  font-family: var(--font-base);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.af-rubric-start:hover:not(:disabled) {
  background: var(--surface-2);
}
.af-rubric-start:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.af-rubric-start:disabled {
  cursor: default;
  opacity: 0.6;
}
.af-rubric-start b {
  font-size: var(--text-base);
}
.af-rubric-start span {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.35;
}
#af-tag-rubric:not(:empty) {
  margin-top: var(--space-4);
}
#af-tag-rubric:not(:empty) + .af-rubric-field:not([hidden]) {
  margin-top: var(--space-4);
}
.af-tag-rubric-note {
  padding: 8px 12px;
  background: var(--af-grey);
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-wording-card {
  max-width: 760px;
  max-height: 86vh;
  overflow: auto;
}
.af-wording-list {
  display: grid;
  gap: var(--space-4);
  margin: 12px 0;
}
.af-wording-set {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.af-wording-set legend {
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.af-wording-level {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  font-size: var(--text-sm);
  font-weight: 600;
}
.af-wording-level textarea {
  height: auto;
  min-height: 44px;
  padding: 8px var(--space-3);
  font-size: var(--text-sm);
  resize: vertical;
}

/* The footer (redesign PR 3): stays at the bottom of the window while the
   form is in view, with what the work counts toward beside the buttons. */
#new-assess-form > .af-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  align-items: center;
  gap: 8px;
  margin: 0 -16px -16px;
  padding: 12px 16px;
  border-top: 0;
  background: var(--surface);
  border-radius: 0 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px);
  box-shadow:
    0 -1px 0 rgba(0, 0, 0, 0.08),
    0 -8px 20px rgba(0, 0, 0, 0.06);
}
#new-assess-form > .af-actions .btn {
  min-height: 40px;
  padding: 0 var(--space-4);
}
/* "Created …" after Create and Add Another, until the next edit. */
.af-saved-note {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-2);
}
.af-saved-note[hidden] {
  display: none;
}
.af-counts-toward {
  flex: 1;
  margin: 0;
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.4;
}
/* Phone width: the mode cards share the row and the footer wraps, so
   neither widens the form past the window. */
@media (max-width: 600px) {
  .af-card-scoring .af-mode-item {
    flex: 1 1 140px;
    min-width: 0;
  }
  .af-card-scoring .af-mode-card {
    min-width: 0;
    padding: 0 12px;
  }
  #new-assess-form > .af-actions {
    flex-wrap: wrap;
  }
  #new-assess-form > .af-actions .af-counts-toward {
    flex: 1 1 100%;
  }
  #new-assess-form > .af-actions .btn {
    flex: 1 1 auto;
  }
}

/* ── Assignment toolbar ─────────────────────────────────────── */
/* Search — subtle pill, up to 220px, giving way first when the row is tight */
.assess-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 110px;
  max-width: 220px;
  min-width: 110px;
}
.assess-search-input {
  height: var(--control-h);
  font-family: var(--font-base);
  font-size: var(--text-base);
  padding: var(--space-1) 12px var(--space-1) 28px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
  outline: none;
  width: 100%;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.assess-search-input:focus {
  background: var(--surface);
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.assess-search-input::placeholder {
  color: var(--text-3);
}

/* ── Module panels (plan PR 8) ────────────────────────────
   A module is a rounded panel tinted in its colour (--mod-color, set on
   the panel) holding its cards. Header: grip, open/close arrow, colour
   square, editable name, "N Assignments" capsule, delete. */
.mod-folder {
  --mod-color: #6366f1;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--mod-color) 7%, transparent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: visible;
  transition: box-shadow 0.12s;
}
@media (prefers-color-scheme: dark) {
  .mod-folder {
    background: color-mix(in srgb, var(--mod-color) 16%, transparent);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}
/* An assessment dragged over the panel: a blue edge and glow. */
.mod-folder.drag-over {
  box-shadow:
    0 0 0 2px var(--active),
    0 0 0 6px rgba(0, 122, 255, 0.15);
}
.mod-folder-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 2px 4px;
  cursor: pointer;
  user-select: none;
  position: relative;
  min-height: 30px;
}
/* Expand header hit area when an assessment is being dragged over a collapsed folder */
.mod-folder.drag-over:not(.open) .mod-folder-header {
  padding: var(--space-3) 4px;
}
.mod-folder-chevron {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: transform 0.15s;
}
.mod-folder.open .mod-folder-chevron {
  transform: rotate(90deg);
}
.mod-folder-color {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.mod-folder-color:hover {
  transform: scale(1.15);
  transition: transform 0.1s;
}
.mod-folder-color {
  border: 0;
  padding: 0;
}

/* Colour popover (ui.js openColorPop): preset colours, then a Custom row. */
.color-pop {
  position: fixed;
  z-index: var(--z-popover);
  background: var(--surface);
  border-radius: 12px;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.16),
    0 0 0 0.5px var(--overlay-pressed);
  padding: 12px;
  width: 196px;
}
.color-pop-grid {
  display: grid;
  grid-template-columns: repeat(5, 28px);
  gap: 8px;
  justify-content: space-between;
}
.color-pop-opt {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.color-pop-opt.selected,
.color-pop-opt:focus-visible {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--text);
  outline: none;
}
.color-pop-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.color-pop-custom-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}
.color-pop-well {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}
.color-pop-well::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-pop-well::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}
.color-pop-well::-moz-color-swatch {
  border: 0;
  border-radius: 8px;
}
.color-pop-hex {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: 0.875rem var(--font-base);
  color: var(--text);
  background: var(--surface);
}
.color-pop-hex.invalid {
  border-color: var(--score-1);
}
.mod-folder-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.mod-folder-name-input {
  font-family: var(--font-base);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px var(--space-2);
  margin-left: calc(-1 * var(--space-2));
  min-width: 6ch;
  max-width: min(420px, 100%);
  field-sizing: content;
  text-overflow: ellipsis;
  cursor: text;
  outline: none;
  transition:
    border-color 0.12s,
    background 0.12s;
}
.mod-folder-name-input:hover {
  background: rgba(255, 255, 255, 0.6);
}
/* One focus treatment: the app's blue field border and soft ring. */
.mod-folder-name-input:focus {
  background: var(--surface);
  border-color: var(--active) !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15) !important;
  text-overflow: clip;
}
.mod-folder-meta {
  padding: 2px var(--space-2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .mod-folder-meta {
    background: rgba(255, 255, 255, 0.1);
  }
}
.mod-folder-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}
.mod-folder-action {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mod-folder-action:hover {
  background: rgba(118, 118, 128, 0.14);
}
.mod-folder-action.delete:hover {
  color: var(--score-1-dark);
}
.mod-folder-body {
  display: none;
  padding-top: 12px;
}
.mod-folder.open .mod-folder-body,
.mod-folder.is-closing .mod-folder-body {
  display: block;
}
.mod-folder-body .assess-card:last-child {
  margin-bottom: 0;
}
.mod-folder-empty {
  padding: var(--space-6);
  border-radius: 14px;
  border: 1.5px dashed rgba(60, 60, 67, 0.35);
  text-align: center;
  color: var(--text);
  font-size: var(--text-base);
}
/* Drag affordance on assessment cards: the ⠿ grip (.assess-grip) */
.assess-card.dragging {
  opacity: 0.35;
  transform: scale(0.98);
}
/* Two loose cards stacked: the target turns purple with a Create Module
   label under it. */
@keyframes merge-pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0.985);
  }
}
.assess-card.merge-target {
  animation: merge-pulse 0.35s ease-out forwards;
  background: rgba(88, 86, 214, 0.08);
  box-shadow: 0 0 0 2px var(--mod-badge);
  position: relative;
  z-index: 2;
}
.assess-card.merge-target::after {
  content: 'Create Module';
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px var(--space-3);
  border-radius: 12px;
  background: var(--mod-badge);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(88, 86, 214, 0.35);
  z-index: 3;
  pointer-events: none;
}
/* Reorder by drag: a blue line in the gap above or below the card the
   dragged one will land beside. Drawn outside the card, so nothing moves. */
.assess-card.drop-before,
.assess-card.drop-after {
  position: relative;
}
.assess-card.drop-before::before,
.assess-card.drop-after::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  height: 4px;
  border-radius: 2px;
  background: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
  pointer-events: none;
}
.assess-card.drop-before::before {
  top: -8px;
}
.assess-card.drop-after::after {
  bottom: -8px;
}
/* Module drag grip */
.mod-folder-grip {
  color: var(--text-3);
  font-size: 15px;
  cursor: grab;
  flex-shrink: 0;
  user-select: none;
  padding: 4px 2px;
  margin: -4px 0;
}
.mod-folder-grip:active {
  cursor: grabbing;
}
.mod-folder.dragging {
  opacity: 0.35;
}
/* Drop zones between modules for reordering — large hit area, thin visual line */
.mod-drop-zone {
  height: 0;
  padding: var(--space-4) 0;
  margin: calc(-1 * var(--space-4)) 0;
  position: relative;
  z-index: 5;
  border-radius: 2px;
  transition:
    margin 0.12s,
    padding 0.12s;
}
.mod-drop-zone::after {
  content: '';
  display: block;
  height: 3px;
  border-radius: 2px;
  background: transparent;
  transition:
    background 0.12s,
    box-shadow 0.12s;
}
.mod-drop-zone.drag-over {
  padding: 16px 0;
  margin: calc(-1 * var(--space-3)) 0;
}
.mod-drop-zone.drag-over::after {
  background: var(--active);
  box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}
/* Add module button at bottom */
.add-module-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  margin-top: 8px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-family: var(--font-base);
  font-size: var(--text-md);
  font-weight: 500;
  transition:
    background-color 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.add-module-btn:hover {
  border-color: var(--active);
  color: var(--link);
  background: rgba(0, 122, 255, 0.03);
}
/* Ungrouped Assignments: a plain heading over loose cards, no panel. */
.mod-folder.no-module {
  padding: 0;
  background: none;
  box-shadow: none;
}
.mod-folder.no-module .mod-folder-header {
  padding: 8px 2px 2px;
}
.mod-folder.no-module .mod-folder-meta {
  background: rgba(118, 118, 128, 0.12);
}
.mod-folder.no-module.empty-target .mod-folder-header {
  opacity: 0.55;
}
.mod-folder.no-module.drag-over {
  border-radius: 18px;
}
.mod-folder.no-module.empty-target.drag-over .mod-folder-header {
  opacity: 1;
}

/* Core competency badge on assess header */
.cc-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 1px var(--space-2);
  border-radius: var(--radius);
  border: 1.5px solid;
  background: transparent;
  letter-spacing: var(--tracking-wide);
}

/* Core competency chips in assessment form */
.af-cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.af-cc-chip {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) 12px;
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 500;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--divider-subtle);
  color: var(--text-2);
  cursor: pointer;
  transition:
    background-color 0.12s,
    border-color 0.12s,
    color 0.12s;
  white-space: nowrap;
  max-width: 100%;
}
/* On a phone-width form a long competency name wraps inside its chip. */
@media (max-width: 480px) {
  .af-cc-chip {
    white-space: normal;
    text-align: left;
  }
}
.af-cc-chip:hover {
  background: var(--overlay-pressed);
  color: var(--text);
}
/* Chosen: solid blue, the dot white (redesign PR 14). */
.af-cc-chip.active,
.af-cc-chip.active:hover {
  border-color: var(--active-fill);
  background: var(--active-fill);
  color: #fff;
  font-weight: 600;
}
.af-cc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.af-cc-chip.active .af-cc-dot {
  /* The dot's colour is set inline. */
  background: #fff !important;
}

/* ── Rubric Bank ────────────────────────────────────────────── */
/* The Rubrics button's window (teacher/rubric-bank.js). It sits under the
   rubric editor (5000) and the confirm dialogs (10002) it opens. */
.rb-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0, 0, 0, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in var(--duration-normal) ease-out;
}
.rb-card {
  width: min(1184px, 100%);
  height: min(760px, 100%);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-base);
  color: var(--text);
}
.rb-head {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  flex-shrink: 0;
  padding: 0 12px 0 24px;
  border-bottom: 1px solid var(--divider-medium);
}
.rb-heading {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}
.rb-head-gap {
  flex: 1;
}
.rb-scope {
  display: flex;
  margin-left: 8px;
  padding: 2px;
  border-radius: 9px;
  background: var(--seg-track);
}
.rb-scope-btn {
  height: 30px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text-2);
  cursor: pointer;
}
.rb-scope-btn.is-active {
  background: var(--seg-thumb);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  font-weight: 600;
  color: var(--text);
}
.rb-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rb-close:hover {
  background: var(--overlay-hover);
}
.rb-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* Left: search and the list */
.rb-side {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--divider-medium);
  background: var(--bg);
}
.rb-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin: 12px 12px 4px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-3);
}
.rb-search:focus-within {
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}
.rb-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text);
}
/* The box shows focus; the input inside it does not draw a second ring. */
.rb-search input:focus,
.rb-search input:focus-visible {
  outline: none;
  box-shadow: none;
}
.rb-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rb-group {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  padding: 12px 12px 4px;
}
/* All My Classes: one collapsible group per class */
.rb-class {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 12px 12px 4px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  text-align: left;
  cursor: pointer;
}
.rb-class:hover {
  color: var(--text);
}
.rb-chev {
  flex-shrink: 0;
  transition: transform var(--duration-micro) var(--ease-out);
}
.rb-class[aria-expanded='true'] .rb-chev {
  transform: rotate(90deg);
}
.rb-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: var(--space-2) 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.rb-row:hover {
  background: var(--overlay-hover);
}
.rb-row.is-selected {
  background: var(--active-light);
}
.rb-row:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: -2px;
}
.rb-row-name {
  font-size: var(--text-base);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-row.is-selected .rb-row-name {
  color: var(--link);
}
.rb-row-meta {
  font-size: var(--text-xs);
  color: var(--text-3);
}
.rb-empty-list {
  padding: 16px 12px;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.rb-hint {
  padding: var(--space-3) 16px;
  border-top: 1px solid var(--divider-subtle);
  font-size: var(--text-xs);
  color: var(--text-3);
}

/* Right: the selected rubric */
.rb-pane {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 24px;
}
.rb-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.rb-title-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.rb-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.rb-rename {
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px solid var(--active);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-width: 320px;
}
.rb-rename.is-invalid {
  border-color: var(--danger);
}
.rb-sub {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.rb-linked {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--space-2);
  border-radius: 12px;
  background: var(--active-light);
  color: var(--link);
  font-size: var(--text-xs);
  font-weight: 600;
}
.rb-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rb-btn {
  height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  cursor: pointer;
}
.rb-btn:hover {
  background: var(--overlay-hover);
}
.rb-btn-primary {
  background: var(--active-fill);
  border-color: var(--active-fill);
  color: #fff;
  font-weight: 600;
}
.rb-btn-primary:hover {
  background: var(--active-fill);
  filter: brightness(0.92);
}
.rb-btn-new,
.rb-btn-link {
  color: var(--link);
  font-weight: 600;
}
.rb-more {
  width: 36px;
  padding: 0;
  justify-content: center;
}
.rb-more.is-open {
  background: var(--surface-2);
}
.rb-more-wrap {
  position: relative;
}
.rb-menu {
  position: absolute;
  right: 0;
  top: 44px;
  z-index: 2;
  width: 200px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.rb-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: var(--text-base);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.rb-menu button:hover,
.rb-menu button:focus-visible {
  background: var(--overlay-hover);
  outline: none;
}
.rb-menu button.is-danger {
  color: var(--danger);
}
.rb-menu-sep {
  height: 1px;
  margin: var(--space-2) 0;
  background: var(--divider-medium);
}

/* The rubric, read only, in the class's level order */
.rb-grid-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.rb-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px 0;
  margin: 0 calc(-1 * var(--space-2));
  table-layout: fixed;
}
.rb-grid th,
.rb-grid td {
  text-align: left;
  vertical-align: top;
}
.rb-crit-head {
  width: 210px;
  padding: 8px var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-3);
}
.rb-level-head {
  padding: 8px var(--space-3);
  border-radius: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}
.rb-level-head span {
  display: inline-block;
}
.rb-level-value {
  float: right;
}
.rb-level-head.l4 {
  background: var(--score-4-bg);
  color: var(--score-4-text);
}
.rb-level-head.l3 {
  background: var(--score-3-bg);
  color: var(--score-3-text);
}
.rb-level-head.l2 {
  background: var(--score-2-bg);
  color: var(--score-2-text);
}
.rb-level-head.l1 {
  background: var(--score-1-bg);
  color: var(--score-1-text);
}
/* Class So Far: teacher-only counts above the grid. */
.rb-stats {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.rb-stats-label {
  font-weight: 600;
  color: var(--text-2);
}
.rb-stats-scope {
  height: 28px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text);
}
.rb-stats-toggle {
  margin-left: auto;
  color: var(--text-2);
  cursor: pointer;
}
/* The criterion cell: name, chips and weight, with its pie beside them. */
.rb-crit-wrap {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.rb-crit-main {
  flex: 1;
  min-width: 0;
}
.rb-pie {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--divider-subtle);
}
/* A custom-criteria rubric's overall levels, pinned under the grid. */
.rb-overall {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
  padding-top: 12px;
  border-top: 1px solid var(--divider-medium);
}
.rb-overall-label {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}
.rb-overall-label span {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--text-3);
}
.rb-overall-bar {
  flex: 1;
  display: flex;
  gap: 2px;
  height: 22px;
}
.rb-dist-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: default;
}
.rb-crit,
.rb-cell {
  padding: 12px var(--space-3);
  border-top: 1px solid var(--divider-medium);
}
.rb-crit {
  font-weight: 400;
}
.rb-crit-name {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.rb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-2);
}
.rb-chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  background: var(--bg-secondary);
  color: var(--text-2);
  font-size: var(--text-xs);
}
/* A competency with no match in this class, shown before copying. */
.rb-chip.is-missing {
  background: transparent;
  border: 1px dashed var(--score-2);
  color: var(--score-2-text);
}
.rb-note {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-2);
}
.rb-note svg {
  flex-shrink: 0;
  color: var(--text-3);
}
.rb-foot.rb-legend {
  justify-content: flex-start;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.rb-legend > span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.rb-weight {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-3);
}
.rb-cell {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: break-word;
}
.rb-cell-value {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-3);
}
.rb-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--divider-medium);
}
.rb-used {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  min-width: 0;
}
.rb-used-label {
  margin-right: 4px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}
.rb-use-chip.is-static,
.rb-use-more.is-static {
  cursor: default;
}
.rb-use-chip {
  height: 26px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  font: inherit;
  font-size: var(--text-xs);
  color: var(--link);
  cursor: pointer;
}
.rb-use-chip:hover {
  border-color: var(--active);
}
.rb-use-more {
  height: 26px;
  padding: 0 8px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.rb-use-more:hover {
  color: var(--link);
}
.rb-empty-pane {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
}
.rb-empty-title {
  font-size: var(--text-md);
  color: var(--text-2);
}
.rb-empty-actions {
  display: flex;
  gap: 8px;
}
/* Smaller laptops: a narrower list and criterion column leave the four
   level columns room for whole words. */
@media (max-width: 1240px) {
  .rb-side {
    width: 240px;
  }
  .rb-crit-head {
    width: 176px;
  }
  .rb-pie {
    width: 36px;
    height: 36px;
  }
  .rb-pane {
    padding: var(--space-4) var(--space-4);
  }
}
@media (max-width: 760px) {
  .rb-overlay {
    padding: 0;
  }
  .rb-card {
    height: 100%;
    border-radius: 0;
  }
  .rb-body {
    flex-direction: column;
  }
  .rb-side {
    width: auto;
    max-height: 40%;
    border-right: none;
    border-bottom: 1px solid var(--divider-medium);
  }
  .rb-hint {
    display: none;
  }
}
/* Delete confirmation: the assessments a rubric is in, and what goes. */
.confirm-card.rb-del-card {
  max-width: 480px;
}
.rb-del-card .confirm-message {
  margin-bottom: 12px;
}
.rb-del-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
}
.rb-del-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 var(--space-4);
  font-family: var(--font-base);
  font-size: var(--text-base);
  color: var(--text);
}
.rb-del-row + .rb-del-row {
  border-top: 1px solid var(--divider-subtle);
}
.rb-del-meta {
  flex-shrink: 0;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.rb-del-warn,
.rb-del-note {
  margin-bottom: 12px;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-2);
}
.rb-del-warn.is-danger {
  color: var(--danger);
  font-weight: 600;
}
.rb-del-note {
  margin-bottom: 20px;
  color: var(--text-3);
}
@media print {
  .rb-overlay {
    display: none;
  }
}

/* Rubric editor modal overlay */
.rubric-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: rubricFadeIn 0.15s ease;
}
@keyframes rubricFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.rubric-editor {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 80vw;
  max-width: 1200px;
  min-width: 700px;
  height: 85vh;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  animation: rubricSlideIn 0.15s ease;
}
@keyframes rubricSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal header — sticky */
.rubric-editor-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.rubric-editor-title {
  font-family: var(--font-base);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.rubric-editor-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: var(--text-lg);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.1s,
    color 0.1s;
}
.rubric-editor-close:hover {
  border-color: var(--active);
  color: var(--text);
}

/* Modal body — scrollable */
.rubric-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* Rubric name */
.rubric-name-input {
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--text-lg);
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  outline: none;
  margin-bottom: 20px;
}
.rubric-name-input:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

/* Criterion block — accordion */
.rubric-criterion {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--surface);
  overflow: hidden;
}
.rubric-criterion.collapsed .rubric-criterion-body {
  display: none;
}
.rubric-criterion-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--overlay-hover);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.rubric-criterion.collapsed .rubric-criterion-header {
  border-bottom: none;
}
.rubric-criterion.collapsed .rubric-criterion-header:hover {
  background: rgba(0, 122, 255, 0.04);
}
.rubric-criterion-chevron {
  font-size: var(--text-md);
  color: var(--text-3);
  transition: transform 0.15s;
  width: 12px;
  flex-shrink: 0;
}
.rubric-criterion.collapsed .rubric-criterion-chevron {
  transform: rotate(-90deg);
}
.rubric-criterion-num {
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
  background: var(--active-fill);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rubric-criterion-name {
  flex: 0 1 260px;
  min-width: 120px;
  font-family: var(--font-base);
  font-size: var(--text-md);
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  outline: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.rubric-criterion-name:hover {
  border-color: var(--border);
}
.rubric-criterion-name:focus {
  background: var(--surface);
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}
/* Summary of chosen competencies; only shown while collapsed */
.rubric-header-chips {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow: hidden;
}
.rubric-criterion:not(.collapsed) .rubric-header-chips {
  visibility: hidden;
}
.rubric-header-chip {
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-2);
  padding: 2px var(--space-2);
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--sec) 35%, transparent);
  background: color-mix(in srgb, var(--sec) 10%, transparent);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1;
}
.rubric-criterion-weight-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
.rubric-criterion-weight {
  width: 54px;
  padding: 4px var(--space-2);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-align: right;
}
.rubric-criterion-weight:focus {
  outline: none;
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}
.rubric-criterion-delete {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.1s,
    border-color 0.1s,
    color 0.1s;
}
.rubric-criterion-delete:hover {
  background: rgba(211, 47, 47, 0.08);
  color: var(--score-1);
  border-color: rgba(211, 47, 47, 0.2);
}

/* Criterion body: competencies, then level descriptors */
.rubric-criterion-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: 16px var(--space-4) var(--space-4);
}
.rubric-part-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 8px;
}
.rubric-part-hint {
  margin-left: 8px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-3);
}
.rubric-part-note {
  margin: -2px 0 8px;
  font-size: var(--text-xs);
  color: var(--text-2);
}
.rubric-header-chip-overall {
  --sec: var(--text-3);
  color: var(--text-3);
}
.rubric-comp-group {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  margin: var(--space-3) 0 var(--space-2);
}
.rubric-comp-group:first-of-type {
  margin-top: 0;
}
.rubric-comp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.rubric-comp-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 12px var(--space-1) var(--space-2);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.1s,
    border-color 0.1s;
}
.rubric-comp-chip:hover:not(:disabled) {
  border-color: var(--sec);
}
.rubric-comp-chip.selected {
  border-color: var(--sec);
  background: color-mix(in srgb, var(--sec) 12%, var(--surface));
}
.rubric-comp-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.rubric-comp-mark {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--sec);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.rubric-comp-chip.selected .rubric-comp-mark {
  background: var(--sec);
}
.rubric-comp-used {
  font-size: var(--text-xs);
  color: var(--text-3);
}
.rubric-comp-used::before {
  content: '\00B7  ';
}

/* Level descriptors — one column per level, points in the header */
.rubric-levels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.rubric-level-card {
  border-right: 1px solid var(--border);
  border-top: 3px solid var(--lvl);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.rubric-level-card:last-child {
  border-right: none;
}
.rubric-level-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: var(--space-2) var(--space-3) var(--space-2) 12px;
  border-bottom: 1px solid var(--border);
}
.rubric-level-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--lvl);
}
.rubric-level-pts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-3);
}
.rubric-level-value {
  width: 44px;
  padding: 2px var(--space-2);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  text-align: right;
}
.rubric-level-value:hover {
  border-color: var(--border);
}
/* The spin buttons cover the digits at this width */
.rubric-level-value {
  appearance: textfield;
  -moz-appearance: textfield;
}
.rubric-level-value::-webkit-inner-spin-button,
.rubric-level-value::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rubric-level-value:focus {
  outline: none;
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}
.rubric-level-text {
  flex: 1;
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--text-base);
  border: none;
  background: transparent;
  color: var(--text);
  outline: none;
  resize: none;
  min-height: 150px;
  padding: 12px;
  line-height: 1.55;
}
.rubric-level-text:focus {
  background: rgba(0, 122, 255, 0.03);
}
.rubric-level-text::placeholder {
  color: var(--text-3);
}

/* Advanced Rubrics: a Standard | Advanced switch in the header and, in
   Advanced, a checkbox list under each level's descriptor (Rubric Bank plan
   §5, mockup C9). */
.rubric-style-seg {
  flex-shrink: 0;
}
.rubric-style-hint {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-2);
}
.rubric-editor.advanced .rubric-level-text {
  min-height: 96px;
}
/* Single-Point: one wide Proficient box; the points stay with the levels
   picked when scoring. */
.rubric-editor.single-point .rubric-levels {
  grid-template-columns: 1fr;
}
.rubric-editor.single-point .rubric-level-pts {
  display: none;
}
.rubric-editor.single-point .rubric-level-text {
  min-height: 72px;
}
.rubric-check-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px var(--space-3);
  border-top: 1px dashed var(--border);
}
.rubric-check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 1px 0;
  border-radius: var(--radius-sm);
}
.rubric-check-row.dragging {
  opacity: 0.5;
}
.rubric-check-row.drop-before {
  box-shadow: 0 -2px 0 var(--active);
}
.rubric-check-row.drop-after {
  box-shadow: 0 2px 0 var(--active);
}
.rubric-check-handle {
  flex-shrink: 0;
  width: 10px;
  color: var(--text-3);
  font-size: var(--text-sm);
  line-height: 1;
  cursor: grab;
  user-select: none;
}
.rubric-check-box {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--text-3);
  border-radius: 3px;
  box-sizing: border-box;
}
.rubric-check-input {
  flex: 1;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  line-height: 1.35;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.rubric-check-input:hover {
  border-color: var(--border);
}
.rubric-check-input:focus {
  outline: none;
  border-color: var(--active);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}
.rubric-check-input::placeholder {
  color: var(--text-3);
}
.rubric-check-remove {
  flex-shrink: 0;
  padding: 2px var(--space-1);
  font-size: var(--text-xs);
  line-height: 1;
  color: var(--text-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
}
.rubric-check-row:hover .rubric-check-remove,
.rubric-check-row:focus-within .rubric-check-remove,
.rubric-check-remove:focus-visible {
  opacity: 1;
}
.rubric-check-remove:hover {
  color: var(--score-1);
  background: var(--bg);
}
.rubric-add-check-btn {
  align-self: flex-start;
  margin: 4px 0 0 16px;
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.rubric-add-check-btn:hover {
  border-color: var(--active);
  color: var(--text);
}
@media (max-width: 900px) {
  .rubric-levels {
    grid-template-columns: repeat(2, 1fr);
  }
  .rubric-level-card:nth-child(2) {
    border-right: none;
  }
}

/* Footer — sticky */
.rubric-editor-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-4) 28px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 0 0 14px 14px;
}
.rubric-editor-footer .btn {
  min-width: 100px;
}
.rubric-add-criterion-btn {
  margin-right: auto;
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition:
    background-color 0.1s,
    border-color 0.1s,
    color 0.1s;
}
/* Two add buttons sit together on the left; the second takes the gap. */
.rubric-add-criterion-btn:has(+ .rubric-add-criterion-btn) {
  margin-right: 0;
}
.rubric-add-criterion-btn:hover {
  border-color: var(--active);
  color: var(--text);
  background: rgba(0, 122, 255, 0.03);
}

/* Rubric selector in assessment form */
.af-rubric-select {
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--text-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text);
  outline: none;
}
.af-rubric-select:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}
.af-rubric-info {
  font-size: var(--text-sm);
  color: var(--text-3);
  font-style: italic;
  margin-top: 4px;
}
.af-counts-as {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin: -4px 0 12px;
}
.af-counts-as:empty {
  display: none;
}
/* Show Students the Factored Score: a switch under the share bar, points
   work at a Factor other than 1× (2026-11-18). */
.af-factored {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.af-factored[hidden] {
  display: none;
}
.af-factored-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.af-factored .af-label {
  margin: 0;
}
.af-factored-hint {
  font-size: var(--text-sm);
  color: var(--text-2);
}
/* The share bar: this assessment's part of its category, in blue, the
   others grey (2026-11-06). */
.af-share {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.af-share-bar {
  display: flex;
  gap: 2px;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
}
.af-share-seg {
  flex: 0 1 0;
  min-width: 1px;
  background: var(--border);
}
.af-share-seg.af-share-self {
  background: var(--active);
}
.af-share-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-sm);
}
.af-share-pct {
  font-weight: 700;
  color: var(--link);
  white-space: nowrap;
}
.af-share-cat {
  color: var(--text-2);
  text-align: right;
  overflow-wrap: anywhere;
}
.af-untagged-note {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin: var(--space-2) 0 12px;
}
/* Why scored work in a class with categories needs one (shown while
   none is chosen in the form or the copy dialog). */
.af-category-hint {
  font-size: var(--text-sm);
  color: var(--text-2);
  margin: 4px 0 0;
}
.af-category-hint[hidden] {
  display: none;
}
/* Red once a save has stopped at the field. */
.af-input[aria-invalid='true'] + .af-category-hint {
  color: var(--score-1);
}
.grader-needs-category {
  margin-top: 2px;
}
.grader-needs-category[hidden] {
  display: none;
}

/* Rubric badge on assessment cards */
.rubric-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 1px var(--space-2);
  border-radius: var(--radius);
  border: 1.5px solid var(--text-3);
  color: var(--text-3);
  background: transparent;
}

/* ── Rubric Speedgrader ──────────────────────────────────── */
.rsg-grid {
  margin: 0 -16px;
}

/* A student: the name at 21px with status and Comment beside it, and the
   criteria indented under it. Students are parted by an 8px grey band
   across the card, so where one student ends and the next begins is plain
   at a glance; a hairline let teachers lose track of whose row was whose. */
.rsg-student {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 16px 16px var(--space-4);
}
.rsg-student + .rsg-student {
  border-top: 8px solid var(--surface-2);
}
.rsg-student-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
/* Group work on the page: the group's members under its name, each with
   their own status and ⋯ menu (Group grading). */
.rsg-group-members {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ldg-grid .rsg-group-members {
  align-items: center;
  padding: 0 16px 12px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.rsg-group-member {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 var(--space-2) 0 var(--space-3);
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.08);
}
.rsg-group-member.is-separate {
  padding-right: var(--space-3);
}
.rsg-group-member-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.rsg-group-member-note {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}
.rsg-group-member .grader-member-menu {
  top: 42px;
}
.rsg-separate-note {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.rsg-student-name {
  font-size: 1.3125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
}
.rsg-status .grader-status-btn {
  height: 24px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}
.rsg-status .grader-status-sep {
  margin: var(--space-2) 0;
}
.rsg-student-head .score-row-action {
  margin-left: auto;
}
.rsg-student-head .row-fill-btn {
  width: 28px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
}
.rsg-student-head .row-fill-btn:hover {
  background: rgba(118, 118, 128, 0.2);
  color: var(--text);
}

/* The Overall Comment under a student's criteria: one line, three once
   clicked or while it holds text. Plain field edges, blue when focused. */
.rsg-overall {
  padding-left: 20px;
}
.rsg-overall-comment {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: var(--space-2) 12px;
  border: 1px solid #aeaeb2;
  border-radius: 9px;
  background: var(--surface);
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.4;
  color: var(--text);
  resize: none;
  overflow: hidden;
  outline: none;
  transition:
    height var(--duration-fast) var(--ease-out),
    border-color var(--duration-micro) var(--ease-out),
    box-shadow var(--duration-micro) var(--ease-out);
}
.rsg-overall-comment::placeholder {
  color: var(--text-2);
}
.rsg-overall-comment.has-text {
  height: calc(3 * 1.4em + 16px);
  overflow-y: auto;
}
/* It grows to three lines; scrolling comes on once it has, so a long
   comment shows no scrollbar while it opens. */
.rsg-overall-comment:focus {
  height: calc(3 * 1.4em + 16px);
  overflow-y: auto;
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
  transition:
    height var(--duration-fast) var(--ease-out),
    border-color var(--duration-micro) var(--ease-out),
    box-shadow var(--duration-micro) var(--ease-out),
    overflow 0s linear var(--duration-fast);
  transition-behavior: allow-discrete;
}
@media (prefers-color-scheme: dark) {
  .rsg-overall-comment {
    border-color: var(--border);
  }
}

/* Criteria: name (and under it the checklist count on Advanced rubrics);
   the level control to the right, then the comment button. */
.rsg-criteria {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 20px;
}
.rsg-criterion-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-radius: 9px;
}
.rsg-criterion-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: 2px;
  min-width: 0;
}
.rsg-criterion-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.rsg-tag-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}
.rsg-crit-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* The level control: a grey track, the chosen level solid with white text. */
.rsg-levels {
  display: flex;
  margin-top: 4px;
  padding: 2px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.12);
}
.rsg-level {
  flex: 1;
  min-width: 0;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s var(--ease-out);
}
.rsg-level-sep {
  width: 1px;
  flex-shrink: 0;
  margin: var(--space-2) 0;
  background: rgba(60, 60, 67, 0.25);
}
.rsg-level.active + .rsg-level-sep,
.rsg-level-sep:has(+ .rsg-level.active) {
  background: transparent;
}
@media (prefers-color-scheme: dark) {
  .rsg-level-sep {
    background: var(--divider-heavy);
  }
}
.rsg-level:hover:not(.active) {
  background: rgba(118, 118, 128, 0.12);
}
.rsg-level.active {
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}
.rsg-level.active.l4 {
  background: var(--score-4);
}
.rsg-level.active.l3 {
  background: var(--score-3);
}
.rsg-level.active.l2 {
  background: var(--score-2);
}
.rsg-level.active.l1 {
  background: var(--score-1);
}
/* Mixed indicator */
.rsg-level.active.mixed {
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.2) 3px,
    rgba(255, 255, 255, 0.2) 5px
  );
}

/* ── Ledger: Complete/Incomplete and points rows ───────────────
   One line per student: Name · Mark · Status · Overall Comment, rows running to
   the card's edges with hairlines between, the tally and fill actions on
   top and, for points, the class line at the foot. */
.ldg-grid {
  --ldg-cols: 220px max-content auto minmax(0, 1fr);
  margin: 0 -16px;
}
.ldg-grid.pts-grid {
  --ldg-cols: 220px 230px auto minmax(0, 1fr);
}
.ldg-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 16px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.ldg-tally {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text);
}
.ldg-tally b {
  color: var(--text);
  font-weight: 700;
}
.ldg-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.ldg-action {
  height: 28px;
  padding: 0 var(--space-3);
  border: none;
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.12);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.ldg-action:hover {
  background: rgba(118, 118, 128, 0.2);
}
.ldg-action + .ldg-action {
  background: rgba(0, 122, 255, 0.1);
  color: var(--link);
}
.ldg-action + .ldg-action:hover {
  background: rgba(0, 122, 255, 0.16);
}
.ldg-head {
  display: grid;
  grid-template-columns: var(--ldg-cols);
  gap: 12px;
  align-items: center;
  padding: var(--space-2) 16px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text);
}
.score-row.ldg-row {
  display: grid;
  grid-template-columns: var(--ldg-cols);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  margin: 0;
  padding: var(--space-2) 16px;
  border: none;
  border-radius: 0;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.score-row.ldg-row.has-late {
  border-left: none;
}
.score-row.ldg-row:hover {
  /* Undo the generic .score-row:hover widening (margin 0 -8px): these rows
     already carry their padding, so the widening slid every control left. */
  margin: 0;
  padding: var(--space-2) 16px;
  background: transparent;
}
.score-row.ldg-row:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}
.ldg-name {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Mark: two capsules; the chosen one solid in its colour */
.cmp-cell {
  display: flex;
  align-items: center;
}
.ldg-seg {
  display: inline-flex;
  gap: var(--space-2);
}
.cmp-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 15px;
  background: rgba(118, 118, 128, 0.12);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.cmp-btn:hover {
  background: rgba(118, 118, 128, 0.2);
}
.cmp-complete .cmp-icon-bg {
  fill: var(--score-3);
}
.cmp-incomplete .cmp-icon-bg {
  fill: var(--score-1);
}
.cmp-icon-mark {
  stroke: #fff;
}
.cmp-btn.active {
  color: #fff;
  font-weight: 700;
}
.cmp-btn.cmp-complete.active {
  background: var(--score-3);
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}
.cmp-btn.cmp-incomplete.active {
  background: var(--score-1);
  box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}
.cmp-btn.active .cmp-icon-bg {
  fill: #fff;
}
.cmp-btn.cmp-complete.active .cmp-icon-mark {
  stroke: var(--score-3);
}
.cmp-btn.cmp-incomplete.active .cmp-icon-mark {
  stroke: var(--score-1);
}
.score-row.has-status .cmp-cell,
.score-row.has-status .pts-input-cell {
  opacity: 0.3;
  pointer-events: none;
}
/* Status: Late | Excused | Missing, the grader's segmented control */
.ldg-status.grader-status {
  justify-self: start;
}
.ldg-status .grader-status-btn {
  height: 24px;
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}
.ldg-status .grader-status-sep {
  margin: var(--space-2) 0;
}
/* Comment: a blue-tinted pill with its count */
/* The row's Overall Comment field, taking the rest of the row. */
.ldg-overall {
  min-width: 0;
}
/* Points: a grey score box, the maximum and the percent */
.ldg-pts .pts-input-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.ldg-row .gb-pts-input.ldg-pts-input {
  width: 60px;
  height: 30px;
  box-sizing: border-box;
  padding: 0 var(--space-3);
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.12);
  text-align: right;
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
}
.ldg-row .gb-pts-input.ldg-pts-input:focus {
  background: var(--surface);
  border: 1px solid var(--active) !important;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15) !important;
}
.ldg-pts .gb-pts-max {
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text);
}
/* The score times its Factor, beside the score box (2026-11-18): read-only. */
.ldg-pts .gb-pts-max {
  white-space: nowrap;
}
.ldg-pts .gb-pts-factored {
  flex: 0 0 auto;
  min-width: 64px;
  margin-left: 4px;
  font-size: var(--text-sm);
  color: var(--text-2);
  white-space: nowrap;
}
.ldg-pts .gb-pts-live-pct {
  min-width: 44px;
  margin-left: var(--space-4);
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.ldg-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 16px;
  background: rgba(118, 118, 128, 0.06);
  box-shadow: inset 0 0.5px 0 var(--divider-heavy);
  font-size: var(--text-sm);
  color: var(--text);
}
.ldg-stats:empty {
  display: none;
}
.ldg-stats b {
  color: var(--text);
}
.ldg-stats .ldg-name {
  width: 220px;
  font-size: var(--text-sm);
  font-weight: 700;
}
/* − | + inside the chosen level, a stepper like the Advanced rubric's
   chosen tile. The level keeps the same width as the others, its name at
   the left and the signs at the right, white straight on the level colour
   (no lighter track, which would leave white text on a paler fill), the
   picked sign solid white. */
.rsg-levels {
  container-type: inline-size;
}
.rsg-level.has-mods {
  padding: 0;
  justify-content: space-between;
  gap: var(--space-2);
}
.rsg-level-name {
  margin-left: var(--space-3);
  white-space: nowrap;
}
.rsg-mods {
  flex-shrink: 0;
  margin-right: var(--space-1);
  display: flex;
  align-items: center;
  padding: 1px;
  border-radius: 6px;
}
.rsg-mod {
  width: 28px;
  height: 24px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: #fff;
  cursor: pointer;
}
.rsg-mod-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
}
.rsg-mod:hover:not(:disabled):not(.active) {
  background: rgba(255, 255, 255, 0.18);
}
.rsg-mod.active {
  background: #fff;
  font-weight: 700;
}
.rsg-mod.active.l4 {
  color: var(--score-4);
}
.rsg-mod.active.l3 {
  color: var(--score-3);
}
.rsg-mod.active.l2 {
  color: var(--score-2);
}
.rsg-mod.active.l1 {
  color: var(--score-1);
}
.rsg-mod:disabled {
  opacity: 0.35;
  cursor: default;
}
/* Narrow levels: − | + stay beside the name, closer and slimmer, so the
   chosen level is the same height as the others and nothing moves. */
@container (max-width: 720px) {
  .rsg-level.has-mods {
    gap: 2px;
  }
  .rsg-level.has-mods .rsg-level-name {
    margin-left: var(--space-2);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rsg-level.has-mods .rsg-mods {
    margin-right: 1px;
  }
  .rsg-level.has-mods .rsg-mod {
    width: 20px;
  }
}

/* Student assignment status toggles (excused / not submitted) */
.student-status-toggles {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.student-status-row2 {
  margin-top: 2px;
}
.student-status-btn {
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 4px var(--space-3);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  transition:
    background-color 0.15s var(--ease-out),
    border-color 0.15s var(--ease-out),
    color 0.15s var(--ease-out);
  line-height: 1.3;
  min-height: 26px;
}
.student-status-btn:hover {
  border-color: var(--text-2);
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.03);
}
.student-status-btn.active-excused {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
}
.student-status-btn.active-ns {
  background: var(--score-1);
  color: #fff;
  border-color: var(--score-1);
}
.student-status-btn.active-late {
  background: var(--score-2);
  color: #fff;
  border-color: var(--score-2);
}
/* Late indicator — subtle left border, scoring stays fully enabled */
.score-row.has-late {
  border-left: 3px solid var(--score-2);
}
/* Dim scores when student has a status */
.rsg-student.has-status .rsg-criteria {
  opacity: 0.2;
  pointer-events: none;
}
.score-row.has-status .score-row-action,
.rsg-student.has-status .score-row-action {
  opacity: 0.2;
  pointer-events: none;
}

/* ── Comment button — themed pill next to EXC/NS ──── */
.comment-btn {
  padding: 4px 12px;
  border-radius: var(--radius-xl);
  border: none;
  background: var(--active-fill);
  color: #fff;
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s;
  letter-spacing: var(--tracking-tight);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.comment-btn:hover {
  background: var(--btn-hover-blue);
}
.comment-btn .comment-count {
  background: rgba(0, 0, 0, 0.2);
  padding: 0 var(--space-1);
  border-radius: var(--radius);
  font-size: var(--text-2xs);
  font-weight: 700;
  min-width: 14px;
  text-align: center;
}

/* ── Comment popover ──── */
.comment-popover-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--divider-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}
.comment-popover {
  background: var(--surface);
  border-radius: 14px;
  width: 560px;
  max-width: 90vw;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.2),
    0 0 0 0.5px var(--overlay-pressed);
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  animation: commentPopIn 0.15s ease-out;
}
@keyframes commentPopIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.comment-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.comment-popover-title {
  font-family: var(--font-base);
  font-size: var(--text-md);
  font-weight: 650;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
}
.comment-popover-subtitle {
  font-family: var(--font-base);
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 1px;
}
.comment-popover-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition:
    background-color 0.15s,
    color 0.15s;
}
.comment-popover-close:hover {
  background: var(--divider-subtle);
  color: var(--text);
}
.comment-popover-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}
.comment-popover-entries {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.comment-entry {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px var(--space-3);
  border-radius: 8px;
  background: var(--bg);
}
.comment-entry-text {
  flex: 1;
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.45;
}
.comment-entry-date {
  font-family: var(--font-base);
  font-size: 0.75rem;
  color: var(--text-3);
  flex-shrink: 0;
  margin-top: 2px;
}
.comment-entry-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: var(--text-xs);
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 4px;
  flex-shrink: 0;
}
.comment-entry:hover .comment-entry-del,
.comment-entry:hover .comment-entry-edit,
.comment-entry-del:focus-visible,
.comment-entry-edit:focus-visible {
  opacity: 1;
}
.comment-entry-edit {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 4px;
  flex-shrink: 0;
  line-height: 0;
}
.comment-entry-edit svg {
  width: 13px;
  height: 13px;
}
.comment-entry-edit:hover {
  color: var(--active);
}
.comment-entry-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.45;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--space-2) 8px;
  resize: vertical;
}
.comment-entry-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}
.comment-entry-del:hover {
  color: var(--priority);
}
.comment-popover-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--text-3);
  font-size: var(--text-base);
  font-style: italic;
}
.comment-popover-footer {
  display: flex;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}
.comment-popover-capture {
  display: block;
  padding: var(--space-3) 16px var(--space-4);
}
.comment-popover-capture .obsc {
  border: 0;
  padding: 0;
}
.comment-entry-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.comment-entry-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cw-line b {
  font-weight: 600;
}

/* ── Keyboard Navigation Focus ──────────────────────────── */
.rsg-criterion-row.kb-focus {
  outline: 2px solid var(--active);
  outline-offset: 1px;
}

@media (max-width: 1024px) {
  .settings-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── One assessment in several classes (assessment-copy.js) ── */

/* Classes row on the form: this class fixed, every other class a toggle
   chip, all the same width in even columns of four (Colin, Nov 4). */
.af-copy-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 900px) {
  .af-copy-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.af-copy-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  padding: 0 var(--space-4);
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 500;
  text-align: left;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--divider-subtle);
  color: var(--text-2);
  cursor: pointer;
  transition:
    background-color 0.12s,
    color 0.12s,
    border-color 0.12s;
}
.af-copy-chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.af-copy-chip-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  position: relative;
  transition:
    background-color 0.12s,
    border-color 0.12s;
}
.af-copy-chip:hover:not(:disabled) {
  background: var(--overlay-pressed);
  color: var(--text);
}
/* Chosen: solid blue with a white tick (redesign PR 14). */
.af-copy-chip.active,
.af-copy-chip.af-copy-this,
.af-copy-chip.active:hover:not(:disabled) {
  border-color: var(--active-fill);
  background: var(--active-fill);
  color: #fff;
}
.af-copy-chip.active .af-copy-chip-mark,
.af-copy-chip.af-copy-this .af-copy-chip-mark {
  background: transparent;
  border-color: transparent;
}
.af-copy-chip.active .af-copy-chip-mark::after,
.af-copy-chip.af-copy-this .af-copy-chip-mark::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.af-copy-chip.af-copy-this {
  cursor: default;
}
.af-copy-chip:disabled,
.af-copy-chip.af-copy-has {
  opacity: 0.55;
  cursor: default;
}
.af-copy-chip:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
/* Dates: the app's segmented control, labels on one line, with the
   per-class rows lined up under it in the same columns. */
.af-copy-dates-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: var(--space-4);
}
.af-copy-dates-bar[hidden] {
  display: none;
}
.af-copy-dates-label,
.af-copy-date-name {
  width: 200px;
  flex-shrink: 0;
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#af-copy-dates {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--space-3);
}
#af-copy-dates:empty {
  display: none;
}
.af-copy-date-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-md);
}
.af-copy-date-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
}
.af-copy-date-row .af-input {
  width: 170px;
}
@media (max-width: 600px) {
  .af-copy-dates-bar,
  .af-copy-date-row {
    flex-wrap: wrap;
  }
  .af-copy-dates-label,
  .af-copy-date-name {
    width: 100%;
  }
}

/* "Also in Block B" on an assessment card */
.copy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.copy-badge:hover {
  border-color: var(--active);
  color: var(--link);
}
.copy-badge:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 1px;
}

/* Dialogs */
.copy-dialog .copy-dialog-card {
  max-width: 560px;
  width: calc(100% - 32px);
  text-align: left;
}
.copy-dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-3) 0 16px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: var(--text-md);
  color: var(--text);
}
.copy-review-class {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.copy-review-name {
  font-weight: 600;
}
.copy-review-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.copy-review-field .af-input {
  width: auto;
  min-width: 180px;
}
.copy-review-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-md);
  color: var(--text);
  cursor: pointer;
}
.copy-review-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--text);
  flex-shrink: 0;
}
.copy-review-check.af-copy-has {
  color: var(--text-3);
  cursor: default;
}
.copy-review-note {
  line-height: 1.4;
}
.copy-review-muted {
  color: var(--text-3);
}
.copy-change-list {
  margin: 0;
  padding-left: var(--space-6);
  color: var(--text-2);
  line-height: 1.5;
}
.copy-from-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ── Add From Another Class (teacher/add-from-class.js) ──────────────
   The top (title, class chips, search) and the buttons stay put; only the
   list scrolls. Rows are a grid, so titles, categories, scoring and dates
   line up however long a title is. */
.afrom-overlay {
  padding: 24px 16px;
  box-sizing: border-box;
  /* Opens at once: the list is what the teacher came for. */
  animation: none;
}
.afrom-card {
  --afrom-cols: 18px minmax(0, 1fr) 180px 132px 92px;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: min(760px, 100%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-base);
  color: var(--text);
  overflow: hidden;
}
.afrom-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px var(--space-4);
}
.afrom-title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}
.afrom-what {
  margin: -8px 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-2);
}
.afrom-what strong {
  font-weight: 600;
  color: var(--text);
}
.afrom-from {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.afrom-label {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}
.afrom-classes {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
}
.afrom-class {
  max-width: 100%;
  height: var(--control-h);
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--divider-subtle);
  color: var(--text-2);
  cursor: pointer;
}
.afrom-class:hover {
  background: var(--overlay-pressed);
  color: var(--text);
}
.afrom-class[aria-checked='true'] {
  border-color: var(--active-fill);
  background: var(--active-fill);
  color: #fff;
}
.afrom-class:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.afrom-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.afrom-search {
  flex: 1 1 220px;
}
.afrom-select {
  flex: 0 1 190px;
  min-width: 0;
  height: var(--control-h);
  padding: 0 8px;
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.afrom-cols,
.afrom-row {
  display: grid;
  grid-template-columns: var(--afrom-cols);
  column-gap: var(--space-4);
  align-items: center;
  padding: 0 24px;
}
.afrom-cols {
  padding-top: 8px;
  padding-bottom: 8px;
  border-top: 1px solid var(--divider-medium);
  border-bottom: 1px solid var(--divider-medium);
  background: var(--bg);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
}
.afrom-col-all {
  cursor: pointer;
}
.afrom-box {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--active);
  cursor: pointer;
}
.afrom-box:disabled {
  cursor: default;
}
.afrom-list {
  flex: 1 1 auto;
  min-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.afrom-list.afrom-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  font-size: var(--text-base);
  color: var(--text-2);
  text-align: center;
}
.afrom-row {
  min-height: 38px;
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  box-sizing: border-box;
  border-bottom: 1px solid var(--divider-subtle);
  font-size: var(--text-base);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.afrom-row:last-child {
  border-bottom: 0;
}
.afrom-row:hover {
  background: var(--divider-subtle);
}
.afrom-row.is-on,
.afrom-row.is-on:hover {
  background: var(--active-light);
}
.afrom-row:has(.afrom-box:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--active);
}
.afrom-row.is-off {
  color: var(--text-3);
  cursor: default;
}
.afrom-row.is-off:hover {
  background: none;
}
.afrom-title-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  min-width: 0;
}
.afrom-name {
  min-width: 0;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.afrom-cell {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.afrom-row.is-off .afrom-cell {
  color: var(--text-3);
}
.afrom-date {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.afrom-chip {
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: var(--radius-xl);
  background: var(--divider-subtle);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
}
.afrom-chip-warn {
  background: var(--score-2-bg);
  color: var(--text);
}
.afrom-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-top: 1px solid var(--divider-medium);
}
.afrom-status {
  flex: 1;
  min-width: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text-2);
}
.afrom-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
}
.afrom-link:hover {
  text-decoration: underline;
}
.afrom-foot .confirm-ok {
  min-width: 76px;
}
.afrom-foot .confirm-ok:disabled {
  opacity: 0.45;
  cursor: default;
}
/* A narrow window: Scoring gives its room to the titles. */
@media (max-width: 700px) {
  .afrom-card {
    --afrom-cols: 18px minmax(0, 1fr) 120px 84px;
  }
  .afrom-scoring {
    display: none;
  }
  .afrom-head,
  .afrom-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .afrom-cols,
  .afrom-row {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* Rubric editor: note about scored criteria whose top value changed. */
.rubric-guard-note {
  margin: 0 0 var(--space-3);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--score-2-bg);
  color: var(--text-1);
  font-size: var(--text-sm);
  line-height: 1.4;
}

/* ── Criterion comment icon + Print rubrics (rubric handouts) ─────── */
.rsg-criterion-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The criterion comment: a labelled blue button under the criterion's name,
   beside the checklist button and the same size, solid blue once the
   criterion has a comment. C opens it on the focused row. */
.rsg-crit-comment {
  height: 26px;
  padding: 0 var(--space-2);
  border: none;
  border-radius: 7px;
  background: rgba(0, 122, 255, 0.12);
  color: #0058d0;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
/* A level's words, joined under the level bar in its grey: part of the
   rubric, not feedback. The chosen level's cell is the one that reads dark. */
.rsg-words {
  display: flex;
  margin-top: calc(-1 * var(--space-1));
  padding: var(--space-2) 2px var(--space-2);
  border-radius: 0 0 9px 9px;
  background: rgba(118, 118, 128, 0.07);
}
.rsg-words-col {
  flex: 1;
  min-width: 0;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--text-3, var(--text-2));
  overflow-wrap: anywhere;
}
.rsg-words-col + .rsg-words-col {
  border-left: 1px solid var(--divider-subtle, rgba(0, 0, 0, 0.06));
}
.rsg-words-col.is-chosen {
  color: var(--text);
  font-weight: 600;
}
.rsg-crit-comment svg {
  width: 13px;
  height: 13px;
}
/* The saved comment, read in place under the levels. */
/* The teacher's comment to the student, marked as feedback: a blue rule and
   its name, so it never reads as the rubric's own words. */
.rsg-crit-note {
  margin-top: var(--space-2);
  padding: 1px 4px 1px var(--space-3);
  border-left: 3px solid var(--link);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.rsg-crit-note::before {
  content: 'Comment  ';
  font-weight: 700;
  color: var(--link);
}
.rsg-crit-comment:hover,
.rsg-crit-comment:focus-visible {
  background: rgba(0, 122, 255, 0.2);
}
.rsg-crit-comment.has-comment {
  background: #0062d6;
  color: #fff;
}
.rsg-crit-comment.has-comment:hover,
.rsg-crit-comment.has-comment:focus-visible {
  background: #0058c0;
}
.rsg-crit-comment.has-comment svg {
  fill: currentColor;
  fill-opacity: 0.35;
}
@media (prefers-color-scheme: dark) {
  .rsg-crit-comment {
    color: #64a8ff;
  }
}
/* The criterion comment, typed in place under the levels: the Overall
   Comment's field (plain edges, blue when focused), one line that grows
   with the text. The count shows while typing, amber past two printed
   lines on a quarter sheet. */
.rsg-crit-comment.is-open:not(.has-comment) {
  background: rgba(0, 122, 255, 0.2);
}
.rsg-crit-edit {
  margin-top: var(--space-2);
  animation: rsg-crit-edit-in var(--duration-fast) var(--ease-out);
}
@keyframes rsg-crit-edit-in {
  from {
    max-height: 0;
    overflow: hidden;
  }
  to {
    max-height: 120px;
    overflow: hidden;
  }
}
@media (prefers-reduced-motion: reduce) {
  .rsg-crit-edit {
    animation: none;
  }
}
.rsg-crit-edit-box {
  position: relative;
}
.rsg-crit-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: var(--space-2) 76px var(--space-2) 12px;
  border: 1px solid #aeaeb2;
  border-radius: 9px;
  background: var(--surface);
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.4;
  color: var(--text);
  resize: none;
  overflow: hidden;
  outline: none;
  transition:
    border-color var(--duration-micro) var(--ease-out),
    box-shadow var(--duration-micro) var(--ease-out);
}
.rsg-crit-input::placeholder {
  color: var(--text-2);
}
.rsg-crit-input:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}
.rsg-crit-count {
  position: absolute;
  right: 12px;
  bottom: 9px;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
  pointer-events: none;
}
.rsg-crit-input:not(:focus) ~ .rsg-crit-count {
  visibility: hidden;
}
.rsg-crit-count.is-long {
  color: #a15c00;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .rsg-crit-input {
    border-color: var(--border);
  }
  .rsg-crit-count.is-long {
    color: #ffb340;
  }
}
/* Same As: a comment already written on this criterion for another
   student or group, one click to use it. */
.rsg-crit-reuse {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-2);
}
.rsg-crit-reuse[hidden] {
  display: none;
}
.rsg-crit-reuse-label {
  flex: none;
}
.rsg-crit-reuse-chip {
  min-width: 0;
  max-width: 460px;
  padding: var(--space-1) 8px;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--link);
  font: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.rsg-crit-reuse-chip b {
  font-weight: 700;
}
.rsg-crit-reuse-chip:hover,
.rsg-crit-reuse-chip:focus-visible {
  background: rgba(0, 122, 255, 0.2);
  outline: none;
}
/* The Comment Bank in the grader (teacher/crit-bank.js, the commentBank
   switch): Last Time above the box, the Bank row under Same As, the whole
   bank as one soft panel. Same As's own rules are above and unchanged. */
.rsg-crit-edit.has-bank {
  animation-name: rsg-crit-bank-in;
}
@keyframes rsg-crit-bank-in {
  from {
    max-height: 0;
    overflow: hidden;
  }
  to {
    max-height: 520px;
    overflow: hidden;
  }
}
.rsg-crit-last {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin: 4px 0 var(--space-2);
  padding: 0 2px;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text);
}
.rsg-crit-last b {
  flex: none;
  font-weight: 600;
}
.rsg-crit-last-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rsg-crit-edit.has-bank .rsg-crit-reuse-label,
.rsg-crit-bank-label {
  flex: none;
  width: 60px;
}
.rsg-crit-edit.is-bank-open .rsg-crit-reuse {
  display: none;
}
.rsg-crit-bank-box[hidden],
.rsg-crit-bank-panel[hidden] {
  display: none;
}
.rsg-crit-bank {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}
.rsg-crit-bank-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  white-space: nowrap;
  cursor: pointer;
}
.rsg-crit-bank-label:hover {
  color: var(--active);
}
.rsg-crit-bank-label svg {
  transition: transform var(--duration-micro) var(--ease-out);
}
.rsg-crit-bank-label.is-on svg {
  transform: rotate(180deg);
}
.rsg-crit-bank-chips {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-width: 0;
  flex: 1;
}
.rsg-crit-bank-chips.is-wrap {
  flex-wrap: wrap;
}
.rsg-crit-bank-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  height: 24px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 6px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--link);
  font: inherit;
  cursor: pointer;
}
.rsg-crit-bank-chip:hover,
.rsg-crit-bank-chip:focus-visible,
.rsg-crit-bank-chip.is-hi,
.rsg-crit-edit .rsg-crit-reuse-chip.is-hi {
  background: rgba(0, 122, 255, 0.2);
  outline: none;
}
.rsg-crit-bank-chip.is-hi,
.rsg-crit-edit .rsg-crit-reuse-chip.is-hi {
  box-shadow: inset 0 0 0 1.5px var(--active);
}
.rsg-crit-bank-ct {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rsg-crit-bank-cx {
  flex: none;
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rsg-crit-bank-add,
.rsg-crit-bank-kept {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: var(--space-1);
  height: 24px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}
.rsg-crit-bank-add {
  background: rgba(0, 122, 255, 0.1);
  color: var(--link);
  cursor: pointer;
}
.rsg-crit-bank-add:hover,
.rsg-crit-bank-add:focus-visible {
  background: rgba(0, 122, 255, 0.2);
  outline: none;
}
.rsg-crit-bank-kept {
  background: rgba(46, 125, 50, 0.12);
  color: #1b5e20;
}
/* The opened bank: one soft panel, so its rows read as one thing. */
.rsg-crit-bank-panel {
  padding: var(--space-2) var(--space-3) var(--space-2);
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.08);
}
.rsg-crit-bank-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  font-size: var(--text-sm);
}
.rsg-crit-bank-line + .rsg-crit-bank-line {
  margin-top: var(--space-2);
}
.rsg-crit-bank-lv {
  flex: none;
  width: 96px;
  height: 24px;
  line-height: 24px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}
.rsg-crit-bank-lv.t1 {
  color: var(--score-1-text);
}
.rsg-crit-bank-lv.t2 {
  color: var(--score-2-text);
}
.rsg-crit-bank-lv.t3 {
  color: var(--score-3-text);
}
.rsg-crit-bank-lv.t4 {
  color: var(--score-4-text);
}
.rsg-crit-bank-line.is-edit {
  justify-content: flex-end;
  margin-top: var(--space-1);
}
.rsg-crit-bank-edit {
  display: inline-flex;
  align-items: center;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
}
.rsg-crit-bank-edit:hover,
.rsg-crit-bank-edit:focus-visible {
  color: var(--active);
  text-decoration: underline;
  outline: none;
}
.rsg-overall .rsg-crit-bank-box {
  margin-top: 0;
}
@media (prefers-color-scheme: dark) {
  .rsg-crit-bank-kept {
    color: var(--score-3-text);
  }
}
/* Line for One Student (group work): a member's own field under the
   group's, and the buttons that open one. */
.rsg-crit-own {
  margin: var(--space-2) 0 0 24px;
}
.rsg-crit-own-label {
  display: block;
  margin: 0 0 var(--space-1) 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-2);
}
.rsg-crit-own .rsg-crit-input {
  padding-right: 12px;
}
.rsg-crit-each {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-2);
}
.rsg-crit-each-btn {
  padding: 2px var(--space-2);
  border: 0;
  border-radius: 5px;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
}
.rsg-crit-each-btn:hover,
.rsg-crit-each-btn:focus-visible {
  background: rgba(0, 122, 255, 0.1);
  outline: none;
}
/* A saved line for one student, under the group's comment. */
.rsg-crit-own-note {
  margin: var(--space-1) 0 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text-2);
  overflow-wrap: anywhere;
  cursor: text;
}
.rsg-crit-own-note b {
  color: var(--text);
  font-weight: 700;
}
.rsg-crit-own-note:hover {
  color: var(--text);
}
/* The saved comment opens to edit with a click. */
.rsg-criterion-row .rsg-crit-note {
  cursor: text;
}
.rsg-criterion-row .rsg-crit-note:hover {
  color: var(--text);
}

/* Rubric copy dialogs: a class or rubric row with its match summary under it. */
.rubric-copy-row {
  margin-top: 4px;
}
.rubric-copy-row-name {
  font-weight: 600;
}
.rubric-copy-summary {
  padding-left: var(--space-6);
  font-size: var(--text-sm);
  line-height: 1.4;
}
.rubric-copy-group {
  margin-top: 8px;
  font-size: var(--text-xs);
  color: var(--text-3);
}
.rubric-linked-removal {
  margin-top: 4px;
  color: var(--text-2);
}

/* Rubric editor: "Draft from …" beside the Level descriptors label, and the
   competency picker behind "+ From competency". */
.rubric-draft-btn {
  margin-left: var(--space-3);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
.rubric-draft-btn:hover {
  border-color: var(--text-3);
  color: var(--text);
}
.crit-from-comp-dialog .copy-dialog-card {
  max-width: 720px;
}
.crit-from-comp-dialog .rubric-comp-group {
  margin-top: 4px;
}

/* ── Rubric Bank: Advanced Rubrics ─────────────────────────── */
.rb-row-top,
.rb-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.rb-title-row {
  gap: 8px;
}
.rb-adv-tag {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 var(--space-2);
  border-radius: 5px;
  background: var(--accent-purple-light);
  color: var(--accent-purple);
  font-size: var(--text-xs);
  font-weight: 600;
}
.rb-title-row .rb-adv-tag {
  height: 22px;
  font-size: var(--text-sm);
}
.rb-rule {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-3);
}
.rb-cell-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.rb-cell-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.35;
  color: var(--text-2);
}
.rb-box {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  margin-top: 1px;
  border: 1.5px solid var(--text-3);
  border-radius: 3px;
  box-sizing: border-box;
}
.rb-new-wrap {
  position: relative;
}
.rb-btn-new.is-open {
  background: var(--active-light);
}
.rb-menu.rb-new-menu {
  width: 290px;
  top: 42px;
}
.rb-new-menu button {
  height: auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
}
.rb-menu-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.rb-menu-help {
  font-size: var(--text-xs);
  color: var(--text-3);
}

/* ── Advanced Rubric checklists (scoring) ─────────────────── */
/* The checklist button under the criterion's name, beside Comment, showing
   how many boxes are ticked (never a total: teachers tick only what the
   student showed). The checklist opens under its row with one column under
   each level button. */
.rsg-checks-cell {
  display: flex;
}
.rsg-checks-btn {
  height: 26px;
  padding: 0 var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 7px;
  background: rgba(118, 118, 128, 0.12);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.rsg-checks-btn:hover {
  background: rgba(118, 118, 128, 0.2);
}
.rsg-checks-btn.is-open {
  background: var(--active-fill);
  color: #fff;
  font-weight: 700;
}
.rsg-checks-btn:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
/* A criterion with its checklist open: a pale blue panel holding the
   suggestion under the tools and a column of boxes under each level. */
.rsg-criterion-row.has-checklist {
  padding: var(--space-2);
  margin: 0 calc(-1 * var(--space-2));
  border-radius: 14px;
  background: rgba(0, 122, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.22);
}
.rsg-criterion-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: var(--space-2);
  min-width: 0;
}
.rsg-checklist-advice {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: 4px;
}
.rsg-checklist-head {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text);
}
.rsg-checklist-advice.l4 .rsg-checklist-head {
  color: var(--score-4-dark);
}
.rsg-checklist-advice.l3 .rsg-checklist-head {
  color: var(--score-3-dark);
}
.rsg-checklist-advice.l2 .rsg-checklist-head {
  color: var(--score-2-dark);
}
.rsg-checklist-advice.l1 .rsg-checklist-head {
  color: var(--score-1-dark);
}
.rsg-checklist-hint {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--text);
}
/* Four columns lined up under the level buttons; the chosen level's
   column is tinted in its colour, the rest white with a faint edge. */
.rsg-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 0 2px;
}
.rsg-checklist-col {
  min-width: 0;
  padding: var(--space-3) var(--space-2);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.rsg-checklist-col.is-chosen.l4 {
  background: color-mix(in srgb, var(--score-4) 9%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--score-4) 22%, transparent);
}
.rsg-checklist-col.is-chosen.l3 {
  background: color-mix(in srgb, var(--score-3) 9%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--score-3) 22%, transparent);
}
.rsg-checklist-col.is-chosen.l2 {
  background: color-mix(in srgb, var(--score-2) 9%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--score-2) 22%, transparent);
}
.rsg-checklist-col.is-chosen.l1 {
  background: color-mix(in srgb, var(--score-1) 9%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--score-1) 22%, transparent);
}
.rsg-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}
.rsg-check input {
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  flex-shrink: 0;
}
.rsg-checklist-col.l4 .rsg-check input {
  accent-color: var(--score-4);
}
.rsg-checklist-col.l3 .rsg-check input {
  accent-color: var(--score-3);
}
.rsg-checklist-col.l2 .rsg-check input {
  accent-color: var(--score-2);
}
.rsg-checklist-col.l1 .rsg-check input {
  accent-color: var(--score-1);
}

/* All Caught Up (I3): over the dialog after the last piece in a queue. */
.grader-caught-up {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
  border-radius: inherit;
}
.grader-caught-up-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
}
.grader-caught-up-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grader-caught-up-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--text-sm);
  color: var(--text);
}
.grader-caught-up-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grader-caught-up-n {
  flex: none;
  font-weight: 600;
}
.grader-caught-up-actions {
  display: flex;
  gap: var(--space-3);
}
.grader-spacer {
  flex: 1;
}
.grader-status {
  display: flex;
  align-items: stretch;
  padding: 2px;
  border-radius: 9px;
  background: rgba(118, 118, 128, 0.14);
}
/* Hairlines between the segments, hidden beside the chosen one. */
.grader-status-sep {
  width: 1px;
  flex-shrink: 0;
  margin: var(--space-2) 0;
  background: rgba(60, 60, 67, 0.25);
}
.grader-status-btn.is-on + .grader-status-sep,
.grader-status-sep:has(+ .grader-status-btn.is-on) {
  visibility: hidden;
}
@media (prefers-color-scheme: dark) {
  .grader-status-sep {
    background: var(--divider-heavy);
  }
}
.grader-status-btn {
  height: 28px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.grader-status-btn:disabled {
  color: var(--text-3);
  cursor: not-allowed;
  /* Unmistakably off beside an enabled Late (Nov 3 sweep). */
  opacity: 0.45;
}
.grader-status-btn.is-on {
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}
.grader-status-btn.is-ns {
  background: var(--score-1);
}
.grader-status-btn.is-exc {
  background: var(--text-2);
}
.grader-status-btn.is-late {
  background: var(--score-2);
}
/* Group work (Group grading): Students in This Group (TGroupGrade), after
   the criteria. One row per member: the name, "Same as group" (or what was
   changed for them) at the right, their own Missing | Excused | Late and a
   ⋯ menu; a member graded separately shows their grade and Back to Group
   Grade instead. The card sits in the lane like the criteria cards. */
.grader-members {
  background: var(--surface);
  border-radius: 16px;
  padding: var(--space-4) 16px 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px var(--divider-medium);
}
.grader-members[hidden],
.grader-separate-line[hidden],
.grader-status[hidden] {
  display: none;
}
.grader-members-title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
}
.grader-members-grid {
  display: flex;
  flex-direction: column;
}
.grader-member {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) 12px;
  padding: 8px 0;
  border-top: 1px solid var(--divider-subtle);
}
.grader-member-name {
  flex: 0 1 auto;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.grader-member > .grader-member-same,
.grader-member > .grader-member-separate {
  flex: 1 1 auto;
  margin: 0;
  text-align: right;
}
.grader-member-changes {
  flex: 1 0 100%;
  text-align: right;
}
.grader-member-changes .grader-member-same {
  margin: 0;
}
button.grader-member-name {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--active);
  cursor: pointer;
  text-align: left;
}
.grader-member-more {
  width: 30px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.14);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.grader-member-more[aria-expanded='true'] {
  background: rgba(118, 118, 128, 0.28);
}
.grader-member-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 0;
  z-index: 5;
  min-width: 200px;
  padding: var(--space-1);
  border-radius: 10px;
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--divider-medium),
    0 8px 24px rgba(0, 0, 0, 0.18);
}
.grader-member-menu[hidden] {
  display: none;
}
.grader-member-menu button {
  width: 100%;
  padding: 8px var(--space-3);
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.grader-member-menu button:hover,
.grader-member-menu button:focus-visible {
  background: rgba(0, 122, 255, 0.1);
}
.grader-member .grader-status-btn {
  padding: 0 var(--space-3);
}
.grader-member-separate {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.grader-member-separate .grader-grade {
  font-size: var(--text-sm);
  white-space: nowrap;
}
.grader-member-back {
  height: 30px;
  padding: 0 var(--space-3);
  border: none;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.14);
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.grader-member-back:hover {
  background: rgba(118, 118, 128, 0.22);
}
/* "Graded Separately From Group 2" under a separated member's name. */
.grader-separate-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: calc(-1 * var(--space-2));
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.grader-body .assess-card {
  border: none;
  box-shadow: none;
  margin: 0;
  background: var(--surface);
  border-radius: 16px;
  padding: 4px var(--space-4);
}
/* The dialog grades one student: their name, status and Comment live in
   its header and the Overall Comment, so the grids' own copies stand aside. */
.grader-body .rsg-student {
  grid-template-columns: minmax(0, 1fr) 36px;
}
.grader-body .rsg-student-name,
.grader-body .ldg-head,
.grader-body .ldg-name,
.grader-body .ldg-status,
.grader-body .ldg-overall {
  display: none;
}
.grader-body .ldg-grid {
  --ldg-cols: minmax(0, 1fr);
}
/* The Note for the Report, under the grading: one quiet line, "Note for
   the Report · Optional", that opens to the field (Colin, Nov 13: the open
   box confused teachers). Open by itself where a note is written. */
.grader-report-note {
  margin: calc(-1 * var(--space-2)) 16px 0;
  padding: 0 4px;
}
.grader-report-note[hidden] {
  display: none;
}
.grader-report-note-head {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: var(--space-2) 0;
  cursor: pointer;
  list-style: none;
  color: var(--text-2);
}
.grader-report-note-head::-webkit-details-marker {
  display: none;
}
.grader-report-note-head::before {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(-45deg);
  transition: transform 0.15s;
}
.grader-report-note[open] > .grader-report-note-head::before {
  transform: translateY(-3px) rotate(45deg);
}
.grader-report-note-head:hover,
.grader-report-note-head:focus-visible {
  color: var(--text);
}
.grader-report-note-head h2 {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: inherit;
}
.grader-report-note-opt {
  font-size: var(--text-xs);
  color: var(--text-3);
}
.grader-report-note-what {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--text-2);
}
.grader-report-note-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  padding: 4px 0 8px var(--space-4);
}
/* The same field edges as every comment field (.grdt-note), one line. */
.grader-report-note-input {
  box-sizing: border-box;
  height: 36px;
  padding: var(--space-2) 12px;
  border: 1px solid #aeaeb2;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
  outline: none;
}
.grader-report-note-input::placeholder {
  color: var(--text-3);
}
.grader-report-note-input:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}
.grader-report-note-input:disabled {
  color: var(--text-2);
  cursor: not-allowed;
}
.grader-report-note-preview {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-2);
}
/* The hint, in orange while the note does not start with a past-tense verb. */
.grader-report-note-preview.warn .grader-report-note-hint {
  color: var(--score-2-text);
  font-weight: 600;
}
/* A competency level's three lines (CompetencyWording) over the foot,
   while the level is hovered, focused or held: absolutely placed, so the
   dialog keeps its size. */
.grader-dialog {
  position: relative;
}
.grdl-wording-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 64px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--overlay-pressed);
  border-radius: var(--radius);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.1),
    0 1px 4px rgba(0, 0, 0, 0.05);
  font-size: var(--text-base);
  line-height: 1.35;
  color: var(--text);
  pointer-events: none;
}
.grdl-wording-bar[hidden] {
  display: none;
}
/* Holding a level on a touch screen shows its lines, not the callout. */
.grdl-level,
.rsg-level {
  -webkit-touch-callout: none;
  user-select: none;
}
.grader-grade-label {
  font-size: var(--text-sm);
  font-weight: 600;
}
.grader-grade {
  /* A readout, not a button: the grade in its level's colour, no fill
     (Colin, Nov 13: the pills read as buttons). */
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}
.grader-grade.tone-l4 {
  color: var(--score-4-text);
}
.grader-grade.tone-l3 {
  color: var(--score-3-text);
}
.grader-grade.tone-l2 {
  color: var(--score-2-text);
}
.grader-grade.tone-l1 {
  color: var(--score-1-text);
}
.grader-grade.tone-muted {
  color: var(--text-2);
}
/* The column header's levels and the Set Unmarked buttons fill every
   student, and the stats row is the class's; the dialog grades one. */
.grader-body .ldg-bar,
.grader-body .ldg-stats {
  display: none;
}

/* ── Draft and Returned in the dialog (S0-F2) ────────────────
   Return and where the grade stands, in a row above the footer that does
   not scroll away: Return on the left, the Draft mark and its line on the
   right; "Returned Nov 3" once the grade is given. In the grading cards'
   lane. The level-wording bar moves up to sit above the row. */
.grader-return {
  flex-shrink: 0;
  min-height: 56px;
  box-sizing: border-box;
  padding: var(--space-2) 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  box-shadow: 0 -0.5px 0 var(--divider-heavy);
  color: var(--text);
}
.grader-return-btn {
  height: 34px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: 17px;
  background: var(--active-fill);
  color: #fff;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
}
.grader-return-btn:hover {
  background: var(--btn-hover-blue);
}
.grader-return-btn:disabled {
  background: var(--seg-track);
  color: var(--text-3);
  cursor: default;
}
.grader-returned {
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  background: var(--score-3-bg);
  color: var(--score-3-text);
  font-size: var(--text-base);
  font-weight: 600;
}
.grader-draft {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}
.grader-draft-line {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.grader-draft-mark {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 var(--space-3);
  border-radius: 12px;
  border: 1.5px dashed var(--score-3);
  color: var(--score-3-text);
  font-size: var(--text-sm);
  font-weight: 700;
}
.grader-draft-text,
.grader-draft-still {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* ── What is waiting to return (S1-F2) ────────────────────────
   In a class that returns grades When I Return Them: the toolbar's
   To Return option on Show, a card's chips and Return N Graded, a row's Draft or
   Returned mark, Return under one student's grader, and the dialog's bar
   with Show and Return N Graded. Colours are the app's tokens, each with
   its dark pair: the Demo Mode pill's amber for a count that waits, the
   Proficient green for the Draft mark's dashes (as in the dialog), the
   app's blue for a button that returns. */
.assess-returns,
.assess-return-slot {
  display: contents;
}
.assess-to-return {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--demo-pill-bg);
  color: var(--demo-pill-text);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
.assess-returned {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.assess-return-btn,
.grader-return-all {
  flex-shrink: 0;
  height: 30px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: 15px;
  background: var(--active-fill);
  color: #fff;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.assess-return-btn:hover {
  background: var(--btn-hover-blue);
}
/* In the dialog it is tinted, as the board draws it and as Print is: Done
   and Return stay the dialog's solid blue buttons. The Assignments card's
   Return N Graded is tinted too: + New Assessment is that screen's one
   solid button (DECISIONS, "Buttons and breadcrumbs"). */
.assess-return-btn,
.grader-return-all {
  background: rgba(0, 122, 255, 0.1);
  color: #0062cc;
}
.assess-return-btn:hover,
.grader-return-all:hover {
  background: rgba(0, 122, 255, 0.16);
}
/* Dark: the link blue on a lighter tint, 4.87:1 at rest and 4.63:1 on
   hover over --surface (--active read 3.0:1). */
@media (prefers-color-scheme: dark) {
  .assess-return-btn,
  .grader-return-all {
    background: rgba(10, 132, 255, 0.14);
    color: var(--link);
  }
  .assess-return-btn:hover,
  .grader-return-all:hover {
    background: rgba(10, 132, 255, 0.18);
  }
}
/* A row's mark beside the student's name. */
.ret-mark {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
}
.ret-mark:empty {
  display: none;
}
.ret-draft {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1.5px dashed var(--score-3);
  color: var(--score-3-text);
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0;
}
.ret-returned {
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-2);
}
/* A ledger's name cell holds the name and the mark; the name still ends
   in an ellipsis when it is too long. */
.ldg-name.ldg-name-ret {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ldg-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ...and the work icon at its end (_workIconHtml), its + menu let out of
   the cell. */
.ldg-name.ldg-name-work {
  overflow: visible;
}
.ldg-name-work .rsg-work-btn,
.ldg-name-work .rsg-attach {
  margin-left: auto;
}
/* The + is near the card's left edge here: its menu and Link… open to the
   right of it, not off the card. */
.ldg-name-work .rsg-attach .assess-menu,
.ldg-name-work .rsg-attach-link {
  left: 0;
  right: auto;
}
/* One student on the page: the dialog's row, under their grader in the
   open card. */
.grader-return.grader-return-inline {
  min-height: 0;
  margin-top: 8px;
  padding: 12px 0 2px;
  background: transparent;
  box-shadow: inset 0 0.5px 0 var(--divider-medium);
}
.grader-return.grader-return-inline[hidden] {
  display: none;
}
.grader-show-n {
  font-variant-numeric: tabular-nums;
}

/* ── Rubric tiles (grader, one student) ─────────────────────── */
.grdt-tiles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--space-2) 0;
}

.grdt-crit {
  background: var(--surface);
  border-radius: 16px;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px var(--divider-medium);
  outline: none;
}
.grdt-crit:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}

.grdt-crit-name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}
.grdt-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.grdt-code {
  padding: var(--space-1) 8px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.14);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
}
.grdt-not-scored {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-2);
  border-radius: 10px;
  background: rgba(255, 149, 0, 0.16);
  font-size: var(--text-xs);
  font-weight: 600;
  color: #8a4b00;
}
@media (prefers-color-scheme: dark) {
  .grdt-not-scored {
    color: #ffb340;
  }
}

.grdt-note-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.grdt-note-label {
  padding: var(--space-2) 2px 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
/* A competency card's feedback row sits under its name and level control. */
.grdl-note-label {
  align-self: start;
}
.grdl-card .grdt-note {
  align-self: start;
}
/* The same field as the grid's Overall Comment (.rsg-overall-comment):
   one line until clicked; three while typing or once it holds text. */
.grdt-note {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: var(--space-2) 12px;
  border: 1px solid #aeaeb2;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
  line-height: 1.4;
  resize: none;
  overflow: hidden;
  outline: none;
  transition:
    height var(--duration-fast) var(--ease-out),
    border-color var(--duration-micro) var(--ease-out),
    box-shadow var(--duration-micro) var(--ease-out);
}
.grdt-note::placeholder {
  color: var(--text-2);
}
.grdt-note:focus,
.grdt-note.has-text {
  height: calc(3 * 1.4em + 16px);
  overflow-y: auto;
}
.grdt-note:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.25);
}
@media (prefers-color-scheme: dark) {
  .grdt-note,
  .grader-report-note-input {
    border-color: var(--border);
  }
}
/* The tiles sit straight on the dialog's grey, without the card behind
   the older grids. */
.grader-body .assess-card:has(.grdt-tiles) {
  background: none;
  padding: 0;
}

/* ── A rubric for one student: the board's compact rows ─────────
   Name, Checklist and Comment chips, Suggested at the right; the level bar
   under them; the checklist folded under its chip (a pale blue card while
   open, as the Assignments page's rows); the comment under the levels. */
.grdr-rows {
  gap: var(--space-3);
}
.grdt-crit.grdr-crit {
  gap: 8px;
  padding: 12px var(--space-4);
}
.grdt-crit.grdr-crit.is-open {
  background: color-mix(in srgb, var(--active) 4%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--active) 24%, transparent);
}
.grdr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) 8px;
}
.grdr-head .grdt-crit-name {
  font-size: var(--text-base);
  font-weight: 700;
  margin-right: 2px;
}
.grdr-suggested {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
.grdr-suggested.l4 {
  color: var(--score-4-dark);
}
.grdr-suggested.l3 {
  color: var(--score-3-dark);
}
.grdr-suggested.l2 {
  color: var(--score-2-dark);
}
.grdr-suggested.l1 {
  color: var(--score-1-dark);
}
.grdr-chip.rsg-crit-comment.is-open:not(.has-comment) {
  box-shadow: inset 0 0 0 1.5px var(--active);
}
.grdr-levels .grdl-seg {
  min-width: 0;
}
.grdr-levels .grdl-level {
  min-width: 0;
}
.grdr-checklist {
  padding: 0;
}
/* The saved comment, read in place under the levels; a click opens it. */
.grdr-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  padding: 0 2px;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  line-height: 1.4;
  text-align: left;
  cursor: text;
}
.grdr-note svg {
  flex-shrink: 0;
  margin-top: var(--space-1);
  color: var(--active);
}

/* ── Levels, points and Complete/Incomplete (grader, one student) ── */
.grdl-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--space-2) 0;
}
.grdl-card,
.grdp-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: var(--space-4) 16px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px var(--divider-medium);
  outline: none;
}
.grdp-card {
  padding: var(--space-6) 24px;
}
.grdl-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}
.grdl-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.grdl-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.grdl-name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.grdl-text {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text);
}
.grdl-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.grdl-seg {
  flex: 1;
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.14);
}
.grdl-level {
  flex: 1;
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
.grdl-level:hover {
  background: rgba(118, 118, 128, 0.12);
}
.grdl-level.is-on {
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.grdl-level.is-on.l4 {
  background: var(--score-4);
}
.grdl-level.is-on.l3 {
  background: var(--score-3);
}
.grdl-level.is-on.l2 {
  background: var(--score-2);
}
.grdl-level.is-on.l1 {
  background: var(--score-1);
}
/* A competency whose criteria disagree: the lowest, striped as in the grid. */
.grdl-level.is-on.mixed {
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.2) 3px,
    rgba(255, 255, 255, 0.2) 5px
  );
}
/* The chosen level and its − | + share one coloured segment, as on a
   chosen rubric tile. The name gives way before the signs do. */
.grdl-pick {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  min-width: max-content;
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}
.grdl-pick.l4 {
  background: var(--score-4);
}
.grdl-pick.l3 {
  background: var(--score-3);
}
.grdl-pick.l2 {
  background: var(--score-2);
}
.grdl-pick.l1 {
  background: var(--score-1);
}
.grdl-pick.mixed {
  background-image: repeating-linear-gradient(
    135deg,
    transparent,
    transparent 3px,
    rgba(255, 255, 255, 0.2) 3px,
    rgba(255, 255, 255, 0.2) 5px
  );
}
.grdl-pick > .grdl-level.is-on {
  flex: 1 1 auto;
  padding: 0 4px 0 12px;
  background: transparent;
  box-shadow: none;
}
.grdl-stepper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-right: 4px;
}
.grdl-stepper button {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.grdl-stepper button:hover:not(:disabled):not(.is-on) {
  background: rgba(255, 255, 255, 0.18);
}
.grdl-stepper button.is-on {
  background: #fff;
  font-weight: 700;
}
.grdl-pick.l4 .grdl-stepper button.is-on {
  color: var(--score-4);
}
.grdl-pick.l3 .grdl-stepper button.is-on {
  color: var(--score-3);
}
.grdl-pick.l2 .grdl-stepper button.is-on {
  color: var(--score-2);
}
.grdl-pick.l1 .grdl-stepper button.is-on {
  color: var(--score-1);
}
.grdl-stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}
.grdl-stepper-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.5);
}
.grdl-stepper button.is-on + .grdl-stepper-sep,
.grdl-stepper-sep:has(+ button.is-on) {
  visibility: hidden;
}
.grdp-entry {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.grdp-input {
  box-sizing: border-box;
  width: 120px;
  height: 56px;
  padding: 0 var(--space-4);
  border: none;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
  font: inherit;
  font-size: 30px;
  font-weight: 700;
  text-align: right;
  outline: none;
}
.grdp-input:focus {
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--active),
    0 0 0 4px rgba(0, 122, 255, 0.25);
}
.grdp-max {
  font-size: 30px;
  font-weight: 300;
  color: var(--text);
}
.grdp-pct {
  margin-left: var(--space-2);
  padding: var(--space-2) 12px;
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.14);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--text);
}
.grdc-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.grdc-btn {
  height: 64px;
  border: none;
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.1);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  cursor: pointer;
}
.grdc-complete .grdc-icon-bg {
  fill: var(--score-3);
}
.grdc-incomplete .grdc-icon-bg {
  fill: var(--score-1);
}
.grdc-icon-mark {
  stroke: #fff;
}
.grdc-btn.is-on {
  color: #fff;
  font-weight: 700;
}
.grdc-complete.is-on {
  background: var(--score-3);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.28);
}
.grdc-incomplete.is-on {
  background: var(--score-1);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.28);
}
.grdc-btn.is-on .grdc-icon-bg {
  fill: #fff;
}
.grdc-complete.is-on .grdc-icon-mark {
  stroke: var(--score-3);
}
.grdc-incomplete.is-on .grdc-icon-mark {
  stroke: var(--score-1);
}
.grdc-btn:disabled,
.grdp-input:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Missing or Excused: the work isn't graded, so the controls step back.
   The Overall Comment stays open, as on the Assignments rows (Nov 3
   sweep): a note on missing work is still feedback a teacher may write. */
.grader-body.is-locked .grdt-tiles:not(.grdt-overall),
.grader-body.is-locked .grdl-cards,
.grader-body.is-locked .grdp-card {
  opacity: 0.45;
  pointer-events: none;
}
.grader-body .assess-card:has(.grdl-cards),
.grader-body .assess-card:has(.grdp-card) {
  background: none;
  padding: 0;
}

/* One student on the Assignments page: the dialog's grader inside the
   open card. The card is already white, so criteria and competencies are
   rows in it rather than cards of their own. */
.grader-inline {
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}
.grader-inline-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px 0 var(--space-3);
  box-shadow: inset 0 -0.5px 0 var(--divider-medium);
}
.grader-inline-name {
  margin: 0;
  font-size: 1.3125rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}
.grader-inline .grader-status-btn {
  height: 24px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
}
.grader-inline .grader-hint {
  flex: none;
}
.grader-inline .grader-grade {
  font-size: var(--text-sm);
}
.grader-inline .grdt-tiles,
.grader-inline .grdl-cards {
  gap: 0;
  padding: 0;
}

.grader-inline .grdt-crit,
.grader-inline .grdl-card,
.grader-inline .grdp-card {
  background: none;
  border-radius: 0;
  padding: 12px 0 var(--space-4);
  box-shadow: inset 0 -0.5px 0 var(--divider-medium);
}
.grader-inline .grdt-crit:last-child,
.grader-inline .grdl-card:last-child,
.grader-inline .grdp-card:last-child {
  box-shadow: none;
}
.grader-inline .grdt-crit:focus-visible,
.grader-inline .grdl-card:focus-visible {
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}
.grader-inline.is-locked .grdt-tiles:not(.grdt-overall),
.grader-inline.is-locked .grdl-cards,
.grader-inline.is-locked .grdp-card {
  opacity: 0.45;
  pointer-events: none;
}

/* Toolbar, option C "Three Things" (assign-toolbar.js): Search with Filter
   in its end, Show, a chip for each filter, then ⋯ and + New Assessment
   with its ▾. What this bar shares with the Gradebook's (Search and its
   Filter button, Show's badges, the chips, ⋯, the checklist rows) is in
   teacher/styles.css. One row while it fits; a row that doesn't (a narrow
   window, a wide font) wraps rather than push the buttons out of sight or
   scroll sideways. Search gives way first (300 down to 180), then the chips. */
.assess-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}
.assess-toolbar .seg,
.assess-toolbar .tb-action-btn {
  flex-shrink: 0;
}
.atb-show-slot {
  display: contents;
}
/* + New Assessment and its ▾, one button in two parts: 1px apart, the
   inside corners square. */
.atb-new {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}
.atb-split .atb-new-main {
  border-radius: 8px 0 0 8px;
}
.assess-toolbar .atb-new-more {
  width: 30px;
  padding: 0;
  justify-content: center;
  border-radius: 0 8px 8px 0;
}
.atb-new .assess-menu-wrap {
  display: flex;
}
/* The menus open under their button, lined up with its right edge. */
.assess-toolbar .assess-menu {
  min-width: 200px;
}
.assess-filter-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 30px;
  z-index: 50;
  width: 270px;
  padding: var(--space-2);
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.16),
    0 0 0 0.5px var(--divider-medium);
  flex-direction: column;
  gap: 2px;
}
.atb-search.open .assess-filter-menu {
  display: flex;
}
.grader-inline .grader-status-sep {
  margin: var(--space-2) 0;
}

/* Assessment card chips (plan PR 7): category capsule in its tint, the
   rubric outlined with its icon, core competencies outlined in their
   colour, collaboration in blue, Also In as a grey button. */
.assess-meta .type-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: 10px;
  font-size: var(--text-xs);
  font-weight: 600;
}
/* The category pill is a button on the Assignments page: it filters the
   list to its category (the same switch as ticking it in Filter). It looks
   as it did; pressed, a ring in its own colour. */
.assess-meta button.type-badge {
  border: none;
  line-height: inherit;
  cursor: pointer;
}
.assess-meta button.type-badge:hover {
  filter: brightness(0.95);
}
.assess-meta button.type-badge[aria-pressed='true'] {
  box-shadow: inset 0 0 0 1.5px currentColor;
}
.assess-meta button.type-badge:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 1px;
}
/* Point to preview: while the pointer or the keyboard rests on an
   unpressed Submitted, To Grade, To Return or Not In, the cards it would
   not keep dim. The delay keeps the list still as the pointer crosses the
   bar. */
.page-layout:has(.atb-show [data-show='submitted']:is(:hover, :focus-visible):not([aria-pressed='true']))
  .assess-card:not([data-has~='submitted']),
.page-layout:has(.atb-show [data-show='tograde']:is(:hover, :focus-visible):not([aria-pressed='true']))
  .assess-card:not([data-has~='tograde']),
.page-layout:has(.atb-show [data-show='toreturn']:is(:hover, :focus-visible):not([aria-pressed='true']))
  .assess-card:not([data-has~='toreturn']),
.page-layout:has(.atb-show [data-show='notin']:is(:hover, :focus-visible):not([aria-pressed='true']))
  .assess-card:not([data-has~='notin']) {
  opacity: 0.4;
}
@media (prefers-reduced-motion: no-preference) {
  .assess-card {
    transition: opacity 150ms ease;
  }
  .page-layout:has(.atb-show [data-show='submitted']:is(:hover, :focus-visible):not([aria-pressed='true']))
    .assess-card:not([data-has~='submitted']),
  .page-layout:has(.atb-show [data-show='tograde']:is(:hover, :focus-visible):not([aria-pressed='true']))
    .assess-card:not([data-has~='tograde']),
  .page-layout:has(.atb-show [data-show='toreturn']:is(:hover, :focus-visible):not([aria-pressed='true']))
    .assess-card:not([data-has~='toreturn']),
  .page-layout:has(.atb-show [data-show='notin']:is(:hover, :focus-visible):not([aria-pressed='true']))
    .assess-card:not([data-has~='notin']) {
    transition: opacity 150ms ease 120ms;
  }
}
.assess-meta .score-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.45);
  color: var(--text);
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.assess-meta .rubric-badge {
  gap: 4px;
  padding: 2px var(--space-2);
  border: none;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(60, 60, 67, 0.45);
  color: var(--text);
}
.assess-meta .cc-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.02em;
  border-width: 1.5px;
}
.assess-meta .collab-badge {
  padding: 2px var(--space-2);
  border-radius: 10px;
  background: var(--active-light);
  color: var(--link);
}
.assess-meta .copy-badge {
  height: 22px;
  padding: 0 var(--space-2);
  border: none;
  border-radius: 11px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: 600;
}
.assess-meta .copy-badge:hover {
  background: rgba(118, 118, 128, 0.2);
  color: var(--text);
}

/* ── Single-point rubrics (plan PR 16) ───────────────────────
   One student: a card per criterion in three columns, Work On | the
   Proficient standard with its level control | Went Beyond. */
.grsp-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 4px;
  background: var(--score-3);
}
.is-work .grsp-dot {
  background: var(--score-2);
}
.is-beyond .grsp-dot {
  background: var(--score-4);
}
.grsp-legend {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 232px;
  column-gap: var(--space-3);
  padding: 2px var(--space-4) 0;
}
.grsp-legend > span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.grsp-legend > .is-standard {
  justify-content: center;
}
.grdt-crit.grsp-crit {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 232px;
  gap: var(--space-3);
  align-items: stretch;
}
.grsp-note {
  padding: 12px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grsp-note-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
/* Work On and Went Beyond run the card's full height, their fields filling
   the panel rather than sitting in it as one-line boxes. */
.grsp-note .grdt-note,
.grsp-note .grdt-note:focus,
.grsp-note .grdt-note.has-text {
  flex: 1;
  height: auto;
  min-height: 72px;
  resize: none;
}
.grsp-standard {
  padding: var(--space-2) var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
}
.grsp-standard .grdt-codes {
  justify-content: center;
}
.grsp-words {
  margin: 0;
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--text);
}
/* A narrow column (the dialog at 1024px) puts − | + under the levels
   rather than over Work On and Went Beyond. */
.grsp-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
/* The row never runs past its column: the other levels give way
   (shortened names) before the chosen one and its − | + do. */
.grsp-controls .grdl-seg {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.grsp-controls .grdl-level {
  flex: 0 1 auto;
  min-width: 0;
  height: 28px;
  padding: 0 var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--text-sm);
}
.grsp-controls .grdl-pick {
  flex: none;
}
.grsp-controls .grdl-stepper button {
  width: 22px;
  height: 22px;
}
.grsp-standard .grdt-not-scored {
  align-self: center;
}
.grader-inline .grdt-crit.grsp-crit {
  padding: 12px 0 var(--space-4);
}

/* Whole class: the Proficient standard once above the students, and Work On
   and Went Beyond under each criterion's level control. */
.rsg-sp-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--space-3) 16px 12px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.rsg-sp-strip-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}
.rsg-sp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.rsg-sp-card {
  padding: var(--space-3) 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--score-3) 10%, var(--surface));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rsg-sp-card-name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}
.rsg-sp-card-words {
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text);
}
.rsg-sp-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.rsg-sp-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rsg-sp-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
}
.rsg-sp-label .grsp-dot {
  width: 7px;
  height: 7px;
}
.rsg-sp-input {
  box-sizing: border-box;
  width: 100%;
  height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid #aeaeb2;
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text);
  outline: none;
}
.rsg-sp-input:focus {
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
@media (prefers-color-scheme: dark) {
  .rsg-sp-input {
    border-color: var(--border);
  }
}
.rsg-grid.is-single-point .rsg-criteria {
  gap: var(--space-4);
}

/* ── DIBELS 8 benchmark (plan PR 19) ───────────────────────── */
.dbl-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
.dbl-chip.is-empty {
  color: var(--text-3);
  font-weight: 500;
}
.dbl-dot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: currentColor;
}
.dbl-chip.l4 {
  background: color-mix(in srgb, var(--score-4) 12%, transparent);
  color: var(--score-4-dark);
}
.dbl-chip.l3 {
  background: color-mix(in srgb, var(--score-3) 12%, transparent);
  color: var(--score-3-dark);
}
.dbl-chip.l2 {
  background: color-mix(in srgb, var(--score-2) 16%, transparent);
  color: #7a4d00;
}
.dbl-chip.l1 {
  background: color-mix(in srgb, var(--score-1) 12%, transparent);
  color: var(--score-1-dark);
}
@media (prefers-color-scheme: dark) {
  .dbl-chip.l2 {
    color: var(--score-2-dark);
  }
}
.dbl-chip.l4 .dbl-dot {
  background: var(--score-4);
}
.dbl-chip.l3 .dbl-dot {
  background: var(--score-3);
}
.dbl-chip.l2 .dbl-dot {
  background: var(--score-2);
}
.dbl-chip.l1 .dbl-dot {
  background: var(--score-1);
}
.dbl-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dbl-period .grader-status-btn {
  height: 26px;
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
}
.dbl-period .grader-status-sep {
  margin: var(--space-2) 0;
}
.grader-status-btn.is-on.is-period {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}
.dbl-no-grade {
  padding: var(--space-1) var(--space-3);
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
}
.dbl-tested {
  font-size: var(--text-sm);
  color: var(--text);
}

/* One student: two cards, big fields and what they work out to. */
.dbl-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dbl-card-wrap .dbl-bar {
  padding: 0 4px;
}
.grdl-card.dbl-card {
  padding: var(--space-4) var(--space-6);
}
.dbl-fields {
  display: flex;
  align-items: flex-end;
  gap: var(--space-6);
  flex-wrap: wrap;
}
.dbl-field,
.dbl-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.dbl-stat-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.dbl-stat-value {
  height: 52px;
  display: flex;
  align-items: center;
  font-size: 1.625rem;
  font-weight: 300;
  color: var(--text);
}
.dbl-stat-value .dbl-chip {
  padding: var(--space-2) var(--space-4);
  border-radius: 16px;
  font-size: var(--text-base);
}
.dbl-input {
  box-sizing: border-box;
  width: 56px;
  height: 30px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.12);
  font: inherit;
  font-size: var(--text-md);
  font-weight: 700;
  text-align: right;
  color: var(--text);
  outline: none;
}
.dbl-input:focus {
  background: var(--surface);
  border-color: var(--active);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}
.dbl-input.is-big {
  width: 120px;
  height: 52px;
  padding: 0 var(--space-4);
  border-radius: 12px;
  font-size: 1.625rem;
}
.grader-dibels-levels {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dbl-foot-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

/* Whole class: level counts, then one row per student. */
.dbl-grid {
  --dbl-cols: minmax(130px, 1fr) 58px 50px 62px 100px 1px 56px 64px 62px 100px auto;
  margin: 0 -16px;
  /* A narrow window scrolls the table rather than crowding the columns. */
  overflow-x: auto;
}
.dbl-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.dbl-count-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.dbl-count-name {
  width: 44px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}
.dbl-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text);
}
.dbl-cuts {
  font-size: var(--text-xs);
  color: var(--text);
}
.dbl-head,
.dbl-row {
  display: grid;
  grid-template-columns: var(--dbl-cols);
  gap: 8px;
  min-width: 900px;
  align-items: center;
  padding: var(--space-2) 16px;
  box-shadow: inset 0 -0.5px 0 var(--divider-heavy);
}
.dbl-head {
  align-items: end;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
}
.dbl-head .is-num {
  text-align: right;
}
.dbl-head .is-end {
  text-align: right;
}
.dbl-head-groups {
  padding-top: var(--space-3);
  padding-bottom: 0;
  box-shadow: none;
}
.dbl-group {
  grid-column: span 4;
  font-size: var(--text-sm);
  font-weight: 700;
}
.score-row.dbl-row {
  margin: 0;
  border: none;
  border-radius: 0;
}
.score-row.dbl-row:hover {
  margin: 0;
  padding: var(--space-2) 16px;
  background: transparent;
}
.dbl-row .dbl-input {
  justify-self: end;
}
.dbl-num {
  text-align: right;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text);
}
.dbl-divider {
  align-self: stretch;
  background: var(--divider-heavy);
}
.dbl-row .ldg-status {
  justify-self: end;
}
.dbl-row.has-status .dbl-input,
.dbl-row.has-status [data-out] {
  opacity: 0.3;
  pointer-events: none;
}

/* Start From a Past Assessment (redesign PR 12): a text link on the title's
   label row, and its picker. */
.af-title-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.af-link-btn {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--active);
  cursor: pointer;
}
.af-link-btn:hover {
  text-decoration: underline;
}
/* Type: Add a Type… puts a box where the select was (assessment-type-field.js). */
.af-type-add:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.af-type-add-btns {
  display: flex;
  gap: var(--space-4);
}
.af-past-card {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.af-past-list {
  max-height: min(420px, 60vh);
  overflow-y: auto;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-past-group {
  padding: var(--space-3) 4px 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  text-transform: none;
}
.af-past-row {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 8px var(--space-3);
  border: 0;
  border-radius: 8px;
  background: none;
  text-align: left;
  font-family: var(--font-base);
  font-size: var(--text-base);
  color: var(--text);
  cursor: pointer;
}
.af-past-row:hover,
.af-past-row:focus-visible {
  background: var(--overlay-hover);
  outline: none;
}
.af-past-meta {
  flex: none;
  font-size: var(--text-sm);
  color: var(--text-2);
}

/* The assessment form's hover-overs (redesign PR 13): the shared tooltip,
   a little wider, wrapping. */
#gb-tooltip.af-tip,
#gb-tooltip.af-tip.dark {
  max-width: 360px;
  white-space: normal;
}
#gb-tooltip.af-tip:not(.dark) {
  min-width: 300px;
}
#gb-tooltip.af-tip .gb-code-tip {
  max-width: none;
}
#gb-tooltip.af-tip .af-tip-strong {
  margin-top: 4px;
  font-weight: 600;
}
.af-codes-group-name:focus-visible,
.af-comp-chip:focus-visible,
.af-rubric-card-name:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Hover-overs ease in after the pause rather than snapping (Nov 2). */
@keyframes af-ease-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
#gb-tooltip.af-tip {
  animation: af-ease-in 160ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  #gb-tooltip.af-tip {
    animation: none;
  }
}

/* ── Rubric starts in place (rubric starts plan, PR 3) ──────────
   The open start runs into its card's grey head; the others step back.
   The card is the Competency Rubric's card with a deeper shadow. */
.af-rubric-starts.has-open .af-rubric-start {
  background: var(--af-grey-quiet);
}
.af-rubric-starts.has-open .af-rubric-start b {
  color: var(--text-2);
}
.af-rubric-starts.has-open .af-rubric-start span {
  color: var(--text-3);
}
.af-rubric-starts.has-open .af-rubric-start.is-open {
  position: relative;
  z-index: 3;
  margin-bottom: calc(-1 * var(--space-3));
  padding-bottom: var(--space-6);
  border-radius: 10px 10px 0 0;
  background: var(--af-grey);
}
.af-rubric-starts.has-open .af-rubric-start.is-open b {
  color: var(--active);
}
.af-rubric-starts.has-open .af-rubric-start.is-open span {
  color: var(--text-2);
}
.af-start-card.af-rubric-card {
  position: relative;
  z-index: 2;
  box-shadow:
    0 0 0 1px var(--af-card-edge),
    0 4px 8px rgba(0, 0, 0, 0.06),
    0 16px 36px rgba(0, 0, 0, 0.14);
}
.af-start-card.joins-left {
  border-top-left-radius: 0;
}
.af-start-card.joins-right {
  border-top-right-radius: 0;
}
/* In the narrow scrolling row the open start can't reach down into its
   card, so it is marked by its colour and the card sits under the row. */
@media (max-width: 900px) {
  .af-rubric-starts.has-open .af-rubric-start.is-open {
    margin-bottom: 0;
    padding-bottom: var(--space-3);
    border-radius: 10px;
  }
  .af-start-card.af-rubric-card,
  .af-start-card.joins-left,
  .af-start-card.joins-right {
    margin-top: 8px;
    border-radius: 10px;
  }
}
.af-start-codes {
  font-weight: 700;
  color: var(--af-code);
  letter-spacing: 0.01em;
}
.af-start-pick {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--space-4);
  height: 470px;
  padding: 12px 12px var(--space-3);
}
.af-start-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.af-start-search {
  flex: none;
}
.af-start-list {
  display: grid;
  gap: 2px;
  align-content: start;
  margin-top: 8px;
  overflow-y: auto;
  min-height: 0;
}
.af-start-group {
  padding: 8px 8px 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
}
.af-start-row {
  display: grid;
  gap: 2px;
  padding: 8px var(--space-3);
  border: 0;
  border-radius: 8px;
  background: none;
  font-family: var(--font-base);
  text-align: left;
  cursor: pointer;
}
.af-start-row:hover {
  background: var(--overlay-hover);
}
.af-start-row b {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.af-start-row .af-start-codes {
  font-size: var(--text-xs);
}
.af-start-row small {
  font-size: var(--text-xs);
  color: var(--text-2);
}
.af-start-row.is-on,
.af-start-row.is-on:hover {
  background: var(--active-fill);
}
.af-start-row.is-on b,
.af-start-row.is-on small,
.af-start-row.is-on .af-start-codes {
  color: #fff;
}
.af-start-row:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.af-start-empty {
  margin: 12px 8px;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-start-preview {
  min-width: 0;
  min-height: 0;
  overflow-y: scroll;
  padding-right: 8px;
}
/* Always visible, so it's plain the grid scrolls (macOS hides plain ones). */
.af-start-preview::-webkit-scrollbar {
  width: 8px;
}
.af-start-preview::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--af-line);
}
.af-start-preview::-webkit-scrollbar-track {
  border-radius: 4px;
  background: var(--divider-subtle);
}
.af-start-preview .rb-grid {
  margin: 0;
  padding: 0;
}
@media (max-width: 760px) {
  .af-start-pick {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .af-start-list {
    max-height: 240px;
  }
  .af-start-preview {
    max-height: 360px;
  }
}

.af-copy-from {
  display: grid;
  gap: 4px;
  flex: none;
}
.af-copy-from span {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
}

/* ── Blank Rubric: the compact editor (rubric starts PR 5) ─────────
   The Competency Rubric's grid with cells to type in. */
.af-ge-name {
  width: 320px;
  max-width: 100%;
  height: 34px;
  font-weight: 700;
}
.af-ge-name.is-invalid {
  border-color: var(--score-1);
}
.af-ge-style {
  flex: none;
}
/* Menus and the picker reach past the card's edge, so it doesn't clip;
   the head and footer keep its rounded corners. */
.af-ge-card.af-rubric-card {
  overflow: visible;
}
.af-ge-card > .af-rubric-card-head {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.af-ge-card > .af-tag-rubric-note {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
.af-ge-body {
  padding: 0 var(--space-2) 8px;
}
.af-ge-grid {
  margin: 0;
}
.af-ge-crit {
  position: relative;
  vertical-align: top;
}
.af-ge-crit-name {
  display: block;
  width: calc(100% + 12px);
  margin: calc(-1 * var(--space-1)) calc(-1 * var(--space-2)) 0;
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: 6px;
  resize: none;
  overflow: hidden;
  background: transparent;
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
.af-ge-crit-name:hover {
  background: var(--overlay-hover);
}
.af-ge-crit-name:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--active);
}
.af-ge-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.af-ge-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 26px;
  padding: 0 4px 0 8px;
  border-radius: 4px;
  background: var(--af-grey);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.af-ge-chip b {
  color: var(--af-code);
}
.af-ge-x {
  border: 0;
  background: none;
  padding: 0 4px;
  font-size: 15px;
  line-height: 1;
  color: var(--text-3);
  cursor: pointer;
}
.af-ge-x:hover {
  color: var(--text);
}
.af-ge-tools {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: 8px;
  font-size: var(--text-sm);
}
.af-ge-more {
  border: 0;
  background: none;
  padding: 0 4px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-2);
  cursor: pointer;
}
.af-ge-more[aria-expanded='true'] {
  color: var(--active);
}
.af-ge-menu,
.af-ge-picker {
  position: absolute;
  z-index: 6;
  left: 8px;
  top: calc(100% - 6px);
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--af-card-edge),
    0 12px 28px rgba(0, 0, 0, 0.16);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text);
}
.af-ge-menu {
  width: 240px;
}
.af-ge-menu label,
.af-ge-points label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.af-card .af-ge-menu .af-input {
  width: 70px;
  height: 30px;
}
.af-ge-points {
  display: grid;
  gap: var(--space-2);
}
.af-ge-points > span {
  font-weight: 600;
  color: var(--text-2);
}
.af-ge-remove {
  justify-self: start;
  color: var(--score-1);
}
.af-ge-picker {
  width: 320px;
}
.af-ge-foot {
  position: relative;
  display: flex;
  gap: 16px;
}
.af-ge-foot .af-ge-picker,
.af-ge-picker.is-up {
  top: auto;
  bottom: calc(100% + 4px);
}
/* The card is a layer under the open start (z-index 2 under 3), so a
   picker or menu inside it could be drawn over by that start when it opens
   upward. While one is open the card lifts above the starts. */
.af-start-card.af-rubric-card:has(.af-ge-picker, .af-ge-menu) {
  z-index: 4;
}
/* On a phone the editor fits the card: the grid scrolls sideways inside
   it (contain keeps its width out of the form's), and the name and the
   Style switch take the head's width. */
@media (max-width: 600px) {
  .af-ge-body {
    overflow-x: auto;
    contain: inline-size;
  }
  .af-ge-grid {
    min-width: 560px;
  }
  .af-ge-name,
  .af-ge-style {
    width: 100%;
  }
  .af-ge-style .seg-btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 4px;
    padding-right: 4px;
  }
}
/* Whole Rubric Scores (PR 6): the competencies the whole rubric scores,
   one line under the head. */
.af-ge-whole {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: 8px var(--space-4);
  font-size: var(--text-sm);
}
.af-ge-whole-label {
  font-weight: 600;
  color: var(--text-2);
}
.af-ge-whole .af-ge-picker {
  top: calc(100% - 2px);
}
/* Opened above its button near the form's end: Whole Rubric Scores' top
   must give way too, or the picker is squeezed to its padding. */
.af-ge-whole .af-ge-picker.is-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.af-ge-pick-list {
  display: grid;
  gap: 1px;
  max-height: 260px;
  overflow-y: auto;
}
.af-ge-pick {
  display: flex;
  gap: 8px;
  padding: var(--space-2) 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-family: var(--font-base);
  font-size: var(--text-sm);
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.af-ge-pick:hover,
.af-ge-pick:focus-visible {
  background: var(--active-light);
  outline: none;
}
.af-ge-pick b {
  color: var(--af-code);
  min-width: 36px;
}
.af-ge-cell {
  vertical-align: top;
  padding: var(--space-2) 0;
}
/* A level cell reads like the Competency Rubric card's: the words sit in
   the cell. Empty, it is a soft field with its question; pointed at, a
   little darker; while typing, white with a blue ring. */
.af-ge-text {
  display: block;
  width: 100%;
  min-height: 88px;
  resize: none;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text);
  transition: background-color 120ms ease;
}
.af-ge-text:placeholder-shown {
  background: var(--af-grey-quiet);
}
.af-ge-text:hover {
  background: var(--af-grey);
}
.af-ge-text::placeholder {
  color: var(--text-3);
}
.af-ge-text:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--active);
}
@media (prefers-reduced-motion: reduce) {
  .af-ge-text {
    transition: none;
  }
}
.af-ge-checks {
  display: grid;
  gap: 4px;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
}
.af-ge-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.af-ge-check-input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-bottom: 1px dashed var(--af-line);
  background: transparent;
  font: inherit;
  color: var(--text);
}
.af-ge-check-input:focus {
  outline: none;
  border-bottom-color: var(--active);
}

/* ── Comments in the rubric editor (Comment Bank) ─────────────────────
   A level's comments sit under its description as the Comment Bank board
   draws them: light blue bubbles whose words start where the description's
   do. Shut, three lines at most and a use count at the right; open, each is
   a line to type in, with one empty line (a thin grey outline) after them. */
.af-cm-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}
.af-cm,
.af-cm-field {
  box-sizing: border-box;
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: var(--space-2) var(--space-3);
  background: rgba(0, 122, 255, 0.1);
  font: inherit;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text);
  text-align: left;
  transition: background-color 150ms ease;
}
.af-cm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.af-cm:hover {
  background: rgba(0, 122, 255, 0.17);
}
.af-cm-t {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.af-cm-n {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: #0058d0;
  font-variant-numeric: tabular-nums;
}
.af-cm-wrap {
  position: relative;
}
.af-cm-wrap .af-cm-n {
  position: absolute;
  top: 8px;
  right: 10px;
  pointer-events: none;
}
.af-cm-field {
  display: block;
  resize: none;
  overflow: hidden;
  padding-right: 36px;
}
.af-cm-field.is-new {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(118, 118, 128, 0.28);
}
.af-cm-field::placeholder {
  color: var(--text-3);
}
.af-cm-field:focus {
  outline: none;
  background: var(--surface);
  box-shadow:
    inset 0 0 0 1px var(--active),
    0 0 0 3px rgba(0, 122, 255, 0.25);
}
.af-ge-tools:has(.af-cm-link) {
  flex-wrap: wrap;
  row-gap: 8px;
}
.af-ge-tools:has(.af-cm-link) .af-link-btn {
  white-space: nowrap;
}
/* + Comments sits on a line of its own under + Competency and ···. */
.af-cm-link {
  flex: 0 0 100%;
  text-align: left;
}
.af-cm-overall-name {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
}
.af-cm-overall .af-cm-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-2);
  margin-top: 0;
}
@media (prefers-reduced-motion: reduce) {
  .af-cm,
  .af-cm-field {
    transition: none;
  }
}
@media (prefers-color-scheme: dark) {
  .af-cm-n {
    color: #6cb0ff;
  }
}

/* ── Assignments on a phone (Nov 3 sweep) ─────────────────────
   An open rubric card was 557 px wide at 375: the page's grid let its one
   column grow to the card's widest row, the header actions and Set
   Everyone To chips stayed on one line, and each criterion kept a 200 px
   label column beside its levels, so the level names overlapped. Under
   600 px the column holds the screen's width, those rows wrap, and a
   criterion's name goes above its levels. */
@media (max-width: 600px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .assess-header-actions,
  .rsg-student-head {
    flex-wrap: wrap;
  }
  .rsg-student {
    padding-left: 12px;
    padding-right: 12px;
  }
  .rsg-criteria {
    padding-left: 0;
  }
  .rsg-criterion-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .rsg-level {
    overflow: hidden;
    font-size: var(--text-sm);
  }
  .rsg-level-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ── The grader on a phone (Nov 3 sweep) ──────────────────────
   At 375 px the dialog kept its desktop columns: the score box ran off
   the edge, Excused and Late were cut off, and the Overall Comment was
   26 px wide beside a 200 px label column. Under 600 px a criterion's or
   competency's name goes above its levels (two to a row for rubric
   tiles), and the keyboard hint, which a phone has no use for, is left
   out. The dialog's own frame at that size is in teacher/grader.css. */
@media (max-width: 600px) {
  .grader-spacer {
    display: none;
  }
  .grader-status {
    flex-basis: 100%;
    max-width: 100%;
  }
  .grader-status-btn {
    flex: 1;
  }

  .grdt-note-row,
  .grdl-card,
  .grdp-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .grdp-card {
    padding: var(--space-4) 16px;
  }
  .grdl-controls {
    flex-wrap: wrap;
    min-width: 0;
  }
  .grdl-level {
    padding: 0 4px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-sm);
  }
  .grader-hint {
    visibility: hidden;
  }
}

/* Class Results (teacher/class-results.js): the class line's link under the
   scores. */
.cr-ldg-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--active);
  text-align: left;
  cursor: pointer;
}
.ldg-tally .cr-ldg-link {
  width: auto;
  margin-left: 4px;
}
.cr-ldg-link:hover {
  text-decoration: underline;
}

/* Class Settings › Student Page: the Send Work row (S5-F1,
   teacher/cm-student-page.js). Class Settings' own switch row inside the
   tab's row, which already draws the rule above. Kept here, not in
   dashboard.css, because the student work settings are this track's. */
.sp-send .sp-send-row {
  align-self: stretch;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Assessment form: the Student Work card (S5-F1), redrawn Nov 11 (board
   "Assessment Form" 2a to 2d). Drawn only while the class's Send Work is
   on. One list: each question on the left, its answers on the right; a
   question shows only where it applies. Beside it, the student's card. */
.af-work-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
.af-work-list {
  border: 1px solid var(--divider-subtle);
  border-radius: 10px;
  background: var(--surface);
}
.af-work-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px var(--space-4);
}
.af-work-row + .af-work-row {
  border-top: 1px solid var(--divider-subtle);
}
.af-work-ask {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.af-work-q {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  color: var(--text);
}
.af-work-hint {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.af-work-answer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.af-work-seg .seg-btn {
  padding: 0 var(--space-4);
  white-space: nowrap;
}
.af-work-until {
  display: flex;
  align-items: center;
  gap: 8px;
}
.af-work-until-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.af-card .af-work-date {
  width: 168px;
  height: 32px;
}
/* Cece Sees: the student page's card, small (s/page-view.css's look). */
.af-work-peek {
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--bg);
}
.af-peek-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  margin-bottom: var(--space-3);
}
.af-peek-card {
  padding: var(--space-4);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.af-peek-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.af-peek-unit {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.af-peek-due {
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: #fff3dc;
  color: #8a4b00;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.af-peek-title {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 700;
  line-height: 24px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.af-peek-title.is-empty {
  color: var(--text-3);
  opacity: 0.6;
}
.af-peek-cat {
  display: inline-block;
  margin-top: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.1);
  color: var(--link);
  font-size: 12px;
  font-weight: 700;
}
.af-peek-send {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.af-peek-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 10px;
  background: var(--active-fill);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.af-peek-btn.is-tint {
  background: rgba(0, 122, 255, 0.1);
  color: var(--link);
}
.af-peek-hint {
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
.af-peek-fact {
  margin: var(--space-3) 2px 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--text-2);
}
@media (max-width: 1100px) {
  .af-work-body {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .af-work-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .af-work-answer {
    align-items: flex-start;
  }
}

/* ── Work to grade on the Assignments page and in the gradebook (S6-F4).
   The gradebook's marks live here with the rest of this slice's styles. */
.assess-to-grade {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  background: var(--active-fill);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
.assess-grade-work-btn,
.assess-add-work-btn {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  /* The link blue: 5.11:1 on --bg in light, 6.95:1 in dark (--active
     read 3.7:1 in light). */
  border: 1px solid var(--link);
  background: var(--bg);
  color: var(--link);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
/* The work icon on a student's row (_workIconHtml): See the Work, the
   blue page icon, where work is in; + (Attach Work) where nothing is, quiet
   until pointed at, the size of the row's level menu button. */
.rsg-work-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--link);
  background: var(--bg);
  color: var(--link);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background-color 0.1s,
    border-color 0.1s,
    color 0.1s;
}
.rsg-work-btn svg {
  width: 15px;
  height: 15px;
}
.rsg-see-work:hover,
.rsg-see-work:focus-visible {
  background: var(--active-light);
}
.rsg-attach-btn {
  border: 1px dashed var(--border);
  color: var(--text-3);
}
.rsg-attach-btn:hover,
.rsg-attach-btn:focus-visible,
.rsg-attach-btn[aria-expanded='true'] {
  border-style: solid;
  border-color: var(--active);
  color: var(--link);
  background: var(--surface);
}
.rsg-attach-btn.is-busy {
  cursor: progress;
}
.rsg-attach-spin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--link);
  animation: rsg-attach-spin 0.8s linear infinite;
}
@keyframes rsg-attach-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .rsg-attach-spin {
    animation: none;
  }
}
.rsg-attach .assess-menu {
  min-width: 180px;
}
/* Link… under the +: a web address and an optional name. */
.rsg-attach-link {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  width: 300px;
  padding: var(--space-3);
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--divider-medium),
    0 10px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: default;
}
.rsg-attach-link .af-input {
  width: 100%;
  height: 36px;
}
.rsg-attach-msg {
  margin: 0;
  font-size: 13px;
  color: var(--score-1-dark);
}
.rsg-attach-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.rsg-attach-actions .btn {
  height: 32px;
  padding: 0 var(--space-4);
}
/* Links attached as work, under the pages in the grader's work pane. */
.grader-work-links {
  background: var(--surface);
  border-radius: 12px;
  padding: var(--space-3) var(--space-4);
  font-size: 14px;
}
.grader-work-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.grader-work-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: var(--link);
  text-decoration: none;
  min-width: 0;
}
.grader-work-link:hover .grader-work-link-name {
  text-decoration: underline;
}
.grader-work-link svg {
  flex-shrink: 0;
}
.grader-work-link-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grader-work-link-host {
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}
/* The open card's ⋯ menu (AssignmentsPage). */
.assess-menu-wrap {
  position: relative;
  display: inline-flex;
}
.assess-more-btn {
  width: 30px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(118, 118, 128, 0.12);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.assess-more-btn:hover {
  background: rgba(118, 118, 128, 0.22);
}
/* Blue only while its menu is open, as on the board: one solid primary per screen. */
.assess-more-btn[aria-expanded='true'] {
  background: var(--active-fill);
  color: #fff;
}
.assess-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 220px;
  padding: var(--space-1);
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--divider-medium),
    0 10px 28px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  cursor: default;
}
/* Opened upward, or from the button's left edge, when there's no room
   below or to the left (_placeCardMenu). */
.assess-menu.is-up {
  top: auto;
  bottom: calc(100% + 6px);
}
.assess-menu.is-left {
  right: auto;
  left: 0;
}
.assess-setto {
  display: flex;
  flex-direction: column;
}
/* Set Everyone To's levels: beside the ⋯ menu, placed against the window
   by teacher/card-menu.js. */
.assess-menu.assess-submenu {
  position: fixed;
  top: 0;
  right: auto;
  min-width: 180px;
  z-index: 31;
}
.assess-sub-caret {
  margin-left: auto;
  color: var(--text-3);
}
.assess-sub-btn[aria-expanded='true'] {
  background: var(--active-light);
}
.assess-menu[hidden] {
  display: none;
}
.assess-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 8px var(--space-3);
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}
.assess-menu-item svg,
.assess-menu-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.assess-menu-item:hover,
.assess-menu-item:focus-visible {
  background: var(--active-light);
  outline: none;
}
.assess-menu-item.is-delete {
  color: var(--score-1-dark);
}
.assess-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--divider-medium);
}
.assess-menu-dot {
  width: 10px;
  height: 10px;
  border-radius: 5px;
  flex-shrink: 0;
}
.assess-menu-dot.l1 {
  background: var(--score-1);
}
.assess-menu-dot.l2 {
  background: var(--score-2);
}
.assess-menu-dot.l3 {
  background: var(--score-3);
}
.assess-menu-dot.l4 {
  background: var(--score-4);
}
/* Set Everyone To changes the open grid only: a closed card's menu leaves it out. */
.assess-card:not(.open) .assess-header-actions .assess-setto {
  display: none;
}
.grader-inline-work {
  color: var(--text-2);
  font-size: 13px;
  white-space: nowrap;
}
/* The gradebook's To Grade: Missing's chip (gradebook.css .gb-status) in
   blue, with the Inbox's tray in place of a word, so it fits the column. */
.gb-to-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 22px;
  height: 18px;
  border-radius: 4px;
  background: var(--active-fill);
  color: #fff;
  vertical-align: middle;
}
.gb-work-camera {
  display: inline-flex;
  margin-left: var(--space-1);
  color: var(--active);
  vertical-align: middle;
}
.gb-key-item .gb-work-camera {
  margin: 0 4px 0 0;
}
.gb-key-item .gb-to-grade {
  margin-right: 4px;
}

/* ── Mark Up (S9-F1): teacher/markup.js, shared/markup-draw.js ───────── */
/* The marks lie over the page on its surface, in the grader's work pane
   and on the Mark Up screen, and turn and fit with it. */
.markup-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.markup-pin circle {
  fill: #d93025;
  stroke: #fff;
  stroke-width: 3;
}
.markup-pin text {
  fill: #fff;
  font-weight: 700;
  font-family: inherit;
}
.markup-pin.is-pending circle {
  fill: var(--active);
}
/* ── Group work in the grader (S12-F2): Students in This Group ───────── */
.grader-members-hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-2);
}
.grader-member-same {
  font-size: 13px;
  color: var(--text-2);
}
/* What was changed for one member: amber, as on the board. */
.grader-member-same.is-changed {
  color: var(--score-2-dark);
  font-weight: 600;
}
.grader-change-one {
  position: relative;
  margin-top: var(--space-3);
}
.grader-change-one .grader-member-menu {
  top: 36px;
  left: 0;
  right: auto;
}
.grader-change-one-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  /* The link blue, as Grade Submissions: --active read 3.7:1 in light. */
  border: 1px solid var(--link);
  background: var(--bg);
  color: var(--link);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.grader-change-one-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ── A student's reflection in the grader (S10-F3) ───────────────────── */
.grader-reflect {
  background: var(--surface);
  border: 1px solid var(--divider, #e5e5ea);
  border-left: 4px solid var(--active);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: var(--space-4);
  font-size: 14px;
}
.grader-reflect-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.grader-reflect-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.grader-reflect-when {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}
.grader-reflect-sense {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2, #f2f2f4);
  color: var(--text-2);
}
.grader-reflect-sense.is-unsure {
  background: rgba(255, 159, 10, 0.15);
  color: #8a5300;
}
.grader-reflect-who {
  margin: var(--space-2) 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.grader-reflect-said {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.grader-reflect-now {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-2);
}
.grader-reflect-label {
  display: block;
  margin: var(--space-3) 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.grader-reflect-input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 14px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--divider-heavy, #d1d1d6);
  resize: vertical;
}
.grader-reflect-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: 8px;
}
.grader-reflect-only {
  font-size: 12px;
  color: var(--text-2);
}
.grader-reflect-msg {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--score-1, #c0392b);
}
.grader-reflect-msg:empty {
  display: none;
}

/* ── Revisions in the grader (S11-F1, S11-F3) ────────────────────────── */
/* Return for Revision beside Return; Take Back while a revision is out;
   the Revising mark in the row and in a gradebook cell; the Revision card
   with Before and After; "Was … on the Oct 30 version" on a criterion;
   the Return for Revision sheet over the grader. */
.grader-revise-btn,
.grader-takeback-btn {
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--divider-heavy);
  border-radius: 17px;
  background: var(--surface);
  /* The link blue: --active read 4.02:1 on white. */
  color: var(--link);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
}
.grader-revise-btn:hover,
.grader-takeback-btn:hover {
  background: var(--seg-track);
}
.grader-revise-btn:disabled,
.grader-takeback-btn:disabled {
  color: var(--text-3);
  cursor: default;
}
.grader-revision-line:empty {
  display: none;
}
.grader-revising-mark {
  display: inline-flex;
  align-items: center;
  border-radius: 12px;
  background: var(--seg-track);
  color: var(--text-2);
  font-weight: 700;
  white-space: nowrap;
}
.grader-revising-mark {
  height: 24px;
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
}
/* The gradebook's Revising: a grey arrow turning back, in the cell's corner
   (gradebook.css, "A cell's corner marks") and in the key. */
.gb-revising {
  display: inline-flex;
  color: var(--text-2);
}
.grader-revision-msg {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.grader-revision {
  background: var(--surface);
  border: 1px solid var(--divider-heavy);
  border-left: 4px solid var(--active);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: var(--space-4);
  font-size: 14px;
}
.grader-revision-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.grader-revision-who {
  margin: var(--space-2) 0 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}
.grader-revision-said {
  margin: 0;
  white-space: pre-wrap;
}
.grader-revision-ba {
  margin-top: var(--space-3);
  padding-top: 8px;
  border-top: 1px solid var(--divider-heavy);
}
.grader-revision-ba-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
}
.grader-revision-ba dl {
  margin: 0;
}
.grader-revision-ba-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: var(--space-1) 0;
  align-items: baseline;
}
.grader-revision-ba-row dt,
.grader-revision-ba-row dd {
  margin: 0;
}
.grader-revision-before {
  color: var(--text-2);
}
.grader-revision-after {
  font-weight: 600;
}
.grader-revision-ba-row.is-result {
  font-weight: 700;
}
.grader-revision-ba-row .grader-draft-mark {
  height: 20px;
  padding: 0 var(--space-2);
  font-size: 11px;
}
/* "Was Developing + on the Oct 30 version" as an amber chip under the level
   bar, "Pick the level for the new version." beside it (MainRevised). */
.grader-was {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--space-3);
}
.grdl-card > .grader-was {
  grid-column: 2;
}
.grader-panel-col .grdl-card > .grader-was {
  grid-column: 1;
}
.grader-was-line,
.grader-was-hint {
  margin: 0;
  font-size: 13px;
  color: var(--score-2-dark);
}
.grader-was-line {
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--score-2) 16%, transparent);
  font-weight: 700;
}
.grader-work-versions {
  flex-shrink: 0;
}
.grader-sheet-back {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.32);
}
.grader-sheet {
  width: min(480px, 100%);
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: 20px var(--space-6);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.grader-sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.grader-sheet-sub {
  margin: 2px 0 12px;
  font-size: 13px;
  color: var(--text-2);
}
.grader-sheet-label {
  display: block;
  margin: 12px 0 4px;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
}
.grader-sheet-fix,
.grader-sheet-by,
.grader-sheet-crit {
  width: 100%;
  box-sizing: border-box;
  padding: 8px var(--space-3);
  border: 1px solid var(--divider-heavy);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.grader-sheet-fix {
  resize: vertical;
}
.grader-sheet-keep {
  margin: 0;
  font-size: 14px;
}
.grader-sheet-msg {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-2);
}
.grader-sheet-msg:empty {
  display: none;
}
.grader-sheet-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ── Handouts and Links (the assessment form, board "3a. A Handout and
   Two Links, Adding a Link"): the items in two columns, the link row while
   a link is being added, then + Add a PDF and + Add a Link. ── */
.af-res-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.af-res-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  height: 44px;
  padding: 0 var(--space-2) 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
/* Only the one just added, or the link row as it opens, comes in. */
.af-res-in {
  animation: af-res-in 180ms var(--ease-out);
}
@keyframes af-res-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}
.af-res-icon {
  flex: none;
}
.af-res-icon-doc,
.af-res-icon-video {
  color: var(--danger);
}
.af-res-icon-link {
  color: var(--link);
}
.af-res-name {
  flex: 1;
  min-width: 0;
  font-size: var(--text-md);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.af-res-meta {
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-res-remove {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}
.af-res-remove:hover {
  background: var(--overlay-hover);
  color: var(--text);
}
.af-res-linkrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--bg);
}
.af-res-linkrow .af-input {
  width: auto;
  height: 40px;
}
.af-res-url {
  flex: 1.4 1 260px;
}
.af-res-title {
  flex: 1 1 200px;
}
.af-res-linkrow .btn {
  height: 40px;
  padding: 0 var(--space-4);
}
.af-res-adds {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.af-label + .af-res-adds,
.af-label + .af-res-linkrow {
  margin-top: 0;
}
.af-res-add {
  height: 32px;
  padding: 0 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--active);
  cursor: pointer;
  transition:
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out);
}
.af-res-add:hover:not(:disabled) {
  border-color: var(--active);
  background: var(--active-light);
}
.af-res-add:disabled {
  color: var(--text-2);
  cursor: default;
}
.af-res-hint {
  margin-left: 4px;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-res-msg {
  margin: var(--space-2) 0 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.af-res-msg[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .af-res-list {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion: reduce) {
  .af-res-in {
    animation: none;
  }
}

/* ── List view (teacher/assign-list.js) ─────────────────────────────
   One row per assessment, its settings along the row. Mockup approved
   Nov 16 (https://claude.ai/artifact/QewmqUbXPfuuQcfAzSsRqJ). */
.alv-page {
  padding: 12px 12px 24px;
}
.alv-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.alv-fchip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px var(--space-2) 4px var(--space-3);
  border: 1px solid var(--divider-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.78125rem;
  color: var(--text-2);
  cursor: pointer;
}
.alv-fchip-check {
  padding-right: var(--space-3);
}
.alv-fchip.is-on {
  border-color: var(--active);
  color: var(--active);
}
.alv-fchip select {
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--text);
  max-width: 180px;
  cursor: pointer;
}
.alv-fchip input {
  margin: 0;
}
.alv-count {
  font-size: 0.78125rem;
  color: var(--text-2);
  margin-left: 4px;
}
.alv {
  background: var(--surface);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 0 0 0.5px var(--divider-medium);
  overflow: hidden;
}
.alv-scroll {
  overflow-x: auto;
}
.alv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}
.alv-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-2);
  padding: 8px 4px var(--space-2);
  border-bottom: 1px solid var(--divider-medium);
  white-space: nowrap;
  vertical-align: bottom;
}
.alv-sort {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.alv-sort:hover {
  color: var(--text);
}
.alv-arrow {
  color: var(--active);
  margin-left: var(--space-1);
}
.alv-hint {
  display: block;
  font-weight: 400;
  font-size: 0.6875rem;
  color: var(--text-3);
}
.alv-table td {
  padding: 4px 4px;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid var(--divider-subtle);
}
.alv-table tbody tr:last-child td {
  border-bottom: 0;
}
.alv-table tbody tr.is-ticked td {
  background: var(--active-light);
}
.alv-table tbody tr.is-moving {
  opacity: 0.4;
}
.alv-table tbody tr.drop-before td {
  box-shadow: inset 0 2px 0 var(--active);
}
.alv-table tbody tr.drop-after td {
  box-shadow: inset 0 -2px 0 var(--active);
}
.alv-grip-col {
  width: 22px;
  padding-left: 8px !important;
}
.alv-tick-col {
  width: 26px;
}
.alv-tick-col input {
  margin: 0;
}
.alv-grip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 26px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text-3);
  cursor: grab;
  padding: 0;
}
.alv-grip:hover,
.alv-grip:focus-visible {
  background: var(--overlay-hover);
  color: var(--text);
}
.alv-title-col {
  width: 40%;
}
.alv-title,
.alv-cell,
.alv-factor-in {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  color: var(--text);
}
.alv-title {
  width: 100%;
  min-width: 210px;
  padding: 4px var(--space-2);
  font-weight: 600;
  font-size: 0.84375rem;
}
.alv-cell {
  padding: 4px 2px;
  max-width: 136px;
  cursor: pointer;
}
.alv-date {
  width: 114px;
}
.alv-cell.is-empty {
  color: var(--text-3);
}
.alv-title:hover,
.alv-cell:hover,
.alv-factor-in:hover {
  border-color: var(--divider-strong);
}
.alv-title:focus,
.alv-cell:focus,
.alv-factor-in:focus {
  outline: none;
  border-color: var(--active);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--active-light);
}
.alv-cat {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.alv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.alv-factor {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.alv-step {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: var(--seg-track);
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.alv-step:hover {
  background: var(--overlay-pressed);
}
.alv-factor-in {
  width: 38px;
  padding: var(--space-1) 0;
  text-align: center;
}
.alv-sub {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-3);
  margin: 1px 0 0 4px;
}
.alv-share.is-changed,
.alv-warn {
  color: var(--notice-text);
}
.alv-scoring {
  display: inline-block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  font-size: 0.71875rem;
  color: var(--text-2);
  border: 1px solid var(--divider-strong);
  border-radius: 6px;
  padding: 2px var(--space-2);
}
.alv-open-col {
  text-align: right;
  padding-right: var(--space-3) !important;
}
.alv-link {
  border: 0;
  background: none;
  padding: 4px var(--space-2);
  font: inherit;
  color: var(--link);
  cursor: pointer;
  border-radius: 6px;
}
.alv-link:hover {
  background: var(--active-light);
}
.alv-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  background: var(--active-light);
  border-bottom: 1px solid var(--divider-medium);
}
.alv-bar-n {
  color: var(--active);
}
.alv-bar select,
.alv-bar input[type='date'] {
  font: inherit;
  font-size: 0.78125rem;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--divider-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
}
.alv-bar-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.alv-bar-done {
  color: var(--text-2);
  margin-left: var(--space-2);
}
.alv-sort-bar {
  background: var(--notice-bg);
  color: var(--notice-text);
}
.alv-spacer {
  flex: 1;
}
.alv-none {
  padding: 28px 12px !important;
  text-align: center;
  color: var(--text-2);
  white-space: normal !important;
}

/* ── Drafts (teacher/assign-draft.js) ────────────────────────────────
   A Draft is seen only here until it's assigned: a dashed outline, the
   Draft chip, and Assign where a card's grading would be. */
.assess-card.is-draft {
  background: transparent;
  box-shadow: none;
  outline: 1.5px dashed var(--divider-medium);
  outline-offset: -1.5px;
}
.assess-card.is-draft .assess-title {
  color: var(--text-2);
}
/* Assign is what a Draft is for: shown without a hover. */
.assess-card.is-draft .assess-header-actions {
  opacity: 1;
  background: none;
}
.assess-card.is-draft .assess-header-actions > * {
  pointer-events: auto;
}
.draft-badge,
.draft-sees-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 1px 8px;
  border-radius: var(--radius-xl);
  white-space: nowrap;
}
.draft-badge {
  color: var(--text-2);
  border: 1.5px dashed var(--divider-medium);
}
.draft-sees-badge {
  font-weight: 600;
  color: var(--active);
  background: var(--active-light);
}
.draft-assign-btn {
  padding: var(--space-1) var(--space-4);
  font-size: 13px;
}
.draft-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: 4px 16px 16px var(--space-8);
  font-size: 14px;
  color: var(--text-2);
}
.draft-body p {
  flex: 1 1 280px;
  margin: 0;
}
.assess-menu-item.draft-unassign-off {
  opacity: 0.45;
  cursor: default;
}
.alv-title-col .draft-badge {
  margin-right: var(--space-2);
  vertical-align: middle;
}
.alv-title-col .draft-badge + .alv-title {
  width: calc(100% - 60px);
  /* The badge takes its own room beside the title, so the column need not be wider for it. */
  min-width: 150px;
}
.alv-assign {
  padding: 4px var(--space-4);
  font-size: 13px;
}

/* ── Six-Point rubrics (shared/six-point.js) ──────────────────────────
   Six scores where a rubric has four levels: the editor's level cards, the
   checklist columns and the score buttons, each score in the colour of the
   level it counts as. */
/* Two rows of three: six columns leave the checkbox labels unreadable. */
.rubric-editor.six-point .rubric-levels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rubric-editor.six-point .rubric-level-card {
  border-bottom: 1px solid var(--border);
}
.rubric-editor.six-point .rubric-level-card:nth-child(3n) {
  border-right: none;
}
.rubric-editor.six-point .rubric-level-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.rubric-level-counts {
  font-size: var(--text-xs);
  color: var(--text-3);
}
.rsg-criterion-row.is-six .rsg-checklist,
.grdt-crit.is-six .rsg-checklist {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.sp6-levels {
  display: flex;
  gap: 0;
}
button.sp6-btn {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.sp6-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1.1;
  padding: 2px 2px;
}
.rsg-level.sp6-btn {
  height: 40px;
}
.sp6-num {
  font-weight: 700;
  font-size: var(--text-base);
}
.sp6-word {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sp6-btn.is-on .sp6-word,
.sp6-btn.active .sp6-word {
  font-weight: 600;
}
@container (max-width: 360px) {
  .sp6-word {
    display: none;
  }
}
@media (max-width: 900px) {
  .rubric-editor.six-point .rubric-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rubric-editor.six-point .rubric-level-card:nth-child(3n) {
    border-right: 1px solid var(--border);
  }
  .rubric-editor.six-point .rubric-level-card:nth-child(2n) {
    border-right: none;
  }
}
@media (max-width: 560px) {
  .rubric-editor.six-point .rubric-levels {
    grid-template-columns: 1fr;
  }
}

/* ── The rubric editor window (Nov 19) ────────────────────────────────
   New and Edit from the Rubric Bank: the Blank Rubric card, large, over
   the page. Its level headers are typed in place, each with a ▾ menu, and
   a + adds a level (shared/rubric-scale.js). */
.rb-ed-overlay {
  padding: 24px;
  backdrop-filter: blur(3px);
}
.rb-ed-window {
  display: flex;
  flex-direction: column;
  width: min(1480px, 100%);
  max-height: calc(100vh - 48px);
  border-radius: 16px;
  background: var(--bg, var(--surface));
  box-shadow:
    0 0 0 1px var(--af-card-edge),
    0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: auto;
}
.rb-ed-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: var(--space-4) 24px var(--space-3);
}
.rb-ed-title {
  margin: 0;
  font-size: var(--text-xl, 1.35rem);
  font-weight: 700;
  color: var(--text);
}
.rb-ed-hint {
  flex: 1;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.rb-ed-window > .rubric-guard-note {
  margin: 0 24px 8px;
}
.rb-ed-window > .af-ge-card {
  flex: none;
  display: flex;
  flex-direction: column;
  margin: 0 24px 24px;
}
/* Room under the grid for a level's menu; the window scrolls, not the grid. */
.rb-ed-window > .af-ge-card > .af-ge-body {
  min-height: 300px;
}
.rb-ed-window .af-ge-name {
  min-width: 320px;
}
.rb-ed-window .af-ge-text {
  min-height: 120px;
}

/* Level headers: the name typed on the colour, its number, a ▾ menu. */
.af-ge-level-head {
  position: relative;
  white-space: normal;
}
.af-ge-level-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.af-ge-colname {
  flex: 1;
  min-width: 0;
  margin: calc(-1 * var(--space-1)) 0 calc(-1 * var(--space-1)) calc(-1 * var(--space-2));
  padding: var(--space-1) var(--space-2);
  border: 0;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: inherit;
}
.af-ge-colname:hover {
  background: rgba(255, 255, 255, 0.16);
}
.af-ge-colname:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.af-rubric-card .af-ge-level-head .rb-level-value {
  float: none;
  flex: none;
}
.af-ge-colmore {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.85;
}
.af-ge-colmore:hover,
.af-ge-colmore[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.22);
  opacity: 1;
}
.af-ge-counts-line {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  font-weight: 500;
  opacity: 0.9;
}
.af-ge-colmenu {
  position: absolute;
  z-index: 7;
  right: 0;
  top: calc(100% + 6px);
  display: grid;
  gap: 2px;
  width: 230px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--af-card-edge),
    0 12px 28px rgba(0, 0, 0, 0.18);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text);
  text-align: left;
}
.af-ge-counts {
  display: grid;
  gap: 4px;
  padding: 4px var(--space-2) 8px;
  font-weight: 600;
  color: var(--text-2);
}
.af-card .af-ge-counts .af-input,
.af-ge-counts .af-input {
  width: 100%;
  height: 32px;
}
.af-ge-colnote {
  margin: 0;
  padding: 4px var(--space-2) 8px;
  color: var(--text-3);
}
.af-ge-menu-item {
  display: block;
  width: 100%;
  padding: var(--space-2) 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--text);
  cursor: pointer;
}
.af-ge-menu-item:hover:not(:disabled) {
  background: var(--overlay-hover);
}
.af-ge-menu-item:disabled {
  color: var(--text-3);
  cursor: default;
}
.af-ge-menu-item.is-danger {
  color: var(--score-1);
}
.af-ge-menu-row {
  display: flex;
  gap: 2px;
  margin: 0 -4px;
}
.af-ge-menu-row .af-ge-menu-item {
  width: auto;
  flex: 1;
  text-align: center;
}
/* The + at the far end of the header row. */
.af-ge-addcol-head,
.af-ge-addcol-cell {
  width: 40px;
  padding: 0;
}
.af-ge-addcol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px dashed var(--af-card-edge, var(--border));
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition:
    border-color 0.12s,
    color 0.12s;
}
.af-ge-addcol:hover {
  border-color: var(--active);
  color: var(--active);
}
