/* ===== Brand Colours (from style guide) ===== */
:root {
  --primary-neutral: #3C3C3C;   /* Slate Grey */
  --accent-orange:  #FF7A00;    /* Warm Orange */
  --accent-orange-hover: #E56D00;
  --accent-yellow:  #FFD95A;    /* Soft Yellow */
  --accent-sky:     #5AC8FA;    /* Sky Blue */
  --accent-corn:    #6495ED;    /* Cornflower Blue */
  --base-light:     #FFFFFF;    /* Pure White */
  --alt-grey:       #F5F5F5;    /* Cloud Grey */
  --shadow:         0 2px 6px rgba(0,0,0,0.1);
}

/* ===== Base ===== */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--base-light);       /* Base colour = white */
  color: var(--primary-neutral);
  font-family: 'Nunito Sans', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  line-height: 1.6;
}
body {
  min-height: 100vh;
  overflow-y: scroll; /* keep scrollbar consistent across pages to prevent layout shift */
}

/* ===== Utilities ===== */
.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;
}

/* ===== Banner ===== */
.banner {
  position: relative;
  z-index: 5;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 16px 0;
  background: var(--alt-grey);
  box-shadow: var(--shadow);
}
.banner img {
  max-width: 100%;      /* allow it to shrink with screen */
  height: auto;         /* keep aspect ratio */
  display: block;
  margin: 0 auto;       /* center the image */
}

/* ===== Navigation ===== */
.banner-nav nav {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.5);
  gap: 0.75rem;
}
.banner-nav nav a {
  font-family: inherit;
  color: inherit;
  text-decoration: none;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  transition: background 120ms ease, color 120ms ease;
}
.banner-nav nav a:visited {
  color: inherit;
}
.banner-nav nav a.nav-active {
  font-weight: 700;
  color: #000;
}
.banner-nav nav a:hover,
.banner-nav nav a:focus-visible {
  background: var(--accent-orange);
  color: #fff;
}

/* ===== Content ===== */
.content {
  max-width: 920px;
  margin: 2rem auto;
  padding: 0 1rem;
}


h1, h2 {
  font-family: 'Montserrat', 'Barlow Condensed', sans-serif;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
h1 { color: var(--accent-orange); }
h2 { color: var(--primary-neutral); }

/* ===== Cards ===== */
.card {
  background: var(--base-light);
  border: 1px solid #e9e9e9;
  border-radius: 12px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

/* ===== Buttons (UI Components) ===== */
.button-group { margin-top: 1rem; display: flex; gap: 0.5rem; }

.btn-primary {
  background: var(--accent-orange); /* Orange background */
  color: #fff;                      /* White text */
  border: none;
  border-radius: 8px;               /* 8px radius */
  padding: 10px 16px;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);        /* Shadow: 0 2px 6px rgba(0,0,0,0.1) */
}
.btn-primary:hover {
  background: var(--accent-orange-hover); /* Slightly darker on hover */
}

.btn-secondary {
  background: #fff;
  color: var(--primary-neutral);
  border: 2px solid var(--primary-neutral); /* White border/grey text variant per guide */
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* ===== MCQ Styling ===== */
.mcq .option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 120ms ease;
}
.mcq .option:hover {
  background: var(--alt-grey);
}

/* ===== KaTeX tweaks (guide: inline maths ~90% of body size, display centered) ===== */
.katex-inline { font-size: 0.9em; }            /* Inline maths at ~90% */
.display-math   { text-align: center; }        /* Display maths centered with whitespace */
.display-math .katex-display { margin: 1rem 0; }

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 5;
  background: var(--alt-grey);
  text-align: center;
  padding: 1rem;
  font-size: 0.95rem;
  border-top: 1px solid #e9e9e9;
}
.site-footer .footer-links a {
  color: inherit;
  text-decoration: none;
}
.site-footer .footer-links a:visited {
  color: inherit;
  text-decoration: none;
}
.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus-visible {
  text-decoration: underline;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 600px) {

  /* Reduce outer margins and card padding */
  .content {
    padding: 0 0.75rem;
  }

  .card {
    padding: 1rem;
    margin: 1rem 0;
  }

  /* Scale headings slightly smaller for phones */
  h1 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 0.75rem;
  }

  h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  /* Slightly smaller body text for tighter layouts */
  p, label, button {
    font-size: 0.95rem;
  }

  /* Buttons: full width stack instead of side-by-side */
  .button-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-primary, .btn-secondary {
    width: 100%;
  }

  /* Banner padding reduction */
  .banner {
    padding: 6px 0;
  }

  /* Footer spacing */
  .site-footer {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
}

/* ===== Take Quiz Lobby ===== */
.takequiz-lobby {
  max-width: 960px;
  margin: 2.5rem auto;
  padding: 0 1rem;
}

.takequiz-lobby h1 {
  text-align: center;
}

.lobby-card {
  background: var(--base-light);
  border-radius: 16px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
  border: 1px solid #ececec;
}

.lobby-meta {
  margin: 0.6rem 0 1.2rem;
  color: #4a4a4a;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}
.lobby-meta-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.lobby-meta-row span {
  flex: 1 1 30%;
}
.lobby-meta-notes {
  justify-content: center;
}

.lobby-help {
  margin: 0;
  color: #3c3c3c;
  font-weight: 500;
}

.alias-grid {
  margin-top: 1.75rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  list-style: none;
  padding: 0;
}

.alias-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease;
}
.alias-tile--disabled {
  opacity: 0.35;
  filter: grayscale(90%);
  cursor: not-allowed;
}
.alias-tile--disabled .alias-shape {
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.1);
}
.alias-tile--disabled .alias-shape::before,
.alias-tile--disabled .alias-shape::after {
  display: none;
}

.alias-shape-wrapper {
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alias-tile * {
  pointer-events: none;
}

.alias-tile:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 4px;
}

