/* The student's page for one class (s/page-view.js; S4-F1): the frame, the
   four tabs, To Do, Sent and Back, and All Assignments.

   Loaded by the student page (s/index.html) and by the teacher's Preview as
   Student (teacher/app.html), which draws the same HTML inside a phone or a
   Chromebook. So every rule is under .sp-view and sets every property it
   needs (the teacher's own stylesheet has rules for .sp-row and others),
   and the Chromebook layout follows the width of the page itself (a
   container query), not the width of the window: in the preview, a
   Chromebook is a frame on a teacher's screen. */

.sp-view {
  --sp-bg: #f5f5f7;
  --sp-card: #ffffff;
  --sp-text: #1d1d1f;
  --sp-text-2: #636366;
  --sp-line: #d1d1d6;
  --sp-field: #c7c7cc;
  --sp-fill: #e5e5ea;
  --sp-blue: #007aff;
  /* The blue under white words (buttons). White on --sp-blue is 4.02:1; on this, 5.57:1. */
  --sp-blue-fill: #0066cc;
  --sp-blue-text: #0066cc;
  --sp-blue-soft: rgba(0, 122, 255, 0.08);
  --sp-green: #166534;
  --sp-green-soft: #bbf7d0;
  --sp-amber: #b45309;
  --sp-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  container-type: inline-size;
  container-name: sp-view;
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: var(--font-base);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
}
.sp-view *,
.sp-view *::before,
.sp-view *::after {
  box-sizing: border-box;
}
.sp-view button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* The header: the class and its block, the tabs on a Chromebook, Log Out. */
.sp-view .sp-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 10px 12px 18px;
  background: var(--sp-card);
  border: 0;
  border-bottom: 1px solid var(--sp-line);
}
/* The class's name and block: plain text, so a student in two classes
   always sees which one this is. Switch Class is in Settings. */
.sp-view .sp-head-class {
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--sp-text);
}
.sp-view .sp-head-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 600;
}
/* At Large and Larger on a narrow phone the class's name takes two lines
   rather than being cut short: it is how a student knows which class this is. */
.sp-view.sp-text-large .sp-head-title,
.sp-view.sp-text-larger .sp-head-title,
html.sp-size-large .sp-view .sp-head-title,
html.sp-size-larger .sp-view .sp-head-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  line-height: 1.2;
}
/* …and the block goes under the name rather than squeezing it. */
.sp-view.sp-text-large .sp-head-class,
.sp-view.sp-text-larger .sp-head-class,
html.sp-size-large .sp-view .sp-head-class,
html.sp-size-larger .sp-view .sp-head-class {
  flex-wrap: wrap;
  row-gap: 2px;
}
.sp-view .sp-pill {
  flex: none;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sp-fill);
  color: #58585d;
}
.sp-view .sp-head-gap {
  flex: 1;
}
/* The gear: Settings. 44 px square, in the header's right corner. */
.sp-view .sp-gear {
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--sp-text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-view .sp-gear[aria-expanded='true'] {
  background: var(--sp-fill);
}
@media (hover: hover) and (pointer: fine) {
  .sp-view .sp-gear:hover {
    background: var(--sp-fill);
  }
}
.sp-view .sp-head-icon {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--sp-blue-text);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-view .sp-head-icon[aria-pressed='true'] {
  background: var(--sp-blue-soft);
}

/* The tab's body. */
.sp-view .sp-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}
.sp-view .sp-page-title {
  margin: 4px 4px 2px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.sp-view .sp-page-title:focus {
  outline: none;
}
.sp-view .sp-hidden-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  margin: 0;
}
.sp-view .sp-lead {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}
.sp-view .sp-empty {
  padding: 24px 4px;
  color: var(--sp-text-2);
}
.sp-view .sp-fine {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sp-text-2);
  text-align: center;
}
.sp-view .sp-msg {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--sp-text);
}
.sp-view .sp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
.sp-view .sp-btn-quiet {
  background: var(--sp-fill);
}
.sp-view .sp-btn-tint {
  background: rgba(0, 122, 255, 0.12);
  color: #0058d0;
}
.sp-view .sp-btn-pill {
  border-radius: 22px;
  padding: 0 18px;
}
.sp-view .sp-btn[disabled] {
  opacity: 0.6;
}

/* Outstanding and Upcoming. */
.sp-view .sp-segments {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  border-radius: 9px;
  padding: 2px;
}
.sp-view .sp-segment {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #58585d;
  font-size: 14px;
}
.sp-view .sp-segment-on {
  background: #fff;
  color: var(--sp-text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

/* The list. */
.sp-view .sp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--sp-card);
  border-radius: 14px;
  box-shadow: var(--sp-shadow);
  overflow: hidden;
}
.sp-view .sp-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
}
.sp-view .sp-row + .sp-row {
  border-top: 1px solid var(--sp-fill);
}
.sp-view .sp-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sp-field);
}
.sp-view .sp-dot-back {
  background: var(--sp-green);
}
.sp-view .sp-dot-missing {
  background: var(--sp-amber);
}
.sp-view .sp-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sp-view .sp-row-title {
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: inherit;
  overflow-wrap: anywhere;
}
.sp-view .sp-row-sub {
  font-size: 13px;
  line-height: 1.35;
  color: var(--sp-text-2);
}

/* The cards: one under another on a phone, scrolled through (Colin,
   2026-11-14: "they're used to scroll"). */
.sp-view .sp-side {
  display: none;
}
.sp-view .sp-split {
  margin: 0;
}
.sp-view .sp-deck {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-view .sp-piece {
  scroll-margin-top: 12px;
}
.sp-view .sp-piece-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--sp-card);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.05);
}
.sp-view .sp-piece-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sp-view .sp-piece-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.sp-view .sp-piece-title:focus {
  outline: none;
}
.sp-view .sp-flag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sp-fill);
  color: #3a3a3c;
}
.sp-view .sp-flag-due {
  background: #fff1db;
  color: #8a4b00;
}
.sp-view .sp-flag-missing {
  background: #fde8d7;
  color: #8a3b00;
}
.sp-view .sp-flag-back {
  background: var(--sp-green-soft);
  color: var(--sp-green);
}
.sp-view .sp-flag-new {
  background: rgba(0, 122, 255, 0.1);
  color: #0058d0;
}

.sp-view .sp-level {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sp-fill);
  color: var(--sp-text);
  font-variant-numeric: tabular-nums;
}
.sp-view .sp-lv-1 {
  background: #fde2e1;
  color: #8a1c1c;
}
.sp-view .sp-lv-2 {
  background: #fef3c7;
  color: #92400e;
}
.sp-view .sp-lv-3 {
  background: var(--sp-green-soft);
  color: var(--sp-green);
}
.sp-view .sp-lv-4 {
  background: #dbeafe;
  color: #1e40af;
}

.sp-view .sp-row-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
}
.sp-view .sp-row-go {
  flex: none;
  color: var(--sp-field);
}

/* The results didn't load (calc.js could not be fetched). */
.sp-view .sp-no-results {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sp-card);
  border: 1px solid var(--sp-line);
  border-radius: 12px;
  padding: 12px 14px;
}
.sp-view .sp-no-results .sp-msg {
  flex: 1;
}
.sp-view .sp-no-results .sp-btn {
  flex: none;
}

