:root {
  color-scheme: light;
  scrollbar-gutter: stable;
  font: 100%/1.52 "Segoe UI", system-ui, sans-serif;
  --display: Georgia, "Times New Roman", serif;
  --ink: #252a24;
  --muted: #535b50;
  --primary: #a43a20;
  --primary-hover: #802a16;
  --soft: #f7e8de;
  --line: #d8d9cd;
  --field-line: #83897b;
  --paper: #fffef9;
  --canvas: #f7f6f0;
  --surface-muted: #f1f2e9;
  --sage: #e6ebdc;
  --sage-ink: #384b38;
  --control-radius: 6px;
  --panel-radius: 10px;
  --panel-shadow: none;
  --control-height: 44px;
  --panel-space: clamp(18px, 2.25vw, 34px);
  --title-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --record-title-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem);
  --course-title-size: var(--record-title-size);
  --focus: #10538a;
  --good: #28543b;
  --danger: #952c36;
  --action-danger: #982c35;
  --answer-partial-text: #794c12;
  --gutter: clamp(16px, 4.5vw, 72px);
  --content-max: 1280px;
  --rail: clamp(195px, 16vw, 228px);
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
body, form { margin: 0; }

/* Keep native disclosure and keyboard behavior. Only the revealed content moves. */
@supports (interpolate-size: allow-keywords) and selector(details::details-content) and (transition-behavior: allow-discrete) {
  @media (prefers-reduced-motion: no-preference) {
    :is(.access-help, .catalog-help, .roster-filter-options, .results-summary)::details-content {
      interpolate-size: allow-keywords;
      block-size: 0;
      overflow: clip;
      overflow-clip-margin: 4px;
      transition: block-size 160ms ease-out, content-visibility 160ms allow-discrete;
    }
    :is(.access-help, .catalog-help, .roster-filter-options, .results-summary)[open]::details-content {
      block-size: auto;
    }
  }
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button, summary, .button { cursor: pointer; }
button:disabled { opacity: .58; cursor: default; }
a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, currentColor 72%, transparent);
  text-underline-offset: .2em;
  text-decoration-skip-ink: auto;
}
a:hover, a:focus-visible { text-decoration-color: currentColor; }
a:hover { color: var(--primary-hover); }
::selection { background: #f0d4bc; color: var(--ink); }
input, textarea { caret-color: var(--primary); }
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
main:focus { outline: 0; }
.skip { position: fixed; top: 8px; left: 12px; z-index: 10; padding: 9px 16px; background: var(--paper); transform: translateY(-160%); border-radius: 6px; }
.skip:focus { transform: translateY(0); }
.icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; vertical-align: -.18em; }
h1, h2, h3, h4 { text-wrap: balance; color: var(--ink); overflow-wrap: anywhere; }
h1 { margin: 0 0 22px; font-size: var(--title-size); font-weight: 660; letter-spacing: -.037em; line-height: 1.18; }
h2 { margin: 0 0 14px; font-size: clamp(1.15rem, 1.7vw, 1.45rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.3; }
h3 { margin: 0 0 8px; font-size: 1.06rem; font-weight: 650; line-height: 1.4; }
p { margin: 0 0 .85em; color: var(--muted); }
small, td small, .org-row small { display: block; color: var(--muted); font-size: .825rem; }
label { display: block; font-weight: 600; }
label > :is(input:not([type=radio]):not([type=checkbox]), textarea, select) { display: block; margin-top: 5px; }
input:not([type=radio]):not([type=hidden]):not([type=checkbox]), select, textarea {
  width: 100%; min-height: var(--control-height); padding: 9px 12px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--field-line); border-radius: var(--control-radius);
  font-weight: 400;
}
::placeholder { color: #686d7b; opacity: 1; }
textarea { resize: vertical; }
input[type=radio], input[type=checkbox] { accent-color: var(--primary); }
input[type=radio] { flex: none; width: 17px; height: 17px; }
input[type=number] { max-width: 130px; }
.primary, .secondary, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--control-height); padding: .62rem 1rem; border: 1px solid transparent; border-radius: var(--control-radius);
  font-size: .9rem; font-weight: 600; line-height: 1.38; text-align: center; text-decoration: none;
}
/* Keep feedback inside the existing hit area. */
.primary { box-shadow: none; background: var(--primary); color: #fff; }
.primary:not(:disabled):hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.secondary { background: var(--paper); border-color: var(--field-line); color: var(--ink); }
.secondary:not(:disabled):not([aria-disabled="true"]):hover { background: var(--soft); border-color: var(--primary); color: var(--primary-hover); text-decoration: none; }
@media (prefers-reduced-motion: no-preference) {
  :where(.primary, .secondary, .session-logout) {
    transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
  }
  :is(.access-form, .course-main, .editor-actions) .primary {
    transition: scale 130ms cubic-bezier(.2, 0, 0, 1), background-color 120ms ease-out;
  }
  :is(.access-form, .course-main, .editor-actions) .primary:enabled:active { scale: .96; }
}
.textbtn, .actions button {
  padding: 7px 6px; border: 0; border-radius: var(--control-radius);
  background: transparent; color: var(--primary); text-decoration: none;
}
@media (hover: hover) {
  :is(.textbtn, .actions button):enabled:hover { color: var(--primary-hover); background: var(--soft); }
}
.message { padding: 12px 15px; margin: 0 0 18px; border: 1px solid #d8d4eb; border-radius: 9px; background: #f3f1fb; color: #463c81; }
.message:has(> .icon) { display: flex; align-items: flex-start; gap: 10px; }
.message > .icon { margin-top: .2em; }
.message.error { border-color: #e7b9c3; background: #fcf0f2; color: #86273c; }
.message.success { border-color: #b8d4c5; background: #edf7f1; color: var(--good); }
.workspace { min-height: 100vh; color: var(--ink); background: var(--canvas); font-size: .96rem; }
.workspace-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.workspace-bar, .work-content { width: min(var(--content-max), calc(100% - 2 * var(--gutter))); margin-inline: auto; min-width: 0; }
.workspace-bar { display: flex; align-items: stretch; justify-content: space-between; min-height: 64px; gap: 16px; }
.workspace-nav, .session-controls { display: flex; align-items: stretch; gap: 6px; }
.workspace-nav a { min-height: var(--control-height); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px;
  border: 1px solid transparent; border-radius: var(--control-radius); margin: 0; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .91rem; }
.workspace-nav a[aria-current] { font-weight: 700; color: var(--primary-hover); background: var(--soft); }
.workspace-nav { align-items: center; }
.session-controls { align-items: center; gap: 15px; font-size: .875rem; }
.session-role { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); }
.session-logout { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px;
  padding: 7px 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--control-radius); font-size: .875rem; font-weight: 600; }
.session-logout:hover { color: var(--primary); background: var(--soft); }
.work-content { margin-block: clamp(24px, 3.2vw, 46px) 56px; }
@media (max-width: 760px) {
  .workspace-bar { min-height: 56px; gap: 4px; }
  .workspace-nav { gap: 0; }
  .workspace-nav a { padding-inline: clamp(5px, 1.75vw, 12px); gap: 6px; }
  .tabs a { min-height: var(--control-height); }
  .workspace :is(input:not([type=radio]):not([type=checkbox]), select, textarea) { font-size: max(1rem, 16px); }
  .session-role { display: none; }
  .session-logout { width: var(--control-height); min-height: var(--control-height); padding: 0; }
  .session-logout span { display: none; }
}
@media (max-width: 500px) {
  .workspace-bar { width: calc(100% - 16px); }
  .workspace-nav a { font-size: .825rem; }
  .workspace-nav:has(a:nth-child(2)) a { flex-direction: column; gap: 2px; padding: 8px clamp(5px, 1.9vw, 10px); line-height: 1.2; }
  .workspace-nav:has(a:nth-child(2)) a .icon { display: none; }
}
@media (max-width: 340px) {
  .workspace-nav a { padding-inline: 4px; font-size: .78rem; }
}

.kicker, .back { display: block; color: var(--muted); margin: 0 0 9px; font-size: .8rem; font-weight: 550; }
.back { width: fit-content; margin-bottom: 15px; text-decoration: none; }
.heading, .toolbar, .filters, .pagination, .actions, .scores { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.heading { justify-content: space-between; margin: 22px 0 14px; }
.heading > *, .compact { margin: 0; }
.split { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap: 18px; align-items: start; }
.even { grid-template-columns: repeat(2,minmax(0,1fr)); }
.panel, .tablewrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--panel-radius); }
.panel { box-shadow: var(--panel-shadow); padding: var(--panel-space); margin: 0 0 18px; min-width: 0; }
.panel h2 { margin-bottom: 16px; }
.tint { background: #faf9fd; }
.stack { display: grid; gap: 16px; }
.stack > button { justify-self: start; }
.stack > p { margin: 0; }
.spaced { margin-top: 18px; }
.narrow-left, .wide-label, .quiz { max-width: 820px; }
.empty { padding: 18px 0 4px; }
.org-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.org-row b { margin-left: auto; color: var(--primary); }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; margin: 2px 0 22px; background: #eae9f2; border-radius: calc(var(--control-radius) + 4px); }
.tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 12px; color: var(--muted); font-size: .85rem; font-weight: 600; text-decoration: none; border-radius: var(--control-radius); }
.tabs a[aria-current] { background: #fff; color: var(--primary); box-shadow: 0 1px 3px #25283a14; }
.filters { align-items: flex-end; margin: 15px 0; }
.filters label { min-width: 160px; font-size: .8rem; }
.tablewrap { overflow-x: auto; }
.tablewrap table { border-collapse: collapse; width: 100%; text-align: left; font-variant-numeric: tabular-nums; }
.tablewrap th, .tablewrap td, .tablewrap caption { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--line); }
.tablewrap th { background: var(--surface-muted); color: var(--muted); font-size: .79rem; font-weight: 650; }
.tablewrap td { max-width: 34ch; overflow-wrap: anywhere; }
.tablewrap tbody tr:last-child td { border-bottom: 0; }
.tablewrap td strong { display: block; }
.tablewrap caption { font-size: .8rem; color: var(--muted); }
.pill { display: inline-block; border-radius: 5px; padding: 3px 9px; background: #edf0f5; color: #58657a; white-space: nowrap; font-size: .76rem; font-weight: 600; }
.done { background: #eaf5ef; color: #28684e; }
.started { background: var(--soft); color: var(--primary); }
.pagination { margin: 16px 0; }
.toolbar { padding: 14px; background: #f3f2f9; border: 1px solid var(--line); border-radius: 10px; }
.choice-editor { min-width: 0; border: 0; padding: 0; }
.choice-editor legend, .quiz legend { font-weight: 650; }
.choice-line, .option { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.choice-line input[type=text] { min-width: 60px; flex: 1; }
.quiz h2 { margin-top: 27px; }
.quiz fieldset { min-width: 0; }
.quiz legend { padding: 0 7px; color: var(--primary); font-size: .85rem; }
.option { min-height: var(--control-height); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--control-radius); font-weight: 450; cursor: pointer; }
.option:has(input:checked) { background: var(--soft); border-color: var(--primary); }
.mail { padding: 12px 18px; margin: 16px 0 22px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; }
.mail-line { padding: 8px 0; border-bottom: 1px solid var(--line); }
.mail-line:last-child { border: 0; }
.mail-line > div { white-space: pre-wrap; overflow-wrap: anywhere; }
.fragment { display: inline; color: var(--primary); cursor: pointer; }
.fragment input { vertical-align: middle; }
.fragment:has(input:checked) { color: var(--primary-hover); background: var(--soft); }
@media (hover: hover) {
  .fragment:hover { color: var(--primary-hover); background: var(--surface-muted); }
}
.scores { align-items: stretch; gap: 0; margin: 20px 0; padding: 15px 0; border-block: 1px solid var(--line); }
.scores > div { min-width: 106px; padding: 3px 20px; border-left: 1px solid var(--line); }
.scores > div:first-child { border: 0; padding-left: 0; }
.scores strong { font-size: 1.75rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.score .pill { margin-bottom: 12px; }
summary { color: var(--primary); }
.actions { gap: 3px; }

@media (max-width: 950px) {
  .split { grid-template-columns: minmax(0,1fr); gap: 0; }
}
@media (max-width: 760px) {
  .panel { padding: 18px; }
  .filters > * { flex: 1; }
  .toolbar > * { width: 100%; }
  .choice-line { gap: 4px; }
  .tablewrap table { min-width: 690px; }
  .tablewrap td:first-child { min-width: 165px; }
  .tablewrap :is(th,td) { overflow-wrap: normal; }
  .tablewrap td small { overflow-wrap: anywhere; }
  .scores > div { min-width: 0; padding-inline: 12px; }
}
@media (forced-colors: active) {
  .primary, .workspace-nav a[aria-current], .tabs a[aria-current] { border: 1px solid ButtonText; }
}

/* The type and colours are shared by the signed-in and signed-out surfaces. */
.platform-name {
  display: inline-block;
  color: var(--ink);
  font: bold 1.6rem/1.1 var(--display);
  letter-spacing: -.055em;
  white-space: nowrap;
}
.platform-name .platform-role { font-weight: 400; }
.workspace { font-size: 1rem; }
.workspace h1, .access h1, .material-reader h1 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.025em;
  text-wrap: pretty;
}
.primary { padding-inline: 20px; }
.secondary { background: transparent; }
:where(.workspace,.access) :is(input, select, textarea) { font-size: 1rem; }
.course-meta, .mast-context {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  color: var(--muted); font-size: .86rem;
}
.course-meta > span {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--sage-ink); font-weight: 650;
}
.course-meta .icon { width: 17px; height: 17px; }
.access .primary:focus-visible, .workspace .primary:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 3px;
}
a, button, label, dt, dd { overflow-wrap: anywhere; }
@media (forced-colors: active) {
  :where(a,button,input,select,textarea,summary):focus-visible { outline-color: Highlight; }
}