.alias-shape {
  --alias-color: var(--accent-sky);
  --alias-base-scale: 1;
  --alias-selected-scale: 1;
  width: 100%;
  height: 100%;
  background: var(--alias-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  clip-path: polygon(8% 0, 92% 0, 100% 15%, 100% 85%, 92% 100%, 8% 100%, 0 85%, 0 15%);
  box-shadow: inset 0 -5px 9px rgba(0,0,0,0.2), 0 10px 18px rgba(0,0,0,0.2);
  color: #fff;
  font-size: clamp(0.95rem, 2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transform: scale(var(--alias-base-scale)) scale(var(--alias-selected-scale));
}

.alias-shape::before,
.alias-shape::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.alias-shape::before {
  background: linear-gradient(145deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 40%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

.alias-shape::after {
  background: linear-gradient(315deg, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 55%);
  mix-blend-mode: multiply;
  opacity: 0.6;
}

.alias-tile--selected .alias-shape {
  opacity: 0.45;
  --alias-selected-scale: 0.95;
  filter: grayscale(30%);
}

.alias-shape[data-shape="circle"] {
  clip-path: circle(50% at 50% 50%);
}

.alias-shape[data-shape="square"] {
  clip-path: inset(0);
  --alias-base-scale: 0.9;
}

.alias-shape[data-shape="rectangle"] {
  clip-path: inset(5% 8%);
}

.alias-shape[data-shape="triangle"] {
  clip-path: polygon(4% 4%, 96% 4%, 50% 96%);
}

.alias-shape[data-shape="pentagon"] {
  clip-path: polygon(50% 4%, 96% 38%, 78% 96%, 22% 96%, 4% 38%);
}

.alias-shape[data-shape="hexagon"] {
  clip-path: polygon(25% 4%, 75% 4%, 96% 50%, 75% 96%, 25% 96%, 4% 50%);
}

.alias-shape[data-shape="trapezoid"] {
  clip-path: polygon(20% 4%, 80% 4%, 96% 96%, 4% 96%);
}

.alias-shape[data-shape="oval"] {
  clip-path: ellipse(45% 38% at 50% 50%);
  --alias-base-scale: 1.1;
}

.alias-shape[data-shape="parallelogram"] {
  clip-path: polygon(15% 4%, 100% 4%, 85% 96%, 0% 96%);
}

.alias-shape[data-shape="kite"] {
  clip-path: polygon(50% 6%, 86% 50%, 50% 94%, 14% 50%);
}

.alias-shape[data-shape="rhombus"] {
  clip-path: polygon(50% 4%, 96% 50%, 50% 96%, 4% 50%);
  --alias-base-scale: 1.1;
}

.alias-shape[data-shape="octagon"] {
  clip-path: polygon(
    29.289% 0%,
    70.711% 0%,
    100% 29.289%,
    100% 70.711%,
    70.711% 100%,
    29.289% 100%,
    0% 70.711%,
    0% 29.289%
  );
}

.alias-initials {
  position: relative;
  z-index: 1;
  text-shadow: none;
}

.alias-empty {
  margin: 1rem 0 0;
  color: #555;
  font-style: italic;
}

.lobby-footnote {
  margin-top: 1.75rem;
  color: #666;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .alias-shape-wrapper {
    width: 90px;
    height: 90px;
  }
}

/* ===== Alias Modal ===== */
.alias-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.alias-modal[hidden] {
  display: none;
}
.alias-modal__card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  width: min(360px, 92vw);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  position: relative;
}
.alias-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: #555;
}
.alias-modal__alias {
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: center;
  color: #222;
}
#aliasPinInput {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #ccc;
  margin-top: 0.35rem;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-align: center;
}
.alias-modal__actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}
.alias-modal__error {
  min-height: 1.2rem;
  color: #c62828;
  font-weight: 600;
  margin: 0.5rem 0 0;
  text-align: center;
}

/* ===== Take Quiz Session ===== */
.takequiz-session {
  max-width: 880px;
  margin: 0 auto 2rem;
  padding: 0 1rem 3rem;
}

.takequiz-session--with-banner-gap {
  margin-top: 0.9rem;
}

.quiz-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

.quiz-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.quiz-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 0.1rem;
}

.quiz-card__eyebrow--muted {
  color: #9aa2af;
  font-size: 0.8rem;
}

.quiz-card__progress {
  font-weight: 600;
  color: var(--accent-orange);
  margin: 0;
}

.quiz-card__instructions {
  background: #fff6ec;
  border: 1px solid #ffd3a8;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
  color: #6b3500;
}

.quiz-start {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.quiz-complete {
  text-align: center;
  margin: 2rem 0;
}

.quiz-card--result {
  text-align: center;
}
.quiz-card__header--center {
  justify-content: center;
  align-items: center;
}
.quiz-card--result .quiz-card__header > div {
  text-align: center;
  width: 100%;
}
.quiz-card--result .quiz-card__eyebrow,
.quiz-card--result .quiz-card__title {
  text-align: center;
  display: block;
}

.quiz-complete__score {
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
}

.quiz-result__score {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

.quiz-result__percent {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: #4f5d75;
}

.quiz-complete__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.quiz-complete__actions .btn-primary {
  border-radius: 999px;
}

.quiz-result__actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-tertiary {
  border: 1px solid rgba(0,0,0,0.2);
  background: transparent;
  color: #444;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
}

.quiz-question__title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #444;
}

.quiz-stem {
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
  min-height: 4.0rem;
}
.quiz-stem img {
  width: 500px;
  height: auto;
  max-width: 100%;
  display: block;
  margin: 0.75rem auto;
}

.quiz-choices {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.choice-btn {
  width: 100%;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: #fff;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(0,0,0,0.06);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  min-height: 3.1rem;
}

.choice-btn:hover,
.choice-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent-orange);
  box-shadow: 0 10px 22px rgba(0,0,0,0.1);
  outline: none;
}

.choice-btn.is-static {
  cursor: default;
  box-shadow: none;
  border-style: dashed;
}

.choice-label {
  font-weight: 700;
  color: var(--accent-orange);
  min-width: 24px;
}

.choice-text {
  flex: 1;
  font-size: 1.2rem;
  line-height: 1.6;
}

.quiz-choices.review li {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}

.quiz-choices.review .choice-row {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.5rem;
  align-items: stretch;
}

.quiz-choices.review .choice-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-height: 100%;
  border-radius: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.quiz-choices.review .choice-state-icon--correct {
  color: #14532d;
}

.quiz-choices.review .choice-state-icon--wrong {
  color: #9a3412;
}

.quiz-choices.review .choice-state-icon--empty {
  background: transparent;
}

.choice-meta .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.quiz-choices.review .choice-meta {
  margin-left: 2.5rem;
}

.tag-correct {
  background: #e4f6ea;
  color: #14532d;
  border-color: #86d7a2;
}

.tag-wrong {
  background: #fff0e8;
  color: #9a3412;
  border-color: #f7b38f;
}

.choice-correct .choice-btn {
  border: 2px solid #2f9e5b;
  background: #f1fbf4;
}

.choice-selected {
  opacity: 1;
}

.choice-selected .choice-btn {
  border: 2px dashed #c2410c;
  background: #fff8f3;
}

.choice-selected-correct .choice-btn {
  border: 2px solid #1d7f4a;
  background: #dcf6e6;
  box-shadow: inset 0 0 0 2px rgba(29,127,74,0.2);
}

.review-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.review-nav span {
  min-height: 1px;
}
.review-done {
  justify-self: center;
}