/* All caught up. */
.sp-view .sp-caught-up {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px 24px;
}
.sp-view .sp-out-mark {
  width: 84px;
  height: 84px;
  border-radius: 42px;
  background: var(--sp-green-soft);
  color: var(--sp-green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sp-view .sp-caught-up-words {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.sp-view .sp-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  margin: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #1b5e20;
  font-size: 13px;
  font-weight: 700;
}
.sp-view .sp-btn-primary {
  background: var(--sp-blue-fill);
  color: #fff;
}
.sp-view .sp-btn-big {
  min-height: 50px;
  border-radius: 14px;
  font-size: 17px;
}
.sp-view .sp-piece-card .sp-btn-big {
  margin-top: auto;
}

/* Your Feedback and The Whole Rubric (S4-F3). On a phone the screen is the
   feedback alone, with the way back at the top; on a Chromebook the list
   stays on the left and the feedback takes the card's place. */
.sp-view .sp-feedback {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.sp-view .sp-fb-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  margin: -8px 0 0 -8px;
  padding: 0 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--sp-blue-text);
  font-size: 16px;
}
.sp-view .sp-fb-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 2px;
}
.sp-view .sp-fb-title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.sp-view .sp-fb-title:focus {
  outline: none;
}
.sp-view .sp-fb-sub {
  margin: 0;
  font-size: 14px;
  color: #58585d;
}
.sp-view .sp-fb-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-view .sp-fb-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 16px;
  background: var(--sp-card);
  border-radius: 18px;
}
.sp-view .sp-fb-label {
  font-size: 13px;
  font-weight: 700;
  color: #58585d;
}
.sp-view .sp-fb-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.sp-view .sp-fb-big {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.sp-view .sp-fb-beside {
  font-size: 16px;
  font-weight: 600;
  color: #3a3a3c;
  font-variant-numeric: tabular-nums;
}
.sp-view .sp-lvt-1 {
  color: #8a1c1c;
}
.sp-view .sp-lvt-2 {
  color: #8a4b00;
}
.sp-view .sp-lvt-3 {
  color: #1b5e20;
}
.sp-view .sp-lvt-4 {
  color: #1e40af;
}
.sp-view .sp-fb-rows {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}
.sp-view .sp-fb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}
.sp-view .sp-fb-row-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}
.sp-view .sp-feedback .sp-level {
  font-size: 15px;
  padding: 4px 12px;
  white-space: nowrap;
}
.sp-view .sp-fb-points {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 18px;
}
.sp-view .sp-fb-score {
  flex: none;
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.sp-view .sp-fb-outof {
  color: #6e6e73;
  font-weight: 600;
}
.sp-view .sp-fb-meter {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sp-view .sp-fb-pct {
  font-size: 17px;
  font-weight: 700;
}
.sp-view .sp-fb-bar {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--sp-fill);
  overflow: hidden;
}
.sp-view .sp-fb-fill {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--sp-text-2);
}
.sp-view .sp-lvf-1 {
  background: #b91c1c;
}
.sp-view .sp-lvf-2 {
  background: #c07a00;
}
.sp-view .sp-lvf-3 {
  background: #2e7d32;
}
.sp-view .sp-lvf-4 {
  background: #1d4ed8;
}
.sp-view .sp-fb-comment {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: #e8f1ff;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sp-view .sp-fb-levels {
  padding: 4px 16px;
  gap: 4px;
}
.sp-view .sp-fb-levels-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
}
.sp-view .sp-fb-levels-btn span {
  flex: 1;
}
.sp-view .sp-fb-legend {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sp-view .sp-fb-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
}
.sp-view .sp-fb-legend-chip {
  flex: none;
  width: 104px;
}
.sp-view .sp-fb-fine {
  margin: 4px 0 10px;
  font-size: 14px;
  color: #3a3a3c;
}
.sp-view .sp-fb-section {
  margin: 6px 2px 0;
  font-size: 20px;
  font-weight: 800;
}
.sp-view .sp-fb-crits {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-view .sp-fb-criterion {
  gap: 12px;
}
.sp-view .sp-fb-crit-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.sp-view .sp-fb-crit-name {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.sp-view .sp-fb-part {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.sp-view .sp-fb-part-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sp-view .sp-fb-part-title {
  font-size: 13px;
  font-weight: 700;
}
.sp-view .sp-fb-amber,
.sp-view .sp-fb-blue {
  padding: 10px 12px;
  border-radius: 12px;
}
.sp-view .sp-fb-amber {
  background: #fff7e8;
}
.sp-view .sp-fb-amber .sp-fb-part-title,
.sp-view .sp-fb-to-mark {
  color: #8a4b00;
}
.sp-view .sp-fb-to-mark {
  flex: none;
  margin-top: 2px;
}
.sp-view .sp-fb-blue {
  background: #e8f1ff;
}
.sp-view .sp-fb-blue .sp-fb-part-title {
  color: #0c2d6b;
}
.sp-view .sp-fb-goal .sp-fb-part-title {
  color: #1b5e20;
}
.sp-view .sp-fb-lvt-1 .sp-fb-part-title {
  color: #8a1c1c;
}
.sp-view .sp-fb-lvt-2 .sp-fb-part-title {
  color: #8a4b00;
}
.sp-view .sp-fb-lvt-3 .sp-fb-part-title {
  color: #1b5e20;
}
.sp-view .sp-fb-lvt-4 .sp-fb-part-title {
  color: #1e40af;
}
.sp-view .sp-fb-words {
  font-size: 15px;
  overflow-wrap: anywhere;
}
.sp-view .sp-fb-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 15px;
}
.sp-view .sp-fb-box {
  flex: none;
  margin-top: 2px;
  color: #2e7d32;
}
.sp-view .sp-fb-box-open {
  color: #8e8e93;
}
.sp-view .sp-fb-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e8f1ff;
  font-size: 15px;
  overflow-wrap: anywhere;
}
.sp-view .sp-whole .sp-fb-card {
  gap: 4px;
}
.sp-view .sp-fb-whole-levels {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp-view .sp-fb-whole-level {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
}
.sp-view .sp-fb-whole-name {
  flex: none;
  width: 104px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #58585d;
}
.sp-view .sp-fb-whole-words {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #3a3a3c;
}
.sp-view .sp-fb-you {
  box-shadow: inset 0 0 0 2px currentColor;
}
.sp-view .sp-fb-you .sp-fb-whole-name {
  font-weight: 800;
  color: inherit;
}
.sp-view .sp-fb-you .sp-fb-whole-words {
  color: var(--sp-text);
}
.sp-view .sp-fb-you-tag {
  display: inline-block;
  padding: 0 7px;
  border-radius: 8px;
  background: var(--sp-text);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
}

/* On a phone, Your Feedback is a screen of its own: no class header, no
   To Do, Sent and Back, no tabs along the bottom (the board). */
@container sp-view (max-width: 759px) {
  .sp-view.sp-on-feedback .sp-head,
  .sp-view.sp-on-feedback .sp-tabs-bottom,
  .sp-view.sp-on-feedback .sp-fb-segments {
    display: none;
  }
  .sp-view .sp-split-feedback {
    margin: 0;
  }
}

/* Reflections (S4-F4): on a phone the open ones as cards and the rest as
   lists; on a Chromebook the list on the left and the one picked on the
   right. */
.sp-view .sp-forms-desk {
  display: none;
}
.sp-view .sp-forms-phone {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
}
.sp-view .sp-form-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--sp-card);
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.sp-view .sp-form-card .sp-btn-big {
  align-self: stretch;
}
.sp-view .sp-form-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.sp-view .sp-form-title:focus {
  outline: none;
}
.sp-view .sp-form-sub {
  margin: 0;
  font-size: 14px;
  color: #3a3a3c;
}
.sp-view .sp-form-line {
  margin: 0;
  font-size: 17px;
}
.sp-view .sp-form-mark {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sp-fill);
  color: #58585d;
}
.sp-view .sp-form-mark-done {
  background: var(--sp-green-soft);
  color: var(--sp-green);
}

