/* Preview as Student (teacher/preview-student.js). The page inside the
   device follows s/student.css's list (placeholder until the student page's
   real screens land). */
.ps-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: none;
  background: rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-family: var(--font-base);
  font-size: var(--text-base, 14px);
  line-height: 1.4;
}
.ps-dialog {
  display: flex;
  flex-direction: column;
  flex: none;
  max-width: 100%;
  margin: auto;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ps-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--divider);
}
.ps-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
}
.ps-head-space {
  flex: 1;
}
.ps-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.ps-close:hover {
  background: var(--overlay-hover);
}
.ps-close:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 0;
}
.ps-body {
  display: flex;
  justify-content: center;
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: none;
  padding: 20px 24px 24px;
}

/* The device. */
.ps-stage {
  display: flex;
  justify-content: center;
}
.ps-device {
  position: relative;
  flex: none;
  padding: 12px;
  background: #1d1d1f;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.ps-device-phone {
  --ps-h: min(780px, calc(100vh - 170px));
  border-radius: 44px;
}
.ps-device-phone .ps-screen {
  padding-top: 30px;
  width: 390px;
  height: var(--ps-h);
  border-radius: 34px;
}
.ps-device-chromebook {
  --ps-h: min(540px, calc(100vh - 170px));
  border-radius: 14px;
}
.ps-device-chromebook .ps-screen {
  width: 820px;
  height: var(--ps-h);
  border-radius: 4px;
}
.ps-screen {
  overflow-y: auto;
  overscroll-behavior: none;
  box-sizing: border-box;
  background: #f5f5f7;
  color: #1d1d1f;
  font-size: 15px;
}
/* The student page's sheets (Settings, Log Out?) are fixed to the
   student's screen. Here the device is that screen: the transform makes
   it what they are fixed to, and they sit inside its 12 px bezel. Lengths
   inside the page are divided by its Text Size zoom (--sp-zoom), as on the
   student page (s/student.css). */
.ps-device {
  transform: translateZ(0);
}
.ps-screen > .sp-view {
  --sp-zoom: 1;
  --sp-bezel: calc(12px / var(--sp-zoom));
}
.ps-device-phone .ps-screen > .sp-view {
  --sp-screen-h: calc(var(--ps-h) / var(--sp-zoom));
}
.ps-device-chromebook .ps-screen > .sp-view {
  --sp-screen-h: calc(var(--ps-h) / var(--sp-zoom));
}
.ps-screen .sp-view .sp-set-back {
  inset: var(--sp-bezel);
  border-radius: 4px;
}
.ps-device-phone .ps-screen .sp-view .sp-set-back {
  border-radius: 34px;
}
@container sp-view (max-width: 759.98px) {
  .ps-screen .sp-view .sp-set,
  .ps-screen .sp-view .sp-logout {
    right: var(--sp-bezel);
    bottom: var(--sp-bezel);
    left: var(--sp-bezel);
  }
  .ps-device-phone .ps-screen .sp-view .sp-set,
  .ps-device-phone .ps-screen .sp-view .sp-logout {
    border-radius: 22px 22px 34px 34px;
  }
}
@container sp-view (min-width: 760px) {
  .ps-screen .sp-view .sp-set,
  .ps-screen .sp-view .sp-logout {
    top: calc(var(--sp-bezel) + 58px);
    right: calc(var(--sp-bezel) + 10px);
    bottom: auto;
    left: auto;
  }
}
/* The student page's Text Size (its Settings), drawn inside the device as
   s/student.css draws it on the student's own. */
.ps-screen > .sp-view.sp-text-large {
  --sp-zoom: 1.15;
  zoom: var(--sp-zoom);
}
.ps-screen > .sp-view.sp-text-larger {
  --sp-zoom: 1.3;
  zoom: var(--sp-zoom);
}
.ps-waiting {
  padding: 24px 20px;
  color: #58585d;
}

/* The door, in Class Settings › Student Page: a card laid out as the tab's others (.sp-card). */
.sp-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-preview > .cm-grade-title,
.sp-preview > .cm-hint {
  margin: 0;
}
.sp-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.sp-preview-select {
  flex: 1 1 220px;
  max-width: 320px;
  color: var(--text);
  background-color: var(--surface);
}

/* ── Class Settings › Student Page (teacher/cm-student-page.js; board
   "Teacher: Class Settings, Student Page") ── */
/* Two columns: the Student Page card with the full Student Cards list under
   it, and beside them the cards in short (teacher/student-cards.js,
   summaryHtml) and Preview as Student. One column when there is no room.
   The tab is as wide as Grading's, to make room for the second column. */
.cm-tab-panel-student-page {
  max-width: 1200px;
}
.sp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
.sp-main,
.sp-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
@media (max-width: 1100px) {
  .sp-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
.sp-card > .sp-intro {
  margin: -10px 0 14px;
}
/* A switch that is on is green here, as on the board and the phone. */
.sp-card .gpd-switch input:checked + .gpd-switch-ui {
  background: var(--score-3);
}
/* What students would see, in a grey panel, with See What They'd See as a link after it. */
.sp-learning-panel {
  align-self: stretch;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  color: var(--text);
}
.sp-link-btn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--link);
  cursor: pointer;
}
.sp-link-btn:hover {
  text-decoration: underline;
}
.sp-link-btn:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
  border-radius: 2px;
}
.sp-tint-btn {
  background: var(--active-light);
  color: var(--link);
  font-weight: 600;
}
.sp-tint-btn:hover {
  filter: brightness(0.96);
}
/* The Student Cards summary: counts, the last day, Manage Cards. */
.sc-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sc-summary .cm-grade-title,
.sc-summary .cm-hint {
  margin: 0;
}
.sc-summary-count {
  font-family: var(--font-base);
  font-size: var(--text-base);
  color: var(--text);
}
.sc-summary-btn {
  align-self: flex-start;
  margin-top: 4px;
}
.sc-card #sc-title:focus {
  outline: none;
}
.sc-card #sc-title:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}

/* ── Student Cards (teacher/student-cards.js; board "Teacher: Student
   Cards"): the filters as chips, and the list's words coloured by what they
   mean. ── */
.sc-card .sc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sc-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--seg-track);
  color: var(--text);
  font-family: var(--font-base);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}
.sc-chip .sc-count {
  color: inherit;
  opacity: 0.8;
}
.sc-chip-warn {
  background: var(--score-2-bg);
  color: var(--score-2-text);
}
.sc-chip-alert {
  background: var(--score-1-bg);
  color: var(--score-1-text);
}
.sc-chip.active {
  background: var(--text);
  color: var(--surface);
  font-weight: 600;
}
.sc-chip:focus-visible {
  outline: 2px solid var(--active);
  outline-offset: 2px;
}
.sc-status .sc-lock {
  margin: 0;
  padding: 0;
  background: none;
  font-size: inherit;
  color: var(--score-1-text);
}
.sc-status .sc-unprinted {
  font-weight: 600;
  color: var(--score-2-text);
}
.sc-table .sc-reissued {
  font-weight: 600;
  color: var(--link);
}
.sc-until-row .sc-until-pick {
  width: auto;
  font-size: var(--text-sm);
  padding: 5px 8px;
  color: var(--text);
  background-color: var(--surface);
}

/* A handout file open over the device's screen (shared/handout-viewer.js). */
.ps-device > .hv-layer {
  inset: 12px;
  overflow: hidden;
}
.ps-device-phone > .hv-layer {
  border-radius: 34px;
}
.ps-device-chromebook > .hv-layer {
  border-radius: 4px;
}
