/* Printable graded rubric handouts (teacher/rubric-print.js).

   The sheets render into #rubric-print-root, kept off screen so they can be
   measured, and become the only thing on the page while
   body.rubric-print-active is set. Sheet boxes are sized in inches to match
   the @page rule rubric-print.js injects per layout. Everything is black,
   white and grey: the handouts are photocopied. */

#rubric-print-root {
  position: absolute;
  top: 0;
  left: -30000px;
  width: 11in;
  pointer-events: none;
  background: #fff;
  color: #000;
  font-family: var(--font-base);
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* ── Pages and sheets ─────────────────────────────────────── */
.rubric-page {
  display: grid;
  box-sizing: border-box;
  overflow: hidden;
  break-after: page;
  page-break-after: always;
  break-inside: avoid;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.rubric-page:last-child {
  break-after: auto;
  page-break-after: auto;
}
.rubric-page.layout-full {
  width: 8in;
  height: 10.5in;
  grid-template-columns: 1fr;
}
.rubric-page.layout-half {
  width: 10.5in;
  height: 8in;
  grid-template-columns: 1fr 1fr;
}
.rubric-page.layout-quarter {
  width: 8in;
  height: 10.5in;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.rubric-sheet {
  box-sizing: border-box;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  padding: 0;
  line-height: 1.3;
}
.layout-half .rubric-sheet,
.layout-quarter .rubric-sheet {
  padding: 0.12in;
  line-height: 1.22;
}
/* Smaller sheets: tighter cells, narrower criterion column */
.layout-half .rubric-table th,
.layout-half .rubric-table td,
.layout-quarter .rubric-table th,
.layout-quarter .rubric-table td {
  padding: 0.28em 0.32em;
}
.layout-half .rubric-sheet-inner,
.layout-quarter .rubric-sheet-inner {
  gap: 0.4em;
}
.layout-half .rubric-head,
.layout-quarter .rubric-head {
  padding-bottom: 0.3em;
}
.layout-quarter .rubric-crit-codes {
  display: none;
}
/* Cut lines between sheets */
.layout-half .rubric-sheet:first-child {
  border-right: 1px dashed #9a9a9a;
}
.layout-quarter .rubric-sheet:nth-child(odd) {
  border-right: 1px dashed #9a9a9a;
}
.layout-quarter .rubric-sheet:nth-child(-n + 2) {
  border-bottom: 1px dashed #9a9a9a;
}
.rubric-sheet-inner {
  display: flex;
  flex-direction: column;
  gap: 0.6em;
  height: 100%;
}

/* ── Header ───────────────────────────────────────────────── */
.rubric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1em;
  padding-bottom: 0.45em;
  border-bottom: 2px solid #000;
}
.rubric-head-main {
  min-width: 0;
}
.rubric-student {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.15;
}
/* A blank rubric: a line to write the student's name on. */
.rubric-name-line {
  display: flex;
  align-items: flex-end;
  gap: 0.4em;
  width: 100%;
  max-width: 22em;
}
.rubric-name-line .rubric-label {
  font-size: 0.6em;
  color: #000;
}
.rubric-name-rule {
  flex: 1;
  height: 1em;
  border-bottom: 1px solid #000;
}
.rubric-meta {
  font-size: 0.9em;
  color: #333;
  margin-top: 0.2em;
}
.rubric-overall {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.rubric-overall-value {
  font-size: 1.5em;
  font-weight: 700;
}
.rubric-overall-word,
.rubric-status {
  font-size: 0.9em;
  color: #333;
}
.rubric-label {
  display: block;
  font-size: 0.72em;
  font-weight: 700;
  color: #555;
}
.rubric-comment-row .rubric-label,
.rubric-feedback .rubric-label {
  display: inline;
  margin-right: 0.6em;
}

/* The assessment's Description, under the name and above the rubric,
   with the teacher's line breaks kept (as the student page shows it). */
.rubric-desc {
  font-size: 0.95em;
  line-height: 1.35;
  white-space: pre-line;
  overflow-wrap: break-word;
}

/* ── Rubric grid ──────────────────────────────────────────── */
.rubric-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 1em;
}
.rubric-table th,
.rubric-table td {
  border: 1px solid #000;
  padding: 0.4em 0.45em;
  vertical-align: top;
  text-align: left;
  overflow-wrap: break-word;
}
/* 22% holds a long word ("Consequence") whole on a half sheet. */
.rubric-crit-head {
  width: 22%;
  font-size: 0.85em;
  font-weight: 700;
}
.rubric-level-head {
  font-size: 0.95em;
  font-weight: 700;
  text-align: center !important;
  background: #f1f1f1;
}
.rubric-crit {
  background: #f7f7f7;
  font-weight: 700;
}
.rubric-crit-name {
  font-weight: 700;
  /* A name wraps between words, never inside one. */
  hyphens: manual;
  -webkit-hyphens: manual;
  overflow-wrap: normal;
}
.rubric-crit-codes {
  margin-top: 0.3em;
  font-size: 0.78em;
  font-weight: 400;
  color: #555;
}
/* Descriptors at 0.8 of the sheet's text (Colin, 2026-10-22: "a bit
   smaller so they fit"): tried 1 to 0.75 on 4, 6 and 8 rows; 0.8 fits 8 rows
   on a full page and 6 on a half sheet without shrinking the names, and
   stays readable once a half sheet's text is shrunk to fit. */
.rubric-cell {
  position: relative;
  color: #222;
  font-size: 0.8em;
  line-height: 1.25;
}
/* Black and white only: the handouts go through the photocopier. The
   scored cell is a light grey fill, a heavy border and a ✓ mark. */
/* An Advanced Rubric's checkboxes under the descriptor: an empty square,
   or black with a white tick. */
.rubric-checks {
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  margin-top: 0.45em;
  font-weight: 400;
}
.rubric-check {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
  font-size: 0.86em;
  line-height: 1.25;
}
.rubric-box {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-top: 0.1em;
  border: 1px solid #000;
  background: #fff;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
}
.rubric-check.is-on .rubric-box {
  background: #000;
  color: #fff;
}
.rubric-cell.is-scored {
  color: #000;
  font-weight: 600;
  background: #e2e2e2;
  outline: 2.5px solid #000;
  outline-offset: -2.5px;
}
.rubric-mark {
  float: right;
  margin: -0.1em -0.1em 0.1em 0.4em;
  padding: 0 0.35em;
  border-radius: 0.3em;
  background: #000;
  color: #fff;
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.4;
}
.rubric-comment-row td {
  background: #fff;
  border-top: none;
  font-size: 0.92em;
  padding-top: 0.3em;
  padding-bottom: 0.35em;
}

/* ── Feedback ─────────────────────────────────────────────── */
.rubric-feedback {
  border: 1px solid #000;
  padding: 0.4em 0.5em;
  font-size: 0.95em;
  line-height: 1.35;
}
/* No feedback written: ruled lines for writing on by hand, filling the rest
   of the sheet (at least three), so a short rubric doesn't end in an empty
   box and a long one still has room. Line pitch suits handwriting. */
.rubric-feedback.is-lines {
  /* Basis 0: the spare lines must not count toward the sheet's height. */
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  border: none;
  padding: 0;
  --rp-line: 0.32in;
}
.rubric-feedback.is-lines .rubric-label {
  display: block;
}
.rubric-lines {
  flex: 1 1 0;
  min-height: calc(var(--rp-line) * 3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Each line is a border, which prints with or without background graphics;
   the lines past the box's height are cut off whole. */
.rubric-line {
  flex: 0 0 var(--rp-line);
  box-sizing: border-box;
  border-bottom: 1px solid #8a8a8a;
}
.layout-half .rubric-feedback.is-lines {
  --rp-line: 0.3in;
}
.layout-quarter .rubric-feedback.is-lines {
  --rp-line: 0.26in;
}
.layout-quarter .rubric-lines {
  min-height: calc(var(--rp-line) * 2);
}
/* Next Steps Reflection: the question over its lines. */
.rubric-reflect-q {
  font-size: 0.92em;
}

/* ── Overflow marker (screen only, for the dialog's count) ────── */
.rubric-sheet.is-overflowing {
  outline: 2px solid #d32f2f;
}

/* ── Options dialog ───────────────────────────────────────── */
/* The box is One Print Box (teacher/print-box.css). Here: the page shown,
   scaled down from the staged sheets, and the Pick Students list. */
.rp-preview {
  display: flex;
  justify-content: center;
  align-items: center;
}
.rp-preview-frame {
  position: relative;
  overflow: hidden;
  background: #fff;
  color: #000;
  font-family: var(--font-base);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.rp-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-2);
}
/* A name in the list with its print state, and Mark Not Printed on hover
   or keyboard focus for a printed one. */
.rp-pick-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 26px;
}
/* Each column is half the list. A name and its note ("changed since Nov 2")
   wider than that wrap the note, whole, onto a second line instead of
   running into the next column. */
.rp-pick-row .rp-pick-option {
  flex: 1;
  min-width: 0;
}
.rp-pick-option > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rp-pick-option .pb-help,
.rp-pick-option .rp-tag {
  white-space: nowrap;
}
.rp-tag {
  font-weight: 600;
}
.rp-tag.is-changed {
  color: var(--score-2-text);
}
.rp-tag.is-new {
  color: var(--active);
}
.rp-unmark {
  display: none;
  flex-shrink: 0;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--active);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px var(--space-2);
  cursor: pointer;
  white-space: nowrap;
}
.rp-pick-row.can-unmark:hover .rp-unmark,
.rp-pick-row.can-unmark:focus-within .rp-unmark {
  display: inline-block;
}
.rp-pick-row.can-unmark:hover .rp-pick-option .pb-help,
.rp-pick-row.can-unmark:hover .rp-pick-option .rp-tag,
.rp-pick-row.can-unmark:focus-within .rp-pick-option .pb-help,
.rp-pick-row.can-unmark:focus-within .rp-pick-option .rp-tag {
  display: none;
}
/* Already Printed, under Students. */
.rp-printed {
  padding: var(--space-1) 2px 0;
  font-size: var(--text-sm);
  color: var(--text-2);
}
.rp-printed-title {
  font-weight: 600;
  color: var(--text);
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  body.rubric-print-active {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body.rubric-print-active > :not(#rubric-print-root) {
    display: none !important;
  }
  body.rubric-print-active #rubric-print-root {
    position: static;
    left: auto;
    width: auto;
    pointer-events: auto;
  }
  body.rubric-print-active .rubric-sheet.is-overflowing {
    outline: none;
  }
}

/* Single-point rubric: Criterion | Work On | Proficient Standard | Went
   Beyond. Black and white like every sheet; the standard's cell names the
   student's level and is shaded and boxed as a scored cell. */
.rubric-sp-standard-head {
  width: 38%;
}
.rubric-sp-note {
  font-weight: 400;
}
.rubric-sp-level {
  display: block;
  margin-bottom: 0.3em;
  font-weight: 700;
  font-size: 1.05em;
}

/* ── Printed marker (Assignments page and grader) ───────────
   Beside a student's name once their completed rubric is printed: plain
   small text, grey when it matches what was printed, amber when it has
   changed since. */
.rp-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-base);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-3);
  white-space: nowrap;
}
.rp-mark.is-changed {
  color: var(--score-2-text);
}
.rp-mark[hidden] {
  display: none;
}

/* Six-Point rubrics: six score columns on the same page, so the criterion
   column and the type give a little room. */
.rubric-table.is-six .rubric-crit-head {
  width: 16%;
}
.rubric-table.is-six .rubric-level-head {
  font-size: 0.82em;
}
.rubric-table.is-six td.rubric-cell {
  font-size: 0.72em;
}
.rubric-six-num {
  display: block;
  font-size: 1.25em;
}