.sp-view .sp-dot-new {
  background: var(--sp-blue);
}

.sp-view .sp-flag-updated {
  background: #dbeafe;
  color: #1e40af;
}
.sp-view .sp-was-wrap {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.sp-view .sp-was {
  font-size: 12px;
  color: #58585d;
  white-space: nowrap;
}

.sp-view .sp-tab {
  position: relative;
}
.sp-view .sp-tab-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 4px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #d70015;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* The four tabs: along the bottom on a phone. The header's copy shows on a
   Chromebook instead. */
.sp-view .sp-tabs {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  margin: 0;
  background: var(--sp-card);
  border-top: 1px solid rgba(0, 0, 0, 0.09);
  padding: 6px 0 calc(16px + env(safe-area-inset-bottom));
}
.sp-view .sp-tabs-top {
  display: none;
}
.sp-view .sp-tab {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  line-height: 1.15;
  color: #58585d;
}
.sp-view .sp-tab-on {
  color: var(--sp-blue-text);
  font-weight: 600;
}

@container sp-view (min-width: 760px) {
  .sp-view .sp-head {
    min-height: 60px;
  }
  .sp-view .sp-tabs-bottom {
    display: none;
  }
  .sp-view .sp-tabs-top {
    display: flex;
    flex: none;
    position: static;
    gap: 4px;
    padding: 3px;
    border: 0;
    border-radius: 10px;
    background: rgba(118, 118, 128, 0.12);
  }
  .sp-view .sp-tabs-top .sp-tab {
    flex: none;
    flex-direction: row;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 14px;
  }
  .sp-view .sp-tabs-top .sp-tab-icon {
    display: none;
  }
  .sp-view .sp-tabs-top .sp-tab-badge {
    position: static;
    order: 2;
    margin-left: 6px;
  }
  .sp-view .sp-tabs-top .sp-tab-on {
    background: #fff;
    color: var(--sp-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  }
  /* The Chromebook board: the list on the left, the card picked on the right. */
  .sp-view .sp-split {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    margin: 0;
    align-items: start;
  }
  .sp-view .sp-side {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: var(--sp-card);
    border-radius: 14px;
  }
  .sp-view .sp-side-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
  }
  .sp-view .sp-side-on {
    background: #e8f1ff;
  }
  .sp-view .sp-side-title {
    font-size: 15px;
    font-weight: 500;
  }
  .sp-view .sp-side-on .sp-side-title {
    font-weight: 700;
  }
  .sp-view .sp-deck {
    display: block;
    overflow: visible;
  }
  .sp-view .sp-piece {
    display: none;
    padding: 0;
  }
  .sp-view .sp-piece.sp-picked {
    display: block;
  }
  .sp-view .sp-piece-card {
    box-shadow: var(--sp-shadow);
  }
  .sp-view .sp-piece-title {
    font-size: 28px;
    font-weight: 800;
  }
  .sp-view .sp-page {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 24px;
  }
  .sp-view .sp-page-title {
    font-size: 26px;
  }
  .sp-view .sp-forms-phone {
    display: none;
  }
  .sp-view .sp-forms-desk {
    display: block;
  }
  .sp-view .sp-forms-desk .sp-form-card {
    gap: 14px;
    padding: 24px 28px;
    box-shadow: var(--sp-shadow);
  }
  .sp-view .sp-forms-desk .sp-form-title {
    font-size: 28px;
    font-weight: 800;
  }
  .sp-view .sp-forms-desk .sp-btn-big {
    align-self: flex-start;
    padding: 0 28px;
  }
  /* Your Feedback on a Chromebook: the list stays; no way back is needed. */
  .sp-view .sp-fb-back {
    display: none;
  }
  .sp-view .sp-fb-title {
    font-size: 28px;
  }
  .sp-view .sp-fb-top-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }
  .sp-view .sp-fb-crits {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }
  .sp-view .sp-feedback > .sp-btn-big {
    align-self: flex-start;
    padding: 0 24px;
  }
}

/* My Learning (S13-F2; 2026-11-14): the grade, then the student's work.
   Each level has one colour (--sp-ml-1 to 4); the ladder uses it. */
.sp-view .sp-ml {
  --sp-ml-1: #dc2626;
  --sp-ml-2: #d97706;
  --sp-ml-3: #2e7d32;
  --sp-ml-4: #1d4ed8;
  --sp-ml-amber-bg: #fff3dc;
  --sp-ml-amber-ink: #7c4a03;
  --sp-ml-at: var(--sp-fill);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.sp-view .sp-ml-card {
  display: block;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--sp-card);
  box-shadow: var(--sp-shadow);
  color: var(--sp-text);
  font: inherit;
  text-align: left;
  width: 100%;
}
.sp-view .sp-ml-card-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-text-2);
}
.sp-view .sp-ml-icon {
  flex: none;
  display: block;
}
.sp-view .sp-ml-ink-1 {
  color: var(--sp-ml-1);
}
.sp-view .sp-ml-ink-2 {
  color: var(--sp-ml-2);
}
.sp-view .sp-ml-ink-3 {
  color: var(--sp-ml-3);
}
.sp-view .sp-ml-ink-4 {
  color: var(--sp-ml-4);
}

/* The grade: what it covers, then the word (or letter) on the left and
   the ladder beside it. */
.sp-view .sp-ml-overall {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sp-view .sp-ml-period {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-text-2);
}
.sp-view .sp-ml-overall-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.sp-view .sp-ml-overall-text {
  flex: 1 1 auto;
  min-width: 0;
}
.sp-view .sp-ml-at {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.sp-view .sp-ml-at-lead {
  font-size: 14px;
  font-weight: 600;
  color: var(--sp-text-2);
}
.sp-view .sp-ml-at-word {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
}
.sp-view .sp-ml-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
}
.sp-view .sp-ml-trend-up {
  color: var(--sp-green);
}
.sp-view .sp-ml-trend-down {
  color: var(--sp-text-2);
}
.sp-view .sp-ml-overall-letter .sp-ml-overall-row {
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
.sp-view .sp-ml-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  height: 72px;
  padding: 0 10px;
  border-radius: 16px;
  font-size: 34px;
  font-weight: 800;
}
.sp-view .sp-ml-letter-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sp-view .sp-ml-ie {
  font-size: 15px;
  font-weight: 600;
}
.sp-view .sp-ml-pct {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* The ladder: four rising steps, those reached in the student's level's
   colour, You outlined. */
.sp-view .sp-ml-ladder {
  display: grid;
  grid-template-columns: repeat(4, 24px);
  align-items: end;
  gap: 5px;
  flex: none;
}
.sp-view .sp-ml-at-1 {
  --sp-ml-at: var(--sp-ml-1);
}
.sp-view .sp-ml-at-2 {
  --sp-ml-at: var(--sp-ml-2);
}
.sp-view .sp-ml-at-3 {
  --sp-ml-at: var(--sp-ml-3);
}
.sp-view .sp-ml-at-4 {
  --sp-ml-at: var(--sp-ml-4);
}
.sp-view .sp-ml-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.sp-view .sp-ml-bar {
  display: block;
  width: 100%;
  border-radius: 4px;
  background: var(--sp-fill);
}
.sp-view .sp-ml-step-1 .sp-ml-bar {
  height: 16px;
}
.sp-view .sp-ml-step-2 .sp-ml-bar {
  height: 26px;
}
.sp-view .sp-ml-step-3 .sp-ml-bar {
  height: 38px;
}
.sp-view .sp-ml-step-4 .sp-ml-bar {
  height: 50px;
}
.sp-view .sp-ml-bar-on {
  background: var(--sp-ml-at);
}
.sp-view .sp-ml-step-on .sp-ml-bar {
  box-shadow:
    0 0 0 2px var(--sp-card),
    0 0 0 4px var(--sp-ml-at);
}
.sp-view .sp-ml-you {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--sp-text);
  color: var(--sp-card);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}
