/* ============================================================
   AMSKU app theme — portal redesign palette (Inter + navy/blue).
   Tokens follow the approved design proposal; the structural
   redesign layer lives in portal.css (loaded after this file).
   ============================================================ */
:root {
  --primary: #0b5cad;
  --primary-dark: #094a8c;
  --primary-light: #e8f1fb;
  --dark: #0f2340;
  --text: #12213a;
  --text-mid: #55657a;
  --muted: #7a8797;
  --bg: #f3f5f9;
  --card: #ffffff;
  --border: #e3e8ef;
  --success: #19864b;
  --success-bg: #e3f5ea;
  --danger: #c41e1e;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -14px rgba(16, 24, 40, 0.18);
  --shadow-md: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -14px rgba(16, 24, 40, 0.18);
  --shadow-lg: 0 12px 40px -18px rgba(16, 24, 40, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  /* Shared width for the wide (classroom) pages. */
  --page-wide: 1560px;
  /* Redesign tokens (portal.css) */
  --panel-2: #f7f9fc;
  --line-2: #edf1f5;
  --navy: #0f2340;
  --blue-2: #3b8fe0;
  --blue-tint: #e8f1fb;
  --blue-tint-2: #d7e7f8;
  --yellow: #ffd23f;
  --yellow-hover: #f5c520;
  --yellow-ink: #12213a;
  --yellow-tint: #fff6d6;
  --red-tint: #fde8e8;
  --amber: #a8691a;
  --amber-tint: #fdf1d8;
  --violet: #6d28d9;
  --violet-tint: #eee9fb;
  --focus: 0 0 0 3px rgba(11, 92, 173, 0.28);
  --sidebar-w: 232px;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === HEADER === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
}
.brand img {
  height: 38px;
  width: auto;
  display: block;
}

/* === SKOOL-STYLE TOP NAV (logged in) === */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.topnav-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--page-wide);
  margin: 0 auto;
  padding: 10px 20px;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: var(--dark);
}
.topnav-brand img {
  height: 34px;
  width: auto;
  display: block;
}
.topnav-brand span {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--dark);
  letter-spacing: -0.01em;
}
.topnav-search {
  flex: 1;
  max-width: 520px;
  margin: 0;
}
.topnav-search input {
  width: 100%;
  padding: 9px 16px;
  border-radius: 50px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.topnav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.topnav-icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-mid);
}
.topnav-icon:hover {
  background: var(--bg);
}
.topnav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topnav-avatar {
  display: inline-flex;
  margin-left: 4px;
}
.topnav-avatar img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
}
.topnav-tabs {
  display: flex;
  gap: 2px;
  max-width: var(--page-wide);
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topnav-tabs::-webkit-scrollbar {
  display: none;
}
/* Center the tabs under the page column. Auto margins on the first/last tab
   (instead of justify-content: center) keep the row scrollable on phones —
   a centered overflowing flex row would clip its left-most tabs. */
.topnav-tabs a:first-child {
  margin-left: auto;
}
.topnav-tabs a:last-child {
  margin-right: auto;
}
.topnav-tabs a {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-mid);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.topnav-tabs a:hover {
  color: var(--dark);
}
.topnav-tabs a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
/* Residency nav tab — a normal tab, but orange with a sparkle and no underline */
.topnav-tabs a.residency-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f97316;
  font-weight: 700;
  border-bottom-color: transparent;
}
.topnav-tabs a.residency-link:hover,
.topnav-tabs a.residency-link.active {
  color: #ea580c;
  border-bottom-color: transparent;
}

@media (max-width: 700px) {
  .topnav-brand span {
    display: none;
  }
  .topnav-search {
    display: none;
  }
  .topnav-bar {
    padding: 10px 14px;
  }
  .topnav-tabs {
    padding: 0 10px;
  }
}

