/* Student app, admin area, and sign-in pages */
body { min-height: 100vh; min-height: 100dvh; }
body.modal-open { overflow: hidden; }
.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
h1 { font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.linklike { background: none; border: 0; padding: 0; color: var(--green-700); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.linklike:hover { color: var(--green-900); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #912018; }

.demo-banner { background: var(--warn-bg); color: #5c4200; font-size: 13.5px; padding: 9px 16px; text-align: center; border-bottom: 1px solid #F5DFA3; }
.demo-banner .linklike { color: #5c4200; margin-left: 6px; }

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--paper);
}
.auth-side {
  position: relative; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(6, 28, 31, .55) 0%, rgba(6, 28, 31, .25) 40%, rgba(6, 28, 31, .92) 100%),
    var(--auth-photo, url("/assets/img/photos/leader-woman.jpg")) 40% 30% / cover no-repeat,
    var(--green-950);
  color: rgba(255, 255, 255, .82);
  padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side .brand-row { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.auth-side .brand-row .brand-logo { width: auto; height: 108px; display: block; }
.auth-side .brand-row b { font-family: var(--display); letter-spacing: .12em; font-size: 20px; }
.auth-side .auth-spacer { flex: 1; }
.auth-partners {
  align-self: flex-start;
  display: flex; align-items: center; gap: 24px;
  max-width: 100%;
  padding: 16px 22px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(6, 28, 31, .30);
}
/* The three lockups are drawn at different scales, so each gets the height that
   makes it read as the same size as the others, not the same measured height. */
.auth-partners img {
  display: block; flex: 0 0 auto;
  width: auto; height: 38px;
  object-fit: contain; object-position: center;
}
.auth-partners img[src*="ghr-full"] { height: 42px; }
.auth-partners img[src*="gha-accreditation"] { height: 46px; }
.auth-partners-mobile { display: none; }
@media (max-width: 1150px) {
  .auth-partners { gap: 15px; padding: 12px 15px; }
  .auth-partners img { height: 28px; }
  .auth-partners img[src*="ghr-full"] { height: 31px; }
  .auth-partners img[src*="gha-accreditation"] { height: 34px; }
}
.auth-side blockquote { font-family: var(--serif); font-size: 22px; line-height: 1.35; color: #fff; max-width: 30ch; }
.auth-side .cap { margin-top: 10px; font-size: 13px; color: var(--gold-400); letter-spacing: .06em; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; text-decoration: none; color: var(--ink); }
.auth-card .mobile-brand .brand-logo { width: auto; height: 60px; display: block; }
.auth-card .mobile-brand b { font-family: var(--display); letter-spacing: .12em; font-size: 20px; }
.auth-card h1 { font-size: 34px; margin-bottom: 8px; }
.auth-card > p { color: var(--muted); margin-bottom: 28px; }
.auth-card .foot { margin-top: 28px; font-size: 14px; color: var(--muted); text-align: center; }
.auth-card .foot a { color: var(--green-700); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 880px) {
  .auth-page { grid-template-columns: 1fr; background: var(--cream); }
  .auth-side { display: none; }
  .auth-main { flex-direction: column; align-items: center; padding-top: 48px; }
  .auth-card { background: var(--paper); padding: 28px 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
  .auth-card .mobile-brand { display: flex; }
  .auth-partners-mobile {
    display: flex; justify-content: center; gap: 18px;
    width: 100%; max-width: 420px; margin: 22px auto 8px;
    padding: 12px 14px; background: var(--paper);
    border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .auth-partners-mobile img { height: 22px; }
  .auth-partners-mobile img[src*="ghr-full"] { height: 25px; }
  .auth-partners-mobile img[src*="gha-accreditation"] { height: 27px; }
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font-size: 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(29, 102, 112, .12); }
.input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .input-row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green-700); flex: none; }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 70px; }
.password-wrap button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; font-size: 13px; font-weight: 600; color: var(--green-700); cursor: pointer; padding: 6px 8px; }
.form-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #F9D2CD; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; margin: 4px 0 14px; }
.form-success { background: var(--success-bg); color: var(--success); border: 1px solid #C8E8D5; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.notice { background: var(--cream); border: 1px solid var(--line); padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; }

/* ---------- App shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--green-950); color: #fff; }
.topbar .container { display: flex; align-items: center; gap: 20px; height: 64px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: none; }
/* The platform logo. Width is set from the height so the aspect ratio holds. */
.topbar .brand .brand-logo { width: auto; height: 38px; display: block; }
/* Whose program the student is in, shown beside the platform logo. */
.brand-course { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff; }
.brand-course img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.brand-course-name { font-size: 13px; font-weight: 600; line-height: 1.2; opacity: .92; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-divider { width: 1px; height: 26px; background: rgba(255,255,255,.28); flex: none; }
@media (max-width: 900px) { .brand-course-name { display: none; } }
@media (max-width: 600px) { .brand-course { display: none; } }
.topbar .brand b { font-family: var(--display); letter-spacing: .12em; font-size: 18px; }
.topbar .brand .tag { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green-950); background: var(--gold-400); border-radius: 999px; padding: 2px 8px; margin-left: 4px; }
.topnav { display: flex; gap: 4px; margin-left: 12px; }
.topnav a { color: rgba(255, 255, 255, .72); text-decoration: none; font-size: 14.5px; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.topnav a.active { color: #fff; background: rgba(255, 255, 255, .1); }
.user-menu { margin-left: auto; position: relative; }
.user-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; border-radius: 999px; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: var(--gold-grad); color: var(--green-950); display: grid; place-items: center; font-weight: 700; font-size: 13.5px; flex: none; }
.user-btn .nm { font-size: 14px; font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--paper); color: var(--ink); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; border: 1px solid var(--line-soft); }
.dropdown .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.dropdown .who b { display: block; font-size: 14px; }
.dropdown .who span { font-size: 12.5px; color: var(--muted); word-break: break-all; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14.5px; text-decoration: none; background: none; border: 0; cursor: pointer; color: var(--ink); }
.dropdown a:hover, .dropdown button:hover { background: var(--cream); }
.bottom-nav { display: none; }
@media (max-width: 720px) {
  .topnav { display: none; }
  .user-btn .nm { display: none; }
  .bottom-nav { display: flex; }
  .app-main { padding-bottom: 88px; }
}
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.bottom-nav a { flex: 1; min-width: 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 8px 4px; border-radius: 10px; display: grid; gap: 3px; justify-items: center; }
.bottom-nav a.active { color: var(--green-900); background: var(--cream); }

.app-main { padding: 32px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 38px); }
.page-head p { color: var(--muted); margin-top: 4px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; margin-bottom: 14px; }
.back-link:hover { color: var(--ink); }

.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line-soft); }
.card-pad { padding: 24px; }
.card h2 { font-size: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 64px 0; }
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state h3 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); margin: 0 auto 20px; max-width: 46ch; }