.sp-view .sp-ml-ladder-named {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sp-view .sp-ml-ladder-named .sp-ml-step-1 .sp-ml-bar {
  height: 20px;
}
.sp-view .sp-ml-ladder-named .sp-ml-step-2 .sp-ml-bar {
  height: 34px;
}
.sp-view .sp-ml-ladder-named .sp-ml-step-3 .sp-ml-bar {
  height: 48px;
}
.sp-view .sp-ml-ladder-named .sp-ml-step-4 .sp-ml-bar {
  height: 62px;
}
.sp-view .sp-ml-ladder-named .sp-ml-bar {
  border-radius: 6px;
}
.sp-view .sp-ml-step-name {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sp-text-2);
  text-align: center;
  overflow-wrap: anywhere;
}
.sp-view .sp-ml-step-on .sp-ml-step-name {
  font-weight: 800;
  color: var(--sp-ml-at);
}

/* Rows. */
.sp-view .sp-ml-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sp-view .sp-ml-rows > li {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--sp-fill);
}
.sp-view .sp-ml-rows > li:first-child {
  border-top: 0;
}
.sp-view .sp-ml-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}

.sp-view .sp-ml-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 0;
  text-align: center;
}

/* What the server also tells (S4-W1): the unit and the teacher's
   Description. Each shows only when the page is sent it. */
.sp-view .sp-piece-unit {
  margin: 0;
  font-size: 13px;
  color: var(--sp-text-2);
  overflow-wrap: anywhere;
}

.sp-view .sp-piece-about {
  margin: 0;
  font-size: 14.5px;
  color: #3a3a3c;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.sp-view .sp-core {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--sp-blue-soft);
}

.sp-view .sp-core-name {
  font-size: 14px;
}
.sp-view .sp-fb-comment-words {
  margin: 0;
}

/* Sending (S5-F2, S5-F3): Send My Work, a closed piece, a card sent. */
.sp-view .sp-dot-sent {
  background: var(--sp-blue);
}
.sp-view .sp-flag-sent {
  background: rgba(0, 122, 255, 0.1);
  color: var(--sp-blue-text);
}
.sp-view .sp-send-closed-line,
.sp-view .sp-send-line {
  margin: 0;
  font-size: 14px;
  color: #3a3a3c;
  line-height: 1.4;
}
.sp-view .sp-send-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}
.sp-view .sp-send-thumb {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--sp-line);
  background: var(--sp-fill);
}
.sp-view .sp-send-change {
  display: flex;
  gap: 8px;
}
.sp-view .sp-send-change .sp-btn {
  flex: 1;
}

/* See Your Work, with Show Marks (S9-F3; the board "Student: Returned Photo
   With Marks"). The teacher's marks are drawn over the photo, never into
   it: lines in one drawing the size of the page, ticks, crosses and
   numbered notes placed on it by percent. */
.sp-view .sp-fb-work {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border: 0;
  text-align: left;
  color: var(--sp-text);
  font: inherit;
  cursor: pointer;
}
.sp-view .sp-fb-work-words {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sp-view .sp-fb-work-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--sp-blue-text);
}
.sp-view .sp-fb-work-line {
  font-size: 14px;
  color: #58585d;
}
.sp-view .sp-work-head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -8px 0 0 -8px;
}
.sp-view .sp-work-words {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sp-view .sp-work-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.sp-view .sp-work-title:focus {
  outline: none;
}
.sp-view .sp-work-page {
  position: relative;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--sp-card);
  box-shadow: var(--sp-shadow);
}
.sp-view .sp-work-img {
  display: block;
  width: 100%;
  height: auto;
}
.sp-view .sp-work-over {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sp-view .sp-work-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sp-view .sp-work-pen {
  fill: none;
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sp-view .sp-work-highlight {
  fill: none;
  stroke-width: 14px;
  stroke-linecap: round;
  stroke-opacity: 0.3;
}
.sp-view .sp-work-ink .sp-ink-red {
  stroke: #d70015;
}
.sp-view .sp-work-ink .sp-ink-green {
  stroke: #248a3d;
}
.sp-view .sp-work-ink .sp-ink-blue {
  stroke: #0040dd;
}
.sp-view .sp-work-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.sp-view .sp-work-mark.sp-ink-red {
  color: #d70015;
}
.sp-view .sp-work-mark.sp-ink-green {
  color: #248a3d;
}
.sp-view .sp-work-mark.sp-ink-blue {
  color: #0040dd;
}
.sp-view .sp-work-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 13px;
  background: #d70015;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.sp-view .sp-work-pin-in {
  position: static;
  flex: none;
  transform: none;
  box-shadow: none;
}
.sp-view .sp-work-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  list-style: none;
  background: var(--sp-card);
  border-radius: 14px;
}
.sp-view .sp-work-notes li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  line-height: 1.4;
}
.sp-view .sp-work-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sp-view .sp-work-next svg {
  transform: scaleX(-1);
}
.sp-view .sp-work-bar .sp-head-icon:disabled {
  color: var(--sp-field);
}
.sp-view .sp-work-dots {
  display: flex;
  gap: 6px;
}
.sp-view .sp-work-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--sp-field);
}
.sp-view .sp-work-dot-on {
  background: var(--sp-text);
}
.sp-view .sp-work-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--sp-text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
}
.sp-view .sp-work-track {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--sp-field);
}
.sp-view .sp-work-switch[aria-checked='true'] .sp-work-track {
  background: var(--sp-green-line, #2e7d32);
}
.sp-view .sp-work-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.sp-view .sp-work-switch[aria-checked='true'] .sp-work-knob {
  left: 21px;
}
.sp-view .sp-work-retry {
  align-self: flex-start;
}
.sp-view .sp-work {
  max-width: 620px;
}
/* Save or Print on an open handout (s/page-view.js handoutOutButton): one
   button at the right of the top bar, which never wraps. The title keeps
   room for whole words (10em): where the button would squeeze it below that
   (a narrow phone, large text), the button moves under the title instead.
   Its sheet is the Your Classes sheet (.sp-set above), each row its icon and
   its name. */
.sp-view .sp-handout .sp-work-head {
  flex-wrap: wrap;
  row-gap: 8px;
}
.sp-view .sp-handout .sp-work-head .sp-work-words {
  flex: 1 1 10em;
}
.sp-view .sp-handout-outbtn {
  flex: none;
  gap: 6px;
  margin-left: auto;
  padding: 0 12px;
  white-space: nowrap;
}
.sp-view .sp-out-icon {
  flex: none;
  width: 22px;
  height: 22px;
}
.sp-view .sp-handout-outbtn .sp-out-icon {
  width: 18px;
  height: 18px;
}
.sp-view .sp-out-list .sp-class {
  gap: 14px;
}
.sp-view .sp-out-list .sp-out-icon {
  color: #0066cc;
}
.sp-view .sp-out-list .sp-class[aria-disabled='true'] {
  opacity: 0.6;
}

/* For This Assignment (Handouts and Links; the board "What the Student
   Sees (Phone)"): the teacher's handout and links under the Description,
   in a grey box on the card. A handout opens in the page; a link in a new
   tab. */
.sp-view .sp-res {
  display: flex;
  flex-direction: column;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--sp-bg);
}
.sp-view .sp-res-head {
  margin: 0;
  padding-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #3a3a3c;
}
.sp-view .sp-res-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px solid var(--sp-fill);
  background: transparent;
  color: var(--sp-text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 150ms ease-out;
}
.sp-view .sp-res-row:last-child {
  border-bottom: 0;
}
.sp-view .sp-res-row:active {
  opacity: 0.6;
}
.sp-view .sp-res-row:hover .sp-res-name {
  text-decoration: underline;
}
.sp-view .sp-res-icon {
  flex: none;
}
.sp-view .sp-res-icon-doc,
.sp-view .sp-res-icon-video {
  color: #c62828;
}
.sp-view .sp-res-icon-link {
  color: var(--sp-blue-text);
}
.sp-view .sp-res-words {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.sp-view .sp-res-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  overflow-wrap: anywhere;
}
.sp-view .sp-res-line {
  font-size: 13px;
  color: var(--sp-text-2);
  overflow-wrap: anywhere;
}
.sp-view .sp-res-go {
  flex: none;
  color: #8e8e93;
}
@media (prefers-reduced-motion: reduce) {
  .sp-view .sp-res-row {
    transition: none;
  }
}