/* === CALENDAR MONTH GRID === */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
}
.cal-title {
  margin: 0;
  font-size: 1.3rem;
  text-align: center;
}
.cal-nav {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  white-space: nowrap;
}
.cal-nav:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cal-add {
  font-weight: 600;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.cal-dow {
  text-align: center;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 2px;
}
.cal-cell {
  min-height: 98px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}
.cal-cell.muted {
  background: var(--bg);
}
.cal-cell.muted .cal-date {
  color: var(--muted);
}
.cal-cell.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.cal-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-mid);
}
.cal-cell.today .cal-date {
  color: var(--primary);
}
.cal-event {
  display: block;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.join:hover {
  background: var(--primary);
  color: #fff;
}
.cal-event.locked {
  background: var(--bg);
  color: var(--muted);
}
.cal-event .icon {
  width: 0.82em;
  height: 0.82em;
  margin-right: 2px;
}
.cal-list-title {
  margin-top: 28px;
}
.badge.recurring {
  background: #ede9fe;
  color: #6d28d9;
}
.badge.audience {
  background: #fef3c7;
  color: #b45309;
}
.audience-help {
  font-size: 0.85rem;
  margin: 0 0 10px;
}
.recur-fields {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px 16px;
  margin: 4px 0;
}
.recur-fields legend {
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 6px;
  color: var(--text-mid);
}
@media (max-width: 700px) {
  .cal-cell {
    min-height: 62px;
    padding: 4px;
  }
  .cal-event {
    font-size: 0.66rem;
    padding: 2px 4px;
  }
  .cal-dow {
    font-size: 0.62rem;
  }
  .cal-grid {
    gap: 3px;
  }
}

.course-delete {
  margin-top: 16px;
}
.module-quiz {
  margin-top: 14px;
  font-weight: 600;
  font-size: 0.95rem;
}
.course-certificate {
  margin: 26px 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.course-certificate .module-title {
  margin-top: 0;
}
.cert-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 12px 22px;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border-radius: 50px;
  transition: all 0.25s var(--ease);
}
.cert-download:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.quiz-q-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 6px 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* === BUNDLES === */
.bundle-gate {
  background: var(--primary-light);
  border: 1px solid #cce4f0;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}
.bundle-gate p {
  margin: 0 0 14px;
  color: var(--text-mid);
}
.bundle-courses-title {
  margin-top: 28px;
}
.bundle-admin {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}
.bundle-admin h3 {
  margin-top: 24px;
}
.bundle-course-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}
.bundle-course-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

/* === STRATEGY-CALL / CHOOSE-YOUR-PATH PAGE === */
.dca-hero {
  text-align: center;
  margin: 8px 0 28px;
}
.dca-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  margin: 0 0 10px;
}
.dca-hero p {
  color: var(--text-mid);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto;
}
.dca-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 620px;
  margin: 0 auto;
}
.dca-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.dca-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.dca-card h2 {
  font-size: 1.4rem;
  margin: 0 0 12px;
  color: var(--dark);
}
.dca-card p {
  color: var(--text-mid);
  line-height: 1.65;
  margin: 0 0 24px;
  flex: 1 1 auto;
}
.dca-card--feature {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: transparent;
}
.dca-card--feature h2 {
  color: #fff;
}
.dca-card--feature p {
  color: rgba(255, 255, 255, 0.88);
}
.dca-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  padding: 12px 24px;
  border-radius: 50px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  border: none;
  text-decoration: none;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.dca-cta:hover {
  background: var(--primary-dark);
  transform: translateX(2px);
}
.dca-card--feature .dca-cta {
  background: #fff;
  color: var(--primary);
}
.dca-card--feature .dca-cta:hover {
  background: var(--primary-light);
}

/* Calendly popup */
.dca-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dca-modal[hidden] {
  display: none;
}
.dca-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 41, 0.6);
}
.dca-modal-box {
  position: relative;
  width: 100%;
  max-width: 900px;
  height: 80vh;
  max-height: 760px;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.dca-modal-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.dca-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.dca-modal-close:hover {
  background: #fff;
  color: var(--danger);
}
@media (max-width: 700px) {
  .dca-cards {
    grid-template-columns: 1fr;
  }
  .dca-modal-box {
    height: 90vh;
  }
}

/* === INLINE ICONS === */
.icon {
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.16em;
  flex-shrink: 0;
}
.topnav-icon .icon {
  width: 21px;
  height: 21px;
  vertical-align: middle;
}
.like-btn .icon,
.like-count .icon {
  vertical-align: -0.18em;
}
.lesson-check .icon {
  width: 1.15rem;
  height: 1.15rem;
}

/* === COMMUNITY TABS (General / Diagnostics / Injections) === */
.community-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 20px;
}
.community-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-mid);
  background: var(--card);
  border: 1px solid var(--border);
}
.community-tab:hover {
  color: var(--dark);
  border-color: var(--primary);
}
.community-tab.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

/* === LAYOUT === */
.container {
  max-width: 920px;
  margin: 32px auto 64px;
  padding: 0 20px;
}
/* Wide pages (classroom, bundles, courses, lessons, quizzes) use the full
   screen instead of the narrow feed column — no more giant empty margins. */
.container.wide {
  max-width: var(--page-wide);
}
/* Classroom / bundle / course page header: title, breadcrumb, badges and
   description sit centered over the card grid instead of hugging the left. */
.classroom-head {
  text-align: center;
  margin-bottom: 8px;
}
.classroom-head .course-badges {
  justify-content: center;
}
.classroom-head .bundle-desc,
.classroom-head .course-desc {
  margin-left: auto;
  margin-right: auto;
}
.classroom-empty,
.bundle-courses-title,
.bundle-gate {
  text-align: center;
}
.classroom-empty {
  width: 100%;
}
.container.wide > .progress .progress-label {
  text-align: center;
}
/* Breadcrumb back-links: quieter than the page title they sit above. */
.page-breadcrumb {
  margin: 0 0 6px;
  font-size: 0.88rem;
}
.page-breadcrumb a {
  color: var(--muted);
  font-weight: 600;
}
.page-breadcrumb a:hover {
  color: var(--primary);
}