.quiz-empty {
  margin: 2rem 0 0;
  font-style: italic;
  color: #666;
}
.review-nav a.btn-primary,
.review-nav a.btn-secondary,
.review-nav a.btn-tertiary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
}
.review-nav a.btn-primary {
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
}
.review-nav a.btn-secondary,
.review-nav a.btn-tertiary {
  padding: 0.45rem 1.1rem;
}
.review-nav a.btn-secondary {
  border: none;
  background: #fff;
  box-shadow: var(--shadow);
}
.review-nav a.btn-tertiary {
  border: none;
  box-shadow: var(--shadow);
}

.takequiz-session--review {
  padding-bottom: 8rem;
}

.review-floating-nav {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(1120px, calc(100% - 2rem));
  background: #fff;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 20px;
  box-shadow: 0 14px 26px rgba(0,0,0,0.16);
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 120px 92px;
  align-items: center;
  gap: 0.9rem;
  z-index: 1040;
}

.review-float-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  min-width: 84px;
  min-height: 54px;
  padding: 0 1rem;
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  background: #fff;
}

.review-float-btn--arrow {
  border: 3px solid var(--accent-orange);
  color: var(--accent-orange);
}
.review-floating-nav .review-float-btn--arrow:first-child {
  justify-self: start;
}
.review-floating-nav .review-float-btn--arrow:last-child {
  justify-self: end;
}

.review-float-btn--done {
  border: 3px solid #666;
  color: #555;
  font-size: 2rem;
  font-weight: 600;
  min-width: 110px;
  justify-self: end;
}

.review-float-btn--ghost {
  border: 0;
  visibility: hidden;
}

.review-question-jump {
  min-width: 0;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: thin;
}

.review-qnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  font-size: 2.1rem;
  font-weight: 700;
  text-decoration: none;
  color: #888;
  border: 2px solid transparent;
  line-height: 1;
}

.review-qnum--correct {
  color: #1da51a;
}

.review-qnum--incorrect {
  color: #db2525;
}

.review-qnum--unanswered {
  color: #888;
}

.review-qnum.is-current {
  border-color: #666;
}

@media (max-width: 900px) {
  .takequiz-session--review {
    padding-bottom: 9rem;
  }

  .review-floating-nav {
    grid-template-columns: 70px minmax(0, 1fr) 96px 70px;
    gap: 0.65rem;
    padding: 0.65rem 0.8rem;
  }

  .review-question-jump {
    padding-top: 0;
  }

  .review-float-btn {
    min-height: 44px;
    min-width: 68px;
    font-size: 1.4rem;
  }

  .review-float-btn--done {
    font-size: 1.3rem;
    min-width: 88px;
  }

  .review-qnum {
    min-width: 2rem;
    height: 2rem;
    font-size: 1.3rem;
  }
}