/* Reflect on Feedback (S10): its button under Your Feedback, and Your Plan
   From Last Time on the next piece to do. */
.sp-view .sp-fb-reflect {
  align-self: stretch;
}
.sp-view .sp-plan {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
  padding: 12px 14px;
  border-left: 4px solid var(--sp-green-line, #2e7d32);
  border-radius: 12px;
  background: #f0f7f1;
}
.sp-view .sp-plan-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-green);
}
.sp-view .sp-plan-words {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.sp-view .sp-plan-from {
  margin: 0;
  font-size: 13px;
  color: #58585d;
}

/* Group work (S12-F1): the group's line on a card. */
.sp-view .sp-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp-view .sp-group-sent {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.sp-view .sp-group-line {
  margin: 0;
  font-size: 15px;
  color: #58585d;
}

/* Revisions (S11-F2): Needs Revision on a card and on Your Feedback, and
   Before and After once the revision's grade is back. */
.sp-view .sp-dot-revise {
  background: #c2410c;
}
.sp-view .sp-flag-revise {
  background: #ffedd5;
  color: #9a3412;
}

.sp-view .sp-revise {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0;
  padding: 12px 14px;
  border-left: 4px solid #c2410c;
  border-radius: 12px;
  background: #fff7ed;
}
.sp-view .sp-revise-who,
.sp-view .sp-revise-first,
.sp-view .sp-revise-crit-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #9a3412;
}
.sp-view .sp-revise-fix {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.sp-view .sp-revise-crit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.sp-view .sp-revise-crit-name {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sp-card);
  border: 1px solid #fed7aa;
  font-size: 13px;
  font-weight: 600;
}
.sp-view .sp-revise .sp-btn {
  margin-top: 4px;
}
.sp-view .sp-ba-versions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sp-view .sp-ba-version {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  min-width: 0;
}
.sp-view .sp-ba-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--sp-line);
  background: var(--sp-fill);
}
.sp-view .sp-ba-version figcaption {
  display: flex;
  flex-direction: column;
}
.sp-view .sp-ba-label {
  font-size: 15px;
  font-weight: 700;
}
.sp-view .sp-ba-sent {
  font-size: 13px;
  color: var(--sp-text-2);
}
.sp-view .sp-ba-rows {
  list-style: none;
  margin: 0;
  padding: 4px 16px;
  background: var(--sp-card);
  border-radius: 18px;
}
.sp-view .sp-ba-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--sp-fill);
}
.sp-view .sp-ba-row:first-child {
  border-top: 0;
}
.sp-view .sp-ba-name {
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
}
.sp-view .sp-ba-move {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sp-view .sp-ba-was .sp-level {
  opacity: 0.75;
}
.sp-view .sp-ba-same {
  font-size: 13px;
  color: var(--sp-text-2);
}
.sp-view .sp-ba-result .sp-ba-name {
  font-weight: 700;
}
.sp-view .sp-ba-said {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sp-card);
}
.sp-view .sp-ba-said-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #58585d;
}
.sp-view .sp-ba-did .sp-ba-said-title {
  color: var(--sp-green);
}
.sp-view .sp-ba-words {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* ── The boards' cards and lists (board drift fixes, Nov 11) ───────── */

/* A card's unit, in plain grey under its status band (Colin, 2026-11-17). */
.sp-view .sp-piece-head {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--sp-text-2);
  overflow-wrap: anywhere;
}
.sp-view .sp-flag {
  gap: 5px;
}
.sp-view .sp-pill-icon {
  flex: none;
  display: block;
}
.sp-view .sp-flag-closed {
  background: var(--sp-fill);
  color: #3a3a3c;
}

.sp-view .sp-core {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 0;
  background: none;
}

.sp-view .sp-core-name {
  display: inline-flex;
  padding: 3px 10px;
  border: 1.5px solid var(--sp-blue);
  border-radius: 999px;
  color: var(--sp-blue-text);
  font-size: 13px;
  font-weight: 600;
}

/* A grey row with a lock (Closed; Sent, Being Graded). */
.sp-view .sp-lock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sp-bg);
  color: var(--sp-text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.sp-view .sp-lock-row .sp-pill-icon {
  color: #3a3a3c;
}

/* A button with an icon before its words. */
.sp-view .sp-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Your Plan From Last Time: amber, apart from What You're Graded On (SDeckPlan). */
.sp-view .sp-plan {
  border-left: 0;
  background: #fff4e0;
}
.sp-view .sp-plan-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #8a4b00;
}

/* Needs Revision: the teacher's words in a blue-tinted block; Revise By is the amber pill under the title. */
.sp-view .sp-flag-revise {
  background: #fff1db;
  color: #8a4b00;
}
.sp-view .sp-revise {
  gap: 10px;
  margin: 0;
  padding: 0;
  border-left: 0;
  border-radius: 0;
  background: none;
  flex: 1;
}
.sp-view .sp-revise-said {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #e8f1ff;
}
.sp-view .sp-revise-who {
  color: var(--sp-blue-text);
}
.sp-view .sp-revise-first,
.sp-view .sp-revise-crit-title {
  color: #58585d;
}
.sp-view .sp-revise-crit-name {
  border-color: rgba(0, 122, 255, 0.25);
}