/* Progress */
.progress { display: flex; align-items: center; gap: 12px; }
.progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--cream-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-600), var(--green-700)); transition: width .5s ease; }
.progress-label { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Dashboard ---------- */
.welcome {
  position: relative; overflow: hidden; border-radius: 20px; padding: clamp(26px, 4vw, 40px);
  background:
    linear-gradient(90deg, var(--green-950) 0%, rgba(6, 28, 31, .92) 45%, rgba(6, 28, 31, .35) 100%),
    url("/assets/img/photos/future-window.jpg") 80% 35% / cover no-repeat,
    var(--green-950);
  color: rgba(255, 255, 255, .8); margin-bottom: 36px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.welcome .eyebrow { color: var(--gold-400); margin-bottom: 8px; }
.welcome h1 { color: #fff; font-size: clamp(30px, 4vw, 44px); }
.welcome p { margin-top: 8px; max-width: 52ch; }
/* One mark per certification the student holds, side by side. */
.welcome-marks { display: flex; align-items: center; gap: 16px; flex: none; }
.welcome-marks img { width: auto; height: 96px; max-width: 150px; object-fit: contain; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .35)); }
.welcome-marks.many img { height: 72px; max-width: 110px; }
@media (max-width: 860px) { .welcome-marks img { height: 66px; max-width: 100px; } }
@media (max-width: 600px) { .welcome-marks { display: none; } }
.section-title { font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 16px; }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
@media (max-width: 400px) { .cert-grid { grid-template-columns: 1fr; } }
.cert-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.cert-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.cert-cover { position: relative; aspect-ratio: 16 / 7; background: linear-gradient(180deg, rgba(6, 28, 31, .2), rgba(6, 28, 31, .75)), url("/assets/img/photos/data-office.jpg") center / cover, var(--green-900); display: grid; place-items: center; overflow: hidden; }
.cert-cover img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cert-cover img.seal { position: absolute; right: 14px; bottom: 12px; width: 44px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.cert-cover .badge { position: absolute; top: 12px; left: 12px; }
.cert-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.cert-body h3 { font-family: var(--serif); font-weight: 500; font-size: 21px; line-height: 1.25; }
.cert-meta { font-size: 13.5px; color: var(--muted); }
.cert-body .btn { margin-top: auto; align-self: flex-start; }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--cream); color: var(--body); white-space: nowrap; }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-gold { background: var(--gold-grad); color: var(--green-950); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-amber { background: var(--warn-bg); color: var(--warn); }
.badge-dark { background: var(--green-900); color: #fff; }

/* ---------- Course page ---------- */
.course-hero { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; margin-bottom: 28px; }
.course-hero .summary { padding: 22px; }
.course-hero .summary .big { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--ink); }
.course-hero .summary .btn { margin-top: 18px; }
@media (max-width: 820px) { .course-hero { grid-template-columns: 1fr; } }

.module-group + .module-group { margin-top: 22px; }
.module-title { font-family: var(--display); font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-600); margin: 0 4px 10px; }
.lesson-list { list-style: none; overflow: hidden; }
.lesson-row { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.lesson-list li:first-child .lesson-row { border-top: 0; }
a.lesson-row:hover { background: var(--cream); }
.lesson-row.locked { color: var(--muted); cursor: not-allowed; }
.lesson-row .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 700; flex: none; background: var(--cream-2); color: var(--ink); }
.lesson-row.done .num { background: var(--green-700); color: #fff; }
.lesson-row.current .num { background: var(--gold-grad); color: var(--green-950); }
.lesson-row.locked .num { background: var(--cream); color: var(--muted); }
.lesson-row .info { flex: 1; min-width: 0; }
.lesson-row .info b { display: block; font-weight: 600; color: var(--ink); }
.lesson-row.locked .info b { color: var(--muted); }
.lesson-row .info span { font-size: 13px; color: var(--muted); }
.lesson-row .state { flex: none; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* ---------- Lesson page ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 1000px) { .lesson-layout { grid-template-columns: 1fr; } }
.player-shell { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; }
.player-shell .wistia_responsive_padding { position: absolute !important; inset: 0; padding: 0 !important; }
.player-shell .wistia_embed, .player-shell .player-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.player-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: rgba(255, 255, 255, .8); padding: 24px; background: linear-gradient(135deg, var(--green-900), var(--green-950)); }
.player-msg h3 { color: #fff; font-family: var(--serif); font-weight: 500; font-size: 24px; margin-bottom: 8px; }
.demo-player { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #fff; text-align: center; padding: 24px; background: radial-gradient(circle at 50% 40%, var(--green-700), var(--green-950)); }
.demo-player .play-circle { width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 255, 255, .12); display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .25); }
.demo-player .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lesson-info { margin-top: 22px; }
.lesson-info .eyebrow { margin-bottom: 6px; }
.lesson-info h1 { font-size: clamp(26px, 3vw, 34px); }
.lesson-info .desc { margin-top: 12px; max-width: 70ch; white-space: pre-line; }
/* What the admin wrote about this module, under the video. */
.lesson-about { margin-top: 20px; }
.lesson-about h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin-bottom: 10px; }
.lesson-about p { max-width: 70ch; line-height: 1.65; }
.lesson-about p + p { margin-top: 12px; }
/* Feedback on the module. Sent by email, never stored. */
.lesson-feedback { margin-top: 18px; }
.lesson-feedback h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; margin-bottom: 6px; }
.lesson-feedback > p { max-width: 70ch; margin-bottom: 14px; }
.lesson-feedback .field { margin-bottom: 12px; }
/* Workbooks and handouts at the top of a course. */
/* Support tickets in admin: a list that opens to show the whole message. */
.ticket-list { list-style: none; }
.ticket { border-top: 1px solid var(--line); }
.ticket:first-child { border-top: 0; }
.ticket-head { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 14px 22px; font: inherit; cursor: pointer; }
.ticket-head:hover { background: var(--cream); }
.ticket-chevron { display: inline-flex; color: var(--muted); transition: transform .15s ease; }
.ticket.is-open .ticket-chevron { transform: rotate(180deg); }
.ticket-main { flex: 1; min-width: 0; }
.ticket-main b { display: block; font-size: 14.5px; }
.ticket-main span { display: block; }
.ticket-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ticket-body { padding: 0 22px 18px 52px; }
.ticket-message { background: var(--cream); border-radius: 10px; padding: 14px 16px; white-space: pre-wrap; line-height: 1.6; margin-bottom: 14px; }
.ticket-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ticket-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.ticket-facts dd { font-size: 13.5px; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .ticket-head { flex-wrap: wrap; }
  .ticket-body { padding-left: 22px; }
}
/* Students dashboard: the filter bar and the counts above the table. */
.report-filters { margin-bottom: 18px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 10px; }
.filter-grid .field { margin-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-row .stat-tile { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.stat-row .stat-tile .hint { font-size: 11.5px; line-height: 1.35; margin-top: 2px; display: block; }
/* The course logo preview is wide rather than square, unlike the seal. */
.logo-preview { width: auto; min-width: 120px; max-width: 220px; padding: 8px 12px; }
.logo-preview img { max-width: 100%; max-height: 54px; width: auto; height: auto; object-fit: contain; }
.support-form { max-width: 720px; }
.support-form .field { margin-bottom: 16px; }
.materials-card { margin-bottom: 22px; }
.materials-head { margin-bottom: 14px; }
.materials-head h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 4px; }
.material-list { list-style: none; margin-top: 16px; display: grid; gap: 10px; }
.material-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--cream); border-radius: 10px; padding: 10px 12px; }
.material-list .order { display: grid; gap: 2px; }
.material-list .t { flex: 1; min-width: 180px; }
.material-list .t b { display: block; font-size: 14.5px; }
.material-list .t span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.watch-status { margin-top: 20px; padding: 18px 20px; display: grid; gap: 12px; }
.watch-status .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.watch-status .msg { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.empty-state h3 svg { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.watch-status.complete { background: var(--success-bg); border-color: #C8E8D5; }
.watch-status.complete .msg { color: var(--success); font-weight: 600; }
.lesson-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.side-list { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; }
.side-list .card-head { position: sticky; top: 0; background: var(--paper); z-index: 1; }
.side-list .lesson-row { padding: 12px 16px; gap: 12px; }
.side-list .lesson-row .num { width: 28px; height: 28px; font-size: 12px; }
.side-list .lesson-row.active { background: var(--cream); box-shadow: inset 3px 0 0 var(--gold-500); }
.side-list .module-title { margin: 14px 16px 6px; }
@media (max-width: 1000px) { .side-list { position: static; max-height: none; } }

.celebrate { text-align: center; padding: 8px 0; }
.celebrate .trophy { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--gold-grad); color: var(--green-950); }
.celebrate img { width: 64px; margin: 0 auto 12px; }

/* ---------- Admin ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-tile { padding: 20px; }
.stat-tile .k { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat-tile .v { font-family: var(--serif); font-size: 36px; line-height: 1.1; color: var(--ink); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-tile.alert .v { color: var(--danger); }
.stat-tile a { font-size: 13px; color: var(--green-700); font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 40px; min-height: 42px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FCFBF8; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--cream); }
.table .person { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.table .person b { display: block; color: var(--ink); font-weight: 600; }
.table .person span { font-size: 13px; color: var(--muted); }
.table .mini-progress { min-width: 160px; }
.table .mini-progress .t { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.table .actions { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }

/* Student list as cards on phones */
@media (max-width: 720px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .table.stack td { border: 0; padding: 4px 0; }
  .table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .table.stack .actions { text-align: left; }
}

.detail-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.detail-grid.cert-edit-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
@media (max-width: 1000px) { .detail-grid, .detail-grid.cert-edit-grid { grid-template-columns: 1fr; } }
.profile-card { padding: 24px; }
.profile-card .top { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.profile-card .avatar-lg { width: 58px; height: 58px; border-radius: 50%; background: var(--gold-grad); color: var(--green-950); display: grid; place-items: center; font-weight: 700; font-size: 20px; flex: none; }
.profile-card h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.profile-card .email { font-size: 14px; color: var(--muted); word-break: break-all; }
.kv { display: grid; gap: 10px; font-size: 14px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.kv div { display: flex; justify-content: space-between; gap: 12px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--ink); font-weight: 500; text-align: right; }
.btn-stack { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.btn-stack .btn { justify-content: flex-start; }
.enroll-card + .enroll-card { margin-top: 18px; }
.enroll-card .card-head h3 { font-family: var(--serif); font-weight: 500; font-size: 19px; }
.enroll-card .sub { font-size: 13px; color: var(--muted); }
.enroll-card .progress { padding: 16px 22px 4px; }
.lesson-admin-row { display: flex; align-items: center; gap: 12px; padding: 10px 22px; border-top: 1px solid var(--line-soft); font-size: 14px; }
.lesson-admin-row:first-of-type { border-top: 0; }
.lesson-admin-row .n { width: 26px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.lesson-admin-row .t { flex: 1; min-width: 0; }
.lesson-admin-row .t span { display: block; font-size: 12.5px; color: var(--muted); }
.lessons-box { padding: 8px 0 12px; }

.lesson-editor-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line-soft); }
.lesson-editor-row:first-child { border-top: 0; }
.lesson-editor-row .order { display: grid; gap: 2px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.icon-btn:hover:not(:disabled) { border-color: var(--green-700); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.lesson-editor-row .order .icon-btn { width: 26px; height: 22px; border-radius: 6px; }
.lesson-editor-row .n { width: 28px; font-weight: 700; color: var(--muted); text-align: center; }
.lesson-editor-row .t { flex: 1; min-width: 0; }
.lesson-editor-row .t b { display: block; color: var(--ink); }
.lesson-editor-row .t span { font-size: 12.5px; color: var(--muted); }
.lesson-editor-row .ops { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .lesson-editor-row { flex-wrap: wrap; } .lesson-editor-row .ops { width: 100%; justify-content: flex-start; padding-left: 70px; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; font-size: 14.5px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--gold-500); }

details.payload summary { cursor: pointer; font-size: 13px; color: var(--green-700); font-weight: 600; }
details.payload pre { margin-top: 8px; max-height: 280px; overflow: auto; background: var(--green-950); color: #d7e6e4; padding: 12px; border-radius: 8px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.error-text { color: var(--danger); font-size: 13px; }
.copy-box { display: flex; gap: 8px; }
.copy-box .input { font-size: 13px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(6, 28, 31, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s ease; }
.modal-wide { max-width: 640px; }
/* The certificate designer needs room: it shows the real page at a workable size. */
.modal-xl { max-width: min(1320px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 6px; }
.modal-head h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.modal-head .icon-btn { border: 0; }
.modal-body { padding: 12px 22px 4px; }
.modal-body > p { margin-bottom: 12px; }
.modal .form-error { margin: 0 22px 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 520px) {
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92dvh; }
  .modal-actions .btn { flex: 1; }
}

/* ---------- Toasts ---------- */
.toast-host { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-lg); background: var(--green-900); color: #fff; opacity: 0; transform: translateY(8px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--danger); }
@media (max-width: 720px) { .toast-host { bottom: 84px; left: 16px; right: 16px; max-width: none; } }

/* ---------- Certificates ---------- */
.card-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.cert-body .card-actions .btn { margin-top: 0; }
.complete-banner { margin-bottom: 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--success-bg); border-color: #C8E8D5; }
.complete-banner .grow { flex: 1; min-width: 200px; }
.trophy-badge { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: var(--green-950); flex: none; }
.cert-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 22px 14px; }
.lock-setting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 22px 10px; }
.lock-setting label { font-size: 13px; font-weight: 600; color: var(--muted, #5b6b6e); }
.lock-setting .select { width: auto; min-width: 0; max-width: 100%; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
ul.sync-result { margin: 8px 0 12px 18px; display: grid; gap: 4px; }

/* Login page extras */
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.linklike.small { font-size: 13px; }
.auth-card .foot.small { font-size: 13px; margin-top: 18px; }

/* App footer */
.app-footer { border-top: 1px solid var(--line); background: var(--paper); font-size: 13px; color: var(--muted); }
.app-footer .container { display: flex; justify-content: space-between; align-items: center; gap: 10px 20px; flex-wrap: wrap; padding: 18px 0; }
.app-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.app-footer a { color: var(--green-700); text-decoration: none; font-weight: 500; }
.app-footer a:hover { text-decoration: underline; }
.empty-state p a, .hint a { color: var(--green-700); font-weight: 600; }
@media (max-width: 720px) {
  .app-main { padding-bottom: 40px; }
  .app-footer { padding-bottom: 76px; }
}

/* Keep admin detail pages inside the screen on phones */
.detail-grid > * { min-width: 0; }
.btn-stack .btn, .cert-tools .btn, .card-head .toolbar .btn { white-space: normal; text-align: left; }
.card-head > div { min-width: 0; }

/* ================= Exams ================= */
.exam-letter { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--cream); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--green-800); }
.notice-success { background: var(--success-bg); border-color: #C8E8D5; color: var(--success); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.btn-block + .btn-block { margin-top: 8px; }

/* Course page card */
.exam-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; border-color: var(--gold-200); background: linear-gradient(180deg, #FFFDF7, #fff); }
.exam-card.passed { background: var(--success-bg); border-color: #C8E8D5; }
.exam-card h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 2px 0 4px; }
.exam-card .grow { flex: 1; min-width: 220px; }
.exam-card-icon { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: var(--green-950); }
.exam-card.passed .exam-card-icon { background: var(--success); color: #fff; }
.exam-card-icon svg { width: 26px; height: 26px; }

/* Intro */
.exam-intro { max-width: 760px; }
.exam-intro h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 6px 0 12px; }
.exam-instructions { white-space: pre-line; margin-bottom: 16px; }
.exam-facts { list-style: none; display: grid; gap: 10px; margin: 18px 0; padding: 0; }
.exam-facts li { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--ink); }
.exam-facts svg { color: var(--success); flex: none; }
.exam-tips { margin: 0 0 16px 18px; display: grid; gap: 4px; }

/* Runner */
.exam-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; margin-bottom: 18px; position: sticky; top: 72px; z-index: 5; }
.exam-top .eyebrow { margin-bottom: 2px; }
.exam-top-right { display: flex; align-items: center; gap: 14px; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; padding: 6px 12px; border-radius: 999px; background: var(--green-900); color: #fff; }
.exam-timer.low { background: var(--danger); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .75; } }
.exam-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.exam-q-num { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.exam-q-prompt { font-family: var(--serif); font-weight: 500; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.3; margin: 10px 0 20px; white-space: pre-line; overflow-wrap: anywhere; }
.exam-choices { display: grid; gap: 10px; }
.exam-choice { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.exam-choice:hover { border-color: var(--green-600); background: #FBFCFB; }
.exam-choice input { position: absolute; opacity: 0; pointer-events: none; }
.exam-choice.selected { border-color: var(--green-700); background: var(--green-100); }
.exam-choice.selected .exam-letter { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.exam-choice:focus-within { box-shadow: 0 0 0 4px rgba(29, 102, 112, .15); }
.exam-choice-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.exam-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.exam-map { position: sticky; top: 150px; }
.exam-map-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.exam-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; margin-bottom: 18px; max-height: 320px; overflow-y: auto; padding: 2px; }
.exam-map-btn { height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; font-size: 13px; color: var(--body); cursor: pointer; font-variant-numeric: tabular-nums; }
.exam-map-btn.answered { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.exam-map-btn.current { outline: 2px solid var(--gold-500); outline-offset: 1px; }
@media (max-width: 860px) {
  .exam-layout { grid-template-columns: 1fr; }
  .exam-map { position: static; }
  .exam-top { top: 64px; padding: 10px 14px; margin-bottom: 12px; }
  .exam-top .eyebrow { display: none; }
  .exam-top strong { font-size: 14.5px; }
  .exam-timer { font-size: 15px; padding: 4px 10px; }
  .exam-question.card-pad { padding: 20px 18px; }
}

/* Result */
.exam-result { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.exam-result .grow { flex: 1; min-width: 240px; }
.exam-result h1 { font-size: clamp(26px, 3.2vw, 36px); margin: 6px 0 6px; }
.exam-result-score { flex: none; width: 140px; height: 140px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--cream); border: 6px solid var(--line); }
.exam-result.passed .exam-result-score { border-color: var(--success); background: var(--success-bg); }
.exam-result.failed .exam-result-score { border-color: #F3C5C0; background: var(--danger-bg); }
.exam-result-score .big { font-family: var(--serif); font-size: 38px; line-height: 1; color: var(--ink); }
.exam-review { display: grid; gap: 14px; }
.exam-review-item { padding: 18px 22px; border-left: 4px solid var(--line); }
.exam-review-item.right { border-left-color: var(--success); }
.exam-review-item.wrong { border-left-color: var(--danger); }
.exam-review-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.exam-review-prompt { font-weight: 600; color: var(--ink); margin: 8px 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.exam-review-choices, .attempt-q ul, .pool-choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.exam-review-choices li, .attempt-q li, .pool-choices li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; font-size: 14.5px; overflow-wrap: anywhere; flex-wrap: wrap; }
.exam-review-choices em, .attempt-q em { font-style: normal; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-left: auto; }
.exam-review-choices li.chosen, .attempt-q li.chosen { background: var(--cream); }
.exam-review-choices li.chosen.incorrect, .attempt-q .wrong li.chosen, .attempt-q.wrong li.chosen { background: var(--danger-bg); color: var(--danger); }
.exam-review-choices li.correct, .attempt-q li.correct, .pool-choices li.correct { background: var(--success-bg); color: var(--success); }
.exam-explanation { margin-top: 10px; font-size: 14px; color: var(--body); background: var(--cream); padding: 10px 12px; border-radius: 8px; }

/* Admin: exam page */
.tabs button { padding: 10px 14px; font: inherit; font-weight: 600; font-size: 14.5px; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--gold-500); }
.tabs .count { display: inline-block; min-width: 22px; padding: 1px 7px; margin-left: 4px; border-radius: 999px; background: var(--cream-2); font-size: 12px; color: var(--body); }

/* Admin: the certification page, split into tabs so no single screen runs on forever. */
.tab-panel[hidden] { display: none; }
.cert-tab-bar { position: sticky; top: 64px; z-index: 6; background: var(--cream); }
.cert-tabs { padding-bottom: 24px; }
.cert-form-card { max-width: 860px; }
.cert-lessons-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cert-lessons-grid > * { min-width: 0; }
@media (max-width: 1000px) { .cert-lessons-grid { grid-template-columns: 1fr; } }
.cert-lesson-settings .hint { display: block; }
/* Save stays in reach whichever tab you are on, so nothing is lost by scrolling. */
.save-bar {
  position: sticky; bottom: 12px; z-index: 5;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap;
  margin-top: 20px; padding: 14px 18px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(16, 41, 44, .10);
}
.save-bar[hidden] { display: none; }
.save-bar .form-error { margin: 0; flex: 1 1 260px; }
@media (max-width: 720px) {
  .save-bar { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .save-bar .btn { width: 100%; }
}
.exam-settings { max-width: 820px; }
.form-section { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 26px 0 12px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.switch-row { padding: 14px 16px; background: var(--cream); border-radius: var(--radius-sm); margin-bottom: 20px; }
.switch-row .hint { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.input-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 720px) { .input-row.three { grid-template-columns: 1fr; } }
.select-sm { width: auto; padding-top: 6px; padding-bottom: 6px; font-size: 14px; }
.pool-head .toolbar { justify-content: flex-end; }
.pool-filters { display: flex; gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 36px; }
.pool-filters .select { width: auto; }
.pool-item { display: flex; gap: 14px; padding: 16px 22px; border-top: 1px solid var(--line-soft); align-items: flex-start; flex-wrap: wrap; }
.pool-list .pool-item:first-child { border-top: 0; }
.pool-item.off { opacity: .6; }
.pool-item .grow { flex: 1; min-width: 240px; }
.pool-num { flex: none; width: 28px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 2px; }
.pool-prompt { font-weight: 600; color: var(--ink); margin-bottom: 8px; white-space: pre-line; overflow-wrap: anywhere; }
.pool-choices .badge { margin-left: auto; }
.pool-choices { margin-bottom: 8px; }
.pool-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.choice-editor { display: grid; gap: 8px; margin-bottom: 8px; }
.choice-row { display: flex; gap: 8px; align-items: center; }
.choice-row[hidden] { display: none; }
.choice-correct { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 13px; }
.choice-correct input { accent-color: var(--success); width: 16px; height: 16px; }
.choice-correct:has(input:checked) { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.import-steps { margin: 0 0 12px 18px; display: grid; gap: 6px; font-size: 14px; }
.import-steps code { background: var(--cream); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; white-space: pre; }
.import-preview { background: var(--cream); border-radius: 8px; padding: 10px 12px; margin: -4px 0 14px; }
.import-preview ul { margin: 6px 0 0 18px; }
.import-sample { margin-top: 6px; overflow-wrap: anywhere; }
.cert-side { display: grid; gap: 20px; align-content: start; min-width: 0; }
.attempt-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.attempt-summary > div { background: var(--cream); border-radius: 8px; padding: 10px 12px; }
.attempt-summary .k { display: block; font-size: 12px; color: var(--muted); }
.attempt-questions { display: grid; gap: 12px; }
.attempt-q { border: 1px solid var(--line-soft); border-left: 4px solid var(--success); border-radius: 8px; padding: 10px 12px; }
.attempt-q.wrong { border-left-color: var(--danger); }
.attempt-q-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; font-size: 14.5px; color: var(--ink); overflow-wrap: anywhere; }
.attempt-q-head .badge { margin-left: auto; }
.exam-admin-block { margin: 4px 22px 12px; padding: 14px 16px; background: var(--cream); border-radius: var(--radius-sm); }
.exam-admin-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.exam-admin-attempts { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.exam-admin-attempts li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13.5px; background: var(--paper); border-radius: 8px; padding: 8px 10px; }
.exam-admin-attempts li .btn { margin-left: auto; }
.bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= Continuing education ================= */
.course-tabs { margin: 4px 0 22px; }
.course-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.course-tabs .count, .tabs a .count { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--cream-2); font-size: 12px; color: var(--body); text-align: center; }
.ce-hero { margin-bottom: 18px; }
.ce-hero h1 { font-size: clamp(28px, 3.6vw, 42px); margin: 6px 0 8px; }
.ce-hero p { max-width: 62ch; }
.ce-group + .ce-group { margin-top: 32px; }
.ce-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ce-group-head h2 { font-family: var(--serif); font-weight: 500; font-size: 24px; }
.ce-group-desc { margin-bottom: 14px; max-width: 70ch; white-space: pre-line; }
.ce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 12px; }
.ce-card { display: flex; gap: 14px; align-items: center; padding: 16px 18px; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; min-width: 0; }
.ce-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ce-play { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--green-900); color: #fff; }
.ce-play svg { margin-left: 2px; }
.ce-card:hover .ce-play { background: var(--gold-grad); color: var(--green-950); }
.ce-card-body { min-width: 0; display: grid; gap: 2px; }
.ce-card-body b { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.ce-card-body span { font-size: 13px; color: var(--muted); }

/* Admin CE */
.check-list { display: grid; gap: 10px; }
.input-with-btn { display: flex; gap: 8px; align-items: center; }
.input-with-btn .input { flex: 1; min-width: 0; }
.input-with-btn .btn { flex: none; }
.ce-admin-list { list-style: none; margin: 0; padding: 0; }
.ce-admin-row { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.ce-admin-row:first-child { border-top: 0; }
.ce-admin-row.off { opacity: .6; }
.ce-admin-row .n { width: 24px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ce-admin-row .t { flex: 1; min-width: 200px; overflow-wrap: anywhere; }
.ce-admin-row .t span { display: block; font-size: 12.5px; color: var(--muted); }
.ce-admin-row .row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ce-admin-row .icon-btn:disabled { opacity: .3; cursor: default; }
.ce-admin-foot { padding: 12px 22px; border-top: 1px solid var(--line-soft); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--cream); padding: 1px 5px; border-radius: 5px; }

/* Dashboard: continuing education card */
.ce-cover { text-decoration: none; background: linear-gradient(135deg, rgba(6, 28, 31, .88), rgba(15, 58, 64, .72)), url("/assets/img/photos/benefits-tablet.jpg") center / cover, var(--green-900); }
.ce-cover-play { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: var(--green-950); box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .5); transition: transform .2s; }
.ce-cover-play svg { width: 22px; height: 22px; margin-left: 3px; }
.ce-cert-card:hover .ce-cover-play { transform: scale(1.06); }
.ce-cert-card .eyebrow { margin-bottom: 4px; }
.ce-cert-card h3 a { color: inherit; text-decoration: none; }
.ce-cert-card h3 a:hover { text-decoration: underline; }
.complete-banner .toolbar { gap: 8px; }
.seal-editor { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.seal-preview { width: 88px; height: 88px; border-radius: 12px; border: 1px dashed var(--line); background: repeating-conic-gradient(#f3efe6 0% 25%, #fff 0% 50%) 50% / 16px 16px; display: grid; place-items: center; flex: none; overflow: hidden; }
.seal-preview img { max-width: 80px; max-height: 80px; object-fit: contain; }
.seal-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 200px; }
.seal-actions .hint { flex-basis: 100%; }
.seal-actions label.btn { cursor: pointer; }
label.btn.is-busy { opacity: .6; pointer-events: none; }
p.hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* Certificate designer */
.cert-designer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .cert-designer { grid-template-columns: 1fr; } }
.cert-stage { background: var(--cream); border-radius: var(--radius-sm); padding: 12px; min-height: 320px; display: grid; place-items: center; }
.cert-page { position: relative; display: inline-block; line-height: 0; box-shadow: var(--shadow-sm); touch-action: none; }
.cert-page canvas { display: block; border-radius: 4px; }
/* The dashed box shows the width the text has to fit inside. */
.cert-guide { position: absolute; transform: translate(-50%, 0); border: 1px dashed var(--gold-500); border-radius: 3px; pointer-events: none; opacity: .8; }
.cert-label { position: absolute; transform: translate(-50%, 0); white-space: nowrap; cursor: grab; line-height: 1.1; touch-action: none; user-select: none; }
.cert-label::after { content: ""; position: absolute; inset: -8px; border-radius: 6px; }
.cert-label:hover, .cert-label.active { outline: 1px dashed var(--green-600); outline-offset: 3px; background: rgba(29, 102, 112, .06); }
.cert-label:active { cursor: grabbing; }
.cert-label:focus-visible { outline: 2px solid var(--gold-500); }
.cert-controls { position: sticky; top: 0; }
.seg-block { display: flex; width: 100%; }
.seg-block button { flex: 1; }
.nudge-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.nudge { border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 9px 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--green-900); cursor: pointer; }
.nudge:hover { background: var(--cream); }
.range { width: 100%; accent-color: var(--green-900); }
.input-sm { width: 90px; margin-top: 8px; }
.input-color { height: 42px; padding: 4px; }
.cert-controls .field { margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: var(--paper); padding: 7px 14px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--green-900); color: #fff; }
.import-problems { margin: 8px 0 0 18px; display: grid; gap: 4px; font-size: 13.5px; }
.import-problems li { color: var(--danger); }
.email-preview { width: 100%; height: 62vh; min-height: 460px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
/* Kept small and wrapping, so a long address is readable in full on a screenshot. */
.email-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.email-facts > div { background: var(--cream); border-radius: 8px; padding: 8px 10px; min-width: 0; }
.email-facts .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.email-facts b { font-size: 13px; font-weight: 600; line-height: 1.35; display: block; overflow-wrap: anywhere; }
.renewal-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 10px 22px 4px; font-size: 14px; }
.renewal-row .k { display: block; font-size: 12px; color: var(--muted); }
.renewal-row .btn { margin-left: auto; }
