/* Accessible course reader, scoped to avoid changing the existing operational views. */
.course-player { max-width: 1440px; margin: 0 auto; overflow-wrap: anywhere; }
.course-player .page-toolbar h2 { max-width: 1000px; margin: 8px 0 10px; }
.course-player .button { min-height: 44px; white-space: normal; text-align: center; }
.course-player .button:focus-visible, .cp-library .button:focus-visible,
.cp-module-list button:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 3px; }
.cp-summary { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cp-summary p { margin: 8px 0 0; }
.cp-summary progress { display: block; width: 100%; height: 12px; margin: 10px 0; accent-color: var(--brand-dark); border: 0; border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.cp-summary progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 9px; }
.cp-summary progress::-webkit-progress-value { background: var(--brand-dark); border-radius: 9px; }
.cp-summary progress::-moz-progress-bar { background: var(--brand-dark); border-radius: 9px; }
.cp-status-block .actions-row { margin-top: 12px; }
.cp-notice { margin: 18px 0; line-height: 1.7; }
.cp-download { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 18px 0 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.cp-download p { margin: 5px 0 0; max-width: 780px; }
.cp-download > .actions-row { flex: 0 1 330px; justify-content: flex-end; }
.cp-layout { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 2.2fr); gap: 22px; align-items: start; }
.cp-program, .cp-module, .cp-layout > * { min-width: 0; }
.cp-program { position: sticky; top: calc(var(--topbar) + 18px); }
.cp-program h3 { font-size: 16px; margin: 0 0 14px; }
.cp-module-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.cp-module-list button { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 64px; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); font-weight: 650; line-height: 1.5; }
.cp-module-list button[aria-current] { border-color: var(--brand-dark); background: var(--brand-soft); box-shadow: inset 3px 0 var(--brand-dark); }
.cp-module-list small { display: block; font-size: 11px; font-weight: 400; margin-top: 4px; color: var(--muted); }
.cp-module-index { display: grid; place-items: center; flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--brand-dark); }
.cp-module-picker { display: none; margin: 0; }
.cp-module > .card-header h3 { font-size: clamp(20px, 2.5vw, 29px); line-height: 1.2; margin: 7px 0; scroll-margin-top: calc(var(--topbar) + 20px); }
.cp-module > .card-header h3:focus { outline: none; }
.cp-module > .card-header h3:focus-visible { outline: 3px solid var(--brand); outline-offset: 6px; }
.cp-illustration { margin: 0 0 25px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: var(--surface-2); }
.cp-illustration img { display: block; width: 100%; height: auto; max-height: 550px; aspect-ratio: 16/9; object-fit: contain; }
.cp-illustration figcaption { padding: 10px 14px; font-size: 12px; line-height: 1.6; color: var(--muted); background: var(--surface); }
.cp-image-missing { padding: 35px 22px; text-align: center; color: var(--muted); min-height: 120px; }
.cp-reading { font-size: 16px; line-height: 1.8; }
.cp-reading h4 { font-size: 19px; margin: 26px 0 10px; }
.cp-reading p, .cp-reading li { max-width: 78ch; }
.cp-reading li { margin-bottom: 9px; }
.cp-reading code { white-space: pre-wrap; overflow-wrap: anywhere; }
.cp-time { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 30px 0 14px; }
.cp-time > div { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.cp-time strong, .cp-time span, .cp-time small { display: block; }
.cp-time strong { font-size: 23px; color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.cp-time span { margin: 4px 0; font-size: 12px; font-weight: 650; }
.cp-time small { color: var(--muted); font-size: 11px; line-height: 1.6; }
.cp-reflection { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.cp-reflection h4 { font-size: 18px; margin: 0 0 12px; }
.cp-reflection > p:first-of-type { font-size: 16px; line-height: 1.7; }
.cp-reflection textarea { min-height: 160px; max-width: 100%; font-size: 16px; line-height: 1.6; }
.cp-pager { gap: 10px; flex-wrap: wrap; }
.cp-pager > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.cp-assessment { margin-top: 24px; }
.cp-assessment .card-body > p { line-height: 1.8; max-width: 110ch; }
.cp-conflict { margin: 20px 0; }
.cp-conflict h3 { margin: 0 0 14px; }
.cp-conflict-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cp-conflict blockquote { white-space: pre-wrap; margin: 10px 0; padding: 12px; border-left: 3px solid var(--warning); background: rgba(255,255,255,.6); }
.cp-library { overflow-wrap: anywhere; }
.cp-library .card h3 { font-size: 20px; }
#offline-login-note { margin-top: 18px; line-height: 1.7; }
body.is-offline-reader .topbar-actions, body.is-offline-reader .sidebar-compliance { display: none; }
body.is-offline-reader .sidebar-top > .brand { pointer-events: none; }
@media (max-width: 1100px) {
  .cp-layout { grid-template-columns: 1fr; }
  .cp-program { position: static; }
  .cp-program .card-body { padding: 17px 20px; }
  .cp-module-list { display: none; }
  .cp-module-picker { display: block; }
}
@media (max-width: 740px) {
  .cp-summary, .cp-conflict-grid { grid-template-columns: 1fr; gap: 18px; }
  .cp-summary { padding: 17px; }
  .cp-download { display: block; padding: 17px; }
  .cp-download > .actions-row { justify-content: flex-start; margin-top: 14px; }
  .cp-time { grid-template-columns: 1fr; gap: 10px; }
  .cp-time > div { padding: 13px 15px; }
  .cp-module > .card-body { padding: 18px; }
  .cp-module > .card-header { padding: 18px; }
  .cp-module .actions-row > .button, .cp-download .button { width: 100%; }
  .cp-pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cp-pager > span { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .cp-pager .button { font-size: 12px; padding: 8px; }
  .cp-reflection h4 { font-size: 17px; }
  .cp-illustration { margin-left: -4px; margin-right: -4px; }
}
@media (prefers-reduced-motion: reduce) {
  .course-player .button { transition: none; }
}

.cp-history { margin: 18px 0; padding: 15px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cp-history summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 700; }
.cp-history summary:focus-visible { outline: 3px solid var(--brand-dark); outline-offset: 3px; }
.cp-history section + section { border-top: 1px solid var(--line); margin-top: 15px; }
.cp-history blockquote { white-space: pre-wrap; margin: 12px 0; padding: 12px; background: var(--surface-2); border-left: 3px solid var(--brand-dark); }

.cp-online-extras { display: grid; gap: 18px; margin-top: 24px; min-width: 0; }
.cp-online-extras > *, .cp-online-extras .material-card { min-width: 0; }
