/* Course-only controls: isolate native checkboxes from generic input sizing. */
.cl-script-page-scope.cl-script-app-layout,
.cl-script-page-scope .cl-script-app-layout {
  grid-template-columns: minmax(260px, 1fr) minmax(0, 3fr);
}

.cl-script-page-scope .cl-script-main {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.cl-script-page-scope .cl-module-progress {
  padding: 1rem 1.25rem;
}

.cl-script-page-scope .cl-module-progress h2 {
  margin: 0 0 .75rem;
  font-size: 1.125rem;
  line-height: 1.4;
}

.cl-script-page-scope .cl-module-progress .step-panel {
  gap: .5rem;
  margin: 0 0 1rem;
}

.cl-script-page-scope .step-check {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: .625rem;
  min-height: 44px;
  margin: 0;
  padding: .625rem .75rem;
  background: var(--ci-surface-2, var(--panel-soft));
  color: var(--ci-text, var(--ink));
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.cl-script-page-scope .step-check > input[type="checkbox"] {
  flex: 0 0 1.125rem;
  width: 1.125rem;
  min-width: 1.125rem;
  max-width: 1.125rem;
  height: 1.125rem;
  min-height: 1.125rem;
  max-height: 1.125rem;
  margin: .125rem 0 0;
  padding: 0;
  appearance: auto;
  accent-color: #1f659c;
  cursor: pointer;
}

.cl-script-page-scope .step-check > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

html:is([data-carelit-theme="night"], [data-bs-theme="dark"], .dark) body:is(#carelit, .cl-script-aside-page) .cl-script-page-scope .step-check {
  background: #152033;
  color: #e7f2ff !important;
}

.cl-script-page-scope .cl-module-progress > .success-btn {
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
  text-align: center;
  justify-content: center;
}

.cl-script-page-scope .cl-module-navigation {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: stretch;
  gap: .75rem;
  padding: 1rem 1.25rem;
}

.cl-script-page-scope .cl-module-navigation > a {
  min-height: 44px;
  max-width: 100%;
  justify-content: center;
  white-space: normal;
  text-align: center;
  font-weight: 600;
  line-height: 1.4;
}

.cl-script-page-scope .cl-module-navigation > .primary-btn {
  margin-inline-start: auto;
}

/* App themes give all links an !important color; filled course buttons need
   an explicit contrasting pair, including visited/hover/focus states. */
html body:is(#carelit, .cl-script-aside-page) .cl-script-page-scope .cl-script-main :is(a, button).primary-btn {
  color: #fff !important;
  background: #1f659c !important;
  border-color: #1f659c !important;
}

html body:is(#carelit, .cl-script-aside-page) .cl-script-page-scope .cl-script-main :is(a, button).success-btn {
  color: #fff !important;
  background: #087b4e !important;
  border-color: #087b4e !important;
}

html body:is(#carelit, .cl-script-aside-page) .cl-script-page-scope .cl-module-navigation > .ghost-btn {
  color: #1f659c !important;
  background: #fff !important;
  border-color: #9ebed5 !important;
}

html[data-carelit-theme="accessible"] body#carelit#carelit .cl-script-page-scope :is(a, button):is(.primary-btn, .success-btn) {
  color: #fff !important;
  background: #000 !important;
  border-color: #000 !important;
}

html[data-carelit-theme="accessible"] body#carelit#carelit .cl-script-page-scope .cl-module-navigation > .ghost-btn {
  color: #000 !important;
  background: #fff !important;
  border-color: #000 !important;
}

.cl-script-page-scope :is(.primary-btn, .success-btn, .ghost-btn):focus-visible,
.cl-script-page-scope .step-check > input:focus-visible {
  outline: 3px solid #2596be;
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .cl-script-page-scope.cl-script-app-layout,
  .cl-script-page-scope .cl-script-app-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 575.98px) {
  .cl-script-page-scope :is(.cl-module-progress, .cl-module-navigation) {
    padding: .875rem;
  }

  .cl-script-page-scope .cl-module-navigation > a,
  .cl-script-page-scope .cl-module-progress > .success-btn {
    width: 100%;
  }
}