/* ===== Teacher Dashboard: Manage Tasks (from assign_quiz.html) ===== */
        .manage-tasks-shell {
          display: flex;
          flex-direction: column;
          gap: 1.5rem;
        }
        .task-nav-row {
          display: flex;
          flex-wrap: wrap;
          gap: .75rem;
          align-items: center;
          justify-content: space-between;
        }
        .task-tabs {
          display: inline-flex;
          gap: .35rem;
          background: rgba(0,0,0,.04);
          padding: .35rem;
          border-radius: 999px;
        }
        .task-tabs a {
          text-decoration: none;
          padding: .4rem 1.35rem;
          border-radius: 999px;
          font-weight: 600;
          color: #333;
          transition: background .2s ease;
        }
        .task-tabs a.active {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .task-tabs a:not(.active):hover {
          background: rgba(0,0,0,.06);
        }
        .task-section {
          border: 1px solid rgba(0,0,0,.1);
          border-radius: 16px;
          padding: 1.5rem;
          background: #fff;
          box-shadow: 0 8px 20px rgba(0,0,0,.08);
        }
        .task-section h2 {
          margin-top: 0;
          margin-bottom: .5rem;
        }
        .task-section p {
          margin: 0;
          color: rgba(0,0,0,.75);
        }
        .task-form {
          display: flex;
          flex-direction: column;
          gap: 1rem;
        }
        .task-form .field-grid {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
          gap: 1rem;
        }
        .task-form .field-grid.field-grid--quarters {
          grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        }
        .task-form label {
          font-weight: 600;
          display: flex;
          flex-direction: column;
          gap: .35rem;
        }
        .task-form .note-label-row {
          display: flex;
          justify-content: space-between;
          align-items: baseline;
          gap: 0.5rem;
        }
        .task-form input,
        .task-form select {
          padding: .55rem .7rem;
          border-radius: 10px;
          border: 1px solid rgba(0,0,0,.2);
          font-size: .95rem;
          height: 42px;
          box-sizing: border-box;
        }
        .task-form .note-fields {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
          gap: 1rem;
          margin-top: 0.5rem;
        }
        .task-form .char-count {
          font-size: 0.8rem;
          color: rgba(0,0,0,.38);
          margin-top: 0.35rem;
          text-align: right;
        }
        .quiz-table-shell {
          display: flex;
          flex-direction: column;
          gap: .75rem;
          padding-top: 1rem;
          max-width: 100%;
          overflow: hidden;
        }
        .quiz-table-toolbar {
          display: flex;
          justify-content: flex-end;
          align-items: center;
        }
        .quiz-hint-row {
          display: flex;
          align-items: center;
          justify-content: space-between;
          gap: .75rem;
        }
        .quiz-hint-row .quiz-required-hint {
          margin: 0;
        }
        .table-filter {
          margin-top: .4rem;
        }
        .table-filter select {
          width: 100%;
          padding: .35rem .5rem;
          border-radius: 6px;
          border: 1px solid rgba(0,0,0,.2);
          font-size: .95rem;
        }
        .table-filter input[type="search"] {
          width: 100%;
          padding: .45rem .6rem;
          border-radius: 8px;
          border: 1px solid rgba(0,0,0,.2);
          font-size: .95rem;
          height: 38px;
          box-sizing: border-box;
        }
        .title-filter-row {
          display: flex;
          align-items: center;
          gap: .5rem;
        }
        .title-filter-row input[type="search"] {
          flex: 1 1 auto;
          min-width: 0;
        }
        .title-filter-row--assign input[type="search"] {
          flex: 3 1 0;
        }
        .title-filter-row--assign .multi-select {
          flex: 1 1 0;
          width: auto;
        }
        .title-level-headings {
          display: grid;
          grid-template-columns: 3fr 1fr;
          align-items: end;
          gap: .5rem;
          margin-bottom: .4rem;
        }
        .filter-reset-btn {
          border: 1px solid var(--accent-orange, #ff7a00);
          background: #fff;
          color: var(--accent-orange, #ff7a00);
          border-radius: 999px;
          padding: .35rem .9rem;
          font-size: .85rem;
          cursor: pointer;
          white-space: nowrap;
          height: 38px;
          display: inline-flex;
          align-items: center;
          transition: background .15s ease, color .15s ease, border-color .15s ease;
        }
        .filter-reset-btn:hover,
        .filter-reset-btn:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .multi-select {
          position: relative;
          display: inline-block;
          width: 100%;
          background: #fff;
          border: 1px solid rgba(0,0,0,.2);
          border-radius: 8px;
        }
        .multi-select summary {
          list-style: none;
          padding: .35rem .5rem;
          cursor: pointer;
          font-size: .95rem;
        }
        .multi-select.is-disabled {
          opacity: .65;
        }
        .multi-select.is-disabled summary {
          cursor: not-allowed;
        }
        .multi-select summary::-webkit-details-marker {
          display: none;
        }
        .multi-options {
          position: absolute;
          left: -1px;
          right: -1px;
          top: calc(100% + 2px);
          background: #fff;
          border: 1px solid rgba(0,0,0,.2);
          border-radius: 8px;
          padding: .4rem .5rem;
          max-height: 220px;
          overflow-y: auto;
          z-index: 10;
          box-shadow: 0 8px 18px rgba(0,0,0,.12);
        }
        .multi-select .multi-option {
          display: flex;
          flex-direction: row;
          align-items: center;
          justify-content: flex-start;
          gap: .5rem;
          padding: .2rem 0;
          font-size: .9rem;
          text-align: left;
          font-weight: 500;
        }
        .sr-only {
          position: absolute;
          width: 1px;
          height: 1px;
          padding: 0;
          margin: -1px;
          overflow: hidden;
          clip: rect(0, 0, 0, 0);
          border: 0;
        }
        .quiz-table-wrapper {
          overflow: hidden;
          border: 1px solid rgba(0,0,0,.1);
          border-radius: 14px;
          background: #fff;
          scrollbar-width: none;
        }
        .quiz-table-wrapper::-webkit-scrollbar {
          width: 0;
          height: 0;
        }
        .quiz-table {
          width: 100%;
          border-collapse: collapse;
          min-width: 0;
          table-layout: fixed;
        }
        .quiz-table th:nth-child(1),
        .quiz-table td:nth-child(1) {
          width: 25%;
        }
        .quiz-table th:nth-child(2),
        .quiz-table td:nth-child(2) {
          width: 25%;
        }
        .quiz-table th:nth-child(3),
        .quiz-table td:nth-child(3) {
          width: 50%;
        }
        .quiz-table th {
          border-right: 0;
        }
        .quiz-table th:last-child,
        .quiz-table td:last-child {
          border-right: 0;
        }
        .quiz-table th,
        .quiz-table td {
          padding: .65rem .9rem;
          text-align: left;
          border-bottom: 1px solid rgba(0,0,0,.05);
          box-sizing: border-box;
        }
        .quiz-table tbody tr {
          cursor: pointer;
          transition: background .15s ease;
        }
        .quiz-table tbody tr:hover {
          background: rgba(0,0,0,.03);
        }
        .quiz-table tbody tr.selected {
          background: rgba(255,122,0,.14);
          box-shadow: inset 0 0 0 2px rgba(255,122,0,.4);
        }
        .quiz-table td.quiz-title-cell {
          position: relative;
          padding-right: 5.25rem;
        }
        .quiz-row-actions__wrap {
          position: absolute;
          right: .5rem;
          top: 50%;
          transform: translateY(-50%);
          display: inline-flex;
          gap: .5rem;
          align-items: center;
          opacity: 0;
          pointer-events: none;
          transition: opacity .15s ease;
        }
        .quiz-table tbody tr.selected .quiz-row-actions__wrap {
          opacity: 1;
          pointer-events: auto;
        }
        .quiz-row-action {
          width: 34px;
          height: 34px;
          border-radius: 999px;
          border: 1px solid rgba(0,0,0,.2);
          background: #fff;
          color: #333;
          font-weight: 700;
          font-size: .85rem;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          cursor: pointer;
          position: relative;
        }
        .quiz-row-action:hover,
        .quiz-row-action:focus-visible {
          border-color: var(--accent-orange, #ff7a00);
          color: var(--accent-orange, #ff7a00);
          outline: none;
        }
        .quiz-row-action--preview {
          border-color: #6F94E6;
          color: #6F94E6;
        }
        .quiz-row-action--preview:hover,
        .quiz-row-action--preview:focus-visible {
          background: #6F94E6;
          color: #fff;
          border-color: #6F94E6;
        }
        .quiz-row-action--create {
          border-color: var(--accent-orange, #ff7a00);
          color: var(--accent-orange, #ff7a00);
        }
        .quiz-row-action--create:hover,
        .quiz-row-action--create:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .quiz-row-action__label {
          position: absolute;
          left: 50%;
          transform: translate(-50%, 6px);
          bottom: -18px;
          font-size: .65rem;
          font-weight: 600;
          color: #555;
          opacity: 0;
          white-space: nowrap;
          transition: opacity .15s ease, transform .15s ease;
          pointer-events: none;
        }
        .quiz-row-action:hover .quiz-row-action__label,
        .quiz-row-action:focus-visible .quiz-row-action__label {
          opacity: 1;
          transform: translate(-50%, 0);
        }
        @media (max-width: 720px) {
          .quiz-table td.quiz-title-cell {
            padding-right: 4.2rem;
          }
          .quiz-row-action__label {
            display: none;
          }
        }
        .quiz-title-badge {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          margin-left: 0.5rem;
          padding: 0.1rem 0.45rem;
          border-radius: 999px;
          font-size: 0.7rem;
          font-weight: 700;
          letter-spacing: 0.04em;
          color: var(--accent-orange, #ff7a00);
          border: 1px solid var(--accent-orange, #ff7a00);
        }
        .quiz-required-hint {
          font-size: .9rem;
          color: rgba(0,0,0,.65);
          margin-top: 1.25rem;
        }
        .task-form button[type="submit"] {
          align-self: flex-start;
          border: none;
          border-radius: 999px;
          padding: .65rem 1.75rem;
          font-weight: 700;
          color: #fff;
          background: var(--accent-orange, #ff7a00);
          cursor: pointer;
        }
        .task-form button[type="submit"] {
          background: #fff;
          color: var(--accent-orange, #ff7a00);
          border: 1px solid var(--accent-orange, #ff7a00);
          transition: background .15s ease, color .15s ease, border-color .15s ease;
          font-size: .85rem;
        }
        .task-form button[type="submit"]:hover,
        .task-form button[type="submit"]:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .task-form-actions {
          display: flex;
          flex-wrap: wrap;
          gap: .75rem;
          align-items: center;
          justify-content: space-between;
          margin-top: 1.5rem;
        }
        .task-form {
          padding-bottom: 5.5rem;
        }
        .task-form-actions--floating {
          position: fixed;
          left: 50%;
          bottom: 1.25rem;
          transform: translateX(-50%);
          width: min(840px, calc(100% - 2rem));
          background: #fff;
          border: 1px solid rgba(0,0,0,.12);
          border-radius: 16px;
          padding: .75rem 1rem;
          box-shadow: 0 16px 32px rgba(0,0,0,.16);
          z-index: 1035;
        }
        .task-form-actions__status {
          font-weight: 600;
          color: #333;
        }
        .task-form-actions__buttons {
          display: inline-flex;
          gap: .75rem;
          flex-wrap: wrap;
          justify-content: flex-end;
          margin-left: auto;
        }
        @media (max-width: 720px) {
          .task-form-actions--floating {
            width: calc(100% - 1.5rem);
            padding: .65rem .85rem;
          }
          .task-form-actions__status {
            flex: 1 1 100%;
          }
          .task-form-actions__buttons {
            width: 100%;
            justify-content: space-between;
          }
        }
        .preview-btn {
          border-radius: 999px;
          border: 1px solid #6F94E6;
          padding: .65rem 1.5rem;
          font-weight: 600;
          font-size: .85rem;
          background: #fff;
          color: #6F94E6;
          cursor: pointer;
        }
        .preview-btn:hover,
        .preview-btn:focus-visible {
          background: #6F94E6;
          color: #fff;
          outline: none;
        }
        .preview-btn:disabled {
          opacity: var(--btn-disabled-opacity, 0.5);
          cursor: not-allowed;
        }
        .form-errors {
          border-radius: 12px;
          padding: .75rem 1rem;
          background: rgba(198, 40, 40, 0.08);
          color: #c62828;
          font-weight: 600;
        }
        .field-error {
          color: #c62828;
          font-size: .85rem;
        }

      .quiz-preview-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1040;
        padding: 1rem;
      }
      .quiz-preview-overlay.hidden {
        display: none;
      }
      .quiz-preview-card {
        background: #fff;
        border-radius: 14px;
        width: min(600px, 100%);
        min-width: min(620px, 100%);
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
      }
      .quiz-preview-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem 0.25rem;
      }
      .quiz-preview-body {
        padding: 0 1.25rem 1.25rem;
        overflow-y: auto;
        max-height: 65vh;
      }
      .quiz-preview-footer {
        border-top: 1px solid #e8edf5;
        padding: 0.9rem 1.25rem 1rem;
        display: flex;
        justify-content: flex-end;
      }
      .quiz-preview-take-btn {
        margin-left: auto;
        min-width: 170px;
        border: none;
        border-radius: 999px;
        background: #15803d;
        color: #fff;
        font-weight: 700;
        font-size: 1.05rem;
        line-height: 1.2;
        padding: 0.95rem 1.35rem;
        box-shadow: 0 8px 16px rgba(21, 128, 61, 0.2);
        cursor: pointer;
      }
      .quiz-preview-take-btn:hover,
      .quiz-preview-take-btn:focus-visible {
        background: #166534;
      }
      .quiz-preview-take-btn:disabled {
        background: #9ca3af;
        box-shadow: none;
        cursor: not-allowed;
      }
      .quiz-preview-question-list {
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 1rem;
      }
      .quiz-preview-question-label {
        font-weight: 700;
        margin-bottom: .25rem;
        color: var(--accent-orange, #ff7a00);
      }
      .quiz-preview-question-stem {
        line-height: 1.45;
        text-align: left;
      }
      .quiz-preview-question-stem img,
      .quiz-preview-choice-text img {
        max-width: min(100%, 420px);
        max-height: 280px;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
      }
      .quiz-preview-close {
        background: none;
        border: none;
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
      }
      .task-created-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1050;
        padding: 1rem;
      }
      .task-created-overlay.hidden {
        display: none;
      }
      .task-created-card {
        background: #fff;
        border-radius: 12px;
        padding: 1.5rem;
        max-width: 360px;
        width: 100%;
        text-align: center;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
      }
      .task-created-card h3 {
        margin-top: 0;
      }
      .task-created-card code {
        font-size: 1.2rem;
        font-weight: 700;
      }
      .task-created-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        margin: 1rem 0;
      }
      .task-created-feedback {
        min-height: 1rem;
        font-size: 0.9rem;
        color: #2f9e44;
        margin: 0;
      }


/* ===== Teacher Dashboard: Manage Classes (from manage_classes.html) ===== */
        .manage-classes {
          display: flex;
          flex-direction: column;
          gap: 1.5rem;
        }
        .class-nav-row {
          display: flex;
          flex-wrap: wrap;
          gap: .75rem;
          align-items: center;
          justify-content: flex-end;
        }
        .back-to-classes {
          text-decoration: none;
          padding: .4rem 1.35rem;
          border-radius: 999px;
          font-weight: 600;
          color: var(--accent-orange, #ff7a00);
          border: 1px solid var(--accent-orange, #ff7a00);
          transition: background .2s ease, color .2s ease;
        }
        .back-to-classes:hover,
        .back-to-classes:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .class-panels {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
          gap: 1.5rem;
        }
        .class-panels--single {
          grid-template-columns: 1fr;
        }
        .class-panel {
          border: 1px solid rgba(0,0,0,.1);
          border-radius: 16px;
          padding: 1.25rem;
          background: #fff;
          box-shadow: 0 8px 20px rgba(0,0,0,.08);
        }
        .class-panel--wide {
          grid-column: 1 / -1;
        }
        .class-panel form {
          display: flex;
          flex-direction: column;
          gap: .9rem;
        }
        .class-panel label {
          font-weight: 600;
        }
        .class-panel input[type="text"],
        .class-panel select {
          padding: .5rem .7rem;
          border-radius: 10px;
          border: 1px solid rgba(0,0,0,.2);
          font-size: .95rem;
        }
        .class-panel button {
          justify-self: flex-start;
          border: none;
          border-radius: 999px;
          padding: .55rem 1.6rem;
          font-weight: 600;
          font-size: .95rem;
          color: #fff;
          cursor: pointer;
        }
        .class-panel button.btn-add,
        .class-panel button.btn-delete {
          background: #fff;
        }
        .class-panel button:disabled {
          cursor: not-allowed;
          opacity: var(--btn-disabled-opacity, 0.5);
        }
        .pill-btn {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          padding: 0 1.2rem;
          height: 42px;
          border-radius: 999px;
          font-weight: 600;
          font-size: .9rem;
          text-decoration: none;
          border: 1px solid var(--accent-orange, #ff7a00);
          color: var(--accent-orange, #ff7a00);
          transition: background .15s ease, color .15s ease;
        }
        .pill-btn:hover,
        .pill-btn:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .pill-btn.disabled {
          opacity: var(--btn-disabled-opacity, 0.5);
          pointer-events: none;
        }
        .class-list-table {
          width: 100%;
          border-collapse: collapse;
          margin-top: .75rem;
        }
        .class-list-table th,
        .class-list-table td {
          padding: .65rem .75rem;
          text-align: left;
          border-bottom: 1px solid rgba(0,0,0,0.08);
          vertical-align: middle;
        }
        .class-list-table th.center-cell,
        .class-list-table td.center-cell {
          text-align: center;
        }
        .class-list-table .js-curriculum-select,
        .class-list-table .js-year-key-select {
          min-width: 0;
          max-width: 100%;
          padding-right: 2rem;
          box-sizing: border-box;
        }
	        .class-list-table .js-curriculum-select {
	          width: 11rem;
	        }
	        .class-list-table .class-settings-form {
	          display: block;
	          margin: 0;
	        }
	        .class-list-table .curriculum-text {
	          display: block;
	          width: 11rem;
	          box-sizing: border-box;
	          padding: .5rem .7rem;
	        }
	        .class-list-table .js-year-key-select {
	          width: 9.5rem;
	        }
        .class-list-table__divider {
          border-left: 1px solid rgba(0,0,0,0.12);
        }
        .class-list-table th {
          font-size: .9rem;
          color: #333;
        }
        .class-list-quiz {
          display: flex;
          align-items: center;
          gap: .75rem;
          width: 100%;
        }
        .class-list-quiz .pill-btn {
          margin-left: auto;
        }
        .class-list-quiz .class-list-view-btn {
          height: 36px;
          padding: 0 .95rem;
          min-width: 0;
          flex: 0 0 auto;
        }
        .class-list-actions {
          display: flex;
          justify-content: flex-end;
          gap: .75rem;
          margin-top: 1rem;
        }
        .btn-rename {
          background: #546e7a;
        }
        .add-class-form {
          width: 100%;
        }
        .add-class-row {
          display: flex;
          flex-wrap: wrap;
          align-items: baseline;
          gap: 1rem;
        }
        .add-class-row h2 {
          margin: 0;
          white-space: nowrap;
          padding-right: 1rem;
          border-right: 1px solid rgba(0,0,0,0.15);
        }
        .add-class-field {
          display: flex;
          align-items: center;
          gap: .5rem;
        }
        .add-class-field--stack {
          align-items: flex-start;
          flex-direction: column;
          gap: .25rem;
        }
        .add-class-note {
          font-size: .75rem;
          color: #666;
          line-height: 1.2;
        }
        .add-class-field label {
          white-space: nowrap;
        }
        .add-class-field input[type="number"] {
          min-width: 90px;
          padding: .5rem .7rem;
          border-radius: 10px;
          border: 1px solid rgba(0,0,0,.2);
          font-size: .95rem;
        }
        .add-class-row .btn-add {
          margin-left: auto;
        }
        @media (max-width: 720px) {
          .add-class-row h2 {
            width: 100%;
          }
          .add-class-field {
            width: 100%;
          }
          .add-class-field input {
            flex: 1;
          }
          .add-class-row .btn-add {
            width: 100%;
            margin-left: 0;
          }
        }
        .field-error {
          color: #c62828;
          font-size: .85rem;
        }
        .message-list {
          list-style: none;
          margin: 0;
          padding: 0;
          display: flex;
          flex-direction: column;
          gap: .5rem;
        }
        .message-list li {
          padding: .6rem .9rem;
          border-radius: 10px;
          background: rgba(0,0,0,.05);
          font-weight: 600;
        }
        .manage-users-panel h2 {
          margin-bottom: 1rem;
        }
        .manage-users-panel {
          scroll-margin-top: 160px;
        }
        .roster-table-layout {
          display: flex;
          gap: 0.75rem;
          align-items: flex-end;
        }
        .roster-table-wrapper {
          flex: 1;
          overflow-x: auto;
          max-width: 1100px;
          margin: 0 auto;
        }
        .manage-users {
          padding-bottom: 3rem;
        }
        .roster-table {
          width: 100%;
          min-width: 778px;
          border-collapse: collapse;
        }
        .roster-table th,
        .roster-table td {
          padding: .35rem .5rem;
          text-align: left;
          border-bottom: none;
        }
        .roster-table tbody tr:hover {
          background: rgba(0, 0, 0, 0.04);
        }
        .roster-table tbody tr.alias-duplicate-row {
          background: rgba(198, 40, 40, 0.12);
        }
        .roster-table tbody tr.alias-duplicate-row:hover {
          background: rgba(198, 40, 40, 0.18);
        }
        .alias-duplicate-input {
          border-color: #c62828;
          box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.2);
        }
        .roster-table th.select-cell,
        .roster-table td.select-cell {
          text-align: center;
          padding-left: 0;
          padding-right: 0;
          width: 52px;
        }
        .roster-table td.select-cell input[type="checkbox"] {
          margin: 0 auto;
          display: inline-block;
        }
        .roster-table input[type="text"],
        .roster-table select {
          width: 100%;
          padding: .25rem .45rem;
          border-radius: 10px;
          border: 1px solid rgba(0,0,0,0.2);
          height: 32px;
          box-sizing: border-box;
        }
        .roster-table select {
          appearance: none;
          -webkit-appearance: none;
          -moz-appearance: none;
        }
        .roster-table input[type="text"] {
          text-transform: uppercase;
          text-align: center;
          font-weight: 600;
          width: 80px;
        }
        .pin-chip {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          padding: .2rem .65rem;
          border-radius: 999px;
          background: rgba(0,0,0,0.08);
          font-weight: 600;
        }
        .pin-input {
          width: 80px;
          text-align: center;
          font-weight: 600;
          letter-spacing: .1rem;
        }
        .color-select {
          display: inline-flex;
          align-items: center;
          gap: .5rem;
          width: 100%;
        }
        .color-select__swatch {
          width: 18px;
          height: 18px;
          border-radius: 50%;
          border: 1px solid rgba(0,0,0,0.2);
          background: #ccc;
          flex-shrink: 0;
        }
        .class-list-table tbody tr {
          cursor: pointer;
        }
        .class-list-table tbody tr.is-selected {
          background: rgba(255,122,0,.12);
        }
        .class-list-table-wrap {
          overflow-x: auto;
        }
        .class-list-table .student-year-select {
          width: 100%;
          min-width: 92px;
          height: 40px;
          border: 1px solid rgba(0,0,0,0.2);
          border-radius: 10px;
          padding: .45rem .65rem;
          box-sizing: border-box;
          background: #fff;
        }
        .class-list-table .student-pin-input {
          width: 78px;
          max-width: 100%;
          text-transform: none;
          letter-spacing: .08rem;
        }
        .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;
        }
        .inline-form {
          margin: 0;
        }
        .alias-add-form {
          display: inline;
        }
        .table-messages {
          margin-top: 0.75rem;
          text-align: center;
          color: #2e7d32;
          font-weight: 600;
        }
        .roster-actions {
          display: flex;
          flex-wrap: wrap;
          justify-content: center;
          align-items: center;
          gap: .75rem;
          margin: 0.75rem auto;
          text-align: center;
        }
        .roster-actions__group {
          display: flex;
          flex-wrap: wrap;
          gap: .5rem;
        }
        .btn-add-row {
          border: none;
          border-radius: 999px;
          padding: .45rem 1.4rem;
          font-size: 0.95rem;
          font-weight: 600;
          color: #fff;
          background: #fff;
          cursor: pointer;
          height: 42px;
          line-height: 1;
          display: inline-flex;
          align-items: center;
          justify-content: center;
        }
        .add-alias-form {
          align-self: flex-end;
        }
        .roster-bulk-btn {
          border: none;
          border-radius: 999px;
          padding: .45rem 1.4rem;
          font-size: 0.95rem;
          font-weight: 600;
          color: #fff;
          cursor: pointer;
          background: #fff;
          height: 42px;
          display: inline-flex;
          align-items: center;
          justify-content: center;
        }
        .roster-bulk-btn--accent {
          background: #fff;
        }
        .roster-bulk-btn--danger {
          background: #fff;
        }
        .roster-bulk-btn--success {
          background: #fff;
        }
        .class-summary {
          text-align: center;
          font-weight: 600;
          color: #2d2d2d;
        }
        .class-list-hint {
          margin: 0.3rem 0 0.8rem;
          font-size: 0.9rem;
          color: rgba(0,0,0,0.6);
        }
        .manage-users-intro {
          margin: 0.6rem 0 0.8rem;
          font-weight: 600;
          color: #2d2d2d;
          text-align: left;
        }
        .manage-users-intro .unsaved-note {
          color: #ff7a00;
        }
        .manage-users-intro .unsaved-note.unsaved-note--error {
          color: #c62828;
        }
        .manage-classes button,
        .manage-classes .pill-btn,
        .manage-classes .confirm-modal__btn,
        .manage-classes .btn-add-row,
        .manage-classes .roster-bulk-btn {
          background: #fff;
          color: var(--accent-orange, #ff7a00);
          border: 1px solid var(--accent-orange, #ff7a00);
          border-radius: 999px;
          transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
        }
        .manage-classes button:not(:disabled):hover,
        .manage-classes button:not(:disabled):focus-visible,
        .manage-classes .pill-btn:hover,
        .manage-classes .pill-btn:focus-visible,
        .manage-classes .confirm-modal__btn:hover,
        .manage-classes .confirm-modal__btn:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .manage-classes button:disabled,
        .manage-classes .pill-btn.disabled {
          background: #fff;
          color: var(--accent-orange, #ff7a00);
          border-color: var(--accent-orange, #ff7a00);
          opacity: var(--btn-disabled-opacity, 0.5);
        }

        .confirm-modal {
          position: fixed;
          inset: 0;
          background: rgba(0,0,0,0.45);
          display: flex;
          justify-content: center;
          align-items: center;
          z-index: 2000;
        }
        .confirm-modal[hidden] {
          display: none !important;
        }
        .confirm-modal__dialog {
          background: #fff;
          border-radius: 16px;
          padding: 1.5rem;
          width: min(320px, 90%);
          text-align: center;
          box-shadow: 0 20px 40px rgba(0,0,0,0.2);
        }
        .confirm-modal__actions {
          display: flex;
          justify-content: center;
          gap: 0.75rem;
          margin-top: 1.25rem;
        }
        .confirm-modal__btn {
          border: 1px solid var(--accent-orange, #ff7a00);
          border-radius: 999px;
          padding: 0.5rem 1.4rem;
          font-weight: 600;
          cursor: pointer;
          background: #fff;
          color: var(--accent-orange, #ff7a00);
          transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
        }
        .confirm-modal__btn--secondary {
          background: #fff;
          color: var(--accent-orange, #ff7a00);
        }
        .confirm-modal__btn--danger {
          background: #fff;
          color: var(--accent-orange, #ff7a00);
        }
        .confirm-modal__btn:hover,
        .confirm-modal__btn:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }


/* ===== Teacher Dashboard: Results (from results.html) ===== */
        .results-shell {
          display: flex;
          flex-direction: column;
          gap: 1.5rem;
        }
        .results-tabs {
          display: inline-flex;
          gap: .35rem;
          background: rgba(0,0,0,.04);
          padding: .35rem;
          border-radius: 999px;
          flex-wrap: wrap;
        }
        .results-tabs a {
          text-decoration: none;
          padding: .4rem 1.35rem;
          border-radius: 999px;
          font-weight: 600;
          color: #333;
          transition: background .2s ease;
        }
        .results-tabs a.active {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .results-tabs a:not(.active):hover {
          background: rgba(0,0,0,.08);
        }
        .results-panel {
          border: 1px solid rgba(0,0,0,.1);
          border-radius: 16px;
          padding: 1.5rem;
          background: #fff;
          box-shadow: 0 8px 18px rgba(0,0,0,.08);
        }
        .results-panel h2 {
          margin: 0 0 .4rem;
        }
        .results-panel p {
          margin: 0;
          color: rgba(0,0,0,.75);
        }
        .results-filter-form {
          margin-top: 1.2rem;
        }
        .results-filter-form .filter-grid {
          display: grid;
          grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
          gap: 1rem;
          align-items: flex-end;
        }
        .results-filter-form label {
          display: flex;
          flex-direction: column;
          gap: .35rem;
          font-weight: 600;
        }
        .results-filter-form select {
          padding: .5rem .65rem;
          border-radius: 10px;
          border: 1px solid rgba(0,0,0,.2);
          background: #fff;
          font-size: .95rem;
          height: 40px;
          box-sizing: border-box;
        }
        .results-filter-form .filter-action {
          display: flex;
          justify-content: flex-start;
        }
        .results-filter-form button {
          border: 1px solid var(--accent-orange, #ff7a00);
          border-radius: 999px;
          padding: .6rem 1.5rem;
          font-weight: 700;
          font-size: .85rem;
          color: var(--accent-orange, #ff7a00);
          background: #fff;
          cursor: pointer;
          align-self: center;
          min-width: 120px;
          transition: background .15s ease, color .15s ease, border-color .15s ease;
        }
        .results-filter-form button:hover:not(:disabled),
        .results-filter-form button:focus-visible:not(:disabled) {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .results-filter-form select:disabled,
        .results-filter-form button:disabled {
          opacity: var(--btn-disabled-opacity, 0.5);
          cursor: not-allowed;
        }
        .tasks-filter-row {
          display: flex;
          align-items: flex-end;
          justify-content: space-between;
          gap: 1rem;
          margin-top: 1rem;
        }
        .tasks-filter-row select {
          padding: .4rem .6rem;
          border-radius: 8px;
          border: 1px solid rgba(0,0,0,.2);
          font-size: .95rem;
        }
        .tasks-table-filter {
          margin-top: .35rem;
        }
        .tasks-table-filter select {
          width: 100%;
          padding: .35rem .5rem;
          border-radius: 6px;
          border: 1px solid rgba(0,0,0,.2);
          font-size: .95rem;
        }
        .sr-only {
          position: absolute;
          width: 1px;
          height: 1px;
          padding: 0;
          margin: -1px;
          overflow: hidden;
          clip: rect(0,0,0,0);
          border: 0;
        }
        .results-table-scroll {
          margin-top: 1.25rem;
          overflow-x: auto;
        }
        .results-export {
          margin-top: 1.5rem;
          display: flex;
          justify-content: flex-end;
        }
        .matrix-table {
          width: 100%;
          min-width: 640px;
          border-collapse: collapse;
          table-layout: fixed;
        }
        .matrix-table th,
        .matrix-table td {
          padding: .35rem .6rem;
          border-bottom: 1px solid rgba(0,0,0,.06);
          white-space: nowrap;
        }
        .matrix-table th.col-narrow,
        .matrix-table td.col-narrow {
          width: 10%;
          white-space: nowrap;
        }
        .matrix-table th.col-topic,
        .matrix-table td.col-topic,
        .matrix-table th.col-subtopic,
        .matrix-table td.col-subtopic {
          width: 20%;
          white-space: normal;
          word-break: break-word;
        }
        .matrix-table th.col-title,
        .matrix-table td.col-title {
          width: 40%;
          white-space: normal;
          word-break: break-word;
        }
        .matrix-table thead th {
          font-size: .9rem;
          font-weight: 600;
          text-align: left;
          background: rgba(0,0,0,.02);
        }
        .parent-results-table {
          min-width: 0;
          table-layout: fixed;
        }
        .parent-results-table th,
        .parent-results-table td {
          padding: .24rem .45rem;
        }
        .parent-results-table th.col-title,
        .parent-results-table td.col-title {
          width: 72%;
          white-space: normal;
          word-break: break-word;
        }
        .parent-results-table th.col-narrow,
        .parent-results-table td.col-narrow {
          width: 14%;
          white-space: normal;
        }
        .parent-results-table th.col-due,
        .parent-results-table td.col-due {
          white-space: nowrap;
        }
        .parent-results-table th.col-result,
        .parent-results-table td.col-result {
          white-space: nowrap;
          text-align: center;
        }
        .parent-results-table td.result-band {
          text-align: center;
        }
        .matrix-table .matrix-task-col {
          text-align: center;
          padding: .25rem .35rem;
        }
        .matrix-table .matrix-task-handle {
          display: inline-block;
          font-weight: 700;
          position: relative;
          cursor: help;
          white-space: normal;
          word-break: break-word;
          text-align: center;
        }
        .matrix-table .matrix-task-handle[data-tooltip]::after {
          content: attr(data-tooltip);
          position: absolute;
          top: 100%;
          left: 50%;
          transform: translate(-50%, .45rem);
          padding: .25rem .45rem;
          border-radius: .4rem;
          background: rgba(0, 0, 0, .82);
          color: #fff;
          font-size: .7rem;
          line-height: 1.2;
          white-space: normal;
          min-width: 8rem;
          max-width: 14rem;
          box-shadow: 0 2px 6px rgba(0,0,0,.25);
          opacity: 0;
          pointer-events: none;
          transition: opacity .15s ease;
          z-index: 2;
        }
        .matrix-table .matrix-task-handle[data-tooltip]:hover::after,
        .matrix-table .matrix-task-handle[data-tooltip]:focus-visible::after {
          opacity: 1;
        }
        .matrix-table tbody th {
          text-align: left;
          font-weight: 600;
          background: rgba(0,0,0,.01);
        }
        .result-band {
          text-align: center;
          font-weight: 600;
          border-radius: 6px;
        }
        .result-band--green-dark {
          background: #7ABC81;
          color: #0e2c12;
        }
        .result-band--green-light {
          background: #B1D188;
          color: #0d3513;
        }
        .result-band--yellow {
          background: #EDE791;
          color: #3c2f00;
        }
        .result-band--orange {
          background: #F3C185;
          color: #3b1f00;
        }
        .result-band--red {
          background: #E7726F;
          color: #4a1010;
        }
        .matrix-task-meta {
          display: block;
          font-size: .75rem;
          color: rgba(0,0,0,.6);
          margin-top: .15rem;
        }
        .pill-btn {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          padding: .35rem 1rem;
          border-radius: 999px;
          font-weight: 600;
          font-size: .9rem;
          text-decoration: none;
          border: 1px solid var(--accent-orange, #ff7a00);
          color: var(--accent-orange, #ff7a00);
          transition: background .15s ease, color .15s ease;
        }
        .pill-btn:hover,
        .pill-btn:focus-visible {
          background: var(--accent-orange, #ff7a00);
          color: #fff;
        }
        .pill-btn--ghost {
          border-color: rgba(0,0,0,0.2);
          color: rgba(0,0,0,0.75);
          background: #fff;
        }
        .pill-btn--ghost:hover,
        .pill-btn--ghost:focus-visible {
          border-color: rgba(0,0,0,0.5);
          background: rgba(0,0,0,0.08);
          color: rgba(0,0,0,0.9);
        }
        .task-actions {
          display: flex;
          justify-content: flex-end;
          gap: .5rem;
        }
        .results-task-actions {
          display: flex;
          justify-content: flex-end;
          gap: .6rem;
          margin-left: auto;
        }
        .pill-btn.disabled {
          opacity: var(--btn-disabled-opacity, 0.5);
          pointer-events: none;
        }
        .matrix-table tbody tr.selectable {
          cursor: pointer;
        }
        .matrix-table tbody tr.selected {
          background: rgba(255,122,0,.14);
          box-shadow: inset 0 0 0 2px rgba(255,122,0,.4);
        }
        .matrix-empty-note,
        .results-placeholder {
          text-align: center;
          color: rgba(0,0,0,.6);
          font-style: italic;
        }
