:root {
  --canvas: #f6f7fb;
  --surface: #fff;
  --surface-subtle: #eef0f5;
  --ink: #171723;
  --ink-secondary: #656675;
  --ink-tertiary: #858694;
  --rule: #e1e2e8;
  --rule-strong: #bcbec8;
  --accent: #c9f45b;
  --accent-strong: #b4df3e;
  --accent-soft: #f1fbd7;
  --link: #3657d6;
  --sidebar: #181827;
  --sidebar-muted: #aaaabb;
  --danger: #9a3e34;
  --danger-soft: #f7eeec;
  --focus: #7894ec;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --duration-release: 100ms;
  --duration-press: 140ms;
  --duration-fast: 160ms;
  --duration-panel: 180ms;
  --content: 70rem;
  --reading: 47.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light; background: var(--canvas); }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; }

button, input, select, textarea, summary { font: inherit; }

:where(a, button, input, select, textarea, summary, [tabindex], math-field):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: .5rem;
  left: .5rem;
  padding: .625rem .875rem;
  background: var(--ink);
  color: #fff;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  background: rgb(255 255 255 / 97%);
  border-bottom: 1px solid var(--rule);
}

.app-header__inner {
  min-height: 4rem;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 750;
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand span, .brand small { display: block; }
.brand small {
  margin-top: .05rem;
  color: var(--ink-secondary);
  font-size: .6875rem;
  font-weight: 550;
  letter-spacing: .02em;
}
.brand span::after { content: "."; color: var(--accent); }

.primary-nav {
  display: flex;
  align-items: stretch;
  min-height: 4rem;
  gap: .25rem;
}

.primary-nav a,
.header-action,
.menu-list a {
  color: var(--ink-secondary);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  padding: .25rem .75rem;
  border-bottom: 2px solid transparent;
}

.primary-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.header-spacer { margin-left: auto; }

.header-action {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  padding: 0 .75rem;
  border-radius: .375rem;
}

.more-menu { position: relative; }
.more-menu > summary {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0 .75rem;
  color: var(--ink-secondary);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: .375rem;
}
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary::after { content: "⌄"; margin-left: .4rem; font-size: .75rem; }

.menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  width: 14rem;
  padding: .375rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: .625rem;
  box-shadow: 0 4px 12px -8px rgb(0 0 0 / 28%);
}
.menu-list a { display: block; padding: .625rem .75rem; border-radius: .375rem; }
.menu-list a[aria-current="page"] { color: var(--link); background: var(--accent-soft); }

.mobile-menu { display: none; margin-left: auto; }
.mobile-menu .menu-list { position: fixed; top: 4.25rem; left: 1rem; right: 1rem; width: auto; }

@media (min-width: 64.0625rem) {
  .staff-shell .app-header {
    position: fixed;
    inset: 0 auto 0 0;
    width: 15rem;
    background: var(--sidebar);
    border: 0;
  }
  .staff-shell .app-header__inner {
    height: 100%;
    min-height: 0;
    padding: 1.75rem 1rem 1.25rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }
  .staff-shell .brand { padding: 0 .75rem; color: #fff; font-size: 1.125rem; }
  .staff-shell .brand small { color: var(--sidebar-muted); }
  .staff-shell .primary-nav {
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
  }
  .staff-shell .primary-nav a {
    min-height: 2.875rem;
    padding: .65rem .75rem;
    color: var(--sidebar-muted);
    border: 0;
    border-radius: .5rem;
  }
  .staff-shell .primary-nav a[aria-current="page"] {
    color: var(--accent);
    background: rgb(255 255 255 / 8%);
  }
  .staff-shell .header-spacer { margin: 0; flex: 1; }
  .staff-shell .more-menu > summary {
    width: 100%;
    justify-content: space-between;
    color: var(--sidebar-muted);
  }
  .staff-shell .menu-list { left: calc(100% + .75rem); right: auto; top: auto; bottom: 0; }
  .staff-shell .page {
    width: auto;
    max-width: var(--content);
    margin-left: max(17rem, calc(50vw - 27.5rem));
    margin-right: 2rem;
  }
  .staff-shell .primary-nav a:hover,
  .staff-shell .more-menu > summary:hover { color: #fff; background: rgb(255 255 255 / 8%); }
}

.page {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 2.75rem 1.5rem 5rem;
}
.page--reading { width: min(100%, var(--reading)); }

.page-header { margin-bottom: 2rem; }
.page-header h1,
h1 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  font-weight: 730;
  line-height: 1.12;
  letter-spacing: -.035em;
}
.page-header p,
.sub {
  max-width: 68ch;
  margin: .625rem 0 0;
  color: var(--ink-secondary);
  font-size: .9375rem;
  line-height: 1.6;
}

h2 { margin: 0; font-size: 1.25rem; line-height: 1.3; letter-spacing: -.018em; }
h3 { margin: 0; font-size: 1rem; line-height: 1.4; }

.section { margin-top: 3rem; }
.section:first-child { margin-top: 0; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .875rem; }
.section-heading p { margin: 0; color: var(--ink-secondary); font-size: .875rem; }

.panel,
.card {
  margin: 0 0 1.5rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: .875rem;
  box-shadow: 0 1px 2px rgb(24 32 51 / 4%);
}
.panel--compact { padding: 1rem 1.125rem; }
.panel-heading { margin-bottom: 1rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.panel-heading p { margin: 0; color: var(--ink-secondary); font-size: .8125rem; }

.stack { display: grid; gap: 1rem; }
.cluster { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.split { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .625rem; }
.actions form { margin: 0; }

.rows { border-top: 1px solid var(--rule); }
.row-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.row-item__body { min-width: 0; flex: 1; }
.row-item__title { font-weight: 650; }
.row-item__meta, .muted { color: var(--ink-secondary); font-size: .875rem; }

.button,
button,
input[type="submit"] {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: auto;
  padding: .625rem 1rem;
  border: 1px solid var(--accent);
  border-radius: .375rem;
  background: var(--accent);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--duration-release) var(--ease-out),
              background-color var(--duration-fast) ease,
              border-color var(--duration-fast) ease;
}
.button:active, button:active, input[type="submit"]:active {
  transform: scale(.98);
  transition-duration: var(--duration-press), var(--duration-fast), var(--duration-fast);
}
.button--secondary, button.secondary {
  background: var(--surface);
  border-color: var(--rule-strong);
  color: var(--ink);
}
.button--quiet {
  background: transparent;
  border-color: transparent;
  color: var(--link);
}
.button--danger, button.danger {
  background: var(--danger);
  border-color: var(--danger);
}
button:disabled, .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }

label, .field-label {
  display: block;
  margin: 0 0 .375rem;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
}
.field { margin-top: 1rem; }
.field:first-child { margin-top: 0; }
.field-hint, .hint { margin-top: .375rem; color: var(--ink-secondary); font-size: .8125rem; line-height: 1.5; }

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: .625rem .75rem;
  border: 1px solid var(--rule-strong);
  border-radius: .375rem;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
}
textarea { min-height: 7rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-tertiary); opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-actions { margin-top: 1.5rem; }
fieldset.field { min-width: 0; margin: 1.5rem 0 0; padding: 0; border: 0; }
fieldset.field legend { margin-bottom: .375rem; font-size: .875rem; font-weight: 650; }
.inline-label { margin: 0; display: inline; }
.admin-form-grid { margin-top: 1rem; }
.worksheet-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.document-title { max-width: 21.25rem; overflow-wrap: anywhere; }
.inline-upload { display: flex; align-items: center; flex-wrap: wrap; gap: .375rem; }
input.compact-file { min-width: 12rem; padding: .35rem; font-size: .75rem; }
.inline-upload button { min-height: 2.25rem; padding: .375rem .75rem; }
.worksheet-actions { width: 10.625rem; }
.job-result { font-size: .75rem; white-space: pre-wrap; }
.technical-title { text-transform: capitalize; }
.technical-details { margin-top: 1rem; }
.technical-code { padding: 1rem; overflow-x: auto; background: var(--surface-subtle); border: 1px solid var(--rule); }
.admin-actions { margin-top: 1.25rem; }

