:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #1c1f24;
  --muted: #5f6874;
  --faint: #9299a3;
  --line: #dde2e8;
  --primary: #4b2e83;
  --primary-dark: #372163;
  --gold: #b38b2d;
  --clinical-blue: #256d85;
  --ok: #2f7a4d;
  --warn: #a46f18;
  --bad: #b23a3a;
  --shadow: 0 10px 28px rgba(28, 31, 36, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

h1,
h2,
p,
ol {
  margin: 0;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  display: grid;
  width: 100%;
  max-width: 420px;
  gap: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.system-mark {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 750;
}

.login-brand,
.brand-lockup {
  min-width: 0;
}

.login-brand > div,
.brand-lockup > div {
  min-width: 0;
}

.login-card h1,
.action-row h1,
.panel h1 {
  font-size: 20px;
  line-height: 1.25;
}

.login-card p,
.helper-text {
  color: var(--muted);
}

.company-home-link {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-underline-offset: 3px;
}

.company-home-link:hover,
.company-home-link:focus-visible {
  color: var(--primary);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(28, 31, 36, 0.02);
}

.brand {
  font-weight: 750;
  letter-spacing: 0;
}

.subbrand {
  color: var(--muted);
  font-size: 12px;
}

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

.status,
.meta,
.sources,
.badge,
.review-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.status {
  color: var(--muted);
}

.workspace {
  width: min(1040px, calc(100vw - 32px));
  margin: 24px auto 48px;
}

.role-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-width: auto;
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.action-row,
.control-row,
.answer-zone {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.control-row {
  grid-template-columns: minmax(240px, 1fr) 140px 170px 96px auto;
}

.practice-controls {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 96px auto;
  gap: 12px;
  align-items: end;
  justify-content: end;
}

.practice-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.progress-copy strong {
  color: var(--text);
}

.progress-track {
  display: flex;
  gap: 4px;
  min-height: 8px;
}

.progress-segment {
  flex: 1;
  border-radius: 999px;
  background: var(--line);
}

.progress-segment.current {
  background: var(--clinical-blue);
}

.progress-segment.correct {
  background: var(--ok);
}

.progress-segment.incorrect {
  background: var(--bad);
}

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

#practiceSession {
  scroll-margin-top: 72px;
}

.session-bar strong {
  display: block;
  font-size: 18px;
}

.practice-completion {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 640px;
  margin: 52px auto;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ok);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: var(--shadow);
}

.practice-completion strong {
  font-size: 30px;
  line-height: 1.15;
}

.practice-completion p {
  color: var(--muted);
}

.practice-completion:focus {
  outline: 3px solid rgba(37, 109, 133, 0.16);
  outline-offset: 2px;
}

.answer-zone {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 16px;
}

.student-dashboard {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.readiness-card,
.domain-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.readiness-card {
  display: grid;
  align-items: center;
  border-top: 4px solid var(--clinical-blue);
}

.dashboard-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.dashboard-intro h1 {
  margin-bottom: 4px;
  font-size: 26px;
  line-height: 1.2;
}

.training-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.training-metric {
  display: grid;
  min-height: 92px;
  align-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--clinical-blue);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.training-metric:nth-child(2) {
  border-top-color: var(--gold);
}

.training-metric:nth-child(3) {
  border-top-color: var(--ok);
}

.training-metric:nth-child(4) {
  border-top-color: var(--primary);
}

.training-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.training-metric strong {
  font-size: 26px;
  line-height: 1;
}

.dashboard-columns,
.training-operations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.dashboard-columns {
  margin-bottom: 14px;
}

.dashboard-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.dashboard-section h1 {
  font-size: 20px;
  line-height: 1.25;
}

.dashboard-section h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.dashboard-wide {
  margin-bottom: 16px;
}

.assignment-list,
.curriculum-list,
.performance-list,
.cohort-list,
.assignment-admin-list {
  display: grid;
}

.assignment-row,
.admin-training-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.assignment-row:first-child,
.admin-training-row:first-child,
.curriculum-row:first-child,
.performance-row:first-child {
  border-top: 0;
  padding-top: 2px;
}

.assignment-row > div:first-child,
.admin-training-row > div:first-child,
.admin-training-result {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.assignment-row > div:first-child > span,
.admin-training-row span,
.assignment-result {
  color: var(--muted);
  font-size: 12px;
}

.assignment-row-head,
.curriculum-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.state-badge {
  flex: none;
  border-radius: 999px;
  background: #f2f4f6;
  color: var(--muted);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.state-badge.completed {
  background: #eef8f2;
  color: var(--ok);
}

.state-badge.in_progress {
  background: #eef7fa;
  color: var(--clinical-blue);
}

.state-badge.overdue {
  background: #fff0f0;
  color: var(--bad);
}

.training-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.training-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--clinical-blue);
}

.curriculum-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 0;
  text-align: left;
}

.curriculum-row:hover {
  background: #fafbfc;
}

.curriculum-row > div {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.curriculum-row-head span,
.module-percent,
.module-sequence {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.module-sequence {
  color: var(--clinical-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.module-percent {
  text-align: right;
}

.performance-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(160px, 0.8fr) 56px;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.performance-row > div:first-child {
  display: grid;
  gap: 2px;
}

.performance-row > div:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.performance-score {
  text-align: right;
}

.training-empty {
  display: grid;
  min-height: 110px;
  align-content: center;
  gap: 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 16px 0;
}

.training-empty strong {
  color: var(--text);
}

.training-stat-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.training-operations {
  margin-bottom: 14px;
}

.training-form {
  display: grid;
  gap: 12px;
}

.training-form > button {
  justify-self: end;
}

.date-fields,
.assignment-fields {
  display: grid;
  gap: 10px;
}

.date-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assignment-fields {
  grid-template-columns: 100px 110px minmax(170px, 1fr);
}

.admin-training-result {
  justify-items: end;
  text-align: right;
}

.study-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
}

.path-summary {
  display: grid;
  justify-items: end;
  min-width: 124px;
}

.path-summary strong {
  color: var(--primary);
  font-size: 30px;
  line-height: 1;
}

.path-summary span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.learning-continue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  min-height: 150px;
  margin-bottom: 24px;
  border: 1px solid #cfdde2;
  border-left: 5px solid var(--clinical-blue);
  border-radius: 8px;
  background: #f3f8fa;
  padding: 24px 26px;
}

.learning-continue > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.learning-continue h2 {
  font-size: 24px;
  line-height: 1.25;
}

.learning-continue p {
  color: var(--text);
}

.learning-continue-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.learning-map {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.phase-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(148px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.phase-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  min-width: 148px;
  min-height: 82px;
  gap: 4px 10px;
  align-content: center;
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.phase-button > span:first-child {
  grid-row: 1 / 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eaf3f6;
  color: var(--clinical-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.phase-button strong {
  overflow-wrap: break-word;
  font-size: 12px;
  line-height: 1.25;
}

.phase-button > span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.phase-button:hover,
.phase-button.active {
  border-color: rgba(37, 109, 133, 0.48);
  background: #f7fbfc;
}

.phase-button.active {
  box-shadow: inset 0 3px 0 var(--clinical-blue);
}

.learning-phase-panel {
  padding-bottom: 30px;
}

.learning-phase-heading {
  align-items: end;
  margin-bottom: 16px;
}

.learning-phase-heading h2 {
  margin: 2px 0;
  font-size: 22px;
}

.learning-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.learning-module-card {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 184px;
  gap: 9px;
  align-content: start;
  border-color: var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 18px;
  text-align: left;
}

.learning-module-card:hover {
  border-color: rgba(75, 46, 131, 0.38);
  background: #fbfafc;
  box-shadow: 0 8px 20px rgba(28, 31, 36, 0.06);
}

.learning-module-card.complete {
  border-top: 3px solid var(--ok);
}

.learning-module-card.in_progress {
  border-top: 3px solid var(--clinical-blue);
}

.learning-module-card.preview {
  border-top: 3px solid var(--gold);
}

.learning-module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.learning-module-card-head > span:first-child,
.learning-card-status,
.learning-module-card-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.learning-card-status {
  border-radius: 999px;
  background: #eef1f4;
  padding: 3px 7px;
}

.learning-module-card.complete .learning-card-status {
  background: #eaf5ef;
  color: var(--ok);
}

.learning-module-card.in_progress .learning-card-status {
  background: #eaf3f6;
  color: var(--clinical-blue);
}

.learning-module-card > strong {
  font-size: 17px;
  line-height: 1.3;
}

.learning-module-card-copy {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.learning-module-card .training-progress {
  align-self: end;
  margin-top: 3px;
}

.learning-back {
  width: auto;
  min-width: 0;
  min-height: 34px;
  margin-bottom: 12px;
  border: 0;
  background: transparent;
  color: var(--primary);
  padding: 0;
  font-size: 13px;
  text-align: left;
}

.learning-back::before {
  margin-right: 7px;
  content: "←";
}

.learning-module-detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.learning-module-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  padding: 28px 30px 22px;
}

.learning-module-head h1 {
  margin: 3px 0 5px;
  font-size: 28px;
  line-height: 1.25;
}

.learning-module-head h1:focus,
.learning-lesson-head h1:focus,
.learning-lesson-content h2:focus {
  outline: none;
}

.learning-status {
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
}

.learning-status.complete {
  background: #eaf5ef;
  color: var(--ok);
}

.learning-status.in_progress {
  background: #eaf3f6;
  color: var(--clinical-blue);
}

.learning-status.preview {
  background: #fff7e6;
  color: var(--warn);
}

.learning-module-progress {
  display: grid;
  grid-template-columns: minmax(210px, 0.55fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: #f8fafb;
  padding: 16px 30px;
}

.learning-module-progress > div:first-child {
  display: grid;
  gap: 2px;
}

.learning-module-progress strong {
  font-size: 14px;
}

.learning-module-progress span {
  color: var(--muted);
  font-size: 12px;
}

.learning-module-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.learning-module-stats > div {
  display: grid;
  gap: 2px;
  padding: 14px 30px;
}

.learning-module-stats > div + div {
  border-left: 1px solid var(--line);
}

.learning-module-stats span {
  color: var(--muted);
  font-size: 11px;
}

.learning-module-stats strong {
  font-size: 15px;
}

.learning-module-columns {
  display: grid;
  grid-template-columns: minmax(250px, 0.78fr) minmax(0, 1.22fr);
  gap: 0;
  padding: 26px 30px;
}

.learning-objectives-panel,
.learning-activity-panel {
  min-width: 0;
}

.learning-objectives-panel {
  padding-right: 30px;
}

.learning-activity-panel {
  border-left: 1px solid var(--line);
  padding-left: 30px;
}

.learning-objectives-panel h2,
.learning-activity-panel h2 {
  margin: 3px 0 14px;
  font-size: 17px;
}

.learning-objectives-panel ol {
  display: grid;
  gap: 11px;
  margin: 0;
  padding-left: 22px;
}

.learning-activity-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.learning-activity-row:first-child {
  border-top: 0;
}

.learning-activity-row > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.learning-activity-row > div span {
  color: var(--muted);
  font-size: 12px;
}

.activity-sequence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef1f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.learning-activity-row.complete .activity-sequence {
  background: #eaf5ef;
  color: var(--ok);
}

.learning-activity-row.in_progress .activity-sequence {
  background: #eaf3f6;
  color: var(--clinical-blue);
}

.learning-activity-type {
  color: var(--primary);
  font-size: 10px !important;
  font-weight: 800;
  text-transform: uppercase;
}

.learning-module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  background: #f8fafb;
  padding: 18px 30px;
}

.learning-module-footer p {
  color: var(--muted);
  font-size: 13px;
}

.learning-lesson-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 610px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.learning-lesson-rail {
  display: grid;
  align-content: start;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
  padding: 24px 18px;
}

.learning-lesson-rail > div {
  display: grid;
  gap: 7px;
}

.learning-lesson-rail strong {
  font-size: 14px;
}

.learning-lesson-nav {
  display: grid;
  gap: 4px;
}

.learning-lesson-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  min-width: 0;
  min-height: 42px;
  gap: 8px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 7px;
  text-align: left;
}

.learning-lesson-step > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8ecef;
  font-size: 10px;
}

.learning-lesson-step > span:last-child {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.learning-lesson-step:hover,
.learning-lesson-step.active {
  background: #eef4f6;
  color: var(--text);
}

.learning-lesson-step.active {
  box-shadow: inset 3px 0 0 var(--clinical-blue);
}

.learning-lesson-step.active > span:first-child,
.learning-lesson-step.visited > span:first-child {
  background: var(--clinical-blue);
  color: #fff;
}

.learning-lesson-player {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

.learning-lesson-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 24px 30px 20px;
}

.learning-lesson-head h1 {
  margin: 3px 0 4px;
  font-size: 22px;
}

.learning-lesson-content {
  max-width: 800px;
  min-height: 390px;
  padding: 46px 44px;
}

.learning-content-label {
  display: block;
  margin-bottom: 8px;
  color: var(--clinical-blue);
  font-size: 12px;
  font-weight: 800;
}

.learning-lesson-content h2 {
  margin-bottom: 16px;
  font-size: 28px;
  line-height: 1.25;
}

.learning-lesson-lead,
.learning-concept-copy,
.learning-section-copy {
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}

.learning-section-bullets {
  display: grid;
  gap: 9px;
  margin: 22px 0 0;
  padding-left: 22px;
  line-height: 1.55;
}

.learning-formula-callout {
  margin-top: 22px;
  border-left: 3px solid var(--clinical-blue);
  background: #f2f7f8;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}

.learning-worked-example {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 18px;
}

.learning-worked-example > span,
.learning-safety-note > span,
.learning-reference-list > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.learning-worked-example ol {
  display: grid;
  gap: 7px;
  margin: 4px 0 0;
  padding-left: 22px;
}

.learning-safety-note {
  display: grid;
  gap: 4px;
  margin-top: 24px;
  border-left: 3px solid var(--bad);
  background: #fff7f7;
  padding: 14px 16px;
}

.learning-safety-note strong {
  font-size: 14px;
  line-height: 1.5;
}

.learning-reference-list {
  display: grid;
  gap: 5px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.learning-reference-list strong {
  font-size: 12px;
  font-weight: 650;
}

.learning-lesson-objectives,
.learning-recap-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding-left: 24px;
}

.learning-source-note,
.learning-next-callout {
  display: grid;
  gap: 2px;
  margin-top: 28px;
  border-left: 3px solid var(--gold);
  background: #fffbf2;
  padding: 13px 15px;
}

.learning-source-note span,
.learning-next-callout span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.learning-source-note strong,
.learning-next-callout strong {
  font-size: 13px;
}

.learning-lesson-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #f8fafb;
  padding: 16px 30px;
}

.learning-lesson-actions .primary {
  margin-left: auto;
}

.calculation-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.calculation-header h1 {
  margin: 3px 0 4px;
  font-size: 26px;
  line-height: 1.2;
}

.mode-control {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #eef1f4;
}

.mode-button {
  min-width: 88px;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.mode-button.active {
  background: var(--panel);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(28, 31, 36, 0.12);
}

.calculation-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 500px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.calculation-menu {
  display: grid;
  align-content: start;
  gap: 16px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
  padding: 18px;
}

.calculation-menu > button {
  width: 100%;
}

.calculation-exercise-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.calculation-exercise-meta strong {
  color: var(--text);
  font-size: 14px;
}

.calculation-workspace {
  min-width: 0;
  padding: 28px;
}

.calculation-empty {
  display: grid;
  min-height: 430px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  text-align: center;
}

.calculation-empty strong {
  color: var(--text);
  font-size: 18px;
}

.calculation-scenario-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

#calculationPrompt {
  max-width: 760px;
  margin: 8px 0 22px;
  font-size: 22px;
  line-height: 1.38;
}

.calculation-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.calculation-values > div {
  border-left: 3px solid var(--clinical-blue);
  background: #f7fafb;
  padding: 12px;
}

.calculation-values dt,
.calculation-values dd {
  margin: 0;
}

.calculation-values dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.calculation-values dd {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 750;
}

.formula-callout {
  margin: 18px 0;
  border-left: 3px solid var(--gold);
  background: #fffbf2;
  color: var(--text);
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.calculation-answer {
  display: grid;
  grid-template-columns: minmax(180px, 320px) auto;
  gap: 12px;
  align-items: end;
  margin-top: 20px;
}

.answer-input-wrap {
  position: relative;
  display: block;
}

.answer-input-wrap input {
  padding-right: 68px;
}

.answer-input-wrap > span {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 12px;
  transform: translateY(-50%);
}

.calculation-result {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.calculation-verdict {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
}

.calculation-verdict.correct {
  color: var(--ok);
}

.calculation-verdict.incorrect {
  color: var(--bad);
}

.calculation-mastery {
  margin: 0 0 18px;
  border-left: 3px solid var(--gold);
  background: #fffbf2;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.calculation-mastery.complete {
  border-left-color: var(--ok);
  background: #f2faf6;
}

#calculationWorkedSteps ol {
  display: grid;
  gap: 7px;
  padding-left: 22px;
}

.calculation-return {
  width: auto;
  margin-top: 20px;
}

.curriculum-admin-band {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.curriculum-admin-band h2 {
  color: var(--text);
  font-size: 18px;
}

.admin-curriculum-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.55fr);
  gap: 24px;
}

.admin-phase-list,
.abcp-coverage-panel > div {
  display: grid;
}

.admin-phase-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  min-height: 54px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.admin-phase-row:first-child,
.abcp-coverage-row:first-child {
  border-top: 0;
}

.admin-phase-row > span {
  color: var(--clinical-blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.admin-phase-row > div {
  display: grid;
  gap: 2px;
}

.admin-phase-row > div span {
  color: var(--muted);
  font-size: 12px;
}

.abcp-coverage-panel {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.abcp-coverage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 0;
}

.abcp-coverage-row strong {
  color: var(--text);
  text-align: right;
}

.study-toolbar {
  margin-bottom: 14px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
}

.study-toolbar h1 {
  margin-bottom: 4px;
  font-size: 22px;
}

.readiness-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}

.readiness-card p {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mastery-empty {
  grid-column: 1 / -1;
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 18px;
  color: var(--muted);
}

.mastery-empty strong {
  color: var(--text);
}

.domain-card {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 118px;
  gap: 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.domain-card:hover {
  border-color: rgba(37, 109, 133, 0.45);
  background: #fbfdfe;
}

.domain-card-head,
.domain-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.domain-card-head strong {
  font-size: 14px;
  line-height: 1.3;
}

.domain-card-head span {
  flex: none;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}

.domain-card.strong .domain-card-head span {
  background: #eef8f2;
  color: var(--ok);
}

.domain-card.building .domain-card-head span {
  background: #fff7ea;
  color: var(--warn);
}

.domain-card.needs-work .domain-card-head span {
  background: #fff0f0;
  color: var(--bad);
}

.domain-card.not-started .domain-card-head span {
  background: #f3f5f7;
  color: var(--muted);
}

.mastery-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.mastery-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--clinical-blue);
}

.domain-card.strong .mastery-bar span {
  background: var(--ok);
}

.domain-card.building .mastery-bar span {
  background: var(--warn);
}

.domain-card.needs-work .mastery-bar span {
  background: var(--bad);
}

.domain-card-foot {
  color: var(--muted);
  font-size: 12px;
}

.generated-results {
  display: grid;
  gap: 14px;
}

.generated-panel {
  display: grid;
  gap: 14px;
}

.generated-list {
  display: grid;
  gap: 14px;
}

.generated-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.count-field input {
  text-align: center;
}

input,
select,
button {
  border-radius: 6px;
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0 11px;
}

textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  border-color: rgba(75, 46, 131, 0.55);
  outline: 3px solid rgba(75, 46, 131, 0.12);
}

button {
  min-height: 40px;
  min-width: 144px;
  border: 1px solid var(--primary);
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

button.primary {
  background: var(--primary);
  color: white;
}

button.primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--primary);
}

button.danger {
  border-color: rgba(178, 58, 58, 0.45);
  background: #fff;
  color: var(--bad);
}

button.danger:hover:not(:disabled) {
  border-color: var(--bad);
  background: rgba(178, 58, 58, 0.06);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  padding: 0 14px;
  font-weight: 700;
  text-decoration: none;
}

.button-link:hover {
  border-color: rgba(75, 46, 131, 0.38);
  background: #faf8ff;
}

button.compact {
  min-width: auto;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

button:disabled {
  border-color: #c9ced3;
  background: #d9dde1;
  color: #6d747c;
  cursor: not-allowed;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

#questionHeading:focus {
  outline: none;
}

.panel + .panel,
.view + .panel {
  margin-top: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.review-filter {
  min-width: 165px;
}

.review-filter select {
  min-height: 34px;
}

h2 {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.question-text {
  min-height: 70px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.48;
}

.question-text.loading-message {
  display: flex;
  align-items: baseline;
  gap: 1px;
  color: var(--muted);
  font-weight: 650;
}

.loading-dots {
  display: inline-flex;
  min-width: 18px;
}

.loading-dots span {
  animation: loadingDot 1.1s infinite ease-in-out;
  opacity: 0.18;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes loadingDot {
  0%,
  70%,
  100% {
    opacity: 0.18;
  }
  35% {
    opacity: 1;
  }
}

.expected,
.choices,
.sources {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.choices {
  display: grid;
  gap: 8px;
}

.choice {
  display: grid;
  grid-template-columns: 18px 34px 1fr;
  gap: 10px;
  align-items: start;
  min-height: 46px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.choice:hover {
  border-color: rgba(75, 46, 131, 0.35);
}

.choice input {
  min-height: auto;
  margin: 4px 0 0;
  padding: 0;
}

.choice-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  background: #f0edf7;
  color: var(--primary);
  font-weight: 800;
}

.choice-text {
  overflow-wrap: anywhere;
}

.generated-choice input {
  display: none;
}

.generated-choices .generated-choice {
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: auto;
  cursor: default;
}

.generated-choices .generated-choice:hover {
  border-color: var(--line);
}

.generated-choices .generated-choice .choice-text {
  overflow-wrap: break-word;
  word-break: normal;
}

.choice.selected {
  border-color: rgba(75, 46, 131, 0.55);
  background: #faf8ff;
}

.choice.correct {
  border-color: rgba(47, 122, 77, 0.48);
  background: #f5faf7;
}

.choice.incorrect {
  border-color: rgba(178, 58, 58, 0.42);
  background: #fff7f7;
}

.choice.locked {
  cursor: default;
}

.choice.locked input {
  cursor: default;
}

.feedback-panel {
  margin-top: 16px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
}

.feedback-verdict {
  margin-bottom: 6px;
  font-weight: 800;
}

.feedback-verdict.correct {
  color: var(--ok);
}

.feedback-verdict.partial {
  color: var(--warn);
}

.feedback-verdict.incorrect {
  color: var(--bad);
}

#feedbackWhy {
  color: var(--text);
}

.sources summary {
  color: var(--muted);
  cursor: pointer;
}

.source-item {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.source-item:last-child {
  border-bottom: 0;
}

.source-title {
  color: var(--text);
}

.source-meta {
  color: var(--muted);
}

.review-list,
.user-list {
  display: grid;
  gap: 10px;
}

.admin-stat-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.admin-stat.attention strong {
  color: var(--bad);
}

.admin-stat {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.admin-stat strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 24px;
  line-height: 1.1;
}

.admin-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.review-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.account-role-select {
  min-width: 140px;
}

.account-cohort-select {
  min-width: 150px;
}

.user-email {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.review-copy h2 {
  margin: 4px 0 8px;
  color: var(--text);
  font-size: 16px;
}

.review-copy ol {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}

.review-copy li {
  padding-left: 4px;
}

.review-actions {
  display: grid;
  gap: 8px;
  min-width: 148px;
}

.review-action-select {
  min-width: 148px;
}

.revision-editor {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.revision-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.revision-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.review-meta,
.correct-line,
.reference-line,
.user-row span {
  color: var(--muted);
}

.reference-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
}

.trust-badge {
  border-radius: 999px;
  background: #eef8f2;
  color: var(--ok);
  padding: 2px 8px;
  font-weight: 800;
}

.duplicate-badge {
  border-radius: 999px;
  background: #fff0f0;
  color: var(--bad);
  padding: 2px 8px;
  font-weight: 800;
}

.account-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.2fr) 130px 170px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.empty-state,
.form-error {
  color: var(--muted);
}

.form-error {
  min-height: 20px;
  color: var(--bad);
  font-size: 13px;
}

@media (max-width: 980px) {
  .control-row,
  .account-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .training-metrics,
  .admin-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .phase-strip {
    grid-template-columns: repeat(6, 148px);
  }

  .learning-module-columns,
  .admin-curriculum-grid {
    grid-template-columns: 1fr;
  }

  .learning-objectives-panel {
    padding-right: 0;
    padding-bottom: 24px;
  }

  .learning-activity-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 24px;
    padding-left: 0;
  }

  .abcp-coverage-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 18px;
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: center;
  }

  .topbar-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .topbar button,
  .session-bar button {
    width: auto;
  }

  .workspace {
    width: min(100vw - 24px, 1040px);
    margin-top: 18px;
  }

  .action-row,
  .control-row,
  .practice-controls,
  .student-dashboard,
  .answer-zone,
  .admin-stat-row,
  .account-form,
  .review-item,
  .user-row,
  .dashboard-intro,
  .training-metrics,
  .dashboard-columns,
  .training-operations,
  .assignment-row,
  .admin-training-row,
  .performance-row,
  .date-fields,
  .assignment-fields,
  .study-toolbar,
  .learning-continue,
  .learning-module-head,
  .learning-module-progress,
  .learning-module-columns,
  .learning-lesson-shell,
  .learning-lesson-head,
  .calculation-header,
  .calculation-shell,
  .calculation-answer {
    grid-template-columns: 1fr;
  }

  .learning-module-grid {
    grid-template-columns: 1fr;
  }

  .learning-continue {
    gap: 18px;
    padding: 20px;
  }

  .learning-continue > button {
    justify-self: stretch;
  }

  .path-summary {
    justify-items: start;
  }

  .learning-module-head,
  .learning-module-columns {
    padding-right: 20px;
    padding-left: 20px;
  }

  .learning-module-progress {
    gap: 12px;
    padding-right: 20px;
    padding-left: 20px;
  }

  .learning-status {
    justify-self: start;
  }

  .learning-module-stats > div {
    padding: 12px;
  }

  .learning-module-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 16px 20px;
  }

  .learning-module-footer button {
    width: 100%;
  }

  .learning-lesson-rail {
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }

  .learning-lesson-nav {
    grid-auto-columns: minmax(118px, 1fr);
    grid-auto-flow: column;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .learning-lesson-step {
    min-width: 118px;
  }

  .learning-lesson-content {
    min-height: 360px;
    padding: 32px 22px;
  }

  .learning-lesson-content h2 {
    font-size: 24px;
  }

  .learning-lesson-actions {
    flex-wrap: wrap;
    padding: 14px 20px;
  }

  .learning-lesson-actions button {
    width: auto;
    flex: 1 1 140px;
  }

  .calculation-menu {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .calculation-workspace {
    padding: 20px;
  }

  .calculation-empty {
    min-height: 260px;
  }

  .calculation-values {
    grid-template-columns: 1fr;
  }

  .calculation-answer button {
    justify-self: stretch;
  }

  .learning-activity-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .learning-activity-row > button {
    grid-column: 2;
    justify-self: start;
    width: auto;
  }

  .dashboard-intro {
    align-items: start;
  }

  .dashboard-intro button,
  .training-form > button {
    justify-self: stretch;
  }

  .assignment-row,
  .admin-training-row {
    align-items: stretch;
  }

  .admin-training-result,
  .performance-score {
    justify-items: start;
    text-align: left;
  }

  .curriculum-row {
    grid-template-columns: 28px minmax(0, 1fr) 42px;
  }

  .session-bar {
    align-items: center;
    flex-direction: row;
  }

  .role-tabs {
    overflow-x: auto;
  }

  .panel-actions,
  .revision-actions {
    flex-wrap: wrap;
  }

  .review-actions,
  .revision-choice-grid,
  .domain-grid {
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .phase-button,
  .learning-module-card,
  .mode-button {
    width: 100%;
  }

  .learning-back,
  .calculation-return {
    width: auto;
  }
}
