:root {
  color-scheme: light;
  --paper: #faf8f3;
  --ink: #2b2014;
  --ink-soft: #4c3d2c;
  --ink-mid: #6b5a45;
  --ink-muted: #7d6e5c;
  --ink-faint: #9a8a77;
  --ink-ghost: #bfb3a2;
  --line: #e8e5db;
  --line-card: #eceadf;
  --line-input: #ddd9cd;
  --line-quiet: #e2ded2;
  --primary: #b4530a;
  --primary-deep: #94430a;
  --primary-soft: #fdf6ee;
  --primary-line: #eeceac;
  --primary-pill-bg: #f8e8d6;
  --primary-pill-ink: #8a4a12;
  --amber: #dd9434;
  --teal: #12958a;
  --red: #c73a4a;
  --track: #efece3;
  --chip-bg: #f2f0e9;
  --radius-card: 16px;
  --radius-input: 11px;
  --shadow-primary: 0 10px 24px rgb(180 83 10 / 22%);
  --shadow-card-hover: 0 12px 28px rgb(93 53 12 / 8%);
  --font-serif: 'Fraunces', Georgia, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Spline Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #f6e2cf;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-deep);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #e5b98a;
  letter-spacing: 0.18em;
}

/* Buttons */

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  border-radius: var(--radius-input);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.button-primary {
  padding: 0 18px;
  color: #fff;
  border: 0;
  background: var(--primary);
  box-shadow: var(--shadow-primary);
}

.button-primary:hover {
  background: var(--primary-deep);
}

.button-primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-quiet {
  color: var(--ink-mid);
  border: 1px solid var(--line-quiet);
  background: #fff;
}

.button-quiet:hover {
  border-color: var(--primary-line);
  color: var(--primary);
}

.button-full {
  width: 100%;
  margin-top: 8px;
  min-height: 44px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--ink-muted);
  font-size: 20px;
  font-family: inherit;
  border: 0;
  border-radius: 9px;
  background: var(--chip-bg);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--ink);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.round-icon-button {
  display: inline-flex;
  width: 42px;
  height: 42px;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--ink-mid);
  border: 1px solid var(--line-quiet);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.round-icon-button:hover {
  color: var(--primary);
  border-color: var(--primary-line);
}

.round-icon-button svg {
  width: 17px;
  height: 17px;
}

.round-icon-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* Forms */

.field {
  display: grid;
  gap: 7px;
  margin: 16px 0;
}

.field label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line-input);
  border-radius: var(--radius-input);
  outline: none;
  background: #fff;
  font: inherit;
}

.field input:focus,
.field select:focus {
  border-color: #d99a63;
  box-shadow: 0 0 0 4px rgb(180 83 10 / 10%);
}

.field select[size] {
  height: auto;
  max-height: 14rem;
  padding: 4px;
  overflow-y: auto;
}

.field input[readonly] {
  color: var(--ink-muted);
  border-color: #e9e6dd;
  background: #f8f7f2;
}

.school-combobox {
  position: relative;
}

.school-listbox {
  position: absolute;
  z-index: 20;
  top: 100%;
  right: 0;
  left: 0;
  max-height: 280px;
  padding: 4px;
  margin: 4px 0 0;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line-input);
  border-radius: var(--radius-input);
  background: #fff;
  box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
}

.school-listbox[hidden] {
  display: none;
}

.school-option {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 10px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.school-option[aria-selected="true"],
.school-option:hover {
  background: #fdf1e3;
}

.school-option small {
  color: var(--ink-muted);
  font-size: 12px;
}

.school-option-new {
  font-weight: 600;
}

.school-code-row {
  display: flex;
  gap: 8px;
}

.school-code-row input {
  flex: 1;
  min-width: 0;
}

.field-error {
  margin: 0;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
}

.field-error[hidden] {
  display: none;
}

.form-error {
  padding: 10px 12px;
  margin: 12px 0;
  color: #a3313f;
  font-size: 13px;
  border: 1px solid #f2ccd2;
  border-radius: 9px;
  background: #fff5f6;
}

/* Sign-up lists every problem at once, one per line, and marks each field. */
.form-error-line {
  display: block;
}

.form-error-line + .form-error-line {
  margin-top: 4px;
}

#auth-form input[aria-invalid='true'] {
  border-color: #a3313f;
  box-shadow: 0 0 0 3px rgba(163, 49, 63, 0.12);
}

/* Warm notice (needs the teacher to decide, not an error) */

.notice {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 14px 16px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid #ecd9a2;
  border-radius: 12px;
  background: #fff9e8;
}

.notice[hidden] {
  display: none;
}

.notice-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.notice p {
  margin: 0;
}

.notice-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice-list li {
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff3cc;
}

.notice-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.credentials-existing {
  color: var(--ink-mid);
  font-style: italic;
}

/* Brand */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, #c2651a, #e09a3c);
  box-shadow: 0 8px 18px rgb(170 95 25 / 35%);
}

.brand-product {
  margin-left: 4px;
  padding-left: 14px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  border-left: 1px solid var(--line);
}

/* Auth */

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(380px, 0.95fr) minmax(460px, 1.05fr);
}

.auth-story {
  position: relative;
  display: flex;
  padding: 46px clamp(36px, 6vw, 88px);
  color: #fff;
  background:
    radial-gradient(circle at 78% 12%, rgb(224 154 60 / 20%), transparent 42%),
    linear-gradient(150deg, #241811 0%, #382415 58%, #46301c 100%);
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.auth-story-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgb(255 255 255 / 22%) 1px, transparent 1.5px);
  background-size: 96px 96px;
  opacity: 0.5;
}

.auth-story-dots.secondary {
  background-image: radial-gradient(circle, rgb(255 255 255 / 14%) 1px, transparent 1.5px);
  background-size: 54px 54px;
  background-position: 27px 40px;
  opacity: 0.4;
}

.brand-light {
  position: relative;
  gap: 11px;
  color: #fff;
  font-size: 16px;
}

.brand-light .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgb(170 95 25 / 45%);
}

.story-copy {
  position: relative;
  max-width: 600px;
  margin: 70px 0;
}

.story-copy h1 {
  margin: 0;
  max-width: 560px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.03em;
}

.story-copy p:last-child {
  max-width: 520px;
  margin: 24px 0 0;
  color: #e8d5c0;
  font-size: 17px;
  line-height: 1.7;
}

.story-proof {
  position: relative;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.story-proof span {
  padding: 9px 14px;
  color: #eddfc9;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: 999px;
  background: rgb(255 255 255 / 7%);
}

.auth-panel {
  display: grid;
  padding: 40px;
  place-content: center;
}

.auth-card {
  width: min(430px, calc(100vw - 48px));
  padding: 34px;
  border: 1px solid #e9e6dd;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(60 42 20 / 9%);
}

.auth-tabs {
  display: grid;
  padding: 4px;
  margin-bottom: 28px;
  border-radius: 12px;
  background: var(--chip-bg);
  grid-template-columns: 1fr 1fr;
}

.auth-tab {
  padding: 10px;
  color: var(--ink-muted);
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.auth-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 12px rgb(60 42 20 / 10%);
}

.auth-note {
  max-width: 420px;
  margin: 20px auto 0;
  color: var(--ink-muted);
  font-size: 12px;
  text-align: center;
}

.link-button {
  display: block;
  min-height: 32px;
  margin: 14px auto 0;
  padding: 4px;
  color: var(--primary-deep);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  border: 0;
  background: none;
  cursor: pointer;
}

.link-button[hidden] {
  display: none;
}

.auth-notice {
  padding: 10px 12px;
  margin: 0 0 14px;
  color: #1f5c36;
  font-size: 13px;
  border: 1px solid #c8e4d2;
  border-radius: 9px;
  background: #f1faf4;
}

.auth-notice[hidden] {
  display: none;
}

.auth-panel-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.auth-panel-copy {
  margin: 0 0 16px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
}

.verify-banner {
  display: flex;
  padding: 8px 26px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 13px;
  border-bottom: 1px solid #ecd9a2;
  background: #fff9e8;
}

.verify-banner[hidden] {
  display: none;
}

.verify-banner p {
  margin: 0;
}

.verify-banner .button-quiet {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

/* Topbar */

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 58px;
  padding: 0 26px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 86%);
  backdrop-filter: blur(14px);
}

.teacher-menu {
  display: flex;
  align-items: center;
  gap: 11px;
}

.teacher-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c2651a, #e09a3c);
}

/* `.student-identity span` (the username line) also matched the avatar and turned its initials grey. */
.student-identity .student-avatar {
  color: #fff;
  font-size: 14px;
}

.teacher-menu-copy {
  display: grid;
  min-width: 0;
  max-width: 180px;
}

.teacher-menu-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.teacher-menu-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-muted);
  font-size: 11px;
}

.teacher-menu .button-quiet {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 10px;
}

/* Dashboard shell */

.dashboard-shell {
  display: grid;
  min-height: calc(100vh - 58px);
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 58px;
  display: flex;
  height: calc(100dvh - 58px);
  min-height: 0;
  padding: 22px 16px 22px 22px;
  align-self: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  background: var(--paper);
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
}

.sidebar-stack {
  display: grid;
  gap: 20px;
  align-content: start;
}

.sidebar-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.sidebar-label {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-count {
  color: var(--ink-ghost);
  font-size: 11px;
  font-weight: 600;
}

.classroom-list {
  display: grid;
  gap: 8px;
}

.classroom-item {
  display: grid;
  width: 100%;
  padding: 13px 14px;
  gap: 7px;
  text-align: left;
  border: 1px solid var(--line-card);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: border-color 150ms ease;
}

.classroom-item.active {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  box-shadow: 0 6px 18px rgb(180 83 10 / 8%);
}

.classroom-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.classroom-item-row strong {
  color: var(--ink);
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grade-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  color: var(--ink-mid);
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--chip-bg);
}

.classroom-item-count {
  color: var(--ink-muted);
  font-size: 12px;
}

.classroom-item .progress-track {
  height: 4px;
}

.new-classroom-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-mid);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px dashed #d4d0c2;
  border-radius: 13px;
  background: transparent;
  cursor: pointer;
}

.new-classroom-button span {
  font-size: 15px;
}

