:root {
  --ink: #172033;
  --navy: #14283f;
  --navy-2: #203a59;
  --red: #b22d3d;
  --red-dark: #8f1f31;
  --gold: #c89a4b;
  --cream: #f7f4ee;
  --paper: #ffffff;
  --muted: #667085;
  --line: #dfe4ea;
  --success: #2d7a5c;
  --success-soft: #e6f4ed;
  --warning: #b16a12;
  --shadow: 0 20px 55px rgba(20, 40, 63, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: "Aptos", "Segoe UI", Arial, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header { position: sticky; top: 0; z-index: 30; min-height: 76px; display: flex; align-items: center; gap: 22px; padding: 12px clamp(20px, 4vw, 64px); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 270px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--red); font-family: Georgia, serif; font-size: 19px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.main-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; padding: 5px; background: #f1f3f5; border-radius: 12px; }
.nav-link { padding: 9px 12px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 700; }
.nav-link.active { color: var(--ink); background: white; box-shadow: 0 4px 12px rgba(20,40,63,.08); }
.message-nav-link { display: inline-flex; align-items: center; gap: 7px; }
.message-badge { min-width: 20px; padding: 2px 5px; border-radius: 99px; color: white; background: var(--red); font-size: 12px; line-height: 1.2; text-align: center; }
.header-progress { min-width: 145px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; }
.mini-progress { width: 145px; height: 6px; margin-top: 6px; overflow: hidden; background: #e6e9ed; border-radius: 99px; }
.mini-progress span { display: block; width: 0; height: 100%; background: var(--red); border-radius: inherit; transition: width .35s ease; }
.profile-chip { min-width: 214px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.profile-initials { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--navy); font-size: 12px; font-weight: 900; }
.profile-copy { min-width: 0; }
.profile-copy strong, .profile-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy strong { font-size: 13px; }
.profile-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.sign-out-link { padding: 7px 8px; color: var(--red); border-radius: 8px; font-size: 11px; font-weight: 800; text-decoration: none; }
.sign-out-link:hover { background: #fff1f3; }

main { min-height: calc(100vh - 140px); }
.view { display: none; max-width: 1240px; margin: 0 auto; padding: 56px 28px 72px; }
.view.active { display: block; animation: fade-in .25s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
.eyebrow { margin: 0 0 10px; color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(38px, 5vw, 64px); line-height: 1.04; letter-spacing: -.025em; }
h2 { margin-bottom: 12px; font-size: 21px; }
h3 { font-size: 17px; }

.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1.25fr .5fr; align-items: center; gap: 46px; padding: clamp(34px, 6vw, 72px); min-height: 390px; color: white; background: linear-gradient(135deg, var(--navy) 0%, #203b5c 66%, #344d67 100%); border-radius: 28px; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -100px; bottom: -140px; width: 400px; height: 400px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 50px rgba(255,255,255,.035), 0 0 0 100px rgba(255,255,255,.025); }
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #edc986; }
.hero-copy { max-width: 630px; color: #dce4ed; font-size: 18px; line-height: 1.65; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 0 20px; border-radius: 11px; border: 1px solid transparent; font-weight: 800; }
.primary-button { color: white; background: var(--red); box-shadow: 0 10px 24px rgba(178,45,61,.24); }
.primary-button:hover { background: var(--red-dark); transform: translateY(-1px); }
.secondary-button { color: var(--navy); background: white; border-color: var(--line); }
.secondary-button:hover { border-color: var(--navy-2); }
.primary-button.full { width: 100%; }
.progress-ring { justify-self: end; width: 190px; height: 190px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#d9b66f 0%, rgba(255,255,255,.13) 0); transition: background .4s ease; }
.progress-ring::before { content: ""; grid-area: 1 / 1; width: 154px; height: 154px; border-radius: 50%; background: var(--navy-2); }
.progress-ring div { grid-area: 1 / 1; z-index: 1; text-align: center; }
.progress-ring strong, .progress-ring span { display: block; }
.progress-ring strong { font-size: 38px; }
.progress-ring span { color: #dce4ed; font-size: 13px; }

.dashboard-grid { display: grid; grid-template-columns: 1.45fr .8fr; gap: 20px; margin-top: 22px; }
.message-alert { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; padding: 22px 28px; border: 1px solid #eed59e; border-radius: 18px; background: #fff6df; }
.message-alert .eyebrow { margin: 0 0 5px; color: var(--red); }
.message-alert h2 { margin: 0 0 4px; font-size: 22px; }
.message-alert p:last-child { margin: 0; line-height: 1.5; }
.message-alert .primary-button { flex: 0 0 auto; }
@media (max-width: 620px) { .message-alert { align-items: stretch; flex-direction: column; padding: 20px; } }
.panel { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 9px 30px rgba(20,40,63,.05); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.status-pill { flex: 0 0 auto; padding: 6px 11px; border-radius: 99px; color: var(--success); background: var(--success-soft); font-size: 12px; font-weight: 800; }
.next-panel > p { color: var(--muted); line-height: 1.55; }
.next-actions { display: grid; gap: 9px; margin-top: 22px; }
.next-action { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.next-action.done { color: var(--muted); background: #fafafa; text-decoration: line-through; }
.task-check { appearance: none; width: 21px; height: 21px; flex: 0 0 21px; display: grid; place-content: center; margin: 0; border: 2px solid #bdc5cf; border-radius: 6px; }
.task-check:checked { border-color: var(--success); background: var(--success); }
.task-check:checked::after { content: "✓"; color: white; font-size: 14px; font-weight: 900; }
.orientation-card { background: #fffaf0; border-color: #ead9b7; }
.orientation-card dl { display: grid; gap: 14px; margin: 22px 0; }
.orientation-card dl div { display: grid; grid-template-columns: 80px 1fr; gap: 10px; }
.orientation-card dt { color: var(--muted); font-size: 13px; }
.orientation-card dd { margin: 0; font-weight: 700; }
.text-button { padding: 0; border: 0; color: var(--red); background: transparent; font-weight: 800; }
.book-count { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-weight: 800; }
.book-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0 0; padding: 0; list-style: none; }
.book-list li { display: flex; align-items: center; gap: 12px; }
.book-list strong, .book-list small { display: block; }
.book-list small { margin-top: 3px; color: var(--muted); }
.book-icon.anatomy { color: white; background: linear-gradient(135deg, #0b5970, #18a9b6); }
.download-book { grid-column: 1 / -1; padding: 16px; border: 1px solid #b8dfe3; border-radius: 14px; background: #f1fbfc; }
.book-download { display: inline-block; margin-top: 8px; color: #0b5970; font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.book-download:hover, .book-download:focus-visible { color: var(--red); }
.books-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.teams-download-panel { margin-top: 22px; }
.teams-download-panel > div:first-child { max-width: 800px; }
.teams-download-panel > div:first-child p:last-child, .teams-download-panel > p { color: var(--muted); line-height: 1.55; }
.teams-download-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.teams-download-actions a, .chapter-actions a, .exam-hero a { text-decoration: none; text-align: center; }
.resource-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 390px; }
.resource-card h2 { margin: 8px 0 10px; font-size: 26px; }
.resource-card > p:not(.eyebrow):not(.print-tip) { color: var(--muted); line-height: 1.65; }
.large-book-icon { width: 74px; height: 74px; margin-bottom: 22px; border-radius: 18px; font-size: 15px; box-shadow: 0 12px 25px rgba(20,40,63,.13); }
.book-action { width: 100%; margin-top: auto; text-align: center; text-decoration: none; }
.printable-card { color: white; background: linear-gradient(145deg, var(--navy), #244e72); border: 0; }
.printable-card .eyebrow, .printable-card > p:not(.eyebrow):not(.print-tip) { color: #dce7f0; }
.printable-card .book-action { color: var(--navy); background: white; box-shadow: none; }
.print-tip { margin: 16px 0 0; color: #dce7f0; font-size: 13px; line-height: 1.5; }
.required-books-panel { display: flex; justify-content: space-between; gap: 30px; align-items: center; margin-top: 22px; }
.required-books-panel > div { max-width: 520px; }
.required-books-panel > div > p:last-child { color: var(--muted); }
.required-code-books { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; list-style: none; margin: 0; padding: 0; }
.required-code-books li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f6f8fa; border: 1px solid var(--line); border-radius: 12px; }
.calendar-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.calendar-summary div { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.calendar-summary strong, .calendar-summary span { display: block; }
.calendar-summary strong { color: var(--navy); font-family: Georgia, serif; font-size: 27px; }
.calendar-summary span { margin-top: 4px; color: var(--muted); font-size: 13px; }
.calendar-panel { padding: 0; overflow: hidden; }
.calendar-table-wrap { overflow-x: auto; }
.class-calendar { width: 100%; border-collapse: collapse; }
.class-calendar th, .class-calendar td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.class-calendar th { color: white; background: var(--navy); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.class-calendar td:first-child { width: 84px; color: var(--red); font-weight: 900; }
.class-calendar tr:nth-child(even):not(.no-class) { background: #f8fafc; }
.class-calendar .no-class { color: #8a5a14; background: #fff5df; font-weight: 700; }
.calendar-note { margin: 0; padding: 18px; color: var(--muted); background: #fff; }
.book-icon { width: 48px; height: 58px; display: grid; place-items: center; flex: 0 0 48px; border-radius: 4px 9px 9px 4px; color: white; font-size: 10px; font-weight: 900; box-shadow: inset 5px 0 rgba(0,0,0,.12); }
.book-icon.red { background: var(--red); } .book-icon.blue { background: #2e628e; } .book-icon.gold { background: var(--gold); } .book-icon.ink { background: #4d5260; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.stats div { padding: 16px 9px; text-align: center; background: #f5f7f9; border-radius: 12px; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 27px; }
.stats span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.save-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.page-heading h1 { font-size: clamp(36px, 5vw, 54px); }
.page-heading p:last-child { max-width: 650px; color: var(--muted); }
.course-filter { min-width: 285px; }
.course-filter label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 800; }
.course-filter input { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.course-filter input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(178,45,61,.1); }
.week-grid { display: grid; gap: 14px; }
.week-card { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 17px; transition: border-color .2s ease, box-shadow .2s ease; }
.week-card.open { border-color: #c9b184; box-shadow: var(--shadow); }
.week-card.hidden-by-search { display: none; }
.week-summary { width: 100%; display: grid; grid-template-columns: 64px 1fr auto auto; align-items: center; gap: 18px; padding: 20px 24px; border: 0; color: inherit; background: transparent; text-align: left; }
.week-number { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 14px; color: white; background: var(--navy); font-size: 17px; font-weight: 900; }
.week-card.completed .week-number { background: var(--success); }
.week-summary h2 { margin: 0 0 5px; }
.week-summary p { margin: 0; color: var(--muted); font-size: 13px; }
.week-mini-progress { min-width: 94px; color: var(--muted); font-size: 12px; font-weight: 800; text-align: right; }
.chevron { font-size: 20px; transition: transform .2s ease; }
.week-card.open .chevron { transform: rotate(180deg); }
.week-body { display: none; padding: 0 24px 26px 106px; }
.week-card.open .week-body { display: block; animation: fade-in .2s ease; }
.week-columns { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.topic-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.topic-tag { padding: 7px 10px; border-radius: 99px; color: var(--navy); background: #edf2f7; font-size: 12px; font-weight: 700; }
.assignment-list { display: grid; gap: 9px; }
.assignment-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px; background: #f8f9fa; border-radius: 11px; }
.assignment-row.done { color: var(--muted); text-decoration: line-through; }
.assignment-row span { padding-top: 1px; }
.week-note { padding: 18px; color: #5c4a2c; background: #fff9ec; border-left: 4px solid var(--gold); border-radius: 10px; line-height: 1.55; }
.quiz-launch { margin-top: 18px; }
.quiz-score { margin-left: 10px; color: var(--success); font-size: 13px; font-weight: 800; }
.orientation-agenda { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; counter-reset: agenda; list-style: none; }
.orientation-agenda li { display: flex; gap: 13px; align-items: flex-start; }
.orientation-agenda li::before { counter-increment: agenda; content: counter(agenda); width: 28px; height: 28px; flex: 0 0 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--red); font-size: 12px; font-weight: 800; }

.orientation-heading { align-items: center; }
.date-block { min-width: 240px; padding: 22px 26px; color: white; background: var(--navy); border-radius: 17px; box-shadow: var(--shadow); }
.date-block strong, .date-block span { display: block; }
.date-block strong { color: #edc986; font-family: Georgia, serif; font-size: 38px; }
.date-block span { margin-top: 4px; font-size: 13px; }
.orientation-layout { display: grid; grid-template-columns: 1fr; gap: 22px; }
.contract-card { display: grid; grid-template-columns: 150px 1fr; gap: 30px; align-items: center; max-width: 920px; }
.contract-document-icon { display: grid; place-items: center; width: 130px; height: 164px; border-radius: 10px 18px 18px 10px; color: white; background: linear-gradient(145deg, var(--red), var(--red-dark)); box-shadow: 10px 10px 0 #e7c88b; font-family: Georgia, serif; font-size: 30px; font-weight: 800; }
.contract-copy h2 { margin: 6px 0 10px; }
.contract-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.contract-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 18px; }
.contract-actions a { text-decoration: none; }
.class-start-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; color: white; background: linear-gradient(145deg, var(--red), var(--red-dark)); border: 0; }
.class-start-card .eyebrow { color: #f5d99e; }
.class-start-card p:not(.eyebrow) { color: #ffe8eb; }
.class-start-card .primary-button { color: var(--red-dark); background: white; box-shadow: none; }
.big-date { margin: 8px 0 4px; font-family: Georgia, serif; font-size: 45px; font-weight: 700; }

.chapter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; }
.assessment-meta { color: var(--muted); font-size: 12px; font-weight: 700; }
.reading-modal { width: min(1040px, 100%); max-height: 94vh; padding: clamp(24px, 4vw, 46px); }
.reading-pages { display: grid; gap: 34px; margin-top: 30px; }
.reading-page { width: 100%; max-width: 840px; margin: 0 auto; padding: clamp(28px, 5vw, 54px); color: #26354a; background: #fff; border: 1px solid #e4ded3; border-radius: 18px; box-shadow: 0 14px 38px rgba(20,40,63,.08); }
.reading-page-label { display: inline-block; margin-bottom: 28px; padding: 7px 11px; color: var(--red); background: #fff0f2; border-radius: 99px; font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.reader-content { font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.82; }
.textbook-figure { margin: 0 0 28px; }
.textbook-figure img { display: block; width: 100%; height: auto; border: 1px solid #cad5df; border-radius: 12px; background: #fff; }
.textbook-figure figcaption { margin-top: 10px; color: #516275; font-size: 14px; font-weight: 700; text-align: center; }
.reader-chapter-number { margin-bottom: 8px; color: var(--red); font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 900; letter-spacing: .16em; }
.reader-page-title { margin: 0 0 30px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 4vw, 40px); line-height: 1.15; }
.reader-section-title { margin: 34px 0 16px; padding: 12px 16px; color: var(--navy); background: #eef3f8; border-left: 5px solid var(--red); border-radius: 7px; font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 20px; line-height: 1.35; }
.reader-major-heading { margin: 38px 0 18px; padding-bottom: 9px; color: var(--red-dark); border-bottom: 2px solid #ead6d9; font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 21px; }
.reader-paragraph { margin: 0 0 22px; }
.reader-numbered, .reader-option, .reader-bullet { display: grid; grid-template-columns: 36px 1fr; gap: 13px; align-items: start; margin: 12px 0; }
.reader-numbered > span, .reader-option > span, .reader-bullet > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--navy); font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 12px; font-weight: 900; }
.reader-numbered p, .reader-option p, .reader-bullet p { margin: 1px 0 0; }
.reader-option { margin-left: 48px; padding: 9px 12px; background: #f8f9fb; border: 1px solid #e7eaee; border-radius: 10px; }
.reader-option > span { color: var(--navy); background: white; border: 1px solid #cbd3dc; }
.reader-bullet > span { color: var(--success); background: var(--success-soft); }
.reader-tip { margin: 28px 0; padding: 22px 24px; color: #554321; background: #fff8e8; border-left: 5px solid var(--gold); border-radius: 10px; }
.reader-tip strong { display: block; margin-bottom: 6px; color: #9a6417; font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 11px; letter-spacing: .12em; }
.reader-tip p { margin: 0; }
.reader-example, .reader-warning { margin: 24px 0; padding: 22px 24px; border-radius: 10px; }
.reader-example { color: #193f35; background: #edf8f4; border-left: 5px solid #287c65; }
.reader-warning { color: #61333a; background: #fff0f2; border-left: 5px solid var(--red); }
.reader-example strong, .reader-warning strong { display: block; margin-bottom: 7px; font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 11px; letter-spacing: .12em; }
.reader-example strong { color: #1f6b57; }
.reader-warning strong { color: var(--red-dark); }
.reader-example p, .reader-warning p { margin: 0; }
.reader-directions { margin: 20px 0; padding: 18px 20px; color: #3f4d5d; background: #f1f4f7; border-radius: 10px; font-family: "Aptos", "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.65; }
.assessment-progress { height: 7px; margin: 14px 0 28px; overflow: hidden; background: #e7e9ed; border-radius: 99px; }
.assessment-progress span { display: block; height: 100%; background: var(--red); transition: width .2s ease; }
.assessment-question { margin-bottom: 22px; }
.assessment-question h3 { line-height: 1.45; }
.assessment-result { padding: 28px; border-radius: 16px; background: var(--success-soft); text-align: center; }
.assessment-result strong { display: block; color: var(--success); font-size: 45px; }

.overall-grade { min-width: 160px; padding: 20px; color: white; background: var(--navy); border-radius: 17px; text-align: center; }
.overall-grade strong, .overall-grade span { display: block; }
.overall-grade strong { font-size: 34px; }
.overall-grade span { margin-top: 4px; color: #dce4ed; font-size: 12px; }
.grade-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.grade-stat { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 15px; text-align: center; }
.grade-stat strong, .grade-stat span { display: block; }
.grade-stat strong { font-size: 28px; }
.grade-stat span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.grade-table-wrap { overflow-x: auto; padding: 10px; }
.grade-table { width: 100%; border-collapse: collapse; }
.grade-table th, .grade-table td { padding: 15px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.grade-table th { color: var(--muted); background: #f7f8fa; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.grade-table tr:last-child td { border-bottom: 0; }
.grade-badge { display: inline-block; padding: 5px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.grade-badge.complete { color: var(--success); background: var(--success-soft); }
.grade-badge.pending { color: var(--warning); background: #fff5e5; }
.instructor-table td:first-child { min-width: 210px; }
.student-cell strong, .student-cell small { display: block; }
.student-cell small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.gradebook-loading { color: var(--muted); text-align: center; }
.messages-layout { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(0, 1.28fr); gap: 20px; align-items: start; }
.message-compose { display: grid; gap: 11px; }
.message-compose h2 { margin-bottom: 5px; }
.message-compose label { color: var(--muted); font-size: 12px; font-weight: 800; }
.message-compose textarea, .message-compose select { width: 100%; padding: 13px 14px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 11px; outline: none; }
.message-compose textarea { min-height: 170px; resize: vertical; line-height: 1.55; }
.message-compose textarea:focus, .message-compose select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(178,45,61,.1); }
.message-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
#message-status { color: var(--muted); font-size: 12px; }
.message-inbox { min-height: 430px; }
.message-list { display: grid; gap: 12px; margin-top: 14px; }
.message-item { max-width: 86%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; background: #f6f8fa; }
.message-item.mine { justify-self: end; color: white; background: var(--navy); border-color: var(--navy); border-radius: 15px 15px 4px 15px; }
.message-item.announcement { max-width: 100%; color: #5c4a2c; background: #fff9ec; border-color: #ead9b7; border-radius: 12px; }
.message-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.message-item.mine .message-meta { color: #cbd8e5; }
.message-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }

.exam-intro { display: grid; grid-template-columns: 1.35fr .65fr; gap: 24px; align-items: stretch; }
.exam-hero { padding: clamp(35px, 6vw, 70px); color: white; background: var(--navy); border-radius: 28px; box-shadow: var(--shadow); }
.exam-hero .eyebrow { color: #edc986; }
.exam-hero > p:not(.eyebrow):not(.fine-print) { max-width: 720px; color: #dce4ed; font-size: 17px; line-height: 1.65; }
.exam-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 34px 0; }
.exam-facts div { padding: 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; background: rgba(255,255,255,.05); }
.exam-facts strong, .exam-facts span { display: block; }
.exam-facts strong { font-size: 28px; }
.exam-facts span { margin-top: 4px; color: #cfd9e3; font-size: 12px; }
.fine-print { margin: 15px 0 0; color: #becad6; font-size: 11px; }
.exam-tips { padding: 34px; }
.check-list { display: grid; gap: 18px; margin: 24px 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 30px; line-height: 1.5; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: var(--success); background: var(--success-soft); font-size: 12px; font-weight: 900; }
.hidden { display: none !important; }
@media print {
  .site-header, footer, .calendar-heading .secondary-button { display: none !important; }
  body { background: #fff; }
  .view { display: none !important; }
  #calendar-view.active { display: block !important; max-width: none; padding: 0; }
  .calendar-summary div, .calendar-panel { box-shadow: none; }
  .class-calendar th, .class-calendar td { padding: 9px 10px; font-size: 11px; }
}
.exam-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; padding: 18px 22px; color: white; background: var(--navy); border-radius: 16px; }
.exam-toolbar .eyebrow { margin-bottom: 3px; color: #edc986; }
.exam-tools { display: flex; align-items: center; gap: 12px; }
.timer { min-width: 114px; padding: 12px 15px; border-radius: 10px; background: rgba(255,255,255,.12); font-variant-numeric: tabular-nums; font-weight: 800; text-align: center; }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
.question-card { min-height: 540px; padding: 38px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.question-category { color: var(--red); font-size: 11px; font-weight: 800; letter-spacing: .11em; }
.question-card h2 { margin: 16px 0 28px; font-size: 24px; line-height: 1.45; }
.answer-options { display: grid; gap: 12px; }
.answer-option { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: .15s ease; }
.answer-option:hover { border-color: #aab5c2; background: #fafbfc; }
.answer-option.selected { border-color: var(--red); background: #fff4f5; }
.answer-option input { position: absolute; opacity: 0; pointer-events: none; }
.option-letter { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: #eef1f4; font-weight: 800; }
.answer-option.selected .option-letter { color: white; background: var(--red); }
.question-controls { display: flex; justify-content: space-between; gap: 15px; margin-top: 32px; }
.question-nav-panel { align-self: start; position: sticky; top: 100px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.question-nav-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.question-nav-heading h2 { font-size: 17px; }
.question-nav-heading span { color: var(--muted); font-size: 11px; }
.question-nav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; max-height: 330px; overflow: auto; margin: 12px 0 18px; padding-right: 5px; }
.question-jump { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #fafafa; font-size: 11px; font-weight: 800; }
.question-jump.current { color: white; border-color: var(--navy); background: var(--navy); }
.question-jump.answered:not(.current) { color: white; border-color: var(--success); background: var(--success); }
.question-jump.flagged { box-shadow: inset 0 -3px var(--gold); }
.legend { display: flex; gap: 14px; margin-bottom: 18px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.answered-dot { background: var(--success); }.flagged-dot { background: var(--gold); }
.exam-results { max-width: 920px; margin: 0 auto; }
.result-summary { padding: 46px; color: white; background: var(--navy); border-radius: 24px; text-align: center; }
.result-score { width: 150px; height: 150px; display: grid; place-items: center; margin: 22px auto; border: 9px solid rgba(255,255,255,.2); border-radius: 50%; font-size: 36px; font-weight: 900; }
.result-summary.passed .result-score { border-color: #61b88f; }.result-summary.needs-work .result-score { border-color: #e2aa5a; }
.result-actions { display: flex; justify-content: center; gap: 12px; margin-top: 24px; }
.breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0; }
.breakdown div { padding: 18px; background: white; border: 1px solid var(--line); border-radius: 13px; text-align: center; }
.breakdown strong, .breakdown span { display: block; }
.breakdown span { margin-top: 5px; color: var(--muted); font-size: 12px; }
.review-list { display: grid; gap: 12px; }
.review-item { padding: 20px; background: white; border: 1px solid var(--line); border-radius: 13px; }
.review-item h3 { margin-bottom: 9px; }
.review-item p { margin: 5px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.review-item .correct-answer { color: var(--success); font-weight: 800; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(8,19,33,.68); }
.modal { position: relative; width: min(680px, 100%); max-height: 88vh; overflow: auto; padding: 34px; background: white; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--muted); background: #f0f2f4; font-size: 23px; }
.quiz-question { margin: 22px 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.quiz-question:last-of-type { border-bottom: 0; }
.quiz-question p { font-weight: 700; line-height: 1.45; }
.quiz-question label { display: block; margin: 8px 0; color: var(--muted); cursor: pointer; }
.quiz-result { padding: 18px; border-radius: 12px; color: var(--success); background: var(--success-soft); text-align: center; }

.answer-key-panel { margin-top: 24px; }
.answer-key-heading { align-items: end; gap: 24px; }
.answer-key-heading p { margin-bottom: 0; }
.answer-key-picker { display: grid; gap: 7px; min-width: min(100%, 440px); color: var(--muted); font-size: 13px; font-weight: 800; }
.answer-key-picker select { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; font: inherit; }
.answer-key-content { margin-top: 22px; }
.answer-key-title-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.answer-key-title-row h3 { margin: 0; }
.answer-key-title-row span { color: var(--muted); font-weight: 800; white-space: nowrap; }
.answer-key-list { display: grid; gap: 0; margin: 0; padding: 0 0 0 29px; }
.answer-key-list li { padding: 16px 0 16px 6px; border-bottom: 1px solid var(--line); }
.answer-key-list li:last-child { border-bottom: 0; }
.answer-key-question { display: grid; gap: 8px; }
.answer-key-correct { width: fit-content; padding: 7px 10px; border-radius: 9px; color: var(--success); background: var(--success-soft); font-weight: 900; }
.answer-key-question p { margin: 0; color: var(--muted); line-height: 1.5; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(20px, 4vw, 64px); color: #9ba7b4; background: #101e2e; font-size: 12px; }

@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; gap: 10px; }
  .brand { min-width: 0; margin-right: auto; }
  .main-nav { order: 3; width: 100%; justify-content: center; }
  .header-progress { display: none; }
  .profile-chip { min-width: 0; max-width: min(420px, 100%); }
  .hero { grid-template-columns: 1fr; }
  .progress-ring { justify-self: start; width: 150px; height: 150px; }
  .progress-ring::before { width: 120px; height: 120px; }
  .dashboard-grid, .exam-intro, .exam-layout { grid-template-columns: 1fr; }
  .messages-layout { grid-template-columns: 1fr; }
  .orientation-layout { grid-template-columns: 1fr; }
  .page-heading { display: block; }
  .course-filter { margin-top: 20px; }
  .question-nav-panel { position: static; }
  .question-nav { grid-template-columns: repeat(10, 1fr); max-height: none; }
}

@media (max-width: 620px) {
  .view { padding: 34px 16px 56px; }
  .brand small { display: none; }
  .site-header { padding: 10px 14px; }
  .main-nav { justify-content: flex-start; overflow-x: auto; }
  .nav-link { flex: 0 0 auto; padding: 8px 10px; font-size: 12px; }
  .profile-copy { max-width: 116px; }
  .profile-copy small { display: none; }
  .sign-out-link { display: none; }
  .hero { padding: 32px 23px; border-radius: 20px; }
  .hero h1 { font-size: 40px; }
  .dashboard-grid { gap: 14px; }
  .panel { padding: 22px; }
  .book-list { grid-template-columns: 1fr; }
  .books-library-grid { grid-template-columns: 1fr; }
  .contract-card { grid-template-columns: 1fr; }
  .contract-document-icon { width: 96px; height: 122px; }
  .resource-card { min-height: 0; }
  .required-books-panel { align-items: flex-start; flex-direction: column; }
  .required-code-books { justify-content: flex-start; }
  .stats { grid-template-columns: 1fr; }
  .week-summary { grid-template-columns: 48px 1fr auto; gap: 12px; padding: 16px; }
  .week-number { width: 46px; height: 46px; }
  .week-mini-progress { display: none; }
  .week-body { padding: 0 16px 22px; }
  .week-columns { grid-template-columns: 1fr; }
  .exam-hero { padding: 34px 22px; }
  .exam-facts { gap: 7px; }
  .exam-facts div { padding: 13px 8px; }
  .question-card { min-height: 0; padding: 24px 18px; }
  .reading-page { padding: 24px 19px; }
  .reader-content { font-size: 16px; line-height: 1.72; }
  .reader-option { margin-left: 0; }
  .question-card h2 { font-size: 20px; }
  .exam-toolbar { align-items: flex-start; }
  .exam-tools { flex-direction: column-reverse; align-items: flex-end; }
  .question-nav { grid-template-columns: repeat(5, 1fr); }
  .breakdown { grid-template-columns: 1fr; }
  .grade-summary { grid-template-columns: 1fr; }
  .date-block { margin-top: 20px; }
  .answer-key-heading, .answer-key-title-row { align-items: stretch; flex-direction: column; }
  .answer-key-picker { min-width: 100%; }
  .calendar-summary { grid-template-columns: 1fr; }
  .calendar-panel { padding: 0; }
  .class-calendar th, .class-calendar td { min-width: 130px; padding: 12px; }
  .class-calendar th:first-child, .class-calendar td:first-child { min-width: 68px; }
  footer { display: block; text-align: center; }
  footer span { display: block; margin: 5px; }
}

/* Task-first student navigation */
.site-header {flex-wrap:wrap;gap:12px;position:relative;}
.brand {min-width:200px;}
.main-nav {flex-wrap:wrap;justify-content:center;}
.resource-nav {display:flex;flex-wrap:wrap;justify-content:center;gap:5px;padding:10px 18px;background:white;border-bottom:1px solid var(--line);}
.resource-nav .nav-link {min-height:42px;}
.student-shortcuts {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:24px 0;}
.student-shortcuts button {text-align:left;min-height:116px;border:1px solid var(--line);border-radius:15px;background:white;padding:20px;color:var(--navy);}
.student-shortcuts button:hover {border-color:var(--red);background:#fff8f5;}
.student-shortcuts strong,.student-shortcuts span {display:block;}
.student-shortcuts strong {font-size:17px;margin-bottom:9px;}
.student-shortcuts span {font-size:14px;color:var(--muted);line-height:1.5;}
.resource-search {display:block;max-width:540px;font-weight:700;margin-bottom:24px;}
.resource-search input {display:block;width:100%;margin-top:8px;padding:14px;border:1px solid var(--line);border-radius:10px;font:inherit;}
[hidden] {display:none!important;}
#class-announcement {margin-top:24px;padding:24px;}
@media(max-width:1000px){.student-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr));}.profile-chip{margin-left:auto;}.main-nav{order:3;width:100%;}}
@media(max-width:560px){.student-shortcuts{grid-template-columns:1fr;}.student-shortcuts button{min-height:90px;}.view{padding:28px 16px 48px;}.nav-link{padding:12px 9px;}.hero{padding:28px;min-height:260px;}.profile-chip{min-width:0;max-width:100%;}.resource-nav{justify-content:flex-start;}.books-library-grid{grid-template-columns:1fr;}}

.completion-chapter {padding:18px 0;border-bottom:1px solid var(--line);}.completion-items {display:flex;flex-wrap:wrap;gap:10px;}.completion-label {display:inline-block;padding:8px 12px;margin:4px 0;border-radius:8px;background:#f1f3f5;color:var(--muted);font-size:14px;}.completion-label.done {background:var(--success-soft);color:var(--success);font-weight:700;}.completion-manual {display:flex;align-items:center;gap:10px;margin:22px 0 12px;font-weight:700;}.completion-manual input {width:22px;height:22px;}#completion-list {margin-top:16px;}#completion-list summary,details>summary {cursor:pointer;padding:12px 0;}

/* Keep every chapter's resources together. */
.chapter-resource-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:20px 0;}
.chapter-resource{min-width:0;padding:20px;border:1px solid var(--line);border-radius:14px;background:#fff;display:flex;flex-direction:column;align-items:flex-start;gap:10px;}
.chapter-resource h3,.chapter-resource p{margin:0;}
.chapter-resource p{font-size:14px;line-height:1.5;}
.chapter-resource .primary-button{width:100%;margin-top:auto;text-align:center;padding:12px;min-height:48px;}
.chapter-resource .text-button{font-size:13px;}
.chapter-reading{display:flex;align-items:center;flex-wrap:wrap;gap:16px;padding:14px;border-radius:10px;background:#f1f3f5;}
.chapter-reading p{margin:0;font-size:14px;}
.chapter-topic-details{margin-top:18px;}
@media(max-width:1100px){.chapter-resource-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.chapter-resource-grid{grid-template-columns:1fr;}.chapter-resource{padding:18px;}}
