:root {
  --motion-fast: 160ms;
  --ink: #18314e;
  --sub: #4b607c;
  --teal: #23468b;
  --deep: #1c3970;
  --line: #c5d2e6;
  --paper: #fff;
  --bg: #f4f7fc;
  --warm: #fff2df;
  --radius: 12px;
  --shadow: 0 5px 22px #23468b08;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

/* Component display rules must not override an explicitly hidden control. */
[hidden] {
  display: none !important;
}
.pagination .page-number {
  width: 5.5rem;
  min-width: 0;
}
[data-exams] > summary h2 {
  display: inline;
}

/* Work areas share one navigation language. Context stays close to the action. */
.workspace-sections {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  background: #ffffffc9;
  padding: 12px 28px;
}
.workspace-sections > span {
  color: var(--sub);
  font-size: 0.8rem;
  margin-right: 12px;
}
.workspace-sections a,
.view-tabs a {
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--sub);
  font-weight: 600;
  transition:
    background-color var(--motion-fast),
    color var(--motion-fast);
}
.workspace-sections a:hover,
.view-tabs a:hover {
  background: #eef5fa;
  text-decoration: none;
}
.workspace-sections [aria-current],
.view-tabs [aria-current] {
  color: #075e7d;
  background: #e2f0f8;
  box-shadow: inset 0 -2px #0a83a2;
}
.context-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-left: 3px solid #4397b7;
  border-radius: 0 8px 8px 0;
  background: #edf5fa;
  font-size: 0.88rem;
}
.context-ribbon > span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
p.context-ribbon {
  display: block;
}
.context-ribbon strong {
  margin-left: 6px;
  overflow-wrap: anywhere;
}
.context-ribbon a {
  font-size: 0.83rem;
}
.quiet-help {
  margin: 0 0 20px;
  padding: 10px 0;
  color: var(--sub);
  font-size: 0.88rem;
}
.quiet-help summary {
  cursor: pointer;
  width: fit-content;
}
.quiet-help > div {
  margin-top: 12px;
  max-width: 76ch;
}
.quiet-help p {
  margin-bottom: 0;
}
.view-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.view-tabs a {
  flex-shrink: 0;
  white-space: nowrap;
}
.course-workbench {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.course-studio details.panel {
  padding: 14px 20px;
  margin-bottom: 12px;
}
.course-studio .quiet-help {
  margin-bottom: 0;
  padding: 8px 0 14px;
}
.course-studio .page-head {
  margin-bottom: 18px;
}
.management-course {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.management-course h2,
.management-course p {
  margin-bottom: 0;
}
.management-course > .row:last-child {
  margin-top: auto;
  padding-top: 6px;
}
.course-relations {
  display: flex;
  gap: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.course-relations a {
  font-size: 0.83rem;
  color: var(--sub);
}
.course-relations strong {
  font-size: 1.45rem;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}
.question-preview {
  padding: 16px;
  background: #f5f9fd;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 16px 0;
}
.question-meta {
  display: block;
  color: var(--sub);
  font-size: 0.8rem;
  margin-bottom: 8px;
}
.question-preview summary {
  cursor: pointer;
  color: var(--teal);
}
.question-preview [data-question-preview] {
  padding-top: 18px;
}
.preview-choice {
  display: flex;
  gap: 10px;
  padding: 8px;
  margin: 4px 0;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
}
.answer-placeholder {
  border: 1px dashed #bccfdf;
  border-radius: 6px;
  padding: 18px;
  color: var(--sub);
}
.capacity-meter {
  width: 100%;
  height: 8px;
  margin-bottom: 18px;
  accent-color: var(--teal);
}
.showcase-slots {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.showcase-slots li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.showcase-slots li > div:first-of-type {
  flex: 1;
  min-width: 0;
}
.showcase-slots p {
  margin: 4px 0 0;
}
.slot-number {
  display: grid;
  place-items: center;
  background: #e9f3fa;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}
.catalog-invitation {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 26px 0;
  background: #fff;
}
.catalog-invitation p {
  margin-bottom: 0;
  color: var(--sub);
}
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}
.featured-grid:has(> :only-child) {
  max-width: 600px;
}
.empty-inline {
  color: var(--sub);
  padding: 20px 0;
}
summary:focus-visible {
  outline: 3px solid #008eaa;
  outline-offset: 4px;
  border-radius: 4px;
}
h1[tabindex='-1']:focus {
  outline: none;
}
@media (prefers-reduced-motion: no-preference) {
  .page-ready {
    animation: work-area-enter 180ms ease-out;
  }
  .course-card {
    transition:
      box-shadow var(--motion-fast),
      border-color var(--motion-fast);
  }
  .course-card:hover,
  .course-card:focus-within {
    box-shadow: 0 8px 24px #31587b16;
    border-color: #9ebdd2;
  }
  @keyframes work-area-enter {
    from {
      opacity: 0.7;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
@media (max-width: 760px) {
  .workspace-sections {
    padding: 8px 16px;
    gap: 4px;
  }
  .workspace-sections > span {
    width: 100%;
    margin: 0;
    padding: 4px 0;
  }
  .workspace-sections a {
    padding: 10px 12px;
    font-size: 0.88rem;
  }
  .course-workbench {
    grid-template-columns: minmax(0, 1fr);
  }
  .context-ribbon > span {
    align-items: flex-start;
  }
  .context-ribbon .row {
    width: 100%;
  }
  .showcase-slots li {
    flex-wrap: wrap;
  }
  .showcase-slots li > .row {
    width: 100%;
    justify-content: flex-end;
  }
  .catalog-invitation {
    padding: 22px;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: linear-gradient(125deg, #f9fcff, #eef6fc);
}
a {
  color: var(--teal);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #008eaa;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: var(--type-title);
  line-height: 1.35;
  letter-spacing: 0;
}
h2 {
  font-size: var(--type-section);
  line-height: 1.5;
}
h3 {
  font-size: 1rem;
  line-height: 1.5;
}
p {
  line-height: 1.85;
}
.muted,
small {
  color: var(--sub);
}
.eyebrow {
  display: none;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
button .icon,
a .icon {
  margin-right: 7px;
}
.primary,
.secondary,
.quiet,
.danger {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 11px 17px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  font-size: var(--type-control);
  font-weight: 580;
  line-height: 1.5;
}
.primary {
  background: linear-gradient(120deg, #007aa0, #009da6);
  color: #fff;
}
.primary:hover {
  background: var(--deep);
  text-decoration: none;
}
.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.secondary:hover {
  background: #edf7fc;
}
.quiet {
  color: var(--teal);
  background: transparent;
}
.danger {
  color: #a0392a;
  border-color: #edd5ce;
  background: #fff7f2;
}
.small {
  font-size: var(--type-caption);
  padding: 7px 11px;
}
.icon-button {
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 7px;
}
.icon-button:hover {
  background: #edf5fb;
}
.icon-button .icon {
  margin: 0;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.stack {
  display: grid;
  gap: 18px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.panel p:last-child {
  margin-bottom: 0;
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 5px 9px;
  font-size: 0.72rem;
  color: #526d8d;
  background: #eef4fa;
  border-radius: 6px;
}
.badge.good {
  background: #e2f6f2;
  color: #087d76;
}
.badge.warm {
  background: #fbecd9;
  color: #805524;
}
.field {
  display: grid;
  gap: 8px;
  font-size: var(--type-control);
  font-weight: 550;
  margin-bottom: 18px;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid #cddde9;
  background: #fff;
  border-radius: 8px;
  padding: 11px 13px;
  color: var(--ink);
  font-size: var(--type-control);
  font-weight: 400;
  line-height: 1.7;
  min-width: 0;
}
.field textarea {
  min-height: 130px;
  resize: vertical;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.85rem;
  line-height: 1.8;
  margin: 13px 0;
}
.checkbox input {
  accent-color: var(--teal);
  margin-top: 5px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
.span-2 {
  grid-column: 1/-1;
}
.form-error {
  color: #ad3228;
  font-size: 0.85rem;
  margin: 0 25px 18px;
  white-space: pre-line;
}
.help {
  font-size: 0.8rem;
  color: var(--sub);
  line-height: 1.8;
  margin: 0 0 18px;
}
.callout {
  padding: 17px 20px;
  background: #eef6fc;
  border-radius: 10px;
  color: #315878;
  font-size: 0.84rem;
  line-height: 1.8;
}
.callout.warm {
  background: #faf1e4;
  color: #825c34;
}
.empty {
  text-align: center;
  padding: 45px 24px;
  background: #fff;
  border: 1px dashed #bdd3e4;
  border-radius: 14px;
}
.empty > .icon {
  width: 34px;
  height: 34px;
  margin-bottom: 15px;
  opacity: 0.55;
}
.empty p {
  color: var(--sub);
  font-size: 0.85rem;
  margin-bottom: 18px;
}
.list-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row > div:first-child {
  min-width: 0;
}
.list-row > .stack {
  flex-shrink: 0;
  align-items: flex-end;
}
.list-row > .stack button {
  white-space: nowrap;
}
.list-row p {
  font-size: 0.84rem;
  color: var(--sub);
  margin: 6px 0;
  overflow-wrap: anywhere;
}
.list-row h3 {
  margin: 0;
  overflow-wrap: anywhere;
}
.list-row small {
  display: block;
  overflow-wrap: anywhere;
}
.list-row > .row {
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 48%;
}
.table-wrap {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.83rem;
}
th {
  font-weight: 500;
  font-size: 0.74rem;
  color: var(--sub);
  border-bottom: 1px solid var(--line);
  padding: 13px;
}
td {
  padding: 16px 13px;
  border-bottom: 1px solid #e4edf5;
  vertical-align: top;
}
td .row {
  gap: 8px;
}
td p {
  margin: 4px 0;
  font-size: 0.8rem;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 30px;
}
.page-head .muted {
  font-size: 0.88rem;
  max-width: 690px;
  margin-bottom: 0;
}
.head-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.page-head h1 {
  margin-bottom: 12px;
}
/* Shared shell: adapted from the selected V9.12 frontend, not a separate visual theme. */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 760;
  font-size: 1.45rem;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.brand img {
  width: 40px;
  height: 40px;
}
.brand:hover {
  text-decoration: none;
}
.app-header {
  min-height: 74px;
  padding: 0 30px;
  display: flex;
  gap: 26px;
  align-items: center;
  background: white;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 3;
}
.public-nav {
  display: flex;
  gap: 25px;
  align-items: center;
}
.public-nav a {
  color: var(--ink);
  font-size: 0.9rem;
  white-space: nowrap;
  font-weight: 600;
  padding: 25px 0 21px;
  border-bottom: 3px solid transparent;
}
.public-nav a.active {
  color: var(--teal);
  border-color: var(--teal);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.account-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.account-role {
  color: var(--sub);
  border-left: 1px solid var(--line);
  padding-left: 8px;
}
.identity-options {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.identity-options legend {
  padding: 0 6px;
  font-weight: 600;
}
.header-tag {
  color: var(--sub);
  font-size: 0.8rem;
  white-space: nowrap;
}
.app-header.staff {
  background: linear-gradient(110deg, #102e4d, #1e4670);
  color: white;
  border-color: #254e70;
}
.staff .brand,
.staff .quiet,
.staff .account-role,
.staff .header-tag {
  color: #e0edf9;
}
.staff .header-tag {
  color: #a5bfd7;
  border-left: 1px solid #52718b;
  padding-left: 20px;
}
.staff .icon-button {
  color: white;
  background: #ffffff0a;
  border: 1px solid #ffffff28;
}
.staff .icon-button .icon,
.staff .account-name > .icon {
  filter: invert(1);
}
.staff .icon-button:hover,
.staff .quiet:hover {
  background: #ffffff15;
}
.site-main {
  max-width: 1660px;
  margin: 0 auto;
  padding: 0 30px 30px;
}
.site-main > .page-head {
  padding-top: 30px;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 30px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  color: var(--sub);
}
.dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(120deg, #173855, #24496e);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 7px;
  padding: 11px 17px;
  border: 0;
}
.dark:hover {
  background: #123656;
  text-decoration: none;
}
.dark .icon,
.primary .icon {
  filter: invert(1);
}
.wide {
  width: 100%;
}
.course-code {
  font-size: 0.74rem;
  font-weight: 650;
  color: #08798e;
}

/* Original bridge banner and four-column portal rhythm. Core launch uses two pathways plus work. */
.hero-bridge {
  min-height: 295px;
  margin: 0 -30px;
  background: #eff8ff url('/assets/classic/bridge-hero.png') center / cover no-repeat;
  display: flex;
  align-items: center;
  padding: 42px 46px;
}
.hero-bridge h1 {
  font-size: clamp(2rem, 4vw, 3.125rem);
  letter-spacing: 0;
  margin: 0 0 16px;
  color: #0a254b;
}
.hero-bridge p {
  font-size: 1.12rem;
  color: #5f7895;
  max-width: 480px;
  line-height: 1.9;
  margin: 0;
}
.portal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 0.9fr;
  gap: 14px;
  position: relative;
  margin-top: -5px;
}
.portal-grid > .panel {
  padding: 22px 19px;
  background: #ffffffef;
  display: flex;
  flex-direction: column;
}
.portal-grid h2 {
  font-size: 1.35rem;
  margin: 0;
}
.portal-grid h3 {
  font-size: 1.12rem;
  margin-bottom: 9px;
}
.portal-grid p {
  font-size: 0.83rem;
}
.portal-grid > .panel > .dark {
  margin-top: auto;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 14px;
}
.section-title h3 {
  margin: 0;
}
.route-tile {
  display: grid;
  grid-template-columns: 36% 1fr;
  border: 1px solid #e6eff9;
  border-radius: 10px;
  background: #f4f9fe;
  margin-top: 13px;
  overflow: hidden;
  align-items: center;
}
.route-tile img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}
.route-tile > div {
  padding: 13px;
  min-width: 0;
}
.route-tile p {
  margin-bottom: 12px;
}
.art-cover {
  width: 100%;
  height: 196px;
  object-fit: cover;
  border-radius: 10px;
  margin: 8px 0 20px;
}
.personal-card {
  background: linear-gradient(130deg, #f5faff, #fff) !important;
}
.personal-card > h2 {
  margin-bottom: 14px;
}
.mini-task {
  padding: 15px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  margin-top: 12px;
}
.mini-task strong {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.84rem;
  line-height: 1.8;
}
.mini-task p {
  margin: 8px 0 12px;
}
.personal-next {
  margin-top: 22px;
}
.personal-next .section-title {
  margin-bottom: 0;
}
.personal-next .quiet {
  padding: 4px 0;
}
.story-section,
.course-section {
  margin-top: 28px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 20px;
}
.section-head h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}
.section-head > button {
  flex-shrink: 0;
  white-space: nowrap;
}
.section-head p {
  font-size: 0.85rem;
  color: var(--sub);
  margin: 0;
}
.responsibility-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--sub);
  font-size: 0.76rem;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 18px;
}
.responsibility-note p {
  margin: 0;
}

.course-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.course-card > img {
  width: 100%;
  height: 195px;
  object-fit: cover;
}
.course-card .body {
  padding: 23px;
  flex: 1;
}
.course-card h3 {
  margin: 14px 0 10px;
  font-size: 1.05rem;
}
.course-card p {
  font-size: 0.83rem;
  color: var(--sub);
}
.course-card footer {
  padding: 0 23px 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.75rem;
}
.library-banner {
  background: linear-gradient(110deg, #eff8fe, #f8fcff);
  display: grid;
  grid-template-columns: 1fr 0.45fr;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin: 28px 0 24px;
}
.library-banner > div {
  padding: 30px;
}
.library-banner img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.library-banner h1 {
  margin-bottom: 10px;
}
.library-banner p {
  font-size: 0.9rem;
  color: var(--sub);
  margin-bottom: 0;
}

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  background: white;
}
.filter-bar input {
  flex: 1;
  min-width: 150px;
}
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
  min-height: 75vh;
}
.auth-layout > img {
  width: 100%;
  height: 570px;
  object-fit: cover;
  border-radius: 22px;
}
.auth-form {
  max-width: 420px;
  width: 100%;
  margin: auto;
}
.auth-form h1 {
  margin: 14px 0;
}
.auth-form .primary {
  width: 100%;
  margin-top: 5px;
}
.app-frame {
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  min-height: calc(100vh - 74px);
}
.legacy-sidebar {
  background: linear-gradient(150deg, #153750, #102b47);
  padding: 22px 12px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 74px);
}
.rail-title {
  color: #fff;
  font-size: 1.1rem;
  padding: 8px 13px 14px;
  margin: 0;
}
.legacy-sidebar nav {
  display: grid;
  gap: 5px;
}
.legacy-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 13px;
  border-radius: 6px;
  color: #d6e5f4;
  font-size: 0.87rem;
}
.legacy-sidebar nav a:hover,
.legacy-sidebar nav a.active {
  background: #126080;
  color: white;
  text-decoration: none;
}
.legacy-sidebar nav a .icon {
  margin: 0;
  filter: invert(0.85);
}
.legacy-sidebar.light {
  background: #f9fcff;
  border-right: 1px solid var(--line);
}
.legacy-sidebar.light .rail-title,
.legacy-sidebar.light nav a {
  color: #183c64;
}
.legacy-sidebar.light nav a .icon {
  filter: none;
}
.legacy-sidebar.light nav a:hover,
.legacy-sidebar.light nav a.active {
  background: #e5f5fe;
  color: #063f63;
}
.legacy-sidebar.light nav a.active {
  box-shadow: inset 3px 0 #04a4ac;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 24px 14px 8px;
}
.sidebar-bottom p {
  font-size: 0.78rem;
  color: #adc3d7;
  line-height: 1.85;
  margin-bottom: 10px;
}
.sidebar-bottom a {
  color: #d6e5f4;
  padding: 0;
}
.legacy-sidebar.light .sidebar-bottom p {
  color: var(--sub);
}
.legacy-sidebar.light .sidebar-bottom a {
  color: var(--teal);
}
.workspace {
  min-width: 0;
}
.workspace-main {
  padding: 28px;
  max-width: 1740px;
  margin: 0 auto;
}
.workspace-header .brand {
  margin-right: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 23px;
}
.stat p {
  font-size: 0.79rem;
  color: var(--sub);
  margin-bottom: 15px;
}
.stat strong {
  font-size: 2rem;
  font-weight: 550;
  letter-spacing: 0;
}
.welcome {
  display: grid;
  grid-template-columns: 1fr 0.5fr;
  background: #eaf5fc;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 30px;
}
.welcome > div {
  padding: 30px;
}
.welcome h2 {
  font-size: 1.55rem;
  margin: 0 0 10px;
}
.welcome p {
  font-size: 0.85rem;
  color: var(--sub);
  margin-bottom: 18px;
}
.welcome > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: 250px;
}
.tabs {
  display: flex;
  gap: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tabs button {
  background: none;
  border: 0;
  color: var(--sub);
  padding: 14px 2px;
  white-space: nowrap;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  color: var(--teal);
  border-color: var(--teal);
}
.editor-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 23px;
  align-items: start;
}
.outline {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 20px;
}
.outline h3 {
  font-size: 0.84rem;
  margin-bottom: 13px;
}
.outline .chapter {
  border-top: 1px solid var(--line);
  margin-top: 17px;
  padding-top: 13px;
}
.outline .lesson-link {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 10px 11px;
  border-radius: 7px;
  font-size: 0.8rem;
  color: var(--sub);
  margin-top: 3px;
  line-height: 1.6;
}
.outline .lesson-link.active {
  color: var(--teal);
  background: #e5f5fe;
}
.outline .chapter-title {
  font-size: 0.8rem;
  font-weight: 550;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  overflow-wrap: anywhere;
}
.outline .chapter-title button {
  padding: 3px;
}
.editor-actions {
  position: sticky;
  bottom: 10px;
  background: #fffffff2;
  border: 1px solid var(--line);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-top: 22px;
  z-index: 2;
}
.lesson-reading {
  font-size: 0.93rem;
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #315270;
  max-width: 850px;
}
.lesson-video {
  width: 100%;
  max-height: 470px;
  background: #112e52;
  border-radius: 12px;
  margin-bottom: 25px;
}
.lesson-detail {
  max-width: 100%;
  min-width: 0;
}
/* Learning hides the workspace rail. Keep one full-width track through the shared workspace breakpoints. */
.app-frame.learning-frame {
  grid-template-columns: minmax(0, 1fr);
}
.learning-frame:not(.nav-open) > .legacy-sidebar {
  display: none;
}
.learning-frame > .workspace {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}
.learning-frame .workspace-main {
  max-width: 1260px;
  margin-inline: auto;
  width: 100%;
}
.program-reading-context {
  margin-bottom: 16px;
  padding: 18px 22px;
}
.program-context-header,
.lesson-context-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.program-context-header > strong {
  font-size: 0.93rem;
}
.program-progress {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
}
.program-progress > span {
  color: var(--sub);
}
.program-module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}
.program-module-list li {
  min-width: 0;
  max-width: 100%;
}
.program-module-list a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
.program-module-list a[aria-current='step'] {
  background: #e2f6f2;
  border-color: #9dd9d0;
  color: #087d76;
  font-weight: 600;
}
.program-module-picker .program-module-list {
  max-height: 240px;
  overflow-y: auto;
}
.program-progress-note,
.program-module-picker {
  margin-top: 12px;
}
.program-progress-note summary,
.program-module-picker summary,
.completion-requirements summary {
  color: var(--sub);
  font-size: 0.8rem;
  cursor: pointer;
}
.program-progress-note p,
.completion-requirements p {
  margin-top: 10px;
}
.lesson-context {
  margin: 0 0 22px;
  padding: 16px 22px;
}
.lesson-position {
  margin: 0;
  font-size: 0.83rem;
  color: var(--sub);
}
.lesson-completion {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin: 12px 0;
}
.lesson-completion p {
  margin: 0;
  font-size: 0.85rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.lesson-outline summary {
  font-weight: 650;
  cursor: pointer;
}
.lesson-outline small {
  display: block;
  color: var(--teal);
}
.lesson-tabs {
  margin-bottom: 18px;
}
#lesson-stage:focus {
  outline: none;
}
.lesson-checkpoint > .row {
  margin-top: 20px;
}
.study-notes summary,
.source-details summary {
  cursor: pointer;
  color: var(--teal);
  padding: 8px 0;
}
.study-notes textarea {
  margin-top: 12px;
}
.source-details {
  font-size: 0.8rem;
  margin-top: 22px;
  color: var(--sub);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.reading-prose {
  max-width: 72ch;
  white-space: normal;
  font-size: 1rem;
  line-height: 1.9;
}
.reading-prose p {
  white-space: pre-line;
  margin: 0 0 20px;
}
.reading-prose h3 {
  font-size: 1.1rem;
  color: var(--ink);
  margin: 28px 0 12px;
}
.reading-prose li {
  margin-bottom: 8px;
}
.study-materials {
  margin: 25px 0 12px;
}
.study-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.study-file strong {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
.study-file .row {
  flex-shrink: 0;
}
.material-preview {
  width: 100%;
  height: 62vh;
  border: 1px solid var(--line);
  background: #f3f8fc;
}
.material-image {
  max-width: 100%;
}
.material-text {
  max-height: 62vh;
  overflow: auto;
}
.learning-shelf {
  display: grid;
  gap: 18px;
}
.learning-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 26px;
}
.learning-card > img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
}
.learning-card h2 {
  font-size: 1.25rem;
  margin: 0 0 14px;
}
.reading-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--sub);
  font-size: 0.85rem;
}
.reading-progress progress {
  width: min(190px, 48%);
  height: 7px;
  accent-color: var(--teal);
}
.learner-feedback-link {
  font-size: 0.85rem;
  display: flex;
  align-items: start;
  gap: 8px;
}
.learner-feedback-link .badge {
  flex-shrink: 0;
}
.learning-feedback-overview {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.learning-feedback-overview p {
  margin: 0 0 8px;
}
@media (max-width: 760px) {
  .learning-frame .page-head {
    margin-bottom: 24px;
  }
  .learning-frame .page-head h1 {
    font-size: 1.35rem;
  }
  .learner-layout {
    gap: 14px;
  }
  .learner-layout .lesson-outline {
    max-height: none;
    padding: 14px 18px;
  }
  .lesson-outline nav {
    max-height: 50vh;
    overflow: auto;
  }
  .lesson-tabs {
    margin-top: 0;
  }
  .study-file {
    align-items: start;
    flex-direction: column;
  }
  .learning-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .learning-card > img {
    display: none;
  }
  .lesson-checkpoint .row {
    align-items: start;
  }
}
.lesson-detail .panel {
  margin-bottom: 22px;
}
.quiz-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.quiz-item:last-child {
  border: 0;
}
.quiz-item h3 {
  font-size: 0.92rem;
}
.quiz-feedback {
  margin-top: 20px;
}
.file-link {
  font-size: 0.83rem;
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  margin: 4px;
}
.version-line {
  padding: 14px 18px;
  border-left: 3px solid #b4dbe9;
  background: #f1f7fc;
  font-size: 0.8rem;
  margin-top: 15px;
  line-height: 1.85;
}
.submission-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f3f7fb;
  padding: 20px;
  border-radius: 10px;
  font-size: 0.83rem;
  line-height: 1.85;
  max-height: 440px;
  overflow: auto;
}
.timeline {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}
.timeline-item {
  border-left: 2px solid #c5ddeb;
  padding-left: 18px;
}
.timeline-item strong {
  font-size: 0.82rem;
}
.timeline-item p {
  font-size: 0.82rem;
  margin: 6px 0;
}
.modal-head {
  padding: 23px 25px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin: 0;
}
.modal-body {
  padding: 23px 25px;
  overflow: auto;
  min-height: 0;
}
.modal-footer {
  padding: 18px 25px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
dialog {
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 780px;
  width: calc(100% - 32px);
  max-height: 90vh;
  box-shadow: 0 24px 80px #12365635;
  color: var(--ink);
}
dialog::backdrop {
  background: #102e4d5c;
  backdrop-filter: blur(3px);
}
dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(90dvh - 2px);
}
.modal-head,
.modal-footer,
dialog .form-error {
  flex-shrink: 0;
}
.lesson-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--sub);
}
.quiz-item {
  border: 0;
  padding: 0;
  min-width: 0;
}
.quiz-item legend {
  font-weight: 650;
  margin-bottom: 12px;
  font-size: 1rem;
}
.table-scroll-hint {
  display: none;
}
.table-wrap:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}
.notice {
  position: fixed;
  bottom: 24px;
  right: 25px;
  left: auto;
  background: var(--deep);
  color: white;
  padding: 14px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 45px);
  font-size: 0.84rem;
  line-height: 1.7;
  z-index: 100;
}
.notice.error {
  background: #8f3d2b;
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 20px;
  background: white;
  padding: 12px;
  z-index: 200;
}
.skip-link:focus {
  top: 12px;
}
.initial-loading {
  padding: 70px;
  text-align: center;
}
.startup-indicator {
  display: inline-block;
  inline-size: 2rem;
  block-size: 2rem;
  border: 3px solid #dce7f1;
  border-block-start-color: #23468b;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .startup-indicator {
    animation: startup-spin 1s linear infinite;
  }
}
@keyframes startup-spin {
  to {
    transform: rotate(1turn);
  }
}
.page-loading {
  color: var(--muted);
}
.mobile-menu {
  display: none;
}
.upload-progress {
  font-size: 0.8rem;
  color: var(--teal);
}
details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 550;
  padding: 12px 0;
}
details > div {
  padding-top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 1250px) {
  .app-header {
    padding: 0 20px;
    gap: 18px;
  }
  .public-nav {
    gap: 16px;
  }
  .brand {
    font-size: 1.25rem;
  }
  .header-tag {
    display: none;
  }
  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-grid > .personal-card {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
  }
  .personal-card > h2 {
    grid-column: 1/-1;
    margin: 0;
  }
  .personal-next {
    margin-top: 0;
  }
  .app-frame {
    grid-template-columns: 178px minmax(0, 1fr);
  }
  .legacy-sidebar nav a {
    padding: 12px 8px;
    font-size: 0.83rem;
  }
  .workspace-main {
    padding: 26px 22px;
  }
  .editor-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}
@media (max-width: 1000px) {
  .app-header {
    flex-wrap: wrap;
    min-height: 74px;
    gap: 8px 15px;
    padding: 12px 18px;
  }
  .public-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .public-nav a {
    padding: 8px 0;
  }
  .account-password {
    display: none;
  }
  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-grid > .personal-card {
    grid-column: 1/-1;
    display: grid;
  }
  .personal-next {
    margin-top: 22px;
  }
  .hero-bridge {
    min-height: 270px;
    padding: 30px 32px;
  }
  .hero-bridge p {
    max-width: 330px;
    font-size: 1rem;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-grid {
    gap: 12px;
  }
  .stat {
    padding: 18px;
  }
  .auth-layout {
    gap: 30px;
  }
  .auth-layout > img {
    height: 430px;
  }
}
@media (max-width: 760px) {
  .brand {
    font-size: 1.05rem;
    gap: 7px;
  }
  .brand img {
    width: 31px;
    height: 31px;
  }
  .top-actions {
    gap: 8px;
    flex-wrap: wrap;
  }
  .public-nav {
    justify-content: space-between;
    gap: 8px;
  }
  .public-nav a {
    font-size: 0.8rem;
  }
  .account-role,
  .account-name > .icon {
    display: none;
  }
  .account-name {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }
  .site-main {
    padding: 0 16px 22px;
  }
  .hero-bridge {
    margin: 0 -16px;
    padding: 30px 22px;
    background-position: 65% center;
    min-height: 260px;
  }
  .hero-bridge p {
    font-size: 0.94rem;
    max-width: 280px;
    color: #3d617f;
  }
  .portal-grid {
    grid-template-columns: 1fr;
  }
  .portal-grid > .personal-card {
    grid-column: auto;
    display: flex;
  }
  .grid-2,
  .grid-3,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-head {
    flex-direction: column;
    gap: 16px;
  }
  .head-actions {
    justify-content: flex-start;
  }
  .library-banner {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }
  .library-banner > div {
    padding: 22px;
  }
  .library-banner img {
    display: none;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    min-height: 68vh;
    gap: 25px;
  }
  .auth-layout > img {
    display: none;
  }
  .auth-form {
    padding: 25px 0;
  }
  .app-frame {
    display: block;
  }
  .legacy-sidebar {
    display: none;
    min-height: 0;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }
  .app-frame.nav-open .legacy-sidebar {
    display: flex;
  }
  .legacy-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sidebar-bottom {
    display: none;
  }
  .rail-title {
    font-size: 1rem;
    padding-bottom: 10px;
  }
  .workspace-header {
    gap: 8px;
  }
  .workspace-main {
    padding: 24px 16px 40px;
  }
  .mobile-menu {
    display: inline-flex;
    padding: 5px;
  }
  .welcome {
    grid-template-columns: 1fr;
  }
  .welcome > img {
    display: none;
  }
  .welcome > div {
    padding: 23px;
  }
  .editor-layout {
    grid-template-columns: 1fr;
  }
  .outline {
    position: static;
    max-height: 320px;
    overflow: auto;
  }
  .editor-actions {
    position: static;
    flex-direction: column;
    bottom: 0;
    padding: 13px;
  }
  .panel {
    padding: 21px;
  }
  .section-head {
    align-items: start;
  }
  .section-head h2 {
    font-size: 1.25rem;
  }
  .site-footer {
    flex-direction: column;
    align-items: start;
    padding: 20px 16px;
    margin-top: 0;
  }
  .list-row {
    gap: 12px;
  }
  .list-row > .row {
    justify-content: flex-end;
  }
  .notice {
    right: 16px;
    bottom: 16px;
  }
  .table-wrap {
    margin: 0 -8px;
  }
  .table-wrap table {
    min-width: 660px;
  }
  .table-wrap th {
    white-space: nowrap;
  }
  .table-scroll-hint {
    display: block;
  }
  .workspace-header .brand {
    font-size: 0.94rem;
  }
  .workspace-header .account-name {
    font-size: 0.76rem;
    gap: 4px;
  }
  .workspace-header .account-name > .icon {
    display: none;
  }
  .workspace-header .account-role {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* Authoring and management share the established blue bridge palette. */
.workflow-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}
.workflow-map > * {
  background: #edf6fd;
  border: 1px solid #d4e5f4;
  border-radius: 12px;
  padding: 16px;
  color: #183c64;
}
.workflow-map p {
  font-size: 0.82rem;
  margin: 8px 0 0;
  line-height: 1.6;
}
.management-filter {
  align-items: end;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.management-filter .field {
  flex: 1 1 180px;
  margin: 0;
}
.pagination {
  margin: 22px 0;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.layout-studio {
  display: grid;
  grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}
.layout-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 10px 0;
  background: #f7fbff;
}
.author-preview {
  background: #edf2f7;
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
}
.preview-device {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  margin: auto;
  overflow-wrap: anywhere;
}
.preview-device.mobile {
  width: 360px;
  max-width: 100%;
}
.authoring-readiness {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 18px;
}
.authoring-readiness summary {
  cursor: pointer;
  font-weight: 600;
}
.publication-modules {
  min-width: 0;
  padding: 0;
  margin: 14px 0;
  border: 0;
}
.publication-modules legend {
  padding: 0;
  font-weight: 650;
}
.publication-module-list {
  display: grid;
  gap: 7px;
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
}
.publication-module-list li {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
  overflow-wrap: anywhere;
}
.publication-module-list label.checkbox,
.publication-module-list p {
  margin: 0;
}
.publication-module-list p {
  margin-top: 3px;
}
.publication-module-list a {
  display: inline-block;
  padding: 5px 0 2px;
  text-underline-offset: 3px;
}
.publication-released {
  margin-top: 10px;
}
.publication-released summary {
  cursor: pointer;
}
dialog .modal-footer.publication-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}
.publication-footer .publication-impact {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.publication-footer button[type='submit'] {
  white-space: normal;
}
@media (max-width: 520px) {
  dialog .modal-footer.publication-footer {
    grid-template-columns: 1fr auto;
  }
  .publication-footer .publication-impact {
    grid-column: 1 / -1;
  }
}
@media (max-height: 520px) {
  dialog:has(.publication-footer) .modal-head,
  dialog:has(.publication-footer) .modal-body,
  dialog .modal-footer.publication-footer {
    padding: 10px 16px;
  }
  dialog:has(.publication-footer) .modal-body > h3,
  dialog:has(.publication-footer) .modal-body > p {
    margin: 0 0 8px;
  }
  dialog:has(.publication-footer) .publication-modules {
    margin-top: 6px;
  }
}
@media (min-width: 961px) {
  .legacy-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    height: calc(100vh - 74px);
    overflow-y: auto;
  }
}
@media (max-width: 1100px) {
  .workflow-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout-studio {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .workflow-map {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .management-filter {
    align-items: stretch;
  }
  .management-filter > * {
    width: 100%;
  }
  .layout-block {
    flex-wrap: wrap;
  }
  .preview-device {
    padding: 14px;
  }
}

/* Structured course documents: source order is reading order on every viewport. */
.course-document,
.compose-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}
.course-block,
.compose-item {
  min-width: 0;
  overflow-wrap: anywhere;
}
.course-block.full,
.compose-item.full {
  grid-column: 1/-1;
}
.course-block figure {
  margin: 0;
}
.course-block h2,
.course-block h3 {
  margin-top: 0;
}
.course-block p:empty {
  display: none;
}
.course-block figcaption {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 10px 0;
  white-space: pre-wrap;
}
.block-image {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: auto;
}
.course-block audio {
  width: 100%;
  max-width: 100%;
}
.block-code {
  white-space: pre;
  overflow: auto;
  max-height: 540px;
  background: #102b40;
  color: #edf8fc;
  border-radius: 10px;
  padding: 20px;
  font-size: 14px;
}
.block-callout,
.block-reveal,
.block-checklist,
.block-checkpoint {
  padding: 22px;
  border-radius: 12px;
  border: 1px solid #cde1ea;
  background: #f0f8fb;
}
.block-callout.tone-tip {
  background: #ecfaf3;
  border-color: #b8ddce;
}
.block-callout.tone-warning {
  background: #fff9ea;
  border-color: #e6d09a;
}
.block-table {
  overflow: auto;
  max-width: 100%;
}
.block-table table {
  min-width: 300px;
  width: 100%;
  border-collapse: collapse;
}
.block-table th,
.block-table td {
  border: 1px solid #d9e4eb;
  padding: 12px;
  text-align: left;
  white-space: pre-wrap;
}
.block-table th {
  background: #edf6fa;
}
.block-table input {
  min-width: 100px;
}
.compose-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid #dde7ee;
  padding: 12px 0;
}
.compose-workspace {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  gap: 20px;
  margin: 20px 0;
}
.compose-library {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: 78vh;
  overflow: auto;
  padding-right: 8px;
}
.compose-library h4 {
  margin: 16px 0 8px;
  color: #4c6479;
  font-size: 12px;
}
.compose-palette {
  display: grid;
  gap: 7px;
}
.compose-palette button {
  text-align: left;
  font-size: 13px;
}
.compose-library .quiet {
  display: block;
  margin-top: 8px;
}
.compose-canvas-wrap {
  background: #eef4f8;
  border: 1px solid #dce6ef;
  border-radius: 14px;
  padding: 18px;
  min-width: 0;
}
.compose-canvas {
  max-width: 100%;
  margin: auto;
}
.compose-canvas.mobile {
  max-width: 375px;
}
.compose-item {
  border: 1px solid #cedee8;
  border-radius: 10px;
  background: white;
  box-shadow: 0 3px 10px #15365008;
  overflow: hidden;
}
.compose-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: #f8fbfd;
  border-bottom: 1px solid #e2ebf2;
  padding: 8px 12px;
  font-size: 12px;
  color: #496379;
}
.compose-item header .row {
  gap: 0;
}
.compose-item header button {
  font-size: 11px;
  padding: 6px;
}
.compose-handle {
  cursor: grab;
  touch-action: none;
}
.compose-handle:active {
  cursor: grabbing;
}
.compose-example {
  padding: 22px;
  min-height: 55px;
  max-height: 440px;
  overflow: auto;
  pointer-events: none;
}
.compose-example .reading-prose {
  font-size: 15px;
}
.compose-example p:first-child {
  margin-top: 0;
}
.compose-document-name {
  overflow-wrap: anywhere;
}
.compose-document-name p {
  margin: 6px 0 0;
}
.compose-reading-range {
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #e2ebf2;
  color: #496379;
  font-size: 13px;
}
.compose-reading-range button {
  min-height: 40px;
}
.compose-ghost {
  opacity: 0.35;
  border: 2px dashed #168b9b;
}
.compose-empty {
  text-align: center;
  color: #607c91;
  border: 2px dashed #c0d7e4;
  padding: 45px 15px;
  border-radius: 12px;
}
.compose-empty small {
  display: block;
  margin-top: 12px;
}
.compose-list:empty {
  min-height: 50px;
}
.compose-workspace.is-preview {
  grid-template-columns: 1fr;
}
.is-preview .compose-library {
  display: none;
}
.is-preview .compose-canvas {
  background: white;
  padding: 28px;
  border-radius: 12px;
}
.compose-canvas.mobile .course-document,
.compose-canvas.mobile .compose-list {
  grid-template-columns: 1fr;
}
.compose-canvas.mobile .half {
  grid-column: 1/-1;
}
.compose-issues {
  border-left: 3px solid #d8b465;
  padding: 12px 16px;
  background: #fffaf0;
}
.rich-editor {
  margin: 12px 0 20px;
}
.rich-editor .ql-editor {
  font-family: inherit;
  font-size: 16px;
  line-height: 1.8;
  min-height: 250px;
  max-height: 50vh;
}
.rich-editor .ql-toolbar.ql-snow {
  font-family: var(--font-ui);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}
.rich-editor .ql-container {
  font-family: inherit;
}
.rich-editor .ql-tooltip {
  z-index: 3;
}
.rich-editor .ql-editor p {
  margin: 0;
}
@media (min-width: 1180px) {
  .course-studio .editor-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}
@media (max-width: 850px) {
  .compose-workspace {
    grid-template-columns: 1fr;
  }
  .compose-library {
    position: static;
    max-height: none;
    padding: 0;
  }
  .compose-palette {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .compose-canvas-wrap {
    padding: 10px;
  }
  .compose-item header button {
    padding: 8px;
  }
  .compose-item header {
    gap: 6px;
  }
}
@media (max-width: 600px) {
  .course-document,
  .compose-list {
    grid-template-columns: 1fr;
  }
  .course-block.half,
  .compose-item.half {
    grid-column: 1/-1;
  }
  .is-preview .compose-canvas {
    padding: 18px;
  }
  .compose-example {
    padding: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .compose-item {
    transition: none !important;
  }
}

.rich-editor .ql-snow .ql-tooltip::before {
  content: '链接：';
}
.rich-editor .ql-snow .ql-tooltip[data-mode='link']::before {
  content: '输入链接：';
}
.rich-editor .ql-snow .ql-tooltip a.ql-action::after {
  content: '编辑';
}
.rich-editor .ql-snow .ql-tooltip.ql-editing a.ql-action::after {
  content: '保存';
}
.rich-editor .ql-snow .ql-tooltip a.ql-remove::before {
  content: '移除';
}

.ai-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.ai-summary article {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-summary strong {
  font-size: 26px;
}
.ai-summary small {
  color: var(--sub);
  line-height: 1.6;
}
.ai-security-alert {
  border: 1px solid #dea4a4;
  background: #fff5f4;
  color: #782c2b;
}
.ai-security-alert:not(.panel) {
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
  line-height: 1.7;
}
.badge.ai-red {
  background: #fae0df;
  color: #8e2927;
}
.ai-endpoint {
  overflow-wrap: anywhere;
}
.ai-section-actions {
  margin: 20px 0;
}
.ai-setup-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0;
  border-left: 3px solid var(--teal);
}
.ai-setup-entry h2,
.ai-setup-panel h2 {
  margin: 0 0 8px;
}
.ai-setup-entry p {
  margin: 0;
  color: var(--sub);
}
.ai-setup-panel {
  margin-bottom: 24px;
}
.ai-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 16px 0;
  list-style: none;
}
.ai-setup-steps li {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-setup-steps span {
  color: var(--sub);
  font-size: 0.85rem;
  line-height: 1.65;
}
@media (max-width: 700px) {
  .ai-setup-steps {
    grid-template-columns: 1fr;
  }
}
.ai-connection-card h2 {
  margin: 0;
}
.ai-catalog-note {
  grid-column: 1 / -1;
  margin-top: 0;
}
.ai-preset-help {
  padding: 16px 18px;
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  background: #f2f7ff;
  line-height: 1.65;
  margin: 8px 0 20px;
}
.ai-preset-help p {
  margin: 8px 0;
}
.ai-preset-help small {
  display: block;
  color: var(--sub);
  margin-top: 8px;
}
#modal-form [hidden] {
  display: none;
}
@media (max-width: 1000px) {
  .ai-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 500px) {
  .ai-summary {
    gap: 10px;
  }
  .ai-summary article {
    padding: 16px;
  }
  .ai-summary strong {
    font-size: 21px;
  }
}

/* A quiet reminder that editing and public publication are separate actions. */
.course-lifecycle-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.course-lifecycle-strip span {
  padding: 10px 12px;
  border: 1px solid var(--line, #d9e4f0);
  border-radius: 8px;
  color: var(--muted, #60738c);
  font-size: 0.85rem;
}
@media (max-width: 650px) {
  .course-lifecycle-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.course-management-shortcuts {
  margin: 0 0 16px;
}
.editor-actions {
  flex-wrap: wrap;
}
.editor-actions > small {
  flex-basis: 100%;
  color: var(--sub);
  line-height: 1.6;
}
.required-marker {
  color: #b42318;
  font-weight: 700;
}
.optional-marker {
  color: var(--sub);
  font-size: 0.85em;
  font-weight: 400;
}

/* Course extension forms stay with the existing studio; visible modules follow the release snapshot. */
.course-extension {
  margin-block: 1.25rem;
}
.metadata-module {
  border-top: 1px solid var(--line);
  padding-block: 1rem;
}
.instructor-card h3 {
  margin-top: 0.25rem;
}
.instructor-card .row {
  flex-wrap: wrap;
}

/* The reviewer keeps submitter identity and requirements version beside the work, including on phones. */
.review-context {
  background: #f1f7fc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
}
.review-context dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 0;
}
.review-context dt {
  font-size: 0.8rem;
  color: var(--sub);
}
.review-context dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
@media (max-width: 650px) {
  .review-context dl {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dossier-record {
  border-top: 1px solid var(--line);
  padding-block: 18px;
}
.dossier-record .row {
  flex-wrap: wrap;
}
.dossier-record h3 {
  margin: 0;
}
.block {
  display: block;
}
.input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.exam-question {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.exam-question h2 {
  font-size: 1.15rem;
}
.exam-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.exam-navigation a {
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.exam-question,
.certificate-sheet {
  overflow-wrap: anywhere;
}
@media (max-width: 650px) {
  /* Long record labels retain the full content width; actions follow the summary. */
  .assessment-record {
    flex-direction: column;
    align-items: stretch;
  }
  .assessment-record > a {
    align-self: flex-start;
  }
  .list-row > .row {
    max-width: 100%;
    justify-content: flex-start;
  }
  .certificate-sheet {
    padding: 24px 16px;
  }
}
.certificate-sheet h2 {
  font-size: 2.3rem;
  margin: 36px 0;
}
.certificate-sheet h3 {
  font-size: 1.8rem;
  margin: 28px 0;
}
.certificate-sheet.bridge {
  border-color: var(--teal);
  background: linear-gradient(135deg, #fff 60%, #ecf7fc);
}
.input-with-unit input {
  flex: 1;
  min-width: 0;
}
[data-upload-progress] progress {
  width: 100%;
  height: 16px;
}
.certificate-sheet {
  background: white;
  padding: 48px;
  border: 2px solid var(--navy);
  text-align: center;
  max-width: 900px;
  margin: 24px auto;
}
.certificate-sheet .certificate-number {
  font-family: var(--font-code);
}
.certificate-sheet img {
  max-height: 130px;
  max-width: 220px;
  object-fit: contain;
}
/* A named page keeps certificates landscape without changing the print
   format of course handouts or management directories. */
@page certificate {
  size: A4 landscape;
  margin: 12mm;
}
@media print {
  .page-ready {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .legacy-sidebar,
  .topbar,
  .app-header,
  .site-footer,
  .skip-link,
  .page-head,
  #notice,
  .print-hidden {
    display: none !important;
  }
  .certificate-sheet {
    page: certificate;
    break-inside: avoid;
    margin: 0;
    width: 100%;
    max-width: none;
    height: 180mm;
    min-height: 0;
    box-sizing: border-box;
    padding: 9mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--navy);
    line-height: 1.5;
    font-size: 11pt;
  }
  .certificate-sheet p {
    margin: 5px 0;
  }
  .certificate-sheet h2 {
    font-size: 27pt;
    line-height: 1.25;
    margin: 14px 0;
  }
  .certificate-sheet h3 {
    font-size: 22pt;
    line-height: 1.25;
    margin: 10px 0;
  }
  .certificate-sheet .certificate-number {
    font-size: 9.5pt;
  }
  .certificate-sheet img {
    max-height: 96px;
    max-width: 96px;
    margin: 8px 0;
  }
  .certificate-sheet > a {
    display: none;
  }
  body,
  #app,
  .app-frame,
  .workspace {
    min-height: 0 !important;
    height: auto !important;
  }
  .app-frame {
    display: block;
  }
  .workspace-sections {
    display: none;
  }
  main {
    padding: 0 !important;
  }
}

.email-register-steps {
  display: flex;
  list-style: none;
  gap: 26px;
  padding: 0;
  margin: 24px 0;
  color: #64748b;
  font-size: 14px;
}
.email-register-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.email-register-steps b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #edf1f7;
  font-size: 12px;
  font-weight: 500;
}
.email-register-steps [aria-current] {
  color: #23468b;
  font-weight: 600;
}
.email-register-steps [aria-current] b {
  background: #23468b;
  color: #fff;
}
.email-verified-summary {
  background: #eef6f8;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #235b65;
  overflow-wrap: anywhere;
}
/* Mail/account views follow the approved preview direction without replacing
   the existing platform palette or navigation in unrelated work areas. */
.email-enrollment-layout {
  max-width: 1100px;
  margin: 24px auto 40px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
  gap: 0;
  align-items: stretch;
  min-height: auto;
  border: 1px solid #dce5f1;
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 12px 42px #23468b08;
}
.email-account-intro {
  padding: 40px 32px;
  background: #edf3fc;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: #23468b;
}
.email-brand {
  width: 172px;
  height: 44px;
  object-fit: contain;
}
.email-kicker {
  font-size: 13px;
  color: #53647f;
  margin: 0 0 12px;
}
.email-account-intro .email-kicker {
  margin-top: 66px;
}
.email-account-intro h2 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 24px;
  letter-spacing: -0.03em;
}
.email-account-intro > p:not(.email-kicker) {
  max-width: 24em;
  font-size: 15px;
  line-height: 1.9;
  color: #53647f;
}
.email-account-intro small {
  margin-top: auto;
  color: #53647f;
  font-size: 12px;
  line-height: 1.8;
}
.email-bridge-art {
  width: 210px;
  height: 152px;
  margin: 34px auto 44px;
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}
.email-bridge-art > span {
  position: absolute;
  width: 206px;
  height: 84px;
  top: 0;
  border-radius: 130px 130px 0 0;
  border: 32px solid #23468b;
  border-bottom: 0;
  box-sizing: border-box;
}
.email-bridge-art > i {
  height: 30px;
  width: 54px;
  border-radius: 5px;
  background: #489dc3;
  margin-bottom: 14px;
}
.email-bridge-art > i:nth-of-type(2) {
  background: #51ade6;
}
.email-bridge-art > i:nth-of-type(3) {
  background: #62bebf;
}
.email-account-form.auth-form {
  padding: 36px 40px;
  max-width: none;
  margin: 0;
  width: auto;
}
.email-account-form h1 {
  color: #16263f;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 10px;
}
.email-account-form > .muted {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 24px;
  color: #53647f;
}
.email-account-form .field {
  margin-bottom: 16px;
}
.email-account-form input,
.email-recovery-form input {
  background: #fff;
  border-color: #ccd9eb;
}
.email-account-form input:focus,
.email-recovery-form input:focus {
  outline: 2px solid #23468b;
  outline-offset: 2px;
}
.email-code-panel {
  padding: 18px 20px;
  margin: 0 0 20px;
  border: 1px solid #d5e0f1;
  border-radius: 10px;
  background: #f4f7fc;
}
.send-captcha {
  margin-block: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface, #fff);
}
.send-captcha-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 600;
}
.send-captcha-image-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.send-captcha-image-row img {
  width: 180px;
  height: 64px;
  max-width: 100%;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.send-captcha [name='sendCaptcha'] {
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.send-captcha .help {
  margin-block: 6px 0;
}
.email-code-heading,
.email-code-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.email-code-panel h2 {
  font-size: 16px;
  color: #23468b;
  font-weight: 600;
  margin: 0;
}
.email-code-panel > .help {
  font-size: 13px;
  margin: 12px 0 16px;
  line-height: 1.8;
  color: #53647f;
}
.email-code-panel input {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.18em;
  min-height: 50px;
}
.email-code-panel [role='status'] {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  color: #23468b;
}
.email-code-panel.verified {
  border-color: #61aaa4;
  background: #f1f9f7;
}
.email-account-form .primary,
.email-recovery-form .primary {
  background: #23468b;
  border-color: #23468b;
  box-shadow: none;
}
.email-account-form .primary:hover,
.email-recovery-form .primary:hover {
  background: #1c3972;
}
.email-account-form .secondary,
.email-recovery-form .secondary {
  color: #23468b;
  background: #fff;
  border-color: #becfe9;
}
.email-account-form .help,
.email-recovery-form .help {
  line-height: 1.8;
}
.email-recovery-form.auth-form {
  max-width: 540px;
  padding: 28px;
  border-top: 4px solid #23468b;
}
.email-recovery-form > .email-brand {
  margin-bottom: 26px;
}
.email-recovery-form .email-code-panel {
  margin-top: 22px;
}
.email-recovery-form .email-code-panel h2 {
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .auth-layout.email-enrollment-layout {
    grid-template-columns: 1fr;
    margin-top: 12px;
  }
  .email-account-intro {
    padding: 24px 28px;
  }
  .email-account-intro .email-kicker,
  .email-account-intro > p:not(.email-kicker),
  .email-account-intro small,
  .email-bridge-art {
    display: none;
  }
  .email-account-intro h2 {
    font-size: 22px;
    margin: 18px 0 0;
  }
  .email-account-intro h2 br {
    display: none;
  }
  .email-account-form.auth-form {
    padding: 28px;
  }
}
@media (max-width: 520px) {
  .auth-layout.email-enrollment-layout {
    border-radius: 10px;
    margin: 0 auto 24px;
  }
  .email-account-intro {
    padding: 20px;
  }
  .email-account-form.auth-form {
    padding: 24px 18px;
  }
  .email-account-form h1 {
    font-size: 25px;
  }
  .email-code-panel {
    padding: 16px 14px;
  }
  .email-code-actions .help {
    font-size: 12px;
  }
  .email-recovery-form.auth-form {
    padding: 22px 18px;
  }
}

/* Approved interface hierarchy and responsive controls, 2026-10-22. */
:is(#app, #modal) :is(.help, .muted, .sidebar-account-sub, .b-breadcrumb, .quiet-help) {
  color: #4b607c;
}
:is(#app, #modal) :is(.primary, .secondary, .quiet, .b-btn-primary, .b-btn-secondary) {
  font-weight: 500;
  border-radius: 10px;
  transition:
    background-color 150ms,
    border-color 150ms,
    box-shadow 150ms;
}
:is(#app, #modal) :is(.primary, .secondary, .b-btn-primary, .b-btn-secondary) {
  min-height: 42px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1.5;
  gap: 8px;
}
:is(#app, #modal) :is(.primary, .b-btn-primary) {
  color: #fff;
  border: 1px solid #23468b;
  background: linear-gradient(180deg, #2d5194, #23468b);
  box-shadow:
    inset 0 1px #ffffff20,
    0 2px 4px #23468b16;
}
:is(#app, #modal) :is(.primary, .b-btn-primary):hover:not(:disabled) {
  background: #1e4081;
  border-color: #1e4081;
  box-shadow: 0 3px 7px #23468b24;
}
:is(#app, #modal) :is(.primary, .b-btn-primary):active:not(:disabled) {
  background: #19376f;
  box-shadow: inset 0 1px 3px #10295630;
}
:is(#app, #modal) :is(.secondary, .b-btn-secondary) {
  border: 1px solid #b4c5df;
  color: #294d83;
  background: #fff;
  box-shadow: 0 1px 2px #23468b05;
}
:is(#app, #modal) :is(.secondary, .b-btn-secondary):hover:not(:disabled) {
  background: #f2f5fc;
  border-color: #89a2c9;
}
:is(#app, #modal) .quiet {
  color: #365d91;
  background: transparent;
}
:is(#app, #modal) .quiet:hover:not(:disabled) {
  background: #f1f4fa;
}
:is(#app, #modal)
  :is(.primary.small, .secondary.small, .b-btn-primary.small, .b-btn-secondary.small) {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}
:is(#app, #modal) :is(.primary, .secondary) > .icon {
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
}
:is(#app, #modal) :is(button, a, input, textarea, select):focus-visible {
  outline: 3px solid #a3b8dc;
  outline-offset: 3px;
}
:is(#app, #modal) :is(.primary, .secondary):disabled {
  box-shadow: none;
}
:is(#app, #modal) input:not([type='checkbox']):not([type='radio']):not([type='range']),
:is(#app, #modal) select,
:is(#app, #modal) textarea {
  border-color: #b7c8e1;
  color: #20344d;
}
:is(#app, #modal) :is(input, textarea)::placeholder {
  color: #5a6c83;
  opacity: 1;
}
:is(#app, #modal) input:focus,
:is(#app, #modal) select:focus,
:is(#app, #modal) textarea:focus {
  border-color: #6484b7;
}
:is(#app, #modal) input[type='checkbox'],
:is(#app, #modal) input[type='radio'],
:is(#app, #modal) progress {
  accent-color: #23468b;
}
#modal #modal-title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  color: #1c3b72;
}
#modal h3 {
  font-size: 17px;
  font-weight: 550;
  line-height: 1.6;
  color: #29435e;
}
#modal .b-create-choice strong {
  font-size: 16px;
  font-weight: 500;
  color: #29435e;
}
#modal .b-create-choice:has(input:checked) {
  border-color: #91aad1;
  background: #edf2fc;
}
#modal .b-create-choice:has(input:checked) strong {
  font-weight: 550;
  color: #23468b;
}
@media (max-width: 760px) {
  :is(#app, #modal) :is(.primary, .secondary, .b-btn-primary, .b-btn-secondary) {
    min-height: 44px;
    padding: 10px 14px;
  }
  :is(#app, #modal) :is(.primary.small, .secondary.small) {
    min-height: 40px;
    padding: 8px 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :is(#app, #modal) :is(.primary, .secondary, .quiet, .b-btn-primary, .b-btn-secondary) {
    transition: none;
  }
}
#app[data-view='learn'] .b-series-progress {
  color: #4b607c;
}
:is(#app, #modal) .compose-item > header > .row {
  flex-wrap: wrap;
  max-width: 100%;
  gap: 6px;
}
:is(#app, #modal) .compose-item > header [data-compose='edit'] {
  color: #23468b;
  background: #fff;
  border-color: #c5d2e6;
  font-weight: 500;
}
:is(#app, #modal) .compose-more {
  min-width: 0;
}
:is(#app, #modal) .compose-more > summary {
  cursor: pointer;
  padding: 7px 9px;
  color: #4b607c;
  font-size: 12px;
  border-radius: 7px;
}
:is(#app, #modal) .compose-more > summary:hover {
  background: #edf2fc;
}
:is(#app, #modal) .compose-more[open] {
  flex-basis: 100%;
}
:is(#app, #modal) .compose-more > .row {
  justify-content: flex-end;
  gap: 6px;
  padding-top: 5px;
}
@media (max-width: 760px) {
  #app[data-view='learn'] .b-series-progress {
    margin-top: 6px;
    padding-block: 6px;
  }
  :is(#app, #modal) .compose-item > header button,
  :is(#app, #modal) .compose-more > summary {
    min-height: 40px;
  }
}
.sp-document .document-page.document-fit {
  max-width: calc(clamp(210px, 52vh, 480px) * var(--document-ratio));
  margin-inline: auto;
}
.sp-document .document-heading > .sp-reading-entry {
  display: none;
}
.sp-reading-surface {
  position: relative;
}
#app .sp-document .sp-reading-surface > .sp-reading-entry {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 21px;
  margin: 0;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 999px;
  background: rgb(20 44 62 / 67%);
  color: #fff;
  font-weight: 650;
  white-space: nowrap;
  box-shadow: 0 3px 14px rgb(12 31 42 / 23%);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  backdrop-filter: blur(10px) saturate(1.15);
}
#app .sp-document .sp-reading-surface > .sp-reading-entry:is(:hover, :focus-visible) {
  background: rgb(20 44 62 / 80%);
}
#app .sp-document .sp-reading-entry:focus-visible {
  outline: 3px solid #f5bf55;
  outline-offset: 3px;
}
.sp-reading-entry .icon {
  width: 19px;
  height: 19px;
  flex: none;
}
.sp-document .document-stage:has(.document-page-state button) .sp-reading-entry {
  visibility: hidden;
}
@media (forced-colors: active) {
  #app .sp-document .sp-reading-surface > .sp-reading-entry {
    border: 2px solid ButtonText;
  }
}
.sp-material-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #f6f9fa;
  border-bottom: 1px solid #dce4ef;
}
.sp-activity-preview {
  margin: 16px 0;
  border: 1px solid #cbdad4;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.sp-scenario {
  border-left: 4px solid #508375;
  padding: 14px 20px;
  background: #f3f8f5;
}
.sp-scenario h3 {
  margin: 5px 0;
}
.sp-scenario p {
  margin: 5px 0;
}
.sp-scenario ol {
  display: flex;
  gap: 6px 22px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 13px;
  color: #4a6b62;
}
.sp-scenario li {
  padding-right: 8px;
}
.sp-cue {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
.sp-cue label {
  flex: 1;
  min-width: 100px;
}