/* The Chromebook list's dots: due orange; Missing and Needs Revision brown; Sent blue; Back green. */
.sp-view .sp-dot-due {
  background: #e08a00;
}
.sp-view .sp-dot-missing,
.sp-view .sp-dot-revise {
  background: #9a4a0a;
}

/* A list's heading: Reflections' Open Now, Done and Coming Up. */
.sp-view .sp-list-head {
  margin: 14px 4px 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sp-text-2);
}
.sp-view .sp-list + .sp-list {
  margin-top: 12px;
}

/* What the Levels Mean: open until closed; on a Chromebook always open, the chips in a row. */
.sp-view .sp-fb-levels-shut .sp-fb-levels-list {
  display: none;
}

/* Before and After: one card with the versions, the rows and Your Result,
   the old result muted; Asked and Did in one card under it. */
.sp-view .sp-ba-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-view .sp-ba-card,
.sp-view .sp-ba-saids {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--sp-card);
  box-shadow: var(--sp-shadow);
}
.sp-view .sp-ba-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--sp-text-2);
}
.sp-view .sp-ba-card .sp-ba-rows {
  padding: 0;
  border-radius: 0;
  background: none;
}
.sp-view .sp-ba-panel {
  border-top: 1px solid var(--sp-fill);
}
.sp-view .sp-ba-card .sp-ba-result {
  border-top: 1px solid var(--sp-fill);
}
.sp-view .sp-ba-old {
  font-size: 15px;
  color: var(--sp-text-2);
  font-variant-numeric: tabular-nums;
}
.sp-view .sp-ba-new {
  font-size: 19px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.sp-view .sp-ink-1 {
  color: #8a1c1c;
}
.sp-view .sp-ink-2 {
  color: #92400e;
}
.sp-view .sp-ink-3 {
  color: var(--sp-green);
}
.sp-view .sp-ink-4 {
  color: #1e40af;
}
.sp-view .sp-ba-saids .sp-ba-said {
  padding: 0;
  border-radius: 0;
  background: none;
}
.sp-view .sp-ba-saids .sp-ba-said-title {
  color: #8a4b00;
}
.sp-view .sp-ba-saids .sp-ba-did .sp-ba-said-title {
  color: var(--sp-blue-text);
}
.sp-view .sp-ba-version:last-child .sp-ba-photo {
  border: 2px solid var(--sp-blue);
}
.sp-view .sp-ba-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@container sp-view (min-width: 760px) {
  .sp-view .sp-fb-levels-btn {
    display: none;
  }
  .sp-view .sp-fb-levels {
    padding: 12px 16px;
  }
  .sp-view .sp-fb-levels .sp-fb-levels-list {
    display: block;
  }
  .sp-view .sp-fb-levels .sp-fb-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
  }
  .sp-view .sp-fb-levels .sp-fb-legend-chip {
    width: auto;
  }
  .sp-view .sp-fb-levels .sp-fb-fine {
    margin: 6px 0 0;
  }
  /* Before and After: the versions on the left, the change beside them, all above the fold. */
  .sp-view .sp-ba-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: 'versions title' 'versions rows' 'versions said';
    grid-template-rows: auto auto 1fr;
    gap: 12px 16px;
    align-items: start;
  }
  .sp-view .sp-ba-card {
    display: contents;
  }
  .sp-view .sp-ba-title {
    grid-area: title;
  }
  .sp-view .sp-ba-versions {
    grid-area: versions;
  }
  .sp-view .sp-ba-panel {
    grid-area: rows;
    border-top: 0;
  }
  .sp-view .sp-ba-panel {
    padding: 4px 16px;
    border-radius: 14px;
    background: var(--sp-card);
    box-shadow: var(--sp-shadow);
  }
  .sp-view .sp-ba-saids {
    grid-area: said;
    padding: 0;
    background: none;
    box-shadow: none;
  }
  .sp-view .sp-ba-saids .sp-ba-said {
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff4e0;
  }
  .sp-view .sp-ba-saids .sp-ba-did {
    background: #e8f1ff;
  }
  .sp-view .sp-ba-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
  .sp-view .sp-ba-actions .sp-btn-big {
    padding: 0 24px;
  }
}

/* The student's pages on a card sit at the left, small (the Sent and Needs Revision boards). */
.sp-view .sp-piece-card .sp-send-thumbs {
  justify-content: flex-start;
}

/* The Chromebook frame (Your Feedback on a Chromebook): Outstanding and
   Upcoming and the list in a full-height sidebar flush to the window's left
   edge; the card or Your Feedback fills the rest. The split's two parts
   become the page's grid items, so the sidebar is one white column from
   the header to the bottom, whatever the segment holds. */