.notice, .msg {
  margin: 0 0 1.5rem;
  padding: .875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: .5rem;
  color: var(--ink);
  font-size: .875rem;
}
.notice--error, .msg.err, .err { border-color: #d8aaa5; background: var(--danger-soft); }
.notice strong:first-child::after { content: " — "; }

.status { font-size: .8125rem; font-weight: 650; }
.status--current { color: var(--link); }
.status--danger { color: var(--danger); }
.pill { display: inline; padding: 0; background: none; color: inherit; border-radius: 0; font-size: inherit; font-weight: 650; }

.stats { display: grid; grid-template-columns: minmax(15rem, 1.4fr) repeat(2, minmax(10rem, 1fr)); gap: .75rem; }
.stat { padding: 1.125rem 1.25rem; background: var(--surface); border: 1px solid var(--rule); border-radius: .75rem; box-shadow: 0 1px 2px rgb(24 32 51 / 4%); text-align: left; }
.stat + .stat { padding-left: 1.25rem; }
.stat .num { color: var(--ink); font-size: 2rem; font-weight: 730; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .lbl { margin-top: .375rem; color: var(--ink-secondary); font-size: .8125rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.dashboard-heading { margin-bottom: 1.5rem; }
.dashboard-lead { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(16rem, .8fr); gap: 1rem; }
.attention-card {
  min-height: 19rem;
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  background: var(--sidebar);
  color: #fff;
  border-radius: .75rem;
  overflow: hidden;
}
.attention-card__label { color: var(--accent); font-size: .8125rem; font-weight: 700; }
.attention-card__count { margin-top: 1.25rem; font-size: clamp(3rem, 7vw, 5rem); font-weight: 780; line-height: .9; letter-spacing: -.07em; }
.attention-card h2 { margin-top: .75rem; max-width: 20ch; font-size: 1.5rem; }
.attention-card p { max-width: 44ch; margin: .625rem 0 1.5rem; color: #c2c6d2; }
.attention-card .button { margin-top: auto; }
.workspace-facts {
  min-height: 19rem;
  padding: 1.5rem;
  background: var(--accent);
  border-radius: .75rem;
}
.workspace-facts h2 { font-size: .875rem; }
.workspace-facts dl { margin: 1.25rem 0 0; }
.workspace-facts dl > div { padding: .875rem 0; display: flex; align-items: baseline; justify-content: space-between; border-top: 1px solid rgb(23 23 35 / 16%); }
.workspace-facts dt { font-size: .875rem; font-weight: 620; }
.workspace-facts dd { margin: 0; font-size: 1.75rem; font-weight: 760; line-height: 1; }
.workspace-facts dd a { color: inherit; text-decoration-color: rgb(23 23 35 / 45%); }
.recent-panel { padding-top: 0; padding-bottom: 0; }

.review-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.queue-total { min-width: 5rem; padding: .75rem 1rem; display: flex; align-items: baseline; justify-content: center; gap: .4rem; background: var(--accent); border-radius: .75rem; }
.queue-total strong { font-size: 1.5rem; line-height: 1; }
.queue-total span { font-size: .8125rem; font-weight: 650; }
.review-toolbar { margin-bottom: .75rem; display: flex; align-items: center; justify-content: space-between; color: var(--ink-secondary); font-size: .875rem; }
.review-toolbar .actions button { min-height: 2.5rem; padding: .45rem .8rem; }
.review-item { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(19rem, .75fr); gap: 1rem; align-items: start; }
.review-question {
  min-height: 32rem;
  padding: 2.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: .75rem;
  box-shadow: 0 16px 42px -36px rgb(23 23 35 / 55%);
}
.review-question__number { color: var(--ink-secondary); font-size: .8125rem; font-weight: 700; }
.review-question h2 { margin-top: 1.25rem; max-width: 34ch; white-space: pre-line; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.28; letter-spacing: -.025em; }
.suggested-answer { margin-top: 2rem; padding: 1.25rem 1.5rem; background: var(--accent-soft); border: 1px solid #deedb6; }
.suggested-answer > span, .suggested-answer > small { display: block; color: var(--ink-secondary); font-size: .8125rem; }
.suggested-answer > strong { display: block; margin: .25rem 0; font-size: 1.75rem; letter-spacing: -.02em; overflow-wrap: anywhere; }
.review-provenance { margin-top: 2rem; border-top: 1px solid var(--rule); }
.review-provenance summary { padding: 1rem 0; color: var(--link); cursor: pointer; font-size: .875rem; font-weight: 650; }
.review-provenance dl { margin: 0; }
.review-provenance dl > div { padding: .625rem 0; display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; border-top: 1px solid var(--rule); }
.review-provenance dt { color: var(--ink-secondary); font-size: .8125rem; }
.review-provenance dd { margin: 0; font-size: .875rem; overflow-wrap: anywhere; }
.decision-panel {
  position: sticky;
  top: 1rem;
  padding: 1.5rem;
  background: var(--sidebar);
  color: #fff;
  border-radius: .75rem;
}
.decision-panel__step { color: var(--accent); font-size: .75rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.decision-panel h2 { margin-top: .5rem; font-size: 1.25rem; }
.decision-panel > form { margin-top: 1.5rem; }
.decision-primary { width: 100%; min-height: 3.25rem; }
.decision-disclosure { margin-top: .75rem; border-top: 1px solid rgb(255 255 255 / 14%); }
.decision-disclosure > summary { padding: .875rem 0; color: #fff; cursor: pointer; font-size: .875rem; font-weight: 650; }
.decision-disclosure--quiet > summary { color: #c8cad4; }
.decision-disclosure--danger > summary { color: #f1b5ae; }
.decision-disclosure form { padding: .25rem 0 1rem; }
.decision-disclosure label, .decision-disclosure .field-label { color: #fff; }
.decision-disclosure .math-field { background: #fff; color: var(--ink); }
.review-empty { max-width: 44rem; }
[hidden] { display: none !important; }

.table-wrap { max-width: 100%; overflow-x: auto; border-top: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
th { color: var(--ink-secondary); font-size: .75rem; font-weight: 650; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
code { padding: .08rem .28rem; background: var(--surface-subtle); border-radius: .25rem; font-size: .875em; overflow-wrap: anywhere; }

.chk { display: flex; align-items: flex-start; gap: .75rem; padding: .875rem 0; border-bottom: 1px solid var(--rule); }
.chk input { flex: 0 0 auto; margin-top: .3rem; }
.chk > span { min-width: 0; }
.chk label, .chk .hint { margin: 0; }
.chk .hint { display: block; margin-top: .2rem; font-weight: 400; }

/* Assignment composer: a workbench, not a stack of generic cards. The bank and the ordered paper
   remain visible together at desktop/tablet widths so filtering never loses the tutor's context. */
.page--composer { max-width: 84rem; }
.composer-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.page-context { margin: 0 0 .4rem; color: var(--ink-secondary); font-size: .8125rem; }
.step-indicator { margin: 0; padding: 0; display: flex; gap: .5rem; list-style: none; }
.step-indicator li { min-height: 2.5rem; padding: .45rem .75rem; display: flex; align-items: center; gap: .5rem; color: var(--ink-secondary); font-size: .8125rem; font-weight: 650; border-bottom: 2px solid transparent; }
.step-indicator li span { width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border: 1px solid var(--rule-strong); border-radius: 50%; font-size: .75rem; }
.step-indicator li[aria-current="step"] { color: var(--ink); border-bottom-color: var(--accent-strong); }
.step-indicator li[aria-current="step"] span { background: var(--accent); border-color: var(--accent); }
.composer-setup { padding: 1.25rem 0 1.75rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.composer-setup h2 { margin-bottom: 1rem; }
.audience-picker { max-width: 46rem; }
.audience-picker__tools { display: grid; grid-template-columns: minmax(12rem, 1fr) auto; gap: .5rem; align-items: center; }
.audience-picker__tools .button--quiet { min-height: 2.75rem; }
.audience-picker__list {
  max-height: 12rem;
  margin-top: .5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow-y: auto;
  border: 1px solid var(--rule);
  border-radius: .5rem;
}
.audience-picker__list label { margin: 0; padding: .75rem; display: flex; align-items: center; gap: .625rem; font-weight: 520; border-bottom: 1px solid var(--rule); }
.audience-picker__list label:nth-child(3n + 2),
.audience-picker__list label:nth-child(3n + 3) { border-left: 1px solid var(--rule); }
.audience-picker__list input { flex: 0 0 auto; }
.composer-grid { margin-top: 2rem; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(20rem, .75fr); gap: 2rem; align-items: start; }
.question-library { min-width: 0; }
.question-library .section-heading { align-items: flex-end; }
.question-library .section-heading > div > p { margin: .25rem 0 0; color: var(--ink-secondary); font-size: .875rem; }
.library-filters { margin-bottom: 1rem; padding: 1rem; display: grid; grid-template-columns: minmax(11rem, .7fr) minmax(14rem, 1.3fr); gap: .75rem; background: var(--surface-subtle); border-radius: .625rem; }
.question-library__list { border-top: 1px solid var(--rule); }
.library-question { margin: 0; min-height: 6rem; padding: 1rem .25rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .875rem; border-bottom: 1px solid var(--rule); cursor: pointer; }
.library-question > input { width: 1.125rem; height: 1.125rem; margin-top: .2rem; }
.library-question__body { min-width: 0; display: grid; gap: .3rem; }
.library-question__meta { color: var(--ink-secondary); font-size: .75rem; font-weight: 650; }
.library-question__text { max-width: 64ch; color: var(--ink); font-size: .9375rem; font-weight: 520; line-height: 1.5; white-space: pre-line; }
.library-question__action { min-width: 3rem; color: var(--link); font-size: .8125rem; font-weight: 650; text-align: right; }
.library-question:has(input:checked) { background: var(--accent-soft); }
.library-question:has(input:checked) .library-question__action::before { content: "Added"; }
.library-question:has(input:checked) .library-question__action { font-size: 0; color: var(--ink-secondary); }
.library-question:has(input:checked) .library-question__action::before { font-size: .8125rem; }
.composer-empty { margin: 1.5rem 0; color: var(--ink-secondary); }
.selection-tray { position: sticky; top: 1rem; padding: 1.25rem; background: var(--sidebar); color: #fff; border-radius: .875rem; }
.selection-tray__header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.selection-tray__header h2 { color: #fff; }
.selection-tray__header p { margin: .25rem 0 0; color: #c7c8d2; font-size: .8125rem; }
.selection-tray__header > strong { min-width: 2.25rem; height: 2.25rem; display: grid; place-items: center; background: var(--accent); color: var(--ink); border-radius: 50%; font-variant-numeric: tabular-nums; }
.selection-tray__list { margin: 1rem 0 0; padding: 0; list-style: none; }
.selection-tray__empty { min-height: 11rem; padding: 2rem 1rem; display: grid; align-content: center; text-align: center; border-top: 1px solid rgb(255 255 255 / 14%); }
.selection-tray__empty p { margin: 0; font-weight: 650; }
.selection-tray__empty span { margin-top: .25rem; color: #aaaebb; font-size: .8125rem; }
.selection-tray > button:last-child { width: 100%; margin-top: 1rem; }
.selection-tray .notice--error { margin: 1rem 0 0; background: #3b2528; border-color: #815158; color: #fff; }
.selection-item { padding: .875rem 0; display: grid; gap: .625rem; border-top: 1px solid rgb(255 255 255 / 14%); }
.selection-item__body { min-width: 0; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .625rem; }
.selection-item__number { width: 1.5rem; height: 1.5rem; display: grid; place-items: center; color: var(--accent); border: 1px solid rgb(255 255 255 / 25%); border-radius: 50%; font-size: .6875rem; font-weight: 750; }
.selection-item__body > span:last-child { min-width: 0; display: grid; gap: .2rem; }
.selection-item__body small { color: #aeb0bd; font-size: .6875rem; }
.selection-item__body small + span { display: -webkit-box; overflow: hidden; color: #fff; font-size: .8125rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.selection-item__actions { padding-left: 2.125rem; display: flex; gap: .25rem; }
.selection-item__actions button { min-height: 2rem; padding: .25rem .45rem; color: #d8d9e0; font-size: .75rem; }
.selection-item__actions button:last-child { margin-left: auto; color: #f2b7b0; }
.review-sheet { width: min(100%, 52rem); margin: 0 auto; background: var(--surface); border: 1px solid var(--rule); box-shadow: 0 20px 55px -44px rgb(23 23 35 / 60%); }
.review-sheet__header { padding: 2rem; display: flex; align-items: start; justify-content: space-between; gap: 1.5rem; border-bottom: 1px solid var(--rule); }
.review-sheet__header > div > p:last-child { margin: .5rem 0 0; color: var(--ink-secondary); }
.review-sheet__questions { margin: 0; padding: 0 2rem; list-style: none; counter-reset: paper-question; }
.review-sheet__questions li { padding: 1.5rem 0 1.5rem 3rem; position: relative; border-bottom: 1px solid var(--rule); counter-increment: paper-question; }
.review-sheet__questions li:last-child { border-bottom: 0; }
.review-sheet__questions li::before { content: counter(paper-question); position: absolute; left: 0; top: 1.5rem; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; background: var(--sidebar); color: var(--accent); border-radius: .35rem; font-size: .75rem; font-weight: 750; }
.review-sheet__questions span { color: var(--ink-secondary); font-size: .75rem; font-weight: 650; }
.review-sheet__questions p { max-width: 60ch; margin: .35rem 0 0; white-space: pre-line; }
.composer-publish { position: sticky; bottom: 1rem; z-index: 10; width: min(100%, 52rem); margin: 1rem auto 0; padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--sidebar); color: #fff; border-radius: .75rem; box-shadow: 0 16px 35px -25px rgb(23 23 35 / 75%); }
.composer-publish p { margin: 0; display: grid; }
.composer-publish p span { color: #b9bbc6; font-size: .75rem; }

.assignment-index-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.assignment-filters { margin-bottom: 2rem; padding: 1rem 0; display: grid; grid-template-columns: minmax(14rem, 1.4fr) minmax(10rem, .6fr) auto; align-items: end; gap: .75rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.assignment-index { border-top: 1px solid var(--rule-strong); }
.assignment-index__item { scroll-margin-top: 2rem; border-bottom: 1px solid var(--rule-strong); }
.assignment-index__header { padding: 1.5rem 0 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.assignment-index__header h2 { margin-top: .4rem; font-size: 1.375rem; }
.assignment-index__header p { margin: .4rem 0 0; color: var(--ink-secondary); font-size: .875rem; }
.assignment-index__meta { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; color: var(--ink-secondary); font-size: .75rem; }
.assignment-progress { margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: .5rem; overflow: hidden; }
.assignment-progress > div { padding: .875rem 1rem; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.assignment-progress > div + div { border-left: 1px solid var(--rule); }
.assignment-progress dt { color: var(--ink-secondary); font-size: .75rem; font-weight: 650; }
.assignment-progress dd { margin: 0; font-size: 1.125rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.assignment-learners { border-top: 1px solid var(--rule); }
.assignment-learner { min-height: 4.5rem; padding: .75rem 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem; border-bottom: 1px solid var(--rule); }
.assignment-learner:last-child { border-bottom: 0; }
.assignment-learner > div { min-width: 0; display: grid; gap: .15rem; }
.assignment-learner > div > a { width: fit-content; color: var(--ink); font-weight: 650; }
.assignment-learner > div > span { color: var(--ink-secondary); font-size: .8125rem; }
.assignment-learner .button { min-height: 2.375rem; padding: .4rem .75rem; font-size: .8125rem; }
.assignment-learner__quiet { color: var(--ink-secondary); font-size: .8125rem; }
.assignment-index__empty { margin: 0; padding: 0 0 1.5rem; color: var(--ink-secondary); font-size: .875rem; }
.assignment-class-heading { align-items: flex-end; }
.class-progress { margin-bottom: 1.25rem; }
.state-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--rule-strong); scrollbar-width: thin; }
.state-tabs a { min-height: 3rem; padding: .75rem 1rem; display: inline-flex; flex: 0 0 auto; align-items: center; gap: .5rem; color: var(--ink-secondary); border-bottom: 2px solid transparent; text-decoration: none; font-size: .875rem; font-weight: 650; }
.state-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.state-tabs a span { color: var(--ink-secondary); font-variant-numeric: tabular-nums; }
.class-search { padding: 1rem 0; display: grid; grid-template-columns: auto minmax(12rem, 22rem) auto; align-items: center; gap: .75rem; border-bottom: 1px solid var(--rule); }
.class-search label { margin: 0; }
.class-learner-list { border-bottom: 1px solid var(--rule-strong); }
.class-learner-row { min-height: 4.75rem; display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(10rem, .6fr) auto; align-items: center; gap: 1rem; border-bottom: 1px solid var(--rule); }
.class-learner-row:last-child { border-bottom: 0; }
.class-learner-row__person { min-width: 0; display: flex; align-items: center; gap: .75rem; }
.class-learner-row__person > a { color: var(--ink); font-weight: 680; }
.class-learner-row__result { display: flex; align-items: baseline; gap: .4rem; color: var(--ink-secondary); font-size: .8125rem; }
.class-learner-row__result strong { color: var(--ink); font-size: 1rem; font-variant-numeric: tabular-nums; }
.class-learner-row .button { min-height: 2.375rem; padding: .4rem .75rem; font-size: .8125rem; }

.problem-page { max-width: 38rem; padding: 2.5rem 0; }
.problem-code { margin-bottom: 1rem; color: var(--ink-secondary); font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.problem-page > p { max-width: 52ch; margin: .75rem 0 0; color: var(--ink-secondary); }
.problem-page .problem-detail { margin-top: 1.25rem; padding-top: 1.25rem; color: var(--ink); border-top: 1px solid var(--rule); font-size: .875rem; }
.problem-page .button { margin-top: 2rem; }
.problem-panel .problem-code { margin-bottom: .75rem; }
.problem-panel > p { color: var(--ink-secondary); }
.problem-panel .button { width: 100%; margin-top: 1.5rem; }

.student-directory-heading { align-items: center; }
.create-student { position: relative; flex: 0 0 auto; }
.create-student > summary,
.access-menu > summary { list-style: none; }
.create-student > summary::-webkit-details-marker,
.access-menu > summary::-webkit-details-marker { display: none; }
.create-student__panel,
.access-menu__panel {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + .5rem);
  width: min(21rem, calc(100vw - 2rem));
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: .75rem;
  box-shadow: 0 16px 34px -26px rgb(23 23 35 / 55%);
}
.learner-directory { padding-top: 0; padding-bottom: 0; }
.learner-directory .row-item:last-child { border-bottom: 0; }
.learner-index {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  background: var(--sidebar);
  color: var(--accent);
  border-radius: .5rem;
  font-weight: 750;
}
.access-menu { position: relative; }
.access-menu__panel { width: 11rem; padding: .5rem; }
.access-menu__panel form + form { margin-top: .375rem; }
.access-menu__panel button { width: 100%; }
.roster-toolbar {
  margin-bottom: 1rem;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(15rem, 1.4fr) repeat(2, minmax(10rem, .6fr));
  gap: .75rem;
  background: var(--surface-subtle);
  border-radius: .625rem;
}
.bulk-bar {
  min-height: 3.75rem;
  padding: .625rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--rule);
}
.bulk-bar p { margin: 0; color: var(--ink-secondary); font-size: .875rem; }
.bulk-bar button { min-height: 2.375rem; padding: .4rem .75rem; }
.roster-table { min-width: 46rem; }
.roster-table th, .roster-table td { vertical-align: middle; }
.roster-table tbody tr:last-child td { border-bottom: 0; }
.roster-check { width: 2.5rem; text-align: center; }
.roster-check input { width: 1.125rem; height: 1.125rem; }
.roster-name { display: block; width: fit-content; color: var(--ink); font-weight: 680; }
.roster-latest { display: block; margin-top: .2rem; color: var(--ink-secondary); font-size: .75rem; }
.roster-secondary { color: var(--ink-secondary); font-size: .75rem; }
/* Between the sidebar breakpoint (64.0625rem) and ~71rem the roster needs more width than the panel
   gives, so .table-wrap scrolls. Pin the actions column to the right edge so Open/Access are never the
   clipped part — the learner/practice columns scroll under it instead. */
.roster-table th:last-child, .roster-table td.roster-actions {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--surface);
  box-shadow: -8px 0 8px -8px rgb(23 32 51 / 22%);
}
.roster-actions { display: flex; align-items: center; justify-content: flex-end; gap: .375rem; }
.roster-actions .button { min-height: 2.25rem; padding: .35rem .625rem; font-size: .8125rem; }
.roster-empty { margin: 0; padding: 2rem 1rem; color: var(--ink-secondary); text-align: center; }

.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem 10vh;
}
.auth-panel {
  width: min(100%, 27rem);
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: .875rem;
  box-shadow: 0 18px 50px -36px rgb(23 32 51 / 55%);
}
.auth-brand { margin-bottom: 2.5rem; }
.auth-panel h1 { font-size: 1.75rem; }
.auth-panel .button, .auth-panel button { width: 100%; min-height: 3rem; margin-top: 1.5rem; }
.auth-switch { margin-top: 1.5rem; }
.code-panel { max-width: 42rem; }
.practice-code { font-size: clamp(1.25rem, 4vw, 1.75rem); font-weight: 730; overflow-wrap: anywhere; }

.student-header .app-header__inner { max-width: var(--reading); }
.student-page { width: min(100%, var(--reading)); }
.student-shell .page-header { padding-bottom: .25rem; }
.assignment-meter { height: .375rem; margin-top: 1.25rem; overflow: hidden; background: #dfe2e9; border-radius: 99px; }
.assignment-meter span { display: block; width: 100%; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; }

.assignment-list { border-top: 1px solid var(--rule); }
.assignment-row { display: grid; grid-template-columns: 1fr auto; gap: .75rem 1.5rem; align-items: center; padding: 1.125rem 0; border-bottom: 1px solid var(--rule); }
.assignment-row__title { font-weight: 650; }
.assignment-row__meta { color: var(--ink-secondary); font-size: .8125rem; }
.assignment-row__main { min-width: 0; }
.assignment-row__heading { display: flex; align-items: center; gap: .625rem; flex-wrap: wrap; }
.assignment-row__heading h3 { margin: 0; font-size: 1rem; }
.assignment-row__result { margin: .375rem 0 0; color: var(--ink-secondary); font-size: .875rem; }
.practice-status { font-size: .75rem; font-weight: 700; letter-spacing: .02em; }
.practice-status::before { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-right: .35rem; border-radius: 50%; background: #777c88; vertical-align: .08em; }
.practice-status--submitted::before { background: var(--accent); }
.practice-status--started::before { background: #9d6d14; }
.breadcrumb { display: flex; gap: .5rem; align-items: center; margin-bottom: 1.5rem; color: var(--ink-secondary); font-size: .875rem; }
.breadcrumb a { color: inherit; }
.review-score { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 1.5rem; overflow: hidden; border: 1px solid var(--rule); border-radius: .75rem; background: var(--rule); }
.review-score div { display: flex; flex-direction: column; padding: 1rem 1.25rem; background: var(--surface); }
.review-score strong { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.review-score span { margin-top: .3rem; color: var(--ink-secondary); font-size: .8125rem; }
.override-box { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.override-box summary { width: fit-content; cursor: pointer; color: var(--link); font-weight: 650; }
.override-box form { margin-top: 1rem; }

.question-list { counter-reset: question; display: grid; gap: 1rem; }
.question {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: .875rem;
  box-shadow: 0 16px 42px -36px rgb(23 23 35 / 55%);
}
.question:first-child { border-top: 1px solid var(--rule); padding-top: 1.5rem; }
.question__number {
  width: fit-content;
  margin-bottom: .875rem;
  padding: .25rem .55rem;
  background: var(--sidebar);
  color: var(--accent);
  border-radius: .35rem;
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .02em;
}
.question__text { max-width: 60ch; margin: 0 0 1.25rem; white-space: pre-line; font-size: 1.125rem; line-height: 1.55; }
.question-figure {
  width: min(100%, 28rem);
  margin: 0 0 1.5rem;
  padding: clamp(.75rem, 2vw, 1.25rem);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: .5rem;
}
.question-figure img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.answer-field { max-width: 34rem; }
.result-review { display: grid; gap: 1rem; }
.result-card { padding: clamp(1.125rem, 3vw, 1.75rem); background: var(--surface); border: 1px solid var(--rule); border-radius: .875rem; }
.result-card__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.result-card__header .question__number { margin: 0; }
.result-card__question { max-width: 60ch; margin-bottom: 1.25rem; font-size: 1.125rem; line-height: 1.55; white-space: pre-line; }
.answer-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; max-width: 40rem; margin: 1.5rem 0; overflow: hidden; background: var(--rule); border: 1px solid var(--rule); border-radius: .5rem; }
.answer-comparison > div { padding: 1rem; background: var(--surface); }
.answer-comparison dt { margin-bottom: .35rem; color: var(--ink-secondary); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.answer-comparison dd { margin: 0; font-size: 1.125rem; font-weight: 650; overflow-wrap: anywhere; }
.worked-method { max-width: 40rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.worked-method h2 { margin-bottom: .75rem; font-size: 1rem; }
.worked-method ol { margin: 0; padding-left: 1.35rem; }
.worked-method li { padding-left: .25rem; line-height: 1.55; }
.worked-method li + li { margin-top: .5rem; }
.math-field {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: .45rem .65rem;
  border: 2px solid #cfd2dc;
  border-radius: .375rem;
  background: var(--surface);
  font-size: 1.25rem;
}
.math-field:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px rgb(54 87 214 / 12%); }
.MLK__toolbar .selected { color: var(--accent-strong) !important; }
.keyboard-fallback { margin-top: .625rem; }
.keyboard-fallback summary { color: var(--link); cursor: pointer; font-size: .8125rem; }
.keyboard-fallback .field { margin-top: .625rem; }

.assignment-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 1rem 0 0;
  padding: .75rem max(1rem, env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgb(24 24 39 / 97%);
  border: 1px solid var(--sidebar);
  border-radius: .75rem;
  box-shadow: 0 10px 30px -24px rgb(23 32 51 / 65%);
}
.assignment-footer .button, .assignment-footer button { border-color: var(--accent); background: var(--accent); color: var(--ink); }
.answer-progress { color: #d7d8df; font-size: .875rem; font-variant-numeric: tabular-nums; }

.result-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.result-word { font-size: .875rem; font-weight: 700; }
.result-word--wrong, .result-word--retry { color: var(--danger); }
.result-actions { margin-top: 2rem; }
.report-filter { max-width: 24rem; }
.report-filter__window { max-width: 8rem; }
.metric-value { flex: 0 0 auto; font-size: 1.5rem; font-weight: 730; font-variant-numeric: tabular-nums; }

.evidence-mobile { display: none; }
.attempt { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.attempt summary { cursor: pointer; list-style: none; }
.attempt summary::-webkit-details-marker { display: none; }
.attempt__grid { display: grid; grid-template-columns: minmax(12rem, 2fr) 1fr 1fr auto; gap: .75rem; align-items: start; }

@media (hover: hover) and (pointer: fine) {
  .primary-nav a:hover, .header-action:hover, .more-menu > summary:hover, .menu-list a:hover { color: var(--ink); background: var(--surface-subtle); }
  .button:hover, button:hover, input[type="submit"]:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
  .button--secondary:hover, button.secondary:hover { background: var(--surface-subtle); border-color: var(--rule-strong); }
  .button--danger:hover, button.danger:hover { background: #7f3028; border-color: #7f3028; }
}

@media (max-width: 64rem) {
  .app-header__inner { min-height: 3.75rem; padding: 0 1rem; gap: 1rem; }
  .desktop-only { display: none !important; }
  .mobile-menu { display: block; }
  .page { padding: 2rem 1rem 4rem; }
  .page-header { margin-bottom: 2rem; }
  .form-grid, .grid, .worksheet-options { grid-template-columns: 1fr; }
  .roster-toolbar { grid-template-columns: 1fr 1fr; }
  .roster-toolbar > div:first-child { grid-column: 1 / -1; }
  .dashboard-lead { grid-template-columns: 1.35fr .9fr; }
  .review-item { grid-template-columns: 1fr; }
  .review-question { min-height: 0; }
  .decision-panel { position: static; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat + .stat { padding-left: 1.25rem; }
  .row-item { align-items: flex-start; flex-direction: column; }
  .row-item .actions { width: 100%; }
  .evidence-desktop { display: none; }
  .evidence-mobile { display: block; }
  .attempt__grid { grid-template-columns: 1fr 1fr; }
  .assignment-footer { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .student-directory-heading { align-items: flex-start; }
  .composer-grid { grid-template-columns: minmax(0, 1.2fr) minmax(18rem, .8fr); gap: 1rem; }
  .selection-tray { top: 4.5rem; }
}

@media (max-width: 30rem) {
  .dashboard-lead { grid-template-columns: 1fr; }
  .attention-card, .workspace-facts { min-height: 0; }
  .attention-card { padding: 1.5rem; }
  .attention-card__count { font-size: 3.5rem; }
  .review-heading { align-items: flex-start; }
  .review-heading { margin-bottom: 1rem; }
  .review-toolbar .actions,
  .review-toolbar .actions > *,
  .review-toolbar .actions button { width: auto; }
  .review-toolbar .actions { flex-wrap: nowrap; }
  .review-question { padding: 1.25rem; }
  .review-provenance dl > div { grid-template-columns: 1fr; gap: .2rem; }
  .section-heading, .panel-heading { align-items: flex-start; flex-direction: column; gap: .25rem; }
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { padding-left: 1.25rem; }
  .split { align-items: stretch; flex-direction: column; }
  .create-student, .create-student > summary { width: 100%; }
  .create-student__panel { position: static; width: 100%; margin-top: .5rem; }
  .actions > *, .actions form, .actions button, .actions .button { width: 100%; }
  .assignment-row { grid-template-columns: 1fr; }
  .assignment-row .button { width: 100%; }
  .review-score { grid-template-columns: 1fr; }
  .question { padding: 1.125rem; }
  .question:first-child { padding-top: 1.125rem; }
  .question__text { font-size: 1.0625rem; }
  .answer-comparison { grid-template-columns: 1fr; }
  .attempt__grid { grid-template-columns: 1fr; }
}

@media (max-width: 48rem) {
  .composer-heading { align-items: flex-start; flex-direction: column; }
  .composer-grid { grid-template-columns: 1fr; }
  .library-filters { grid-template-columns: 1fr; }
  .selection-tray { position: static; }
  .review-sheet__header { padding: 1.25rem; flex-direction: column; }
  .review-sheet__questions { padding: 0 1.25rem; }
  .composer-publish { bottom: 0; border-radius: .75rem .75rem 0 0; }
  .assignment-index-heading { align-items: stretch; flex-direction: column; }
  .assignment-index-heading .button { width: 100%; }
  .assignment-filters { grid-template-columns: 1fr; }
  .assignment-filters button { width: 100%; }
  .assignment-index__header { align-items: stretch; flex-direction: column; }
  .assignment-index__header .button { width: 100%; }
  .class-search { grid-template-columns: 1fr; }
  .class-search button { width: 100%; }
  .class-learner-row { padding: 1rem 0; grid-template-columns: 1fr auto; }
  .class-learner-row__person { align-items: flex-start; flex-direction: column; gap: .35rem; }
  .class-learner-row__result { grid-column: 1; }
  .class-learner-row .button { grid-column: 2; grid-row: 1 / span 2; }
  .roster-toolbar { grid-template-columns: 1fr; }
  .roster-toolbar > div:first-child { grid-column: auto; }
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-bar button { width: 100%; }
  .audience-picker__list { grid-template-columns: 1fr; }
  .audience-picker__list label:nth-child(n) { border-left: 0; }
  .roster-table { min-width: 0; }
  .roster-table thead { display: none; }
  .roster-table, .roster-table tbody, .roster-table tr, .roster-table td { display: block; }
  .roster-table tr { position: relative; padding: 1rem 1rem 1rem 3.5rem; border-bottom: 1px solid var(--rule); }
  .roster-table tbody tr:last-child { border-bottom: 0; }
  .roster-table td { padding: .25rem 0; border: 0; }
  .roster-table .roster-check { position: absolute; top: 1rem; left: 1rem; width: auto; }
  .roster-table td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-secondary); font-size: .75rem; font-weight: 650; }
  /* stacked cards don't scroll horizontally — drop the pinned-column treatment */
  .roster-table th:last-child, .roster-table td.roster-actions {
    position: static; background: none; box-shadow: none;
  }
  .roster-actions { padding-top: .625rem !important; justify-content: flex-start; }
  .roster-actions .access-menu__panel { right: auto; left: 0; }
}

@media (max-width: 30rem) {
  .step-indicator { width: 100%; }
  .step-indicator li { flex: 1; justify-content: center; }
  .library-question { grid-template-columns: auto minmax(0, 1fr); }
  .library-question__action { display: none; }
  .composer-publish { align-items: stretch; flex-direction: column; }
  .composer-publish button { width: 100%; }
  .assignment-learner { grid-template-columns: 1fr; }
  .assignment-learner .button { width: 100%; }
  .assignment-progress { grid-template-columns: 1fr; }
  .assignment-progress > div + div { border-top: 1px solid var(--rule); border-left: 0; }
  .class-learner-row { grid-template-columns: 1fr; }
  .class-learner-row__result, .class-learner-row .button { grid-column: 1; grid-row: auto; }
  .class-learner-row .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .button, button, input[type="submit"] {
    transition-property: background-color, border-color;
    transition-duration: var(--duration-fast);
  }
  .button:active, button:active, input[type="submit"]:active { transform: none; }
}

/* Draw-to-text input (optional handwriting → editable answer box). */
.draw { margin-top: .625rem; }
.draw__toggle {
  padding: .375rem .625rem;
  border: 1px solid var(--rule-strong);
  border-radius: .375rem;
  background: var(--surface-subtle);
  color: var(--link);
  font-size: .8125rem;
  cursor: pointer;
}
.draw__panel { margin-top: .625rem; }
.draw__canvas {
  display: block;
  width: 100%;
  max-width: 32rem;
  height: 200px;
  border: 2px dashed var(--rule-strong);
  border-radius: .5rem;
  background: var(--surface);
  touch-action: none;               /* let the module own pen/touch drawing */
  cursor: crosshair;
}
.draw[data-state="drawing"] .draw__canvas { border-color: var(--link); border-style: solid; }
.draw__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
}
.draw__bar button {
  width: auto;
  min-height: 2.25rem;
  padding: .375rem .75rem;
  border: 1px solid var(--rule-strong);
  border-radius: .375rem;
  background: var(--surface);
  font-size: .8125rem;
  cursor: pointer;
}
.draw__bar [data-draw-recognize] { border-color: var(--accent); background: var(--accent); color: var(--ink); font-weight: 650; }
.draw__status {
  flex: 1 1 12rem;
  min-width: 0;
  color: var(--ink-secondary);
  font-size: .8125rem;
  line-height: 1.4;
}
.draw[data-state="recognizing"] .draw__status { color: var(--link); }
.draw[data-state="recognized"] .draw__status { color: var(--ink); }
.draw[data-state="unreadable"] .draw__status,
.draw[data-state="ratelimited"] .draw__status,
.draw[data-state="busy"] .draw__status,
.draw[data-state="retry"] .draw__status { color: var(--danger); }

@media (max-width: 40rem) {
  .draw__canvas { max-width: 100%; }
  .draw__bar { align-items: stretch; }
  .draw__bar button { flex: 1 1 auto; }
  .draw__status { flex-basis: 100%; }
}

/* ── guided drill (assignment_new) ─────────────────────────────────────────── */
.header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.field--narrow { max-width: 16rem; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; line-height: 1.5; white-space: nowrap; }
.badge--level { background: var(--accent-soft, #e6efff); color: var(--accent-strong, #1b4bb3); }
.badge--muted { background: #eee; color: #666; }
[data-audience-row] { display: flex; align-items: center; gap: .5rem; }
[data-audience-row] .audience-row__name { flex: 1 1 auto; }
.check-row { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; }
.subtopic-grid { display: grid; gap: .15rem; margin-top: .35rem; }
.notice--warning { border-left: 4px solid #c9922b; background: #fdf6e8; }

/* ── guided drill: readable preview items on the WHITE review sheet (not the dark tray) ─────────── */
.page--drill { padding-bottom: 7rem; }                 /* clear the sticky publish bar */
.drill-item { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.drill-item__body { min-width: 0; flex: 1 1 auto; }
.drill-item__meta { display: block; color: var(--ink-secondary); font-size: .72rem; font-weight: 650; margin-bottom: .3rem; }
.drill-item__text { max-width: 60ch; margin: 0; color: var(--ink); font-size: .95rem; line-height: 1.55; white-space: normal; }
.drill-item__text span { color: inherit; font-weight: inherit; font-size: inherit; }  /* keep math spans readable */
.drill-item__actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.drill-item__actions button { min-height: 2rem; padding: .25rem .55rem; border: 1px solid var(--rule-strong); border-radius: .4rem; background: var(--surface); color: var(--ink); font-size: .78rem; cursor: pointer; }
.drill-item__actions button:hover { background: var(--surface-subtle); }
.drill-item__actions button:disabled { opacity: .5; cursor: default; }
.drill-item__actions [data-remove] { color: #b3261e; border-color: #e6b4af; }
.drill-spares { display: none; }
.ack-panel { margin: .5rem 0 1rem; padding: .75rem 1rem; border: 1px solid #d9b877; background: #fdf6e8; border-radius: .5rem; }
.ack-panel .check-row { align-items: flex-start; }

@media (max-width: 640px) {
  .drill-item { flex-direction: column; gap: .6rem; }
  .drill-item__actions { justify-content: flex-start; width: 100%; }
  .subtopic-grid { grid-template-columns: 1fr; }
  [data-audience-row] { flex-wrap: wrap; }
}

/* ── printable worksheet + answer key (assignment_print) ───────────────────────────────────────── */
.page--print { max-width: 60rem; }
.print-header { align-items: flex-start; }
.print-sheet { background: var(--surface); border: 1px solid var(--rule); border-radius: .5rem; padding: 2rem; }
.print-sheet__title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 1rem; padding-bottom: .75rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--ink); }
.print-sheet__title h2 { margin: 0; }
.print-sheet__title span { color: var(--ink-secondary); font-size: .85rem; }
.print-questions { margin: 0; padding-left: 1.6rem; display: grid; gap: 1.5rem; }
.print-question { color: var(--ink); }
.print-question__text { line-height: 1.6; }
.print-question__text span { color: inherit; font-weight: inherit; }
.print-question__figure { margin: .5rem 0; }
.print-question__figure svg { max-width: 100%; height: auto; }
.print-question__answer { margin: .5rem 0 0; }
.print-answer-label { font-weight: 700; color: var(--ink-secondary); margin-right: .35rem; }
.print-question__space { height: 3.5rem; border-bottom: 1px dotted var(--rule-strong); }
@media print {
  .app-header, .skip-link, [data-noprint] { display: none !important; }
  .print-sheet { border: 0; border-radius: 0; padding: 0; }
  .page--print { max-width: none; }
  .print-question { break-inside: avoid; }
  .print-question__space { border-bottom: 1px solid #000; }
}
.actions--wrap { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.composer-publish__actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.badge--overdue { background: #fbe6e4; color: #b3261e; font-weight: 650; }

/* ── three-state skill map (teacher's student profile) ─────────────────────────────────────────── */
.skill-map { padding: 1.25rem; display: grid; gap: 1rem; }
.skill-map__bar { height: .5rem; border-radius: 999px; background: var(--surface-subtle); overflow: hidden; }
.skill-map__bar span { display: block; height: 100%; border-radius: 999px; background: #2e7d32; transition: width .4s ease; }
.skill-map__next { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: var(--accent-soft, #f1fbd7); border-radius: .5rem; }
.skill-map__next-label { font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-secondary); margin-right: .35rem; }
.skill-map__list { margin: 0; padding: 0; list-style: none; display: grid; }
.skill-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .55rem 0; border-top: 1px solid var(--rule); }
.skill-row:first-child { border-top: 0; }
.skill-row__dot { text-align: center; font-weight: 750; }
.skill-row--mastered .skill-row__dot { color: #2e7d32; }
.skill-row--learning .skill-row__dot { color: #b57a00; }
.skill-row--new .skill-row__dot { color: var(--ink-tertiary); }
.skill-row__name { font-weight: 650; }
.skill-row--new .skill-row__name { color: var(--ink-secondary); font-weight: 500; }
.skill-row__meta { color: var(--ink-secondary); font-size: .8rem; white-space: nowrap; }
@media (max-width: 640px) { .skill-row { grid-template-columns: 1.6rem minmax(0, 1fr); } .skill-row__meta { grid-column: 2; white-space: normal; } }

/* honor reduced-motion globally (adopted pattern: shorten transitions, kill loops) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── confirm dialog (Cancel focused; native <dialog>) ─────────────────────────────────────────── */
.confirm-dialog { max-width: 26rem; border: 1px solid var(--rule); border-radius: .75rem; padding: 1.5rem; }
.confirm-dialog::backdrop { background: rgb(23 23 35 / 45%); }
.confirm-dialog h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.confirm-dialog p { margin: 0 0 1rem; color: var(--ink-secondary); }
.confirm-dialog__actions { display: flex; gap: .5rem; justify-content: flex-end; }
.overdue-link { color: #b3261e; font-weight: 750; }

/* ── classes (cohorts) ─────────────────────────────────────────────────────────────────────────── */
.badge--class { background: #e8e6fb; color: #4838a8; margin-left: .35rem; }
.bulk-bar__actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.class-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.class-chip { padding: .3rem .7rem; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); font-size: .8rem; font-weight: 650; cursor: pointer; }
.class-chip:hover { background: var(--surface-subtle); }
.class-chip small { color: var(--ink-secondary); font-weight: 500; }
.student-classes { margin: .2rem 0 0; }
.student-classes .badge--class { margin-left: 0; margin-right: .35rem; display: inline-flex; align-items: center; gap: .25rem; }
.chip-remove { display: inline; }
.chip-remove button { border: 0; background: none; color: inherit; font-size: .9rem; line-height: 1; cursor: pointer; padding: 0 .1rem; }
.badge--due-soon { background: #fdf0d5; color: #8a5a00; font-weight: 650; }

/* ── pilot handoff: publish-success + first-run empty states ───────────────────────────────────── */
.handoff-steps { margin: 0 0 1rem; padding-left: 1.4rem; display: grid; gap: .4rem; }
.handoff-steps li { line-height: 1.55; }
.empty-state--inline { padding: 1rem; border: 1px dashed var(--rule-strong); border-radius: .5rem; margin-top: .5rem; }
.empty-state--inline p { margin: 0 0 .5rem; }
.technical-details summary { cursor: pointer; color: var(--ink-secondary); font-size: .85rem; }