/* === TYPOGRAPHY === */
h1 {
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dark);
  margin: 0 0 16px;
  line-height: 1.2;
}
h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 12px;
}
p {
  color: var(--text-mid);
  line-height: 1.65;
}
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--primary-dark);
}
ul {
  line-height: 1.8;
  color: var(--text);
}
.muted {
  color: var(--muted);
}
.error {
  color: var(--danger);
  font-weight: 600;
}
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* === BUTTONS === */
button,
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 50px;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  transition: all 0.25s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
button:hover,
.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
button[disabled] {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.secondary-btn {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
}
.secondary-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}
.delete-btn {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  padding: 8px 18px;
  font-size: 0.9rem;
}
.delete-btn:hover {
  background: #fff5f5;
  color: var(--danger);
  border-color: var(--danger);
}

/* === FORMS === */
label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 107, 161, 0.12);
}
.inline-form {
  margin: 14px 0;
}

/* === GENERIC CARD HELPERS === */
.feed,
.comments,
.event-list,
.notif-list,
.dm-list,
.admin-table,
.search-results,
.course-list,
.quiz-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

/* === PLANS === */
.plans {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.plan-card {
  flex: 1 1 240px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
}
.plan-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.plan-card h2 {
  margin: 0 0 8px;
}
.price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.interval {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}
.trial-badge {
  display: inline-block;
  margin: 12px 0;
  padding: 4px 14px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* === COMMUNITY / POSTS === */
.post-form,
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.post-form button,
.comment-form button {
  align-self: flex-start;
}
.upgrade-note {
  padding: 16px 18px;
  background: var(--primary-light);
  border: 1px solid #cce4f0;
  border-radius: var(--radius-sm);
  color: var(--text-mid);
}
.post {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease;
}
.post:hover {
  box-shadow: var(--shadow-md);
}
.post-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.post-author {
  font-weight: 600;
  color: var(--text);
}
.post-category {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 50px;
  font-weight: 600;
}
.post-title {
  margin: 4px 0;
  font-size: 1.25rem;
  color: var(--dark);
}
.post-body {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
}
.post-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.post-comments-link {
  font-size: 0.9rem;
  font-weight: 600;
}
.post-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin-top: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.post-image-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
}
.comments-heading {
  margin-top: 28px;
}
.comment {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.comment-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.comment-body {
  margin: 4px 0 0;
  white-space: pre-wrap;
  color: var(--text);
}

/* like + delete pills */
.like-form,
.delete-form {
  margin: 0;
}
.like-btn {
  padding: 6px 16px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text-mid);
  border: 1.5px solid var(--border);
}
.like-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff5f5;
}
.like-btn.liked {
  background: #fff0f0;
  color: var(--danger);
  border-color: var(--danger);
}
.like-count {
  font-size: 0.9rem;
  color: var(--muted);
}

/* === COURSES === */
.course-card {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease);
}
.course-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.course-card h2 {
  margin: 8px 0;
}
.course-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--bg);
}
.course-hero {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 10px 0 16px;
  box-shadow: var(--shadow-sm);
  background: var(--bg);
}
.course-badges,
.event-badges {
  margin-bottom: 6px;
  display: flex;
  gap: 6px;
}
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--border);
  color: var(--text-mid);
}
.badge.free {
  background: var(--success-bg);
  color: var(--success);
}
.badge.paid {
  background: var(--primary-light);
  color: var(--primary);
}
.course-meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.course-progress {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 600;
  margin: 2px 0 0;
}
.course-open {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
}
.course-open.locked {
  color: var(--muted);
}
.course-quiz,
.course-admin {
  margin: 8px 0;
  font-weight: 600;
}