@container sp-view (min-width: 760px) {
  .sp-view.sp-on-deck .sp-page {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 0;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .sp-view.sp-on-deck .sp-page::before {
    content: '';
    grid-column: 1;
    /* Down past the last row too (Demo Mode's line under the card). */
    grid-row: 1 / span 20;
    align-self: stretch;
    background: var(--sp-card);
    border-right: 1px solid var(--sp-line);
  }
  .sp-view.sp-on-deck .sp-page > * {
    grid-column: 2;
    margin-left: 28px;
    margin-right: 28px;
  }
  .sp-view.sp-on-deck .sp-page > .sp-segments,
  .sp-view.sp-on-deck .sp-page > .sp-fb-segments {
    grid-column: 1;
    grid-row: 1;
    margin: 16px 12px 8px;
  }
  .sp-view.sp-on-deck .sp-page > .sp-split {
    display: contents;
  }
  .sp-view.sp-on-deck .sp-split > .sp-side {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    padding: 0 12px 16px;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .sp-view.sp-on-deck .sp-split > :not(.sp-side) {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: auto;
    max-width: 960px;
    margin: 24px 28px;
  }
  .sp-view.sp-on-deck .sp-page > :not(.sp-split):not(.sp-segments):not(.sp-fb-segments) {
    grid-row: auto;
    margin-top: 24px;
  }
}

/* ── Three tabs (Colin, 2026-11-14) ─────────────────────────── */

/* The status band across the top of a card (Colin, 2026-11-17, Option B:
   students could not tell work not assessed yet from late work). The
   status with its icon on the left, the due date on the right. Each status
   has its own word, icon and colour, and the colours differ in lightness
   too: due later blue, due today or tomorrow amber, past due and not
   assessed yet grey, Missing the one solid band, Revise by purple, Sent
   blue, Returned green. Every pair passes 4.5:1. */
.sp-view .sp-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 6px;
  row-gap: 2px;
  min-height: 34px;
  margin: -14px -16px 0;
  padding: 7px 16px;
  border-radius: 16px 16px 0 0;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.3;
}
.sp-view .sp-band .sp-flag {
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
.sp-view .sp-band-when {
  margin-left: auto;
  font-weight: 500;
  white-space: nowrap;
}
.sp-view .sp-band-later {
  background: #e8f0fe;
  color: #1a56b8;
}
.sp-view .sp-band-due {
  background: #fff1db;
  color: #8a4b00;
}
.sp-view .sp-band-waiting,
.sp-view .sp-band-closed {
  background: #ececf0;
  color: #3a3a3c;
}
.sp-view .sp-band-missing {
  background: #c62828;
  color: #fff;
}
.sp-view .sp-band-revise {
  background: #f1e8ff;
  color: #6b21a8;
}
.sp-view .sp-band-sent,
.sp-view .sp-band-updated {
  background: #e6f0ff;
  color: #0058d0;
}
.sp-view .sp-band-back {
  background: #dcfce7;
  color: #166534;
}
.sp-view .sp-flag-late {
  background: #fde2e1;
  color: #9b1c1c;
}
.sp-view .sp-rubric-link {
  align-self: flex-start;
}

/* My Learning's list: a dot for feedback not opened, the title and its
   line, what it got. */
.sp-view .sp-ml-work .sp-row-text {
  flex: 1;
  min-width: 0;
}
.sp-view .sp-ml-work .sp-row-title {
  overflow-wrap: anywhere;
}
.sp-view .sp-ml-new {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.sp-view .sp-ml-new-on {
  background: #007aff;
}
.sp-view .sp-lv-0 {
  background: var(--sp-fill);
  color: #3a3a3c;
}
.sp-view .sp-lv-missing {
  background: #fde2e1;
  color: #9b1c1c;
}
.sp-view .sp-ml {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sp-view .sp-deck-one .sp-piece {
  display: block;
}

/* Your Rubric: one card, a row per criterion, its level and the teacher's comment. */
.sp-view ul.sp-fb-crits {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  list-style: none;
  margin: 0;
  padding: 4px 16px;
  gap: 0;
  background: var(--sp-card);
  border-radius: 18px;
}
.sp-view li.sp-fb-criterion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--sp-fill);
}
.sp-view li.sp-fb-criterion:first-child {
  border-top: 0;
}
.sp-view li.sp-fb-criterion .sp-fb-crit-name {
  font-size: 16px;
}
/* Reflections on a phone: Open Now, Done, Coming Up. */
.sp-view .sp-forms-phone .sp-list-head {
  margin: 6px 2px -4px;
}

/* Log Out? */
.sp-logout .sp-lead {
  margin: 0 0 16px;
}
.sp-logout-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
.sp-view .sp-btn-danger {
  background: #d70015;
  color: #fff;
}

/* Settings (the gear, s/page-view.js): a sheet from the bottom on a phone,
   a small menu under the gear on a Chromebook. Every rule it needs is
   here, so the teacher's Preview as Student (which has no student.css)
   draws it as the student's device does. */
.sp-view .sp-set-back {
  position: fixed;
  inset: 0;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: default;
}
.sp-view .sp-set,
.sp-view .sp-logout {
  position: fixed;
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 6;
  width: auto;
  max-width: 560px;
  max-height: calc(var(--sp-screen-h, 100vh) * 0.85);
  margin: 0 auto;
  overflow-y: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 16px calc(24px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 22px 22px 0 0;
  background: var(--sp-card);
  color: var(--sp-text);
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.12);
}
/* Nothing inside shrinks to fit: when Settings is taller than the screen
   (a short phone, a Text Size, many classes), the sheet scrolls instead,
   so every class in Switch Class stays whole and can be tapped. */
.sp-view .sp-set > *,
.sp-view .sp-logout > * {
  flex-shrink: 0;
}
.sp-view .sp-set-grip {
  display: block;
  align-self: center;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--sp-line);
}
.sp-view .sp-set-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sp-view .sp-set-title {
  flex: 1;
  margin: 0;
  padding: 4px 4px 2px;
  font-size: 19px;
  font-weight: 700;
}
.sp-view .sp-set-title:focus {
  outline: none;
}
.sp-view .sp-set-done {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--sp-blue-text);
  font-size: 16px;
  font-weight: 600;
}
.sp-view .sp-set-who {
  margin: -6px 4px 2px;
  font-size: 14px;
  color: var(--sp-text-2);
  overflow-wrap: anywhere;
}
.sp-view .sp-set-label {
  margin: 6px 4px -2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sp-text-2);
}
/* Switch Class: a class's "3 to do" goes under its name when both don't
   fit, so a name is never broken mid-word. */
.sp-view .sp-set .sp-class {
  flex-wrap: wrap;
}
.sp-view .sp-set .sp-class-words {
  flex: 1 1 7em;
}
.sp-view .sp-set .sp-class-name {
  overflow-wrap: break-word;
}
.sp-view .sp-set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: var(--sp-bg);
  color: var(--sp-blue-text);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}
.sp-view .sp-set-row svg {
  flex: none;
}
/* Text Size: three choices side by side, each word at the size it gives. */
.sp-view .sp-set-sizes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.12);
}
.sp-view .sp-set-size {
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--sp-text);
  font-weight: 600;
  line-height: 1.1;
}
.sp-view .sp-set-size-normal {
  font-size: 15px;
}
.sp-view .sp-set-size-large {
  font-size: 17px;
}
.sp-view .sp-set-size-larger {
  font-size: 19px;
}
/* A phone under 360 px at Larger: the three buttons are about 60 px wide
   in the page's own pixels, too narrow for "Larger" at 19 px in a wide
   font. Each word a step smaller, still in order, and the padding less. */