.new-classroom-button:hover {
  border-color: #e0b285;
  color: var(--primary);
  background: var(--primary-soft);
}

.sidebar-empty {
  padding: 0 4px;
  color: var(--ink-muted);
  font-size: 12.5px;
  text-align: left;
}

.sidebar-note {
  display: flex;
  padding: 14px;
  gap: 10px;
  border: 1px solid #d7ece4;
  border-radius: 13px;
  background: #f2faf7;
}

.note-icon {
  color: #0f8378;
}

.sidebar-note strong {
  font-size: 12px;
}

.sidebar-note p {
  margin: 5px 0 0;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.5;
}

/* Workspace */

.workspace {
  width: min(1200px, 100%);
  padding: 36px clamp(24px, 4vw, 56px) 70px;
  margin: 0 auto;
  min-width: 0;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.page-heading h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 42px);
  letter-spacing: -0.025em;
}

.page-heading-copy {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.page-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Stat cards */

.stat-grid {
  display: grid;
  margin-top: 24px;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.stat-card {
  padding: 16px 18px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fff;
}

.stat-card-label {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card-value {
  margin-top: 6px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1;
}

.stat-card-caption {
  display: block;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 12px;
}

.stat-card-value.evaluating {
  color: var(--ink-muted);
  font-size: 19px;
  line-height: 30px;
  font-style: italic;
}

/* Roster */

.roster-section {
  margin-top: 26px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.roster-workspace-tabs {
  margin-top: 26px;
}

.roster-tab-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-bottom: 1px solid var(--line);
}

.roster-tab {
  min-height: 42px;
  padding: 0 16px;
  color: var(--ink-muted);
  font: inherit;
  font-weight: 600;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
}

.roster-tab:hover,
.roster-tab:focus-visible {
  color: var(--primary);
  outline: none;
}

.roster-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.roster-tab-panel {
  min-width: 0;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 22px;
}

.section-subtitle {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 12.5px;
}

.search-field {
  display: flex;
  width: min(300px, 100%);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line-quiet);
  border-radius: var(--radius-input);
  background: #fff;
}

.search-field:focus-within {
  border-color: #d99a63;
  box-shadow: 0 0 0 4px rgb(180 83 10 / 10%);
}

.search-field > span[aria-hidden] {
  color: var(--ink-faint);
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  background: transparent;
  color: inherit;
  min-width: 0;
}

.loading-card {
  display: grid;
  min-height: 240px;
  margin-top: 16px;
  place-content: center;
  justify-items: center;
  color: var(--ink-muted);
  border: 1px dashed var(--line-input);
  border-radius: var(--radius-card);
  text-align: center;
}

.spinner {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto 12px;
  border: 3px solid #e9e6dc;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 70%), transparent);
  transform: translateX(-100%);
  animation: shimmer 1300ms ease-in-out infinite;
}

.skeleton-line,
.skeleton-track,
.skeleton-chip-row {
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: #ece8dc;
}

.skeleton-line {
  width: 100%;
  height: 12px;
}

.skeleton-line.wide {
  width: 82%;
}

.skeleton-line.medium {
  width: 62%;
}

.skeleton-line.short {
  width: 38%;
}

.skeleton-track {
  width: 100%;
  height: 8px;
  margin-top: 8px;
}

.skeleton-chip-row {
  width: min(220px, 72%);
  height: 26px;
}

.skeleton-avatar {
  color: transparent;
  background: #e3ded2;
}

.student-card.skeleton-card {
  cursor: wait;
  transform: none;
}

.student-card.skeleton-card:hover,
.student-card.skeleton-card:focus-visible {
  border-color: var(--line-card);
  box-shadow: none;
  transform: none;
}

.empty-state {
  display: grid;
  min-height: 270px;
  margin-top: 16px;
  place-content: center;
  justify-items: center;
  color: var(--ink-muted);
  border: 1px dashed var(--line-input);
  border-radius: var(--radius-card);
  text-align: center;
  background: #fffefb;
}

.setup-state {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  color: var(--ink);
  place-content: initial;
  justify-content: initial;
  align-content: initial;
  justify-items: initial;
  border: 0;
  background: transparent;
  text-align: left;
}

.workspace:has(#no-classrooms-state:not([hidden])) {
  width: 100%;
  padding: 12px 42px 70px 24px;
}

.setup-heading {
  display: flex;
  width: 100%;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 11px;
  text-align: left;
}

.setup-heading > div {
  width: 100%;
}

.setup-heading .eyebrow {
  margin: 0 0 3px;
  text-align: left;
}

.setup-state h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(27px, 3vw, 32px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.setup-checklist {
  display: grid;
  width: 100%;
  padding: 0;
  margin: 0 0 14px;
  gap: 12px;
  list-style: none;
  text-align: left;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setup-checklist li {
  display: flex;
  min-height: 124px;
  padding: 15px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  border: 1px solid var(--line-card);
  border-radius: 15px;
  background: #fff;
}

.setup-checklist li.current {
  color: var(--ink);
  border-color: var(--primary-line);
  box-shadow: 0 2px 5px rgb(180 83 10 / 10%);
}

.setup-checklist li > span:first-child {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  background: #f0e8dc;
}

.setup-checklist li.current > span:first-child {
  color: #fff;
  background: var(--primary);
}

.setup-checklist li > span:last-child {
  min-width: 0;
}

.setup-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.setup-actions .button-primary {
  min-height: 43px;
  padding: 0 20px;
  font-size: 15px;
  box-shadow: none;
}

.setup-progress {
  display: flex;
  margin: 18px 0 22px;
  align-items: center;
  gap: 16px;
}

.setup-progress ol {
  display: flex;
  min-width: 0;
  padding: 0;
  margin: 0;
  flex: 1;
  align-items: center;
  list-style: none;
}

.setup-progress li {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  padding-right: 0;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
}

.setup-progress li:not(:last-child)::after {
  width: 24px;
  height: 1px;
  margin: 0 8px;
  flex: 0 0 auto;
  background: var(--line-quiet);
  content: '';
}

.setup-progress li > span:first-child {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  background: #f0e8dc;
}

.setup-progress li.current {
  color: var(--ink);
  font-weight: 700;
}

.setup-progress li.current > span:first-child {
  color: #fff;
  background: var(--primary);
}

.setup-progress li.done > span:first-child {
  color: #fff;
  background: #258579;
}

.setup-progress li.skipped {
  color: var(--ink-muted);
}

.setup-progress > p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
}

.topic-picker-page { display: flex; min-height: calc(100vh - 150px); flex-direction: column; gap: 14px; }
.topic-picker-page .setup-progress { margin: 0; }
.topic-picker-card { padding: 18px 20px; border: 1px solid var(--line-card); border-radius: 16px; background: #fff; }
.topic-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.topic-picker-heading .eyebrow { margin-bottom: 0; }
.topic-picker-heading h1 { margin: 0; font: 600 22px/1.3 var(--font-serif); }
.topic-picker-heading p:last-child { margin: 4px 0 0; color: var(--ink-muted); }
#topic-picker-edit-actions { display: flex; align-items: center; gap: 8px; }
.topic-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topic-picker-row { display: flex; min-width: 0; min-height: 68px; padding: 10px 12px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line-quiet); border-radius: 13px; }
.topic-picker-row > div { display: grid; min-width: 0; }
.topic-picker-row strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.topic-picker-row > div span { color: var(--ink-muted); font-size: 12px; }
.topic-picker-row .button { min-height: 40px; }

.button-added { color: #167c70; border: 1px solid #c7e6dc; background: #eef8f4; }
.topic-picker-footer { position: sticky; z-index: 4; bottom: 0; display: flex; min-height: 68px; padding: 10px 14px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line-card); border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgb(63 44 23 / 9%); }
.topic-picker-footer p { margin: 0 auto 0 0; color: var(--ink-muted); }
.classroom-more-menu { position: relative; }
.classroom-more-menu summary { display: grid; min-width: 40px; min-height: 40px; padding: 0; place-items: center; list-style: none; cursor: pointer; }
.classroom-more-menu summary::-webkit-details-marker { display: none; }
.classroom-more-menu > button { position: absolute; z-index: 5; top: calc(100% + 5px); right: 0; width: max-content; padding: 10px 13px; color: var(--ink); border: 1px solid var(--line-card); border-radius: 10px; background: #fff; box-shadow: var(--shadow-card-hover); cursor: pointer; }
.classroom-more-menu > button:nth-of-type(2) { top: calc(100% + 47px); }

@media (max-width: 640px) {
  .topic-picker-page { min-height: calc(100vh - 120px); }
  .topic-picker-card { padding: 15px 13px; }
  .topic-picker-grid { grid-template-columns: 1fr; }
  .topic-picker-footer { flex-wrap: wrap; }
  .topic-picker-footer p { flex-basis: 100%; }
.topic-picker-footer .button { flex: 1; padding-inline: 9px; font-size: 12px; }
}

.login-cards-page { display: flex; min-height: calc(100vh - 120px); flex-direction: column; gap: 12px; }
.login-cards-page[hidden] { display: none; }
.login-cards-page .setup-progress { margin: 0; }
.login-cards-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.login-cards-heading h1 { margin: 0; font: 600 25px/1.25 var(--font-serif); }
.login-cards-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.login-cards-actions .button { min-height: 40px; }
.login-address-banner { padding: 14px 16px; color: #33281e; line-height: 1.55; border: 1px solid #f1cba7; border-radius: 14px; background: #fff8f0; }
.login-address-banner code { font-size: 14px; }
.school-login-closed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 16px; color: #33281e; line-height: 1.5; border: 1px solid #ecd9a2; border-radius: 14px; background: #fff9e8; }
.school-login-closed[hidden] { display: none; }
.school-login-closed p { margin: 0; flex: 1 1 240px; font-weight: 600; }
.school-login-closed .button { min-height: 44px; }
.login-cards-message-hint { margin: 0; padding: 9px 12px; color: #62451b; font-size: 13px; border-radius: 10px; background: #fbf0d2; }
.login-cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.login-card { min-width: 0; padding: 13px 12px 11px; border: 1px dashed #d8c3ad; border-radius: 14px; background: #fff; break-inside: avoid; }
.login-card h2 { margin: 0 0 10px; overflow-wrap: anywhere; font-size: 15px; }
.login-card-credentials { display: flex; min-height: 112px; justify-content: space-between; gap: 8px; }
.login-card-credentials > div { display: grid; min-width: 0; align-content: start; gap: 3px; }
.login-card-credentials span, .login-card-address span { color: #806b57; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.login-card-credentials code { overflow-wrap: anywhere; font-size: 12px; }
.login-card-qr { width: 112px; height: 112px; flex: 0 0 auto; shape-rendering: crispEdges; }
.login-card-address { display: grid; margin: 8px 0; padding: 8px 0; gap: 3px; border-top: 1px dashed #e5d7c8; border-bottom: 1px dashed #e5d7c8; }
.login-card-address code { overflow-wrap: normal; white-space: nowrap; font-size: 11px; }
.login-card-address small { color: #806b57; font-size: 11px; }
.student-login-card-heading p { margin: 0; color: #806b57; font-size: 13px; }
.login-card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.login-card-actions .button { min-height: 34px; padding: 4px 9px; font-size: 12px; }
.login-cards-footer { position: sticky; z-index: 4; bottom: 10px; display: flex; min-height: 68px; margin-top: auto; padding: 10px 14px; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line-card); border-radius: 15px; background: #fff; box-shadow: 0 8px 24px rgb(63 44 23 / 9%); }
.login-cards-footer[hidden] { display: none; }
.login-cards-footer p { margin: 0; color: var(--ink-muted); }

@media (max-width: 850px) {
  .login-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-cards-heading { align-items: flex-start; flex-direction: column; }
  .student-activity-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .login-cards-grid { grid-template-columns: 1fr; }
  .login-cards-footer { align-items: stretch; flex-direction: column; }
  .student-report-nav { align-items: flex-start; }
  .student-login-card-heading { align-items: flex-start; flex-direction: column; }
}
@media print {
  /* Take everything else out of the layout (not just hide it), or the dashboard's height prints as blank pages. */
  body:has(#login-cards-page:not([hidden])) *:not(#login-cards-page, #login-cards-page *, :has(#login-cards-page)) { display: none !important; }
  body:has([data-student-login-card]) *:not([data-student-login-card], [data-student-login-card] *, :has([data-student-login-card])) { display: none !important; }
  body:has(#login-cards-page:not([hidden])) * { visibility: hidden !important; }
  body:has(#login-cards-page:not([hidden])) #login-cards-page,
  body:has(#login-cards-page:not([hidden])) #login-cards-page * { visibility: visible !important; }
  body:has(#login-cards-page:not([hidden])) #login-cards-page { position: absolute; inset: 0; display: block; width: 100%; min-height: 0; padding: 0; }
  #login-cards-progress, .school-login-closed, .login-cards-actions, .login-cards-message-hint, .login-card-actions, .login-cards-footer { display: none !important; }
  .login-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .login-card { border-style: dashed; }
  body:has([data-student-login-card]) * { visibility: hidden !important; }
  body:has([data-student-login-card]) [data-student-login-card],
  body:has([data-student-login-card]) [data-student-login-card] * { visibility: visible !important; }
  body:has([data-student-login-card]) .student-login-card-panel { position: absolute; inset: 0; display: block; max-width: none; margin: 0; padding: 0; border: 0; }
  .student-login-card-heading, .student-login-card-panel .login-card-actions { display: none !important; }
  @page { margin: 12mm; }
}

.paste-names-field {
  margin-top: 0;
  flex: 0 0 auto;
}

.paste-names-field textarea {
  width: 100%;
  height: clamp(132px, 22vh, 174px);
  min-height: 132px;
  padding: 12px 14px;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  border: 1px solid var(--line-input);
  border-radius: var(--radius-input);
  resize: vertical;
}

.duplicate-name-warning {
  display: block;
  padding: 9px 12px;
  margin: 0;
  color: #795018;
  font-size: 13px;
  border: 1px solid #ecd4aa;
  border-radius: 9px;
  background: #fff8e9;
}

.duplicate-name-warning > span {
  margin-right: 5px;
}

.setup-added-count {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.empty-orbit {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  place-items: center;
  color: var(--primary);
  font-size: 24px;
  border-radius: 50%;
  background: var(--primary-pill-bg);
}

.empty-state h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 20px;
}

.empty-state p {
  max-width: 430px;
  margin: 8px 20px 20px;
  line-height: 1.55;
  font-size: 14px;
}

.roster-grid {
  display: grid;
  margin-top: 16px;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
}

.roster-grid .loading-card {
  grid-column: 1 / -1;
  min-height: 180px;
}

.student-card {
  display: grid;
  padding: 18px;
  gap: 13px;
  align-content: start;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.student-card:hover,
.student-card:focus-visible {
  border-color: var(--primary-line);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.student-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.student-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c2651a, #e09a3c);
}

.student-identity > div {
  display: grid;
  min-width: 0;
}

.student-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
}

.student-identity span {
  color: var(--ink-muted);
  font-size: 12px;
}

.domain-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 24px;
}

.domain-chip {
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  color: var(--primary-pill-ink);
  background: var(--primary-pill-bg);
  border: 1px solid transparent;
}

.domain-empty {
  color: var(--ink-faint);
  font-size: 12px;
  font-style: italic;
}

.progress-copy {
  display: grid;
  gap: 6px;
}

.progress-copy-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.progress-copy-row > span {
  color: var(--ink-muted);
  font-size: 12px;
}

.progress-copy-row strong {
  font-size: 12.5px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--amber));
}

/* Learner detail */

.detail-back {
  display: inline-flex;
  min-height: 36px;
  padding: 0 12px;
  align-items: center;
  gap: 7px;
  color: var(--ink-mid);
  font-weight: 600;
  font-size: 13px;
  font-family: inherit;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.detail-back:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.detail-header {
  display: flex;
  margin-top: 18px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.student-report-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.student-report-nav .detail-back { margin: 0; }
.detail-identity-copy .status-pill { margin: 0 0 0 6px; vertical-align: middle; }
.detail-identity-copy .status-pill-good { color: #167a66; background: #e3f3ee; }
.student-activity-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.student-topic-list { display: grid; margin-top: 14px; gap: 10px; }
.student-topic-card { padding: 16px 18px; border: 1px solid var(--line-card); border-radius: 16px; background: #fffdfa; }
.student-topic-card h2 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 20px; }
.student-topic-skill { display: flex; min-height: 46px; padding: 9px 0; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-card); }
.student-topic-skill:last-child { border-bottom: 0; }
.student-skill-state { flex: 0 0 auto; padding: 5px 10px; border-radius: 999px; color: #6b573e; background: #f0e9df; font-size: 12px; font-weight: 700; }
.student-skill-state.mastered { color: #167a66; background: #e3f3ee; }
.student-skill-state.learning, .student-skill-state.needs-work { color: #8a5a00; background: #fff0ca; }
/* scroll-margin-top: scrolled into view, the card clears the sticky top bar and the toast over it. */
.student-login-card-panel { margin-top: 14px; scroll-margin-top: 72px; padding: 16px; border: 1px solid var(--line-card); border-radius: 16px; background: #fff; }
.student-login-card-heading { display: flex; margin-bottom: 12px; align-items: center; justify-content: space-between; gap: 12px; }
.student-login-card-heading h2 { margin: 0; font-family: var(--font-serif); }
.student-login-card-heading > div { display: flex; flex-wrap: wrap; gap: 8px; }
.student-login-card-panel .login-card { max-width: 420px; }

.detail-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.detail-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 19px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c2651a, #e09a3c);
}

.detail-identity-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.detail-identity-copy h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.02em;
}

.detail-identity-copy span {
  color: var(--ink-muted);
  font-size: 13px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-stat-grid {
  margin-top: 22px;
}

.detail-tabs-row {
  display: flex;
  margin-top: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  width: fit-content;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--chip-bg);
}

.segmented-tab {
  padding: 9px 15px;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.segmented-tab.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 12px rgb(60 42 20 / 10%);
}

.detail-updated {
  color: var(--ink-faint);
  font-size: 12px;
}

.detail-empty {
  min-height: 280px;
  margin-top: 22px;
}

/* Report */

.report-overview {
  display: grid;
  margin-top: 16px;
  gap: 14px;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
}

.report-meter-column {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assignment-meter {
  display: grid;
  padding: 14px 16px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fff;
  grid-template-columns: 72px minmax(0, 1fr);
}

.assignment-meter svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
}

.assignment-meter-track {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke: var(--track);
}

.assignment-meter-value {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
}

.assignment-meter.tone-green .assignment-meter-value {
  stroke: var(--teal);
}

.assignment-meter.tone-amber .assignment-meter-value {
  stroke: #c26a1d;
}

.assignment-meter.tone-red .assignment-meter-value {
  stroke: var(--red);
}

.assignment-meter.tone-neutral .assignment-meter-value {
  stroke: var(--track);
}

.assignment-meter.evaluating .assignment-meter-copy strong {
  color: var(--ink-muted);
  font-size: 15px;
  font-style: italic;
}

.assignment-meter-copy {
  display: grid;
  gap: 2px;
}

.assignment-meter-copy strong {
  font-size: 22px;
}

.assignment-meter-copy span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.assignment-meter-copy small {
  color: var(--ink-muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.question-snapshot-card {
  display: grid;
  padding: 16px;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fff;
}

.question-snapshot-copy {
  display: grid;
  gap: 3px;
}

.question-snapshot-copy h3 {
  margin: 0;
  font-size: 15px;
}

.question-snapshot-copy p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.question-snapshot-body {
  display: grid;
  align-items: center;
  gap: 16px;
  grid-template-columns: auto minmax(140px, 1fr);
}

.report-divider {
  display: flex;
  margin-top: 22px;
  align-items: center;
  gap: 12px;
}

.report-divider span {
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.report-divider::after {
  content: '';
  height: 1px;
  flex: 1;
  background: #e5e2d7;
}

.report-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-pill {
  display: inline-flex;
  padding: 7px 11px;
  color: var(--primary-pill-ink);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--primary-pill-bg);
  white-space: nowrap;
}

/* Domains information panel */

.domains-panel {
  display: grid;
  margin-top: 16px;
  padding: 20px;
  gap: 16px;
  border: 1px solid var(--line-card);
  border-radius: 18px;
  background: #fff;
}

.domains-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.domains-panel-heading h3 {
  margin: 0;
  font-size: 16px;
}

.domains-panel-heading span {
  color: var(--ink-muted);
  font-size: 12.5px;
}

.domains-panel > .progress-track {
  height: 7px;
}

.skill-row {
  display: grid;
  padding: 11px 12px;
  align-items: center;
  gap: 10px;
  border-radius: 11px;
  background: #f8f7f2;
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

.skill-status {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 11px;
  border-radius: 50%;
  color: var(--ink-muted);
  background: #e9e6dc;
}

.skill-row.mastered .skill-status {
  color: #fff;
  background: var(--teal);
}

.skill-row.needs-work .skill-status {
  color: #a3313f;
  background: #f9dfe2;
}

.skill-row > div {
  min-width: 0;
}

.skill-row > div strong {
  display: block;
  font-size: 12.5px;
}

.skill-row > div span {
  color: var(--ink-muted);
  font-size: 11.5px;
}

.skill-mastery {
  font-size: 12.5px;
  font-weight: 700;
}

.skill-mastery.evaluating-text {
  color: var(--ink-muted);
  font-size: 12px;
  font-style: italic;
}

/* Dialogs */

.modal {
  width: min(500px, calc(100vw - 32px));
  padding: 26px;
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 90px rgb(45 30 12 / 30%);
}

.modal-wide {
  width: min(880px, calc(100vw - 32px));
}

@media (min-width: 1001px) {
  .classroom-dialog.classroom-create-view[open] {
    position: fixed;
    /* --classroom-dialog-top is the bottom of the "Verify your email" banner when it shows (set in teacher.ts). */
    inset: var(--classroom-dialog-top, 58px) 0 0 232px;
    width: auto;
    max-width: none;
    max-height: none;
    height: auto;
    padding: 20px 26px;
    margin: 0;
    overflow: auto;
    border: 0;
    border-radius: 0;
    background: var(--paper);
    box-shadow: none;
  }

  .classroom-dialog.classroom-create-view::backdrop {
    background: transparent;
    backdrop-filter: none;
  }
}

.classroom-create-view #classroom-form {
  width: min(700px, 100%);
  padding: 20px 20px 0;
  border: 1px solid var(--line-card);
  border-radius: 18px;
  background: #fff;
}

.classroom-create-view .modal-heading {
  margin-bottom: 14px;
}

.classroom-create-view .modal-heading .eyebrow {
  margin-bottom: -5px;
}

.classroom-create-view .modal-heading h2 {
  margin: 0;
  font-size: 22px;
}

.classroom-create-view .modal-heading [data-close-dialog] {
  display: none;
}

.classroom-create-view .field {
  margin: 12px 0 10px;
}

.classroom-create-view .field label {
  font-size: 15px;
}

.classroom-create-view #classroom-form-error {
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

.classroom-create-view input::placeholder {
  color: #b8aea2;
  font-style: italic;
  opacity: 1;
}

.classroom-create-view .modal-actions {
  padding: 12px 20px 14px;
  margin: 28px -20px 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 1000px) {
  .classroom-dialog.classroom-create-view[open] {
    width: min(700px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 20px;
  }
}

/* A centred class dialog starts below the "Verify your email" banner so the banner text is not covered. */
.classroom-dialog.below-banner[open]:not(.classroom-create-view) {
  margin-top: calc(var(--classroom-dialog-top) + 12px);
  max-height: calc(100dvh - var(--classroom-dialog-top) - 24px);
}

@media (max-width: 1000px) {
  .classroom-dialog.below-banner[open] {
    margin-top: calc(var(--classroom-dialog-top) + 12px);
    max-height: calc(100dvh - var(--classroom-dialog-top) - 24px);
  }
}

/* The dimmed backdrop also starts below the banner, or its text is blurred out. */
.classroom-dialog.below-banner::backdrop {
  top: var(--classroom-dialog-top);
}

.modal::backdrop {
  background: rgb(38 27 15 / 45%);
  backdrop-filter: blur(4px);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading h2 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 24px;
}

.modal-heading .eyebrow {
  font-size: 11.5px;
}

.assignment-modal-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.assignment-modal-save {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.modal-subtext {
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  margin-top: 22px;
  justify-content: flex-end;
  gap: 9px;
}

.modal-actions-spread {
  margin-top: 18px;
  justify-content: space-between;
}

.modal .segmented {
  display: grid;
  width: auto;
  margin-top: 18px;
  grid-template-columns: 1fr 1fr;
}

.search-results {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.search-result-card {
  display: flex;
  padding: 13px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line-card);
  border-radius: 13px;
  background: #fffefb;
}

.search-result-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.search-result-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c2651a, #e09a3c);
}

.search-result-identity > div {
  display: grid;
  min-width: 0;
}

.search-result-card strong {
  font-size: 13.5px;
}

.search-result-card span {
  color: var(--ink-muted);
  font-size: 12px;
}

.search-result-card .button-primary {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 10px;
  box-shadow: none;
}

.empty-inline {
  padding: 18px;
  margin-top: 18px;
  border: 1px dashed var(--line-input);
  border-radius: 13px;
  text-align: center;
  background: #fffefb;
}

.empty-inline h3 {
  margin: 0;
  font-size: 14.5px;
}

.empty-inline p {
  margin: 6px 0 14px;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.empty-inline.compact {
  min-height: 0;
  padding: 14px;
}

.empty-inline.compact p {
  margin: 0;
}

/* Assignment dialog */

.assignment-columns {
  display: grid;
  margin-top: 20px;
  gap: 14px;
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.assignment-column {
  display: grid;
  padding: 16px;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line-card);
  border-radius: 14px;
  background: #fffefb;
}

.assignment-column.staged {
  border-color: #ecd3b8;
  background: #fdf8f1;
}

.assignment-column-label {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.assignment-column.staged .assignment-column-label {
  color: var(--primary-pill-ink);
}

@keyframes assignment-domain-enter-right {
  from {
    opacity: 0;
    transform: translateX(-18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes assignment-domain-enter-left {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.available-domain-add {
  display: inline-flex;
  min-height: 32px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  color: var(--primary-pill-ink);
  font-weight: 700;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid #ecd3b8;
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.available-domain-add:hover {
  background: #f6e2cf;
}

.staged-domain-remove {
  display: inline-flex;
  min-height: 32px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  color: var(--ink-mid);
  font-weight: 600;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--line-quiet);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.staged-domain-remove:hover {
  color: #a3313f;
  border-color: #f2ccd2;
}

.assignment-column-empty {
  margin: 0;
  padding: 14px;
  color: var(--ink-muted);
  font-size: 12.5px;
  text-align: center;
  border: 1px dashed var(--line-input);
  border-radius: 11px;
}

.assignment-column.staged .assignment-column-empty {
  border-color: #ecd3b8;
}

.assignment-column-note {
  margin: 2px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.5;
}

.assignment-group-warning {
  margin: 10px 0 0;
}

.groups-section {
  margin: 26px 0;
}

.group-identity p,
.learning-area-group-members {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.group-status {
  padding: 6px 10px;
  color: var(--primary-pill-ink);
  border-radius: 999px;
  background: var(--primary-pill-bg);
  font-size: 11px;
  font-weight: 700;
}

.group-row {
  display: grid;
  padding: 14px 18px;
  gap: 10px 20px;
  align-items: center;
  grid-template-columns: minmax(200px, 1.2fr) minmax(160px, 1.4fr) minmax(160px, 1fr) auto;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.group-row:hover,
.group-row:focus-visible {
  border-color: var(--primary-line);
  box-shadow: var(--shadow-card-hover);
}

.group-row .row-menu-trigger,
.group-row .row-menu-item {
  cursor: pointer;
}

.group-row .learning-area-group-members {
  margin: 0;
}

.group-identity {
  min-width: 0;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.group-title h3 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.group-title .group-status {
  padding: 3px 9px;
}

.group-picker {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.group-picker legend {
  margin-bottom: 9px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.group-student-options {
  display: grid;
  gap: 8px;
  padding: 2px;
}

.group-wizard-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 22px 0 18px;
  gap: 8px;
}

.group-wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group-wizard-step b {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line-card);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-muted);
  font-size: 11px;
}

.group-wizard-step.active,
.group-wizard-step.complete {
  color: var(--primary);
}

.group-wizard-step.active b,
.group-wizard-step.complete b {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.group-wizard-panel {
  min-height: 190px;
}

.field-help {
  display: block;
  margin-top: 6px;
  color: var(--ink-muted);
  font-size: 12px;
}

.group-conflict-list {
  display: grid;
  margin-top: 18px;
  gap: 8px;
}

.group-conflict-row {
  display: grid;
  padding: 11px 13px;
  gap: 3px;
  border: 1px solid var(--line-card);
  border-radius: 11px;
  background: var(--primary-soft);
}

.group-conflict-row span {
  color: var(--ink-muted);
  font-size: 12px;
}

.group-check {
  display: flex;
  padding: 10px 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-card);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
}

.group-check:has(input:checked) {
  border-color: var(--primary-line);
  background: var(--primary-soft);
}

.group-check input {
  accent-color: var(--primary);
}

.group-check span {
  display: grid;
  gap: 2px;
}

.group-check small {
  color: var(--ink-muted);
  font-size: 11px;
}

.standards-preview-list {
  display: grid;
  gap: 7px;
}

.standard-preview-row {
  display: grid;
  padding: 10px 12px;
  gap: 2px;
  border-radius: 11px;
  background: #f8f7f2;
}

.standard-preview-row strong {
  font-size: 12px;
}

.standard-preview-row span {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.55;
}

/* Toast */

.toast {
  /*
   * Centred over the top bar: every step's action bar is at the bottom, and the page header's
   * buttons (Login card, Edit domains) sit top right, so a toast at either spot covered them.
   * Clicks pass through, so even a long toast never blocks a button.
   */
  position: fixed;
  z-index: 100;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
  padding: 13px 16px;
  color: #fff;
  font-size: 14px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 16px 44px rgb(45 30 12 / 30%);
}

.modal .form-error {
  margin: 14px 0 0;
}

/* Responsive */

@media (max-width: 1000px) {
  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-story {
    min-height: 320px;
  }

  .story-copy {
    margin: 40px 0;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .report-overview {
    grid-template-columns: 1fr;
  }

  .report-meter-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .auth-panel {
    padding: 24px;
  }

  .topbar {
    padding: 0 16px;
  }

  .teacher-menu-copy {
    display: none;
  }

  .brand {
    white-space: nowrap;
  }

  .brand-product {
    display: none;
  }

  .topbar {
    gap: 10px;
  }

  .sidebar {
    padding: 10px 16px;
    gap: 10px;
  }

  /* The class strip takes the whole row; "+ New class" (and Unassigned) go under it, or the
     strip was cut to a sliver beside the button and the second card looked covered by it. */
  .sidebar-stack {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .sidebar-section-heading {
    display: none;
  }

  .classroom-list {
    grid-column: 1 / -1;
    display: flex;
    min-width: 0;
    gap: 8px;
    overflow-x: auto;
  }

  .classroom-item {
    width: 190px;
    min-width: 160px;
    flex: 0 0 auto;
    padding: 9px 11px;
  }

  .new-classroom-button {
    width: auto;
    min-height: 42px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .setup-state {
    padding: 0;
  }

  .setup-checklist {
    grid-template-columns: 1fr;
  }

  .setup-checklist li {
    min-height: 88px;
  }

  .workspace {
    padding: 24px 16px 48px;
  }

  .workspace:has(#no-classrooms-state:not([hidden])) {
    padding: 24px 16px 48px;
}

.roster-tab-bar {
    width: 100%;
  }

  .roster-tab {
    flex: 1 1 0;
    padding: 0 10px;
  }

  .section-heading-actions {
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
  }

  .section-heading-actions .search-field,
  .section-heading-actions .button {
    flex: 1 1 100%;
    width: 100%;
  }

  .question-snapshot-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .group-wizard-step {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    font-size: 9px;
  }

}

@media (min-width: 641px) and (max-width: 1000px) {
  .setup-checklist li {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }
}

/* Learner list rows */
.roster-list {
  display: grid;
  margin-top: 16px;
  gap: 10px;
}

.roster-list .loading-card {
  min-height: 120px;
}

.student-row {
  display: grid;
  padding: 14px 18px;
  gap: 14px 20px;
  align-items: center;
  grid-template-columns: minmax(240px, 1.4fr) minmax(130px, 1fr) minmax(160px, 1fr) auto;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.student-row:hover,
.student-row:focus-visible {
  border-color: var(--primary-line);
  box-shadow: var(--shadow-card-hover);
}

.button-danger {
  color: #a3261a;
  border: 1px solid #e3b4ae;
  background: #fff;
}

.button-danger:hover {
  background: #fdecea;
}

.status-pill {
  display: inline-block;
  white-space: nowrap;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  color: var(--primary-pill-ink);
  background: var(--primary-pill-bg);
}

.status-pill-warn {
  color: #8a2a1a;
  background: #fdecea;
}

/* Row actions (three-dots) menu */
.row-menu {
  position: relative;
  justify-self: end;
}

.row-menu-trigger {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--ink-muted);
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.row-menu-trigger:hover,
.row-menu.open .row-menu-trigger {
  color: var(--ink);
  border-color: var(--line-card);
  background: var(--chip-bg);
}

.row-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 180px;
  padding: 6px;
  gap: 2px;
  border: 1px solid var(--line-card);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(43, 32, 20, 0.16);
}

.row-menu-list[hidden] {
  display: none;
}

.row-menu-item {
  padding: 9px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.row-menu-item:hover,
.row-menu-item:focus-visible {
  background: var(--chip-bg);
}

.row-menu-item-danger {
  color: #a3261a;
}

.row-menu-item-danger:hover,
.row-menu-item-danger:focus-visible {
  background: #fdecea;
}

@media (max-width: 900px) {
  .student-row,
  .group-row {
    grid-template-columns: 1fr;
  }
}

/* Class list */
.classroom-menu-list { position: absolute; z-index: 5; top: calc(100% + 5px); right: 0; display: grid; width: 168px; padding: 5px; gap: 2px; border: 1px solid var(--line-card); border-radius: 12px; background: #fff; box-shadow: var(--shadow-card-hover); }
.classroom-menu-list[hidden] { display: none; }
.classroom-more-menu > .classroom-menu-list > button { position: static; width: 100%; padding: 9px 10px; text-align: left; border: 0; border-radius: 7px; background: transparent; box-shadow: none; }
.classroom-more-menu > .classroom-menu-list > button:hover { background: var(--chip-bg); }
.classroom-more-menu > .classroom-menu-list > button.danger-item { color: #a3261a; }
.classroom-more-menu > .classroom-menu-list > button.danger-item:hover { background: #fdecea; }
.class-summary { display: grid; margin-top: 18px; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.class-summary .stat-card { padding: 12px 14px; }
.class-summary .stat-card-value { margin: 0; font-size: 28px; }
.class-toolbar { display: flex; margin-top: 12px; gap: 10px; align-items: center; justify-content: space-between; }
.class-topic-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.class-topic-chip { padding: 4px 10px; color: #2360a9; font-size: 12px; font-weight: 650; border-radius: 999px; background: #e6eefb; }
.class-updated-at { color: var(--ink-muted); font-size: 12px; white-space: nowrap; }
.class-roster-actions { margin: 10px 0; }
.class-roster-actions .button { gap: 4px; padding-inline: 10px; }
#unlogged-card-count { display: inline-flex; min-width: 0; margin-inline: 1px; padding: 1px 5px; justify-content: center; border-radius: 999px; background: #f4e7d8; font-size: 12px; line-height: 1.2; }
.setup-complete-banner { display: flex; margin-top: 14px; padding: 11px 14px; align-items: center; gap: 10px; color: #246b58; border: 1px solid #cce6da; border-radius: 12px; background: #eff8f3; font-size: 14px; }
.text-link { padding: 0; color: #2360a9; font: inherit; font-weight: 700; border: 0; background: none; cursor: pointer; }
.roster-table-head { display: grid; margin-top: 10px; padding: 10px 14px; gap: 18px; grid-template-columns: minmax(250px, 1.4fr) minmax(180px, 1fr) 100px 100px 46px; color: var(--ink-muted); border: 1px solid var(--line-card); border-bottom: 0; border-radius: 14px 14px 0 0; background: #fbf9f5; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.roster-list { margin-top: 0; gap: 0; border: 1px solid var(--line-card); border-radius: 0 0 14px 14px; overflow: visible; background: #fff; }
.student-row { min-height: 72px; padding: 10px 14px; gap: 10px 18px; grid-template-columns: minmax(250px, 1.4fr) minmax(180px, 1fr) 100px 100px 30px 16px; border: 0; border-bottom: 1px solid var(--line-card); border-radius: 0; }
.student-row:last-child { border-bottom: 0; border-radius: 0 0 14px 14px; }
.student-status { width: max-content; padding: 4px 9px; color: #315d9b; border-radius: 999px; background: #e8eef9; font-size: 12px; font-weight: 600; }
.student-status.playing { color: #26745d; background: #e2f2ec; }
.student-status.not-logged-in { color: #6c6255; background: #f0ece5; }
.student-answered, .student-first-try { text-align: right; font-variant-numeric: tabular-nums; }
.student-row-arrow { color: #c1aa8d; font-size: 22px; }
.student-mobile-metrics { display: none; }
.classroom-workspace .roster-workspace-tabs { margin-top: 18px; }

@media (max-width: 900px) {
  .class-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-toolbar { align-items: flex-start; flex-direction: column; }
  .roster-table-head { display: none; }
  .student-row { grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
  .student-row .student-identity, .student-row .student-status,
  .student-row .student-answered, .student-row .student-first-try { grid-column: 1 / -1; }
  .student-row .student-answered, .student-row .student-first-try { text-align: left; }
  .student-row .student-answered, .student-row .student-first-try { display: none; }
  .student-row .student-mobile-metrics { display: block; color: var(--ink-muted); font-size: 13px; }
  .student-row .row-menu { grid-column: 2; grid-row: 1; }
  .student-row .student-row-arrow { display: none; }
}

/* CSV import + credentials */
.import-steps {
  display: grid;
  margin: 18px 0 0;
  padding: 0;
  gap: 14px;
  list-style: none;
}

.import-step {
  display: grid;
  padding: 16px 18px;
  gap: 14px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fffdfa;
}

.import-step-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.import-step-head > div {
  flex: 1;
  min-width: 0;
}

.import-step-head h3 {
  margin: 0;
  font-size: 15px;
}

.import-step-head p {
  margin: 3px 0 0;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
}

.import-step-number {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c2651a, #e09a3c);
}

.import-template-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.import-csv-card {
  overflow: hidden;
  border: 1px solid var(--line-card);
  border-radius: 12px;
  background: #fff;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
}

.import-csv-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
}

.import-csv-empty {
  color: var(--ink-faint);
  font-style: italic;
}

.import-csv-row + .import-csv-row {
  border-top: 1px solid var(--line-card);
}

.import-csv-row span {
  padding: 8px 14px;
}

.import-csv-row span + span {
  border-left: 1px solid var(--line-card);
}

.import-csv-head {
  color: var(--primary-pill-ink);
  font-weight: 700;
  background: var(--primary-pill-bg);
}

.import-facts {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  list-style: none;
  color: var(--ink-mid);
  font-size: 13px;
  line-height: 1.5;
}

.import-facts li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.import-facts li > span {
  display: grid;
  min-width: 26px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--primary-pill-ink);
  font-weight: 700;
  font-size: 11px;
  border-radius: 7px;
  background: var(--primary-pill-bg);
}

.import-facts p {
  margin: 0;
}

.import-facts code {
  padding: 1px 5px;
  font-size: 12px;
  border-radius: 5px;
  background: #f4ede2;
}

.import-dropzone {
  display: grid;
  position: relative;
  padding: 26px 18px;
  gap: 4px;
  justify-items: center;
  text-align: center;
  color: var(--ink-mid);
  cursor: pointer;
  border: 1.5px dashed var(--primary-line);
  border-radius: 14px;
  background: var(--primary-soft, #fdf6ee);
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.import-dropzone[hidden] {
  display: none;
}

.import-dropzone:hover,
.import-dropzone.is-dragging,
.import-dropzone:focus-within {
  border-color: var(--primary);
  background: #fcefe0;
  box-shadow: 0 0 0 4px rgba(194, 101, 26, 0.12);
}

.import-dropzone-icon {
  color: var(--primary);
}

.import-dropzone-title strong {
  color: var(--primary);
}

.import-dropzone-hint {
  color: var(--ink-faint);
  font-size: 12px;
}

.import-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.import-file-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--ink-mid);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--primary-line);
  border-radius: 12px;
  background: var(--primary-soft, #fdf6ee);
}

.import-file-chip[hidden] {
  display: none;
}

.import-file-chip svg {
  flex: 0 0 auto;
  color: var(--primary);
}

.import-file-chip > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-clear {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.import-clear:hover {
  color: #a3261a;
  background: #fdecea;
}

.import-errors {
  margin-top: 14px;
}

.import-errors ul {
  margin: 6px 0 0;
  padding-left: 18px;
  max-height: 180px;
  overflow: auto;
}

.import-preview {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}

.import-sample-scroll {
  min-height: 0;
  max-height: 236px;
  overflow: auto;
  border: 1px solid var(--line-card);
  border-radius: 9px;
}

.import-sample-scroll .import-sample {
  margin: 0;
}

.import-preview > p {
  margin: 0;
}

.import-sample {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.import-sample th,
.import-sample td {
  padding: 7px 10px;
  text-align: left;
  border: 1px solid var(--line-card);
}

.import-sample th:first-child,
.import-sample td:first-child {
  width: 8%;
}

.import-sample th {
  background: #faf6ef;
}

@media (max-width: 640px) {
  /* Heading on top, the template button below it (full width), so neither is squeezed. */
  .import-step-head {
    flex-wrap: wrap;
  }

  .import-step-head > div {
    flex: 1 1 calc(100% - 44px);
    min-width: 0;
  }

  .import-template-button {
    flex: 1 1 100%;
    justify-content: center;
  }

  /* Three columns on a phone: smaller type and padding, long values wrap. */
  .import-csv-card {
    font-size: 11.5px;
  }

  .import-csv-row span {
    padding: 7px 8px;
    overflow-wrap: anywhere;
  }

  .import-step {
    padding: 14px;
  }
}

.credentials-note {
  margin: 0 0 12px;
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.55;
}

.credentials-table {
  max-height: 340px;
  overflow: auto;
  margin-bottom: 12px;
}

/* Group detail screen */
.group-detail-section {
  display: grid;
  margin-top: 18px;
  padding: 20px 22px;
  gap: 14px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-card);
  background: #fff;
}

.group-detail-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.group-detail-section-head h2 {
  margin: 0;
  font-size: 18px;
}

.group-detail-section .section-subtitle {
  margin: 4px 0 0;
}

.group-detail-section .button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Unassigned learners */
.unassigned-entry {
  display: flex;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  align-items: center;
  gap: 10px;
  color: var(--ink-mid);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  border: 1px solid var(--line-card);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
  transition: border-color 150ms ease;
}

.unassigned-entry[hidden] {
  display: none;
}

.unassigned-entry:hover,
.unassigned-entry.active {
  border-color: var(--primary-line);
  color: var(--primary);
  background: var(--primary-soft);
}

.unassigned-entry-label {
  flex: 1 1 auto;
  min-width: 0;
}

.unassigned-count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 2px 8px;
  color: var(--primary-pill-ink);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  border-radius: 999px;
  background: var(--primary-pill-bg);
}

.unassigned-heading {
  margin-top: 18px;
}

.unassigned-row {
  grid-template-columns: minmax(240px, 1.4fr) minmax(160px, 1fr) auto;
  cursor: default;
}

.unassigned-row:hover {
  border-color: var(--line-card);
  box-shadow: none;
}

.unassigned-former {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: var(--ink-mid);
  font-size: 13px;
}

.unassigned-former small {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.unassigned-empty {
  margin-top: 24px;
}

@media (max-width: 900px) {
  .unassigned-row {
    grid-template-columns: 1fr;
  }
}

/* Add one student */
.field-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.add-students-page .field-row input {
  height: 48px;
}

.add-one-username {
  min-height: 41px;
  padding: 11px 13px;
  margin: 12px 0 0;
  color: #16847b;
  font-size: 13px;
  border-radius: 9px;
  background: #e3f3ec;
}

.add-one-username.is-invalid {
  color: #a3313f;
  font-weight: 600;
}

.add-one-username-edit {
  margin: 4px 0 8px;
}

.add-one-username-edit summary {
  width: fit-content;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.add-one-username-edit > .field-hint {
  display: block;
  margin: 8px 0 12px;
}

.field-optional {
  color: var(--ink-faint);
  font-weight: 500;
}

.field-hint {
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
}

.email-hint .link-button {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0;
}

/* Add students is a workspace page; its card keeps actions visible while previews scroll. */
.workspace:has(.add-students-page:not([hidden])) {
  padding-top: 20px;
}

.add-students-page {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.add-students-page[hidden] {
  display: none;
}

.add-students-card {
  display: flex;
  width: min(880px, 100%);
  min-height: 360px;
  padding: 20px 20px 16px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-card);
  border-radius: 16px;
  background: #fff;
}

.add-students-card .modal-heading {
  flex: 0 0 auto;
  margin-bottom: 4px;
}

.add-students-heading h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 600;
}

.add-students-card .modal-heading h2 {
  margin-bottom: 4px;
}

.add-students-card .modal-heading .eyebrow {
  margin-bottom: 2px;
}

.add-students-card .add-students-tabs {
  display: grid;
  width: 100%;
  flex: 0 0 auto;
  margin: 10px 0 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.add-students-tabs .segmented-tab {
  min-height: 40px;
  font-size: 14px;
  transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.add-students-tabs .segmented-tab:hover:not(.active) {
  color: var(--primary);
}

.add-students-tabs .segmented-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.add-students-panel {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.add-students-panel[hidden] {
  display: none;
}

#add-panel-paste {
  overflow: visible;
}

#add-panel-paste .import-preview {
  padding: 0;
}

.add-students-form {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.add-students-scroll {
  min-height: 0;
  flex: 1 1 auto;
  margin: 0 -8px;
  padding: 0 8px 4px;
  overflow-y: auto;
}

.add-students-scroll > .import-steps {
  margin-top: 0;
}

.add-students-form .modal-actions {
  flex: 0 0 auto;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

#import-form .modal-actions {
  display: none;
}

.setup-student-actions {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}

.setup-student-actions .button-quiet {
  color: var(--ink);
}

.add-students-page .setup-progress {
  flex: 0 0 auto;
  margin: 0;
}

.add-students-page .setup-progress li {
  font-size: 11px;
}

.add-students-page .setup-progress > p {
  font-size: 11px;
}

.add-students-page .field-row .field {
  margin: 0;
}

@media (max-width: 640px) {
  .add-students-card {
    max-height: none;
    min-height: 0;
    padding: 16px 14px 14px;
    overflow: visible;
  }

  .add-students-page .setup-progress {
    gap: 8px;
  }

  .add-students-page .setup-progress li {
    gap: 5px;
    padding-right: 0;
  }

  .add-students-page .setup-progress li:not(.current) .setup-progress-label {
    display: none;
  }

  #topic-picker-progress li:not(.current) .setup-progress-label {
    display: none;
  }
}

.add-one-username code {
  padding: 2px 7px;
  font-size: 13px;
  border-radius: 6px;
  background: #f4ede2;
}

.empty-state-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

.import-ready-count { margin: 0 0 8px; }
.button-icon { vertical-align: -3px; flex: 0 0 auto; }
.student-no-answers { margin: 18px 0; color: var(--muted, #806b57); }

.import-username-input {
  width: 100%;
  min-width: 120px;
  padding: 5px 8px;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ink, inherit);
  border: 1px solid var(--line-card);
  border-radius: 7px;
  background: #fff;
}

.import-username-input[aria-invalid='true'] {
  border-color: #a3313f;
}

.import-username-error {
  display: block;
  margin-top: 3px;
  color: #a3313f;
  font-size: 12px;
  font-weight: 600;
}

.import-username-error:empty {
  display: none;
}

/* Topic editions (graph Teacher Studio): chapter picker, chapter progress, step-back flags. */
.topic-picker-grid > .chapter-group, .topic-picker-grid > .assignment-column-empty { grid-column: 1 / -1; }
.chapter-picker { display: grid; gap: 12px; max-height: min(62vh, 640px); overflow-y: auto; }
.chapter-group { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line-card); border-radius: var(--radius-card); background: #fffdfa; }
.chapter-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chapter-group-head > div { display: grid; min-width: 0; gap: 2px; }
.chapter-group-head h3 { margin: 0; font: 600 16px/1.3 var(--font-serif); overflow-wrap: anywhere; }
.chapter-topic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
/* Topic titles are long: wrap them instead of cutting them to one line with an ellipsis. */
.chapter-topic-list .topic-picker-row strong { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
/* In a dialog or a group the list is narrow: one column. */
.chapter-picker .chapter-topic-list { grid-template-columns: 1fr; }
/* Beats `.topic-picker-row .button` (40px) so each toggle is a 44px target. */
.topic-picker-row .topic-toggle { flex: 0 0 auto; min-height: 44px; }
/* Not ready: readable text (no fading), a dashed edge and the amber pill. */
.topic-picker-row.topic-not-ready { color: var(--ink-muted); border-style: dashed; background: #fbfaf8; }
.topic-picker-row.topic-not-ready strong { color: var(--ink-muted); }
.topic-picker-row .topic-not-ready-note { flex: 0 0 auto; white-space: nowrap; }
.flag-badge { display: inline-flex; margin-left: 8px; padding: 2px 8px; align-items: center; color: #8f2734; font-size: 11px; font-weight: 700; border: 1px solid #f1c9cf; border-radius: 999px; background: #fdecee; white-space: nowrap; }
.flag-note { margin-top: 14px; padding: 14px 16px; border: 1px solid #f1c9cf; border-left: 4px solid var(--red); border-radius: var(--radius-card); background: #fff7f8; }
.flag-note h2 { margin: 0 0 6px; color: #8f2734; font: 600 17px/1.3 var(--font-serif); }
.flag-note ul { display: grid; margin: 0; padding-left: 18px; gap: 6px; color: var(--ink-soft); font-size: 14px; line-height: 1.45; }
/* Decision 37: each note's "Mark as handled", a 44px target under its sentence. */
.flag-note li { display: grid; justify-items: start; gap: 6px; }
.flag-note li > p { margin: 0; }
.flag-note .flag-handled-button { min-height: 44px; }
.chapter-progress-list { display: grid; margin-top: 14px; gap: 14px; }
.chapter-progress { display: grid; gap: 8px; padding: 16px 18px; border: 1px solid var(--line-card); border-radius: var(--radius-card); background: #fff; }
.chapter-progress > h2 { margin: 0; font: 600 19px/1.3 var(--font-serif); overflow-wrap: anywhere; }
.chapter-progress-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-mid); font-size: 13px; font-weight: 650; }
.chapter-progress-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--track); }
.chapter-progress-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.chapter-progress .student-topic-list { margin-top: 4px; }
.chapter-progress .student-topic-card h3 { margin: 0 0 4px; font: 600 17px/1.3 var(--font-serif); }
.topic-card-meta { display: flex; flex-wrap: wrap; margin-bottom: 6px; align-items: center; gap: 6px 10px; color: var(--ink-muted); font-size: 13px; }
.topic-card-meta .flag-badge { margin-left: 0; }
.topic-not-ready-note { padding: 2px 8px; color: #8a5a00; font-size: 11px; font-weight: 700; border-radius: 999px; background: #fff0ca; }
.support-work { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-quiet); }
.support-work h4 { margin: 0 0 6px; color: var(--ink-mid); font-size: 13px; }
.support-work-list { display: grid; margin: 0; padding: 0; gap: 6px; list-style: none; }
.support-work-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.support-work-list li > span:first-child { display: grid; min-width: 0; }
.support-work-list small { color: var(--ink-muted); font-size: 12px; overflow-wrap: anywhere; }
.support-work-state { flex: 0 0 auto; padding: 4px 9px; color: #6b573e; font-size: 12px; font-weight: 700; border-radius: 999px; background: #f0e9df; }
.chapter-other-questions { margin: 2px 0 0; color: var(--ink-muted); font-size: 13px; }
/* Decision 42: every check after a class move, in one small section of the child's page. */
.move-checks { display: grid; margin-top: 14px; gap: 6px; padding: 14px 16px; border: 1px dashed var(--line-card); border-radius: var(--radius-card); background: #fbfaf8; }
.move-checks > h2 { margin: 0; font: 600 17px/1.3 var(--font-serif); }
.move-checks-note { margin: 0 0 4px; color: var(--ink-muted); font-size: 13px; }

@media (max-width: 900px) {
  .chapter-topic-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .chapter-group-head { flex-direction: column; align-items: stretch; }
  .chapter-topic-list { grid-template-columns: 1fr; }
  .support-work-list li { flex-direction: column; align-items: flex-start; }
  .flag-note .flag-handled-button { width: 100%; }
}

.auth-form-title { margin: 0 0 4px; font: 600 20px/1.25 var(--font-serif); }
.auth-form-lead { margin: 0 0 18px; color: var(--ink-muted); font-size: 14px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.password-toggle { position: absolute; top: 50%; right: 8px; padding: 6px; transform: translateY(-50%); border: 0; background: none; color: var(--ink-muted); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.hint-ok { color: #2f7d62; }

.school-chosen { display: flex; min-height: 46px; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #cfe5da; border-radius: 11px; background: #e3f2ec; }
.school-chosen.school-chosen-new { border-color: #efd9c3; background: #fbf5ee; }
.school-chosen[hidden] { display: none; }
.school-chosen-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.school-chosen-name span { color: var(--ink-muted); }
.inline-link { align-self: center; margin: 0 0 0 auto; padding: 2px; border: 0; background: none; color: #a9531f; font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.school-info { margin-bottom: 18px; padding: 10px 12px; border: 1px solid #e5ddd1; border-radius: 11px; background: #faf7f2; color: var(--ink-muted); font-size: 13px; }
.school-info[hidden] { display: none; }
.school-info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.school-info-row p { margin: 0; }
.school-info b { color: var(--ink); font-family: ui-monospace, Menlo, monospace; }
.school-info .inline-link { text-decoration: underline; text-underline-offset: 2px; }
.school-info .school-code-row { margin-top: 8px; align-items: center; }
.inline-link[hidden], .school-code-row[hidden] { display: none; }
.school-code-saved { margin: 8px 0 0; color: #2f7d62; font-size: 13px; }
.school-code-saved[hidden] { display: none; }
.school-info .school-code-row { gap: 8px; }
.school-info .school-code-row > span { color: var(--ink-muted); font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.school-info .school-code-row input { flex: none; width: 110px; height: 46px; padding: 7px 9px; border: 1px solid #e5ddd1; border-radius: 11px; background: #fff; color: var(--ink); font-family: ui-monospace, Menlo, monospace; font-size: 15px; }
.school-info .school-code-row input:focus { border-color: #d39a6a; outline: none; box-shadow: 0 0 0 3px #f6e6d6; }
.school-info .school-code-row button { min-height: 0; padding: 9px 14px; border: 1px solid #e5ddd1; border-radius: 11px; background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; }


/* Starborn Family: parents of a student, the connection notice and the note for parent. */
.parent-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 12px 16px; background: var(--primary-soft); border: 1px solid var(--primary-line); border-radius: var(--radius-card);
}
.parent-notice small, .student-parents-list small { display: block; color: var(--ink-muted); font-size: 12px; }
.parent-notice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.student-parents { margin: 20px 0; padding: 18px 20px; background: #fff; border: 1px solid var(--line-card); border-radius: var(--radius-card); }
.student-parents h2 { margin: 0 0 4px; font-size: 20px; }
.student-parents-help { margin: 0 0 12px; color: var(--ink-muted); font-size: 13px; }
.student-parents-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.student-parents-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line-quiet); border-radius: var(--radius-input); }
.student-parents-list .parent-none { color: var(--ink-muted); border-style: dashed; }
.parent-note-form label { display: block; margin-bottom: 6px; font-weight: 600; }
.parent-note-form textarea { width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line-input); border-radius: var(--radius-input); resize: vertical; }
.parent-note-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; color: var(--ink-muted); font-size: 13px; }

/* Starborn Family: the homework due date on a student's page. */
.student-due { margin: 20px 0; padding: 18px 20px; background: #fff; border: 1px solid var(--line-card); border-radius: var(--radius-card); }
.student-due h2 { margin: 0 0 4px; font-size: 20px; }
.due-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.due-form label { font-weight: 600; }
.due-form input[type='date'] { padding: 8px 10px; font: inherit; border: 1px solid var(--line-input); border-radius: var(--radius-input); }
.badge-unverified-email { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #fff3cd; color: #6b4e00; border: 1px solid #e0c15a; font-size: 12px; font-weight: 600; }

/* Roster: a parent connected and is waiting for "Looks right" on the student page. */
.parent-check-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  color: #7a4a07;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #ecd4aa;
  border-radius: 999px;
  background: #fff4dc;
}

/* Skill map tab: the grade's skills, the earlier skills step-back can use and the links between them. Curriculum only. */
.skill-map-section { margin: 26px 0; }
.skill-map-content { margin-top: 14px; }
.skill-map-content .loading-card { min-height: 200px; margin-top: 0; }
.skill-map-intro { max-width: 76ch; margin: 0; color: var(--ink-soft); font-size: 13.5px; }
.skill-map-empty { margin: 0; padding: 26px 20px; color: var(--ink-soft); border: 1px dashed var(--line-input); border-radius: var(--radius-card); text-align: center; }
.skill-map-legend { display: flex; margin: 10px 0 0; padding: 0; gap: 6px 18px; flex-wrap: wrap; color: var(--ink-muted); font-size: 12px; list-style: none; }
.skill-map-legend li { display: inline-flex; align-items: center; gap: 7px; }
.skill-map-key { display: inline-block; width: 22px; height: 12px; border-radius: 4px; }
.skill-map-key.is-class-grade { border: 1px solid var(--primary-line); background: var(--primary-pill-bg); }
.skill-map-key.is-earlier-grade { border: 1.5px dashed var(--ink-faint); background: #fff; }
.skill-map-key.is-needed, .skill-map-key.is-leads { height: 3px; border-radius: 2px; background: var(--primary); }
.skill-map-key.is-leads { background: var(--teal); }
.skill-map-body { display: grid; margin-top: 14px; gap: 16px; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
/* The map scrolls both ways inside its card, never the page, and is never taller than the window, so its sideways
   scrollbar stays in view. The padding keeps a box the focus moves to clear of the sticky grade headers. */
.skill-map-scroll { min-width: 0; max-height: max(420px, calc(100vh - 150px)); overflow: auto; scroll-padding: 44px 16px 16px; border: 1px solid var(--line-card); border-radius: var(--radius-card); background: #fff; }
.skill-map-canvas { position: relative; margin: 0 auto; }
.skill-map-svg { position: absolute; top: 0; left: 0; display: block; max-width: none; font-family: inherit; user-select: none; }
/* Two sticky layers over the map: the grade headers along the top and the lane (domain) names along the left. */
.skill-map-grade-heads { position: sticky; z-index: 3; top: 0; height: 0; pointer-events: none; }
.skill-map-grade-span { position: absolute; top: 0; height: 44px; }
.skill-map-grade-head { position: sticky; left: 8px; display: block; width: max-content; margin-top: 9px; padding: 3px 8px; color: var(--ink-muted); font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.skill-map-grade-head.is-class-grade { color: var(--primary); border-color: var(--primary-line); }
.skill-map-lane-names { position: sticky; z-index: 2; left: 0; width: 0; height: 0; pointer-events: none; }
.skill-map-lane-name { position: absolute; left: 8px; padding: 1px 6px; color: var(--ink-muted); font-size: 11px; font-weight: 700; line-height: 16px; white-space: nowrap; border-radius: 5px; background: #fff; }
.skill-map-lane-name.is-alt { background: #fbf9f5; }
.skill-map-lane { fill: #fff; }
.skill-map-lane.is-alt { fill: #fbf9f5; }
.skill-map-class-column { fill: var(--primary); fill-opacity: 0.045; }
.skill-map-grade-rule { stroke: var(--line); stroke-dasharray: 4 5; }
.skill-map-link-halo { fill: none; stroke: #fff; stroke-width: 4.5; }
.skill-map-link-line { fill: none; stroke: var(--ink-faint); stroke-width: 1.3; }
.skill-map-link-head { fill: var(--ink-faint); }
.skill-map-link.is-needed .skill-map-link-line { stroke: var(--primary); stroke-width: 2.2; }
.skill-map-link.is-needed .skill-map-link-head { fill: var(--primary); }
.skill-map-link.is-leads .skill-map-link-line { stroke: var(--teal); stroke-width: 2.2; }
.skill-map-link.is-leads .skill-map-link-head { fill: var(--teal); }
.skill-map-link.is-dimmed .skill-map-link-line { stroke: var(--ink-ghost); }
.skill-map-link.is-dimmed .skill-map-link-head { fill: var(--ink-ghost); }
.skill-map-node { cursor: pointer; outline: none; }
.skill-map-node-ring { fill: none; stroke: transparent; stroke-width: 2.5; }
.skill-map-node:focus-visible .skill-map-node-ring { stroke: var(--primary); }
/* Earlier-grade skills: a dashed outline. Class-grade skills: a filled box. */
.skill-map-node-box { fill: #fff; stroke: var(--ink-faint); stroke-width: 1.3; stroke-dasharray: 4 3; transition: fill 150ms ease, stroke 150ms ease; }
.skill-map-node.is-class-grade .skill-map-node-box { fill: var(--primary-pill-bg); stroke: var(--primary-line); stroke-dasharray: none; }
.skill-map-node-label { fill: var(--ink); font-size: 12.5px; font-weight: 650; pointer-events: none; }
/* Dimmed, a box fades its fill and outline but keeps a readable label (4.6:1 or more) and a full-strength focus ring. */
.skill-map-node.is-dimmed .skill-map-node-box { fill: #fff; stroke: var(--ink-ghost); }
.skill-map-node.is-dimmed.is-class-grade .skill-map-node-box { fill: var(--primary-soft); }
.skill-map-node.is-dimmed .skill-map-node-label { fill: var(--ink-muted); }
.skill-map-node:hover .skill-map-node-box { stroke: var(--primary); }
.skill-map-node.is-selected .skill-map-node-box { fill: var(--primary); stroke: var(--primary-deep); stroke-width: 2; }
.skill-map-node.is-selected .skill-map-node-label { fill: #fff; }
.skill-map-node.is-needed .skill-map-node-box { stroke: var(--primary); stroke-width: 2; }
.skill-map-node.is-needed.is-earlier-grade .skill-map-node-box { fill: var(--primary-soft); }
.skill-map-node.is-leads .skill-map-node-box { fill: #e4f4f1; stroke: var(--teal); stroke-width: 2; }
.skill-map-detail { position: sticky; top: 74px; max-height: calc(100vh - 90px); padding: 16px 18px; overflow-y: auto; border: 1px solid var(--line-card); border-radius: var(--radius-card); background: #fff; }
.skill-map-hint { margin: 0; color: var(--ink-muted); font-size: 13px; }
.skill-map-detail-tag { margin: 0; color: var(--ink-muted); font-size: 11.5px; font-weight: 700; }
.skill-map-detail h3 { margin: 4px 0 0; font-family: var(--font-serif); font-size: 22px; font-weight: 600; overflow-wrap: anywhere; }
.skill-map-detail h3:focus-visible { border-radius: 4px; outline: 2.5px solid var(--primary); outline-offset: 2px; }
.skill-map-detail-description { margin: 6px 0 0; color: var(--ink-soft); font-size: 13.5px; }
.skill-map-relation { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.skill-map-relation h4 { margin: 0; color: var(--ink-mid); font-size: 12px; font-weight: 700; }
.skill-map-relation.is-needed h4 { color: var(--primary-deep); }
.skill-map-relation.is-leads h4 { color: #0e766d; }
.skill-map-chips { display: flex; margin: 8px 0 0; padding: 0; gap: 6px; flex-wrap: wrap; list-style: none; }
.skill-map-chip { min-height: 32px; padding: 3px 11px; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 650; border: 1.3px dashed var(--ink-faint); border-radius: 999px; background: #fff; cursor: pointer; }
.skill-map-chip.is-class-grade { border: 1px solid var(--primary-line); background: var(--primary-pill-bg); }
.skill-map-chip:hover { color: var(--primary-deep); border-color: var(--primary); }
.skill-map-chip:focus-visible, .skill-map-clear:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.skill-map-none { margin: 6px 0 0; color: var(--ink-muted); font-size: 12.5px; }
.skill-map-clear { margin-top: 14px; font-size: 12.5px; }
.skill-map-error { display: grid; padding: 26px 20px; justify-items: center; gap: 12px; color: var(--ink-soft); border: 1px dashed var(--line-input); border-radius: var(--radius-card); text-align: center; }
.skill-map-error p { margin: 0; }
/* While the map is shown, a box the focus moves to stops clear of the sticky top bar. */
html:has(#skill-map-panel:not([hidden])) { scroll-padding-top: 70px; }

/* Below the desktop layout the panel follows the map and stays in view at the bottom while the map scrolls past.
   It is kept to 30% of the window, and the page keeps a focused box above it (WCAG 2.4.11). */
@media (max-width: 1000px) {
  .skill-map-body { grid-template-columns: minmax(0, 1fr); }
  .skill-map-scroll { max-height: max(320px, calc(70vh - 120px)); }
  .skill-map-detail { top: auto; bottom: 8px; max-height: 30vh; box-shadow: 0 8px 24px rgb(63 44 23 / 12%); }
  html:has(#skill-map-panel:not([hidden])) { scroll-padding-bottom: calc(30vh + 24px); }
}

@media (max-width: 640px) {
  .skill-map-detail { padding: 12px 14px; }
  .skill-map-detail h3 { font-size: 19px; }
  .skill-map-chip { min-height: 38px; }
}

/* Phones: the logo mark, the avatar and two buttons fill the bar, so the name text gives way.
   With the 40px icon link the bar needs 444px for "Starborn Math", so 421-443px scrolled sideways.
   The name is clipped, not removed, so the home link keeps its accessible name "Starborn Math". */
@media (max-width: 460px) {
  .topbar .brand > span:not(.brand-mark, .brand-product) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* View Curriculum in the topbar (Studio Atlas). Scoped to the link, its divider and anchor buttons.
   --ease-out is defined only on the curriculum page, so each use carries its value as a fallback. */

a.button {
  text-decoration: none;
}

.button:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
}

/* Height, radius and type size come from `.teacher-menu .button-quiet`. */
#view-curriculum-link {
  gap: 8px;
  padding: 0 15px 0 12px;
  color: var(--primary-pill-ink);
  border-color: var(--primary-line);
  background: linear-gradient(180deg, #fffaf4, var(--primary-soft));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%), 0 1px 2px rgb(93 53 12 / 6%);
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 200ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

#view-curriculum-link:hover {
  color: var(--primary-deep);
  border-color: #e3b88c;
  background: #fdf0e2;
  box-shadow: 0 6px 14px rgb(180 83 10 / 12%);
}

#view-curriculum-link:active {
  transform: translateY(1px);
}

/* Lucide "map", plain orange (no tinted tile). */
#view-curriculum-link .button-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
  vertical-align: 0;
  transition: transform 200ms var(--ease-out, cubic-bezier(0.22, 1, 0.36, 1));
}

#view-curriculum-link:hover .button-icon {
  transform: translateY(-1px) rotate(-6deg);
}

/* Separates navigation from the account cluster. It has no content, so it must not shrink when the bar is tight. */
.teacher-menu > .menu-divider {
  flex: none;
  width: 1px;
  height: 22px;
  margin: 0 3px;
  background: var(--line);
}

/* Fitting the bar. The lockup never shrinks or wraps, and the link, the 36px avatar circle and the
   buttons keep their size, so when the bar is tight only the name column (min-width 0, ellipsis)
   gives way. The steps below were measured with a full 180px name column (a real teacher's email):
   wherever the name shows (641px and up) it keeps at least 85px. */
.topbar > .brand {
  flex: none;
  white-space: nowrap;
}

.teacher-menu {
  min-width: 0;
}

.teacher-menu > .teacher-avatar,
.teacher-menu > .button {
  flex: none;
}

@media (min-width: 641px) {
  .topbar {
    gap: 16px;
  }
}

/* Up to 860px the link is a 40px icon button; its accessible name stays "View Curriculum" from the
   clipped label. With the label shown, the full lockup and a 180px name column need about 920px, so
   the label returns at 861px, where the name column still has about 120px. */
@media (max-width: 860px) {
  .teacher-menu {
    gap: 8px;
  }

  .teacher-menu > .menu-divider {
    display: none;
  }

  #view-curriculum-link {
    width: 40px;
    padding: 0;
  }

  #view-curriculum-link .button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* 641-680px: "Teacher Studio" gives way first, as on the curriculum page (its 680px step), so
   "Starborn Math" stays on one line and the name column keeps about 160px. Below 641px the name
   column hides, as before. */
@media (max-width: 680px) {
  .topbar .brand-product {
    display: none;
  }
}

/* 320px phones: with the standard gaps the four controls ran 15px into the right gutter. The 8px
   button padding also leaves room for the WCAG 1.4.12 text-spacing override ("Sign out" widens). */
@media (max-width: 350px) {
  .topbar {
    gap: 8px;
  }

  .teacher-menu {
    gap: 6px;
  }

  .teacher-menu .button-quiet {
    padding: 0 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-curriculum-link:hover .button-icon {
    transform: none;
  }
}