/* modules + lessons */
.module {
  margin-top: 24px;
}
.module-title {
  font-size: 1.15rem;
  margin-bottom: 10px;
  color: var(--dark);
}
.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lesson-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.lesson-list a {
  text-decoration: none;
  font-weight: 500;
}
.lesson-check {
  display: inline-block;
  width: 1.25rem;
  color: var(--success);
  font-weight: 700;
}
.edit-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-left: auto;
}
.edit-link:hover {
  color: var(--primary);
}
.reorder-form {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}
.reorder-form button {
  padding: 2px 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.reorder-form button:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.lesson-breadcrumb {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}
.video-wrap {
  position: relative;
  padding-top: 56.25%;
  margin: 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.video-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.lesson-content {
  white-space: pre-wrap;
}
/* Mark complete: the lesson's primary action — solid, bold, and on the right
   where the eye goes for "next step". */
.complete-form {
  display: flex;
  justify-content: flex-end;
}
.complete-btn {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border: 1.5px solid var(--primary);
}
.complete-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}
.complete-btn.done {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.complete-btn.done:hover {
  background: #128a3e;
  border-color: #128a3e;
}

/* progress bar (native <progress>) */
.progress {
  margin: 16px 0 20px;
}
.progress-label {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-mid);
  font-weight: 600;
}
.progress-bar {
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 50px;
  overflow: hidden;
  background: var(--border);
  -webkit-appearance: none;
  appearance: none;
}
.progress-bar::-webkit-progress-bar {
  background: var(--border);
  border-radius: 50px;
}
.progress-bar::-webkit-progress-value {
  background: var(--primary);
  border-radius: 50px;
}
.progress-bar::-moz-progress-bar {
  background: var(--primary);
  border-radius: 50px;
}

/* === GAMIFICATION === */
.level-card {
  margin: 18px 0;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.level-head {
  margin: 0 0 10px;
  color: var(--text);
}
.level-badge {
  display: inline-block;
  margin-right: 10px;
  padding: 3px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}
.leaderboard {
  list-style: none;
  counter-reset: rank;
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lb-row {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.lb-row::before {
  content: counter(rank);
  width: 1.6rem;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}
.lb-row.me {
  border-color: var(--primary);
  background: var(--primary-light);
}
.lb-name {
  flex: 1;
  color: var(--text);
  font-weight: 600;
}
.lb-level {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}
.lb-points {
  font-weight: 800;
  color: var(--dark);
}

/* === EVENTS === */
.event-card {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease;
}
.event-card:hover {
  box-shadow: var(--shadow-md);
}
.event-card h2 {
  margin: 4px 0;
}
.event-time {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
  margin: 4px 0;
}
.event-join {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
}
.event-join.locked {
  color: var(--muted);
}
.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.checkbox-label input {
  width: auto;
}

/* === NOTIFICATIONS === */
.notif {
  display: block;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.notif:hover {
  border-color: var(--primary);
  color: var(--text);
}
.notif.unread {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
}

/* === SEARCH === */
.search-form {
  display: flex;
  gap: 10px;
  margin: 18px 0;
}
.search-form input {
  flex: 1;
}
.search-form button {
  flex-shrink: 0;
}
.search-heading {
  margin: 24px 0 8px;
}
.search-result {
  display: block;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.search-result:hover {
  border-color: var(--primary);
}
.search-title {
  display: block;
  color: var(--dark);
  font-weight: 700;
}
.search-sub {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

/* === DIRECT MESSAGES === */
.dm-heading {
  margin: 24px 0 8px;
}
.dm-row,
.dm-request {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.dm-row:hover {
  border-color: var(--primary);
}
.dm-request {
  flex-wrap: wrap;
}
.dm-row-link {
  color: var(--text);
  font-weight: 600;
}
.dm-request-actions {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
.dm-name {
  font-weight: 600;
}
.dm-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0;
}
.dm-msg {
  max-width: 80%;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
}
.dm-msg.mine {
  align-self: flex-end;
  background: var(--primary);
  border-color: var(--primary);
}
.dm-msg.mine .dm-msg-meta,
.dm-msg.mine .dm-msg-body {
  color: #fff;
}
.dm-msg-meta {
  font-size: 0.75rem;
  color: var(--muted);
}
.dm-msg-body {
  margin: 3px 0 0;
  white-space: pre-wrap;
  color: var(--text);
}

/* === QUIZZES === */
.quiz-q {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.quiz-q-prompt {
  font-weight: 700;
  color: var(--dark);
  font-size: 1.05rem;
  margin: 0 0 12px;
}
/* Answer choices render as full-width tappable rows with a visible border —
   easier to scan down a narrow column and a bigger touch target on phones. */
.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin: 8px 0;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-opt:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.quiz-opt input {
  margin-top: 4px;
}
.quiz-opt input,
.quiz-opt-row input[type="radio"],
.quiz-opt-row input[type="checkbox"] {
  width: auto;
  flex: none;
}
.quiz-opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.quiz-opt-row input[type="text"] {
  flex: 1;
  min-width: 0;
}
.quiz-q-edit {
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
details.quiz-q-edit > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--dark);
}
details.quiz-q-edit[open] > summary {
  margin-bottom: 10px;
}
.quiz-q-delete {
  margin-top: 8px;
}
.quiz-settings {
  background: var(--primary-light);
  border: 1px solid #cce4f0;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.quiz-result {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 14px 0;
  border: 1px solid var(--border);
  background: var(--card);
}
.quiz-result.pass {
  border-color: var(--success);
  background: var(--success-bg);
}
.quiz-result.fail {
  border-color: var(--danger);
  background: #fef2f2;
}
.quiz-result-msg {
  font-weight: 600;
}
.opt-points {
  width: 64px;
  flex: none;
}
/* Builder question list */
.quiz-q-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.quiz-q-type {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--primary-light);
  color: var(--dark);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 700;
}
.quiz-q-row .quiz-q-prompt {
  flex: 1;
  margin: 0;
}
.quiz-band {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.quiz-band strong {
  white-space: nowrap;
}
/* Taking + review */
.quiz-timer {
  font-weight: 700;
  color: var(--danger);
}
.quiz-hint {
  margin-top: 8px;
  font-size: 0.92rem;
}
.quiz-hint > summary {
  cursor: pointer;
  color: var(--primary);
}
.quiz-q-msg {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}
/* Rich-text editor + rendered rich content */
.trix-content {
  min-height: 8em;
  background: #fff;
}
.quiz-q-prompt img,
.quiz-q-msg img,
.essay-prompt img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}
.quiz-q-prompt figure,
.quiz-q-msg figure,
.essay-prompt figure {
  margin: 8px 0;
}
.quiz-q-prompt ul,
.quiz-q-prompt ol,
.quiz-q-msg ul,
.quiz-q-msg ol {
  margin: 6px 0 6px 1.2em;
}
.quiz-review-opts {
  list-style: none;
  padding-left: 0;
  margin: 6px 0;
}
.quiz-review-opts li {
  padding: 3px 0;
}
.mark-correct {
  color: var(--success);
  font-weight: 700;
}
.mark-wrong {
  color: var(--danger);
  font-weight: 700;
}
.opt-correct {
  color: var(--success);
  font-weight: 600;
}
/* Typed-answer fields get a darker border and generous padding so they read
   as interactive elements, not gaps in the text; the shared :focus rule adds
   the glow when clicked. */
.free-input {
  max-width: 360px;
  border: 2px solid #94a3b8;
}
.cloze-text {
  line-height: 2.6;
  color: var(--text);
  font-size: 1.02rem;
}
.cloze-input {
  display: inline-block;
  width: 140px;
  margin: 0 5px;
  padding: 8px 12px;
  border: 2px solid #94a3b8;
  background: #fbfdff;
}
.essay-input {
  border: 2px solid #94a3b8;
}
.assessment-scale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}
.assess-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.assess-end {
  color: var(--muted);
  font-style: italic;
}
.sort-row,
.matrix-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.sort-select {
  width: 64px;
  flex: none;
}
.sort-pos {
  width: 24px;
  color: var(--muted);
  font-weight: 700;
}
.matrix-crit {
  flex: 1;
  font-weight: 500;
}
.matrix-select {
  flex: 1;
  max-width: 260px;
}
.matrix-arrow {
  color: var(--muted);
}
.essay-input {
  width: 100%;
}
.essay-card {
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.essay-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 6px;
}
.essay-prompt {
  font-weight: 600;
}
.essay-body {
  white-space: pre-wrap;
  border-left: 3px solid var(--border);
  margin: 8px 0;
  padding: 6px 0 6px 12px;
  color: var(--dark);
}

/* === Exam navigator === */
/* Instructions: a collapsible accordion (JS collapses it once the exam
   starts) with high-contrast text — dark ink, roomy line-height, bold
   subheadings — so the rules are actually readable. */
.quiz-instructions {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin: 12px 0;
  background: var(--card);
}
.quiz-instructions > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 700;
  color: var(--dark);
  list-style-position: inside;
}
.quiz-instructions > summary:hover {
  color: var(--primary);
}
.quiz-instructions-body {
  padding: 2px 20px 16px;
  color: var(--text);
  line-height: 1.75;
}
.quiz-instructions-body p {
  color: var(--text);
  line-height: 1.75;
}
.quiz-instructions-body h1,
.quiz-instructions-body h2,
.quiz-instructions-body h3,
.quiz-instructions-body h4,
.quiz-instructions-body strong {
  color: var(--dark);
  font-weight: 700;
}
.quiz-instructions-body img {
  max-width: 100%;
  height: auto;
}
.quiz-attempts {
  margin: 8px 0;
}
.qnav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.qnav-box {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--dark);
  font-weight: 600;
  cursor: pointer;
}
.qnav-box.is-current {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.qnav-box.is-answered {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.qnav-box.is-review {
  background: #1f3f6b;
  color: #fff;
  border-color: #1f3f6b;
}
.qnav-box.is-correct {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.qnav-box.is-incorrect {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.qnav-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 12px 2px 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.qnav-legend .leg::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  margin-right: 7px;
  vertical-align: -3px;
  border: 1px solid var(--border);
}
.leg-current::before { background: #fff; border: 2px solid var(--primary); }
.leg-review::before { background: #1f3f6b; border-color: #1f3f6b; }
.leg-answered::before { background: var(--primary); border-color: var(--primary); }
.leg-correct::before { background: var(--success); border-color: var(--success); }
.leg-incorrect::before { background: var(--danger); border-color: var(--danger); }

.quiz-q-num {
  font-weight: 700;
  margin: 0 0 6px;
}
/* With JS on, show only the active panel; without JS, all panels show. */
.quiz-exam.js .quiz-panel { display: none; }
.quiz-exam.js .quiz-panel.active { display: block; }
.quiz-exam.js .quiz-panel.has-media.active { display: grid; }
/* Question controls: the two per-question tools (Check / Mark for review)
   group on the left; Prev / Next always sit together on the right — the
   standard testing-platform layout. */
.quiz-panel-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.quiz-panel-tools,
.quiz-panel-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.quiz-panel-nav {
  margin-left: auto;
}
.quiz-panel-actions button {
  font-size: 0.95rem;
  padding: 10px 20px;
}
.btn-check {
  background: var(--success);
}
.btn-mark,
.btn-light {
  background: #fff;
  color: var(--dark);
  border: 1.5px solid var(--border);
}
.btn-mark:hover {
  background: #eef2f8;
  border-color: #1f3f6b;
  color: #1f3f6b;
}
.qreview.on {
  background: #1f3f6b;
  color: #fff;
  border-color: #1f3f6b;
}
.quiz-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
}
.quiz-feedback.is-correct {
  border-color: var(--success);
  background: var(--success-bg);
}
.quiz-feedback.is-incorrect {
  border-color: var(--danger);
  background: #fef2f2;
}
.quiz-feedback .fb-label {
  font-weight: 700;
  margin: 0 0 4px;
}
.quiz-feedback img { max-width: 100%; height: auto; }
/* The in-form Finish button is the no-JS fallback; with the exam navigator
   running, the sticky top bar's Finish button (with its confirm dialog) takes
   over, so this one hides to prevent accidental submits under the question. */
.quiz-finish {
  margin-top: 18px;
}
.quiz-exam.js .quiz-finish {
  display: none;
}
/* On phones the action buttons stack: Check and Mark full-width, then
   Prev / Next sharing the last row. */
@media (max-width: 700px) {
  .quiz-panel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .quiz-panel-tools {
    display: contents;
  }
  .quiz-panel-nav {
    display: contents;
  }
  .quiz-panel-actions .qcheck,
  .quiz-panel-actions .qreview {
    grid-column: 1 / -1;
  }
  .quiz-panel-actions button {
    width: 100%;
    white-space: nowrap;
    padding: 12px 10px;
  }
  .quiz-finish button {
    width: 100%;
  }
}

/* === RESIDENCY SYLLABUS === */
.syllabus-sub {
  color: var(--muted);
  font-weight: 600;
  margin-top: -6px;
}
.syllabus-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 14px 0;
}
.syllabus-contact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  min-width: 220px;
}
.syllabus-block {
  margin: 18px 0;
}
.syllabus-block h2 {
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}
.syllabus-search {
  display: flex;
  gap: 8px;
  margin: 16px 0 10px;
}
.syllabus-search input {
  flex: 1;
}
.syllabus-table {
  width: 100%;
  border-collapse: collapse;
  margin: 6px 0 12px;
}
.syllabus-table th,
.syllabus-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.syllabus-table thead th {
  background: #f3effe;
  color: #6d28d9;
  font-weight: 700;
  white-space: nowrap;
}
.syllabus-table tbody tr:hover {
  background: var(--card);
}
.syllabus-table td:first-child {
  white-space: nowrap;
  font-weight: 600;
}
/* Course-material links in the syllabus: make the clickable rows obvious */
.syllabus-table td a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Let wide tables scroll horizontally instead of distorting the page on mobile */
.syllabus-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 6px 0 12px;
}

/* Residency hub — list of items (Syllabus, and more later) */
.residency-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
/* Residency hub header sits centered over the tile grid. */
.residency-hub-head {
  text-align: center;
  margin-bottom: 24px;
}
.residency-hub-head h1 {
  justify-content: center;
}
.residency-hub-head p {
  margin: 0;
}
.residency-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.residency-item:hover {
  border-color: #f97316;
}
.residency-item-icon {
  color: #f97316;
}
.residency-item-text {
  display: flex;
  flex-direction: column;
}
.residency-item-text small {
  color: var(--muted);
}

/* Residency training progress panel (Calendly-driven) */
.residency-progress {
  margin: 18px 0 26px;
  text-align: center; /* heading + status lines sit centered like the hub title */
}
.residency-progress .event-card {
  margin: 14px 0;
  text-align: left; /* the next-event card reads better left-aligned */
}
.residency-orientation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}
.residency-orientation .icon {
  color: #16a34a;
}

/* Student Folder — embedded Zoho WorkDrive. Full width so it fits phones too
   (the original embed's fixed 1000px would overflow small screens). */
.workdrive-frame {
  width: 100%;
  height: 750px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}
/* Shorter variant for the grid-layout embeds (e.g. Tuesday Rounds). */
.workdrive-frame--short {
  height: 520px;
}

/* Webinar Archives — replay links grouped by month. */
.webinar-group {
  margin-bottom: 22px;
}
.webinar-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.webinar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.webinar-item:hover {
  border-color: var(--primary);
}
.webinar-item-icon {
  color: var(--primary);
  flex-shrink: 0;
}

/* Embedded Zoho forms (Help, Update Payment) — full width, no border. */
.zohoform-frame {
  width: 100%;
  height: 800px;
  border: none;
}
.zohoform-frame--short {
  height: 600px;
}
@media (max-width: 700px) {
  .workdrive-frame {
    height: 560px;
  }
  .workdrive-frame--short {
    height: 480px;
  }
}

/* Resident bookings — instructor cards that open a Calendly popup on click */
.booking-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.booking-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: var(--card);
  color: var(--dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font: inherit;
}
.booking-card:hover {
  border-color: #0069ff;
}
.booking-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e7f0ff;
  color: #0069ff;
  font-weight: 700;
  flex: none;
}
.booking-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.booking-text small {
  color: var(--muted);
}

/* Scanning protocols — checklist reference */
.protocol-note {
  padding: 10px 14px;
  border-left: 3px solid #f97316;
  background: #fff7ed;
  border-radius: var(--radius-sm);
  margin: 12px 0 18px;
}
.protocol-region {
  margin: 22px 0;
}
.protocol-region > h2 {
  margin: 0 0 12px;
  padding: 8px 14px;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
}
.protocol-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.protocol-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  padding: 12px 14px;
}
.protocol-group h3 {
  margin: 0 0 8px;
  color: #ea580c;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
ul.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul.checklist ul.checklist {
  margin: 4px 0 4px 22px;
}
ul.checklist li {
  margin: 3px 0;
}
ul.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 500;
  cursor: pointer;
}
ul.checklist input[type="checkbox"] {
  width: auto;
  flex: none;
  margin-top: 3px;
}
ul.checklist input[type="checkbox"]:checked + span,
ul.checklist label:has(input:checked) {
  color: var(--muted);
  text-decoration: line-through;
}
.protocol-footer {
  margin-top: 24px;
  text-align: center;
}
@media (max-width: 700px) {
  .protocol-region > h2 {
    font-size: 1.05rem;
  }
}

@media (max-width: 700px) {
  .syllabus-table th,
  .syllabus-table td {
    padding: 7px 9px;
    font-size: 0.9rem;
  }
  .syllabus-search {
    flex-direction: column;
    align-items: stretch;
  }
  .syllabus-contacts {
    flex-direction: column;
    gap: 10px;
  }
  .syllabus-contact {
    min-width: 0;
    width: 100%;
  }
  .syllabus-contact span {
    overflow-wrap: anywhere;
  }
}

/* === ADMIN === */
.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0;
}
.admin-stat {
  flex: 1 1 110px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.admin-stat strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
}
.admin-stat span {
  font-size: 0.85rem;
  color: var(--muted);
}
.admin-stat .stat-links {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}
.admin-stat .stat-links a {
  color: var(--primary);
  text-decoration: none;
}
.admin-stat .stat-links a:hover {
  text-decoration: underline;
}
.admin-nav {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-nav a {
  display: block;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  color: var(--text);
}
.admin-nav a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.admin-cell-main {
  display: flex;
  flex-direction: column;
}
.admin-cell-side {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
  padding: 14px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
}
.admin-form input[type="text"] {
  flex: 1;
  min-width: 160px;
}
.admin-form textarea {
  flex-basis: 100%;
}
.admin-role-form {
  display: flex;
  gap: 10px;
}
.admin-role-form select {
  width: auto;
  padding: 8px 12px;
}

/* === AVATARS / PROFILE === */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  background: var(--bg);
  border: 1px solid var(--border);
}
.avatar-sm {
  width: 30px;
  height: 30px;
}
.avatar-lg {
  width: 80px;
  height: 80px;
  border: 3px solid var(--primary-light);
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.profile-head h1 {
  margin: 0;
}
.profile-edit {
  margin: 18px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 18px;
  box-shadow: var(--shadow-sm);
}
.profile-edit summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary);
  padding: 10px 0;
}
.danger-zone {
  margin: 18px 0;
  border: 1px solid #fbcaca;
  background: #fff8f8;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
}
.danger-zone summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--danger);
  padding: 10px 0;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .container {
    margin: 20px auto 48px;
    padding: 0 16px;
  }
  .plans {
    flex-direction: column;
  }
  .dm-msg {
    max-width: 92%;
  }
  .admin-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-cell-side {
    width: 100%;
    justify-content: space-between;
  }
  .post-actions {
    gap: 10px;
  }
}