@media (max-width: 359.98px) {
  html.sp-size-larger .sp-view .sp-set-size {
    padding: 0 2px;
  }
  html.sp-size-larger .sp-view .sp-set-size-normal {
    font-size: 13px;
  }
  html.sp-size-larger .sp-view .sp-set-size-large {
    font-size: 14.5px;
  }
  html.sp-size-larger .sp-view .sp-set-size-larger {
    font-size: 16px;
  }
}
.sp-view .sp-set-size-on {
  background: var(--sp-card);
  color: var(--sp-blue-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}
.sp-view .sp-set-hint {
  margin: -2px 4px 0;
  font-size: 13px;
  color: var(--sp-text-2);
}
/* Log Out: last, and set apart from the rest by a line and a gap. It asks
   first (Log Out?), so a stray tap here ends nothing. */
.sp-view .sp-set-out {
  width: 100%;
  min-height: 48px;
  margin: 14px 0 0;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: #fdecee;
  color: #b0000f;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 -15px 0 -14px var(--sp-line);
}
/* At Large and Larger only (Text Size zooms the page, so its layout is as
   narrow as 246 px): rows and pills wrap instead of squeezing a word to a
   line, and the bottom tabs' labels fit. Normal is drawn exactly as before
   Text Size; nothing here reaches it. */
.sp-view.sp-text-large .sp-fb-crit-head,
.sp-view.sp-text-larger .sp-fb-crit-head,
.sp-view.sp-text-large .sp-fb-whole-level,
.sp-view.sp-text-larger .sp-fb-whole-level,
.sp-view.sp-text-large .sp-ba-move,
.sp-view.sp-text-larger .sp-ba-move {
  flex-wrap: wrap;
  max-width: 100%;
}
.sp-view.sp-text-large .sp-fb-crit-head > .sp-fb-crit-name,
.sp-view.sp-text-larger .sp-fb-crit-head > .sp-fb-crit-name {
  flex: 1 1 8em;
  overflow-wrap: break-word;
}
.sp-view.sp-text-large .sp-fb-words,
.sp-view.sp-text-larger .sp-fb-words,
.sp-view.sp-text-large .sp-ml-row .sp-row-title,
.sp-view.sp-text-larger .sp-ml-row .sp-row-title {
  overflow-wrap: break-word;
}
.sp-view.sp-text-large .sp-fb-whole-level > .sp-fb-whole-words,
.sp-view.sp-text-larger .sp-fb-whole-level > .sp-fb-whole-words {
  flex: 1 1 9em;
}
.sp-view.sp-text-large .sp-ml-row,
.sp-view.sp-text-larger .sp-ml-row {
  flex-wrap: wrap;
  gap: 4px 10px;
}
.sp-view.sp-text-large .sp-ml-row > .sp-row-text,
.sp-view.sp-text-larger .sp-ml-row > .sp-row-text {
  flex: 1 1 9em;
}
.sp-view.sp-text-large .sp-ml-row > .sp-level,
.sp-view.sp-text-larger .sp-ml-row > .sp-level {
  margin-left: auto;
  max-width: 100%;
}
/* The bottom tabs: a label's one long word ("Assignments") fits its tab in
   a wide font too (Verdana or DejaVu Sans, bold when its tab is on: about
   7.3 times its letters' size, kept to 7.6), at 12 px or less. From the
   screen's width in the page's own pixels (vw over the zoom, not cqi:
   WebKit measures cqi before the zoom), a third or a quarter of it, less
   the tab's 2 px each side. Three tabs at Normal are as they were. */
.sp-view.sp-text-large .sp-tabs-bottom .sp-tab-label,
.sp-view.sp-text-larger .sp-tabs-bottom .sp-tab-label {
  font-size: min(12px, calc((100vw / var(--sp-zoom) / 3 - 4px) / 7.6));
}
.sp-view .sp-tabs-bottom:has(> .sp-tab:nth-child(4)) .sp-tab-label {
  font-size: min(12px, calc((100vw / var(--sp-zoom) / 4 - 4px) / 7.6));
}
/* My Learning at Normal: where a title's longest word and its level do not
   fit one line, the level goes under the title rather than the word being
   cut in two (a 320 px phone, or a wide font). The title is never narrower
   than its longest word; where both fit, nothing moves. The arrow keeps
   its place at the right, out of the wrapping, so the level and not the
   arrow is what goes under. */
.sp-view:not(.sp-text-large):not(.sp-text-larger) .sp-ml-row {
  flex-wrap: wrap;
  row-gap: 4px;
}
.sp-view:not(.sp-text-large):not(.sp-text-larger) .sp-ml-row > .sp-row-text {
  min-width: min-content;
}
.sp-view:not(.sp-text-large):not(.sp-text-larger) .sp-ml-row .sp-row-title {
  overflow-wrap: break-word;
}
.sp-view:not(.sp-text-large):not(.sp-text-larger) .sp-ml-row > .sp-level {
  margin-left: auto;
}
.sp-view:not(.sp-text-large):not(.sp-text-larger) .sp-ml-row:has(> .sp-row-go) {
  position: relative;
  padding-right: 24px;
}
.sp-view:not(.sp-text-large):not(.sp-text-larger) .sp-ml-row > .sp-row-go {
  position: absolute;
  top: 50%;
  right: 0;
  margin-top: -7px;
}
/* Switch Class at Large and Larger: the name and the current class's tick
   hold one line, and the "3 to do" goes under the name, so the tick never
   drops to a line of its own. Normal is as it was. */
.sp-view.sp-text-large .sp-set .sp-class,
.sp-view.sp-text-larger .sp-set .sp-class {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 4px;
}
.sp-view.sp-text-large .sp-set .sp-class > .sp-class-words,
.sp-view.sp-text-larger .sp-set .sp-class > .sp-class-words,
.sp-view.sp-text-large .sp-set .sp-class > .sp-class-tick,
.sp-view.sp-text-larger .sp-set .sp-class > .sp-class-tick {
  grid-row: 1;
}
.sp-view.sp-text-large .sp-set .sp-class > .sp-class-todo,
.sp-view.sp-text-larger .sp-set .sp-class > .sp-class-todo {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
}
@keyframes sp-set-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}
@keyframes sp-set-drop {
  from {
    clip-path: inset(0 0 100% 0 round 16px);
  }
  to {
    clip-path: inset(0 0 0 0 round 16px);
  }
}
.sp-view .sp-set.sp-set-in {
  animation: sp-set-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@container sp-view (min-width: 760px) {
  /* A menu under the gear: the page stays as it is around it. */
  .sp-view .sp-set-back {
    background: transparent;
  }
  .sp-view .sp-set,
  .sp-view .sp-logout {
    top: 58px;
    right: 10px;
    bottom: auto;
    left: auto;
    width: 340px;
    max-width: calc(100% - 20px);
    max-height: calc(var(--sp-screen-h, 100vh) - 74px);
    margin: 0;
    padding: 12px 14px 16px;
    border: 1px solid var(--sp-line);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  }
  .sp-view .sp-set-grip {
    display: none;
  }
  .sp-view .sp-set.sp-set-in {
    animation: sp-set-drop 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp-view .sp-set.sp-set-in {
    animation: none;
  }
}

/* Photos sit on a light grey until they arrive, so a frame never shows empty. */
.sp-view .sp-send-thumb,
.sp-view .sp-ba-photo,
.sp-view .sp-work-img {
  background-color: #eceef2;
}

/* A handout's pages on a card still to do, to swipe through (s/page-carousel.js;
   Colin, 2026-11-17: "it should look like Instagram"). One page wide at the
   page's own shape (letter until the first page arrives), never taller than
   70% of the screen, the whole page showing. Sideways is the browser's own
   scroll-snap; up and down still scrolls the list. A page not here yet is the
   pictures' waiting grey. */
.sp-view .sp-car {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -18px;
}
.sp-view .sp-car-frame {
  position: relative;
}
.sp-view .sp-car-track {
  display: flex;
  width: 100%;
  aspect-ratio: var(--sp-car-ratio, 8.5 / 11);
  max-height: calc(var(--sp-steady-h, 100vh) * 0.7);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: #eceef2;
  border-top: 1px solid var(--sp-fill);
  border-bottom: 1px solid var(--sp-fill);
}
.sp-view .sp-car-track::-webkit-scrollbar {
  display: none;
}
.sp-view .sp-car-track:focus-visible {
  outline: 3px solid var(--sp-blue);
  outline-offset: -3px;
}
.sp-view .sp-car-slide {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #eceef2;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  cursor: zoom-in;
}
.sp-view .sp-car-slide.sp-car-in {
  background: var(--sp-bg);
}
.sp-view .sp-car-slide:focus-visible {
  outline: 3px solid var(--sp-blue);
  outline-offset: -3px;
}
.sp-view .sp-car-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
.sp-view .sp-car-count {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  pointer-events: none;
}
/* Previous Page and Next Page: with a mouse or a trackpad only; a phone swipes. */
.sp-view .sp-car-arrow {
  display: none;
  position: absolute;
  top: 50%;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--sp-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.sp-view .sp-car-prev {
  left: 10px;
}
.sp-view .sp-car-next {
  right: 10px;
}
.sp-view .sp-car-next svg {
  transform: scaleX(-1);
}
.sp-view .sp-car-arrow:focus-visible {
  outline: 3px solid var(--sp-blue);
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .sp-view .sp-car-arrow {
    display: flex;
  }
}
.sp-view .sp-car-arrow[hidden] {
  display: none;
}
.sp-view .sp-car-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}
.sp-view .sp-car-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sp-field);
}
.sp-view .sp-car-dot-on {
  background: var(--sp-blue);
}
.sp-view .sp-car-caption {
  margin: 0;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sp-text-2);
  overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
  .sp-view .sp-car-track {
    scroll-behavior: auto;
  }
}