/* ============================================================
   Wide-page redesign: quiz exam layout, course/bundle cards,
   lesson sidebar, image lightbox.
   ============================================================ */

/* --- Quiz page title (the breadcrumb above it already says "course") --- */
.quiz-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin-bottom: 10px;
}

/* --- Sticky exam top bar: progress, timer, Prev/Next, Finish ------------- */
/* Sits just below the sticky site header (~63px tall). */
.quiz-topbar {
  position: sticky;
  top: 63px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin: 10px 0 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
/* The toggle, progress, and arrows only make sense with the exam navigator
   running — they stay hidden until quiz.js marks the bar with .js. */
.quiz-topbar .qnav-toggle,
.quiz-topbar .quiz-progress,
.quiz-topbar .quiz-topbar-nav {
  display: none;
}
.quiz-topbar.js .qnav-toggle {
  display: inline-flex;
}
.quiz-topbar.js .quiz-progress {
  display: flex;
}
.quiz-topbar.js .quiz-topbar-nav {
  display: flex;
}
.qnav-toggle {
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #fff;
  color: var(--dark);
  border: 1.5px solid var(--border);
  white-space: nowrap;
}
.qnav-toggle:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  transform: none;
  box-shadow: none;
}
.quiz-progress {
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.quiz-progress-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-mid);
  white-space: nowrap;
}
.quiz-progress-track {
  height: 8px;
  border-radius: 50px;
  background: var(--border);
  overflow: hidden;
}
.quiz-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 50px;
  background: var(--primary);
  transition: width 0.25s var(--ease);
}
.quiz-topbar .quiz-timer {
  margin: 0;
  white-space: nowrap;
}
.quiz-topbar-nav {
  align-items: center;
  gap: 6px;
}
.quiz-topbar-nav button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--dark);
  border: 1.5px solid var(--border);
  font-size: 1.25rem;
  line-height: 1;
}
.quiz-topbar-nav button:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  transform: none;
  box-shadow: none;
}
.quiz-finish-btn {
  padding: 10px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

/* --- Exam layout: collapsible question-grid sidebar + question column ---- */
.quiz-sidebar {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.quiz-sidebar-title {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.quiz-sidebar .qnav {
  padding: 0;
  border: 0;
  background: transparent;
}
@media (min-width: 980px) {
  .quiz-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .quiz-sidebar {
    position: sticky;
    top: 142px; /* below the site header + sticky exam bar */
    max-height: calc(100vh - 162px);
    overflow: auto;
  }
  .quiz-results-exam .quiz-sidebar {
    top: 80px; /* the results page has no exam bar */
    max-height: calc(100vh - 100px);
  }
  .quiz-layout.nav-hidden {
    grid-template-columns: minmax(0, 1fr);
  }
  .quiz-layout.nav-hidden .quiz-sidebar {
    display: none;
  }
}
@media (max-width: 979px) {
  .quiz-sidebar {
    margin-bottom: 14px;
  }
  .quiz-layout.nav-hidden .quiz-sidebar {
    display: none;
  }
}

/* --- Question panels: cards, and a split view when there's an image ------ */
.quiz-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.quiz-media {
  margin: 0 0 14px;
  min-width: 0;
}
.quiz-qa {
  min-width: 0;
}
.quiz-media .quiz-q-img {
  width: 100%;
  margin: 0;
  cursor: zoom-in;
}
.quiz-media figcaption {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}
.quiz-q-prompt img,
.quiz-q-msg img,
.quiz-feedback img {
  cursor: zoom-in;
}
@media (min-width: 980px) {
  /* Split screen: the clinical image owns the left column, the question,
     answers, and controls stay in a narrower right column. */
  .quiz-panel.has-media {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
  }
  .quiz-panel.has-media .quiz-media {
    position: sticky;
    top: 152px;
    margin: 0;
  }
}

/* --- Image lightbox (click any quiz image to enlarge) -------------------- */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 25, 41, 0.92);
  cursor: zoom-out;
}
.img-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.img-lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}
.img-lightbox-close:hover {
  background: #fff;
  color: var(--danger);
  transform: none;
  box-shadow: none;
}

/* --- Course page: module cards with a real "Take the Quiz" button -------- */
.course-desc {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 860px;
}
.module-card {
  margin-top: 20px;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.module-head .module-title {
  flex: 1;
  min-width: 200px;
  margin: 0;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 50px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
}
.quiz-cta:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.module-meta {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-mid);
}
.cert-progress {
  margin-top: 12px;
}

/* --- Classroom + bundle pages: responsive card grid ----------------------- */
.bundle-desc {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 860px;
}
/* Flex instead of grid: full rows stretch to fill the page width, and a short
   last row (or a page with only a couple of cards) stays centered instead of
   leaving the right side empty. */
.course-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}
.course-card-grid {
  display: flex;
  flex-direction: column;
  flex: 1 1 300px;
  max-width: 440px;
  padding: 0;
  overflow: hidden;
}
.course-card-grid .course-card-img {
  height: 170px;
  margin-bottom: 0;
  border-radius: 0;
}
.course-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px 20px 18px;
}
.course-card-body .course-badges {
  margin: 0 0 4px;
}
.course-card-body h2 {
  font-size: 1.15rem;
  margin: 6px 0;
}
.course-card-desc {
  margin: 0 0 8px;
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card-body .course-meta {
  margin: 0 0 4px;
}
.course-card-cta {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 12px;
}
.course-open-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border-radius: 50px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  transition: all 0.25s var(--ease);
}
.course-open-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* --- Lesson page: theater video + "Course content" sidebar ---------------- */
.lesson-sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}
.lesson-sidebar-title {
  font-size: 1.05rem;
  margin: 0 0 10px;
}
.ls-module {
  margin: 0 0 14px;
}
.ls-module-title {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mid);
}
.ls-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ls-lessons li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.ls-lessons li a {
  color: var(--text);
  font-weight: 500;
}
.ls-lessons li a:hover {
  color: var(--primary);
}
.ls-lessons li.current {
  background: var(--primary-light);
}
.ls-current-title {
  font-weight: 700;
  color: var(--primary-dark);
}
.ls-quiz {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
@media (min-width: 1020px) {
  .lesson-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
  }
  .lesson-sidebar {
    margin-top: 0;
    position: sticky;
    top: 122px; /* below the two-row Skool top nav */
    max-height: calc(100vh - 142px);
    overflow: auto;
  }
}

/* --- Small screens: compact exam bar, full-width CTAs --------------------- */
@media (max-width: 700px) {
  .quiz-topbar {
    gap: 10px;
    padding: 10px 12px;
  }
  .qnav-toggle {
    padding: 9px 12px;
  }
  .qnav-toggle-text {
    display: none;
  }
  .quiz-progress-label {
    font-size: 0.72rem;
  }
  .quiz-finish-btn {
    padding: 9px 14px;
    font-size: 0.85rem;
  }
  .quiz-panel {
    padding: 16px;
  }
  .quiz-cta {
    width: 100%;
    justify-content: center;
  }
  .course-card-cta {
    justify-content: stretch;
  }
  .course-card-cta .course-open-btn {
    width: 100%;
    justify-content: center;
  }
  .complete-form {
    justify-content: stretch;
  }
  .complete-btn {
    width: 100%;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  /* Too narrow for the arrow pair — the buttons under the question cover it. */
  .quiz-topbar.js .quiz-topbar-nav {
    display: none;
  }
}
