/* Course page and profile: serious product UI — clean 1.5px ink lines, colour only in illustrations.
   Same tokens and the same wide column (960) as the lesson page; see site/design/GRID.md. */
.page { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter) var(--s-9); }
.topbar a { color: inherit; text-decoration: none; }
.topbar .avatar { text-decoration: none; }

.btn-ink, .btn-line { height: 48px; display: inline-flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-5); border-radius: var(--r-md);
  font-weight: 600; font-size: var(--t-sm); line-height: var(--lh-sm); text-decoration: none; }
.btn-ink { background: var(--ink); color: #fff; border: var(--stroke) solid var(--ink); }
.btn-line { background: #fff; color: var(--ink); border: var(--stroke) solid var(--ink); }
.btn-ink small { font-weight: 400; opacity: .8; font-size: var(--t-sm); }
/* phones: «Продолжить» and the lesson name on two lines instead of a squeezed 48px row */
@media (max-width: 640px) {
  .btn-ink:has(small) { height: auto; min-height: 48px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; padding-block: var(--s-2); }
}

.meter { height: 6px; background: var(--surface); border-radius: var(--r-pill); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--ink); border-radius: var(--r-pill); }

.kicker { margin-bottom: 0; }
.section-title { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 700; letter-spacing: -.02em; margin: var(--s-8) 0 var(--s-5); display: flex; align-items: baseline; gap: var(--s-3); }
.section-title small { font-size: var(--t-sm); font-weight: 400; line-height: var(--lh-sm); color: var(--muted); letter-spacing: 0; }

/* ---------- Course page ---------- */
.course-hero { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: var(--s-7); align-items: center; padding: var(--s-8) 0 var(--s-7); border-bottom: var(--stroke) solid var(--ink); }
.course-hero h1 { font-size: var(--t-2xl); line-height: var(--lh-2xl); letter-spacing: -.035em; margin: var(--s-3) 0 0; }
.course-lead { font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink-2); max-width: 34em; margin: var(--s-4) 0 var(--s-5); }
.course-progress { display: grid; gap: var(--s-2); max-width: 512px; margin-bottom: var(--s-5); }
.course-progress-row { display: flex; justify-content: space-between; gap: var(--s-4); font-size: var(--t-sm); line-height: var(--lh-sm); }
.course-progress-row b { font-weight: 600; white-space: nowrap; }
.course-progress-row span { color: var(--muted); }
.course-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.course-hero video { width: 288px; height: 288px; object-fit: contain; }

.lessons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); list-style: none; padding: 0; margin: 0; }
.lesson-card { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-4); align-items: start; height: 100%;
  border: var(--stroke) solid var(--line); border-radius: var(--r-lg); padding: var(--s-5); color: var(--ink); text-decoration: none; background: #fff; transition: border-color .15s; }
.lesson-card:hover { border-color: var(--ink); }
.lesson-card img { width: 96px; height: 96px; object-fit: contain; }
.lesson-card .num { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.lesson-card h3 { font-size: var(--t-lg); line-height: var(--lh-lg); letter-spacing: -.01em; margin: var(--s-1) 0 var(--s-2); }
.lesson-card p { font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); margin: 0 0 var(--s-3); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.status { height: 24px; display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 0 10px; font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 400; }
.status.done { background: var(--ink); color: #fff; }
.status.doing { border: var(--stroke) solid var(--ink); color: var(--ink); }
.status.todo { border: var(--stroke) solid var(--line); color: var(--muted); }
.status .meter { width: 48px; height: 4px; }
/* the lesson in progress: a black card, the same «main action» language as the covers */
.lesson-card.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.lesson-card.current img { background: #fff; border-radius: 50%; padding: 6px; }
.lesson-card.current .num { color: var(--on-ink-3); }
.lesson-card.current p { color: var(--on-ink-2); }
.lesson-card.current .lesson-meta { color: var(--on-ink-3); }
.lesson-card.current .status.doing { border-color: rgba(255,255,255,.5); color: #fff; }
.lesson-card.current .status .meter { background: rgba(255,255,255,.2); }
.lesson-card.current .status .meter > i { background: #fff; }
.lesson-card .go { display: none; }
.lesson-card.current .go { display: inline-flex; align-items: center; gap: var(--s-2); height: 40px; margin-top: var(--s-4); padding: 0 var(--s-4);
  border-radius: var(--r-md); background: #fff; color: var(--ink); font-size: var(--t-sm); line-height: var(--lh-sm); font-weight: 600; }
.lesson-card.current:hover { border-color: var(--ink); }
.lesson-card.current:hover .go { background: var(--surface); }

.cert-teaser { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: var(--s-5); align-items: center; margin-top: var(--s-7);
  border: var(--stroke) solid var(--ink); border-radius: var(--r-xl); padding: var(--s-5) var(--s-6); }
.cert-teaser img { width: 120px; height: 120px; object-fit: contain; filter: grayscale(1); opacity: .55; }
.cert-teaser h3 { margin: 0 0 var(--s-1); font-size: var(--t-lg); line-height: var(--lh-lg); }
.cert-teaser p { margin: 0; color: var(--ink-2); font-size: var(--t-sm); line-height: var(--lh-sm); }
.cert-teaser .left { font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--muted); white-space: nowrap; }

/* ---------- Profile ---------- */
.profile-head { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-8) 0 var(--s-6); border-bottom: var(--stroke) solid var(--ink); }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 700; box-shadow: inset 0 0 0 var(--stroke) var(--ink); }
.profile-head h1 { font-size: var(--t-2xl); line-height: var(--lh-2xl); letter-spacing: -.025em; margin: 0; }
.profile-head p { margin: var(--s-1) 0 0; color: var(--muted); font-size: var(--t-sm); line-height: var(--lh-sm); }
.profile-head .spacer { flex: 1; }

.course-card { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--s-6); align-items: center; border: var(--stroke) solid var(--ink); border-radius: var(--r-xl); padding: var(--s-6); }
.course-card img { width: 160px; height: 160px; object-fit: contain; }
.course-card h3 { font-size: var(--t-xl); line-height: var(--lh-xl); letter-spacing: -.02em; margin: var(--s-2) 0 var(--s-4); }
.next-course { margin-top: var(--s-4); border: var(--stroke) dashed var(--line); border-radius: var(--r-xl); padding: var(--s-5) var(--s-6); color: var(--muted); font-size: var(--t-sm); line-height: var(--lh-sm); }

.achievements { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4); list-style: none; padding: 0; margin: 0; }
.ach { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: var(--s-4); align-items: center; border: var(--stroke) solid var(--line); border-radius: var(--r-lg); padding: var(--s-4); }
.ach img { width: 80px; height: 80px; object-fit: contain; }
.ach h4 { margin: 0 0 2px; font-size: var(--t-sm); line-height: var(--lh-sm); font-weight: 600; }
.ach p { margin: 0; font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--ink-2); }
.ach .when { margin-top: var(--s-2); font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.ach.earned { border-color: var(--ink); }

.cert-locked { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: var(--s-5); align-items: center; border: var(--stroke) solid var(--line); border-radius: var(--r-xl); padding: var(--s-5) var(--s-6); }
.cert-locked img { width: 136px; height: 136px; object-fit: contain; filter: grayscale(1); opacity: .45; }
.cert-locked h3 { margin: 0 0 var(--s-2); font-size: var(--t-lg); line-height: var(--lh-lg); }
.cert-locked p { margin: 0 0 var(--s-3); color: var(--ink-2); font-size: var(--t-sm); line-height: var(--lh-sm); }

.terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-6); list-style: none; padding: 0; margin: 0; }
.terms li { border-bottom: 1px solid var(--line); padding: var(--s-3) 0; }
.terms b { display: block; font-size: var(--t-sm); line-height: var(--lh-sm); }
.terms span { font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }

/* ---------- Email-free account in the profile: key block + QR to continue on a phone ---------- */
.profile-avatar svg { width: 40px; height: 40px; }
.key-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-6); align-items: start; border: var(--stroke) solid var(--line); border-radius: var(--r-xl); padding: var(--s-6); }
.key-lead { margin: 0 0 var(--s-4); max-width: 560px; color: var(--ink-2); font-size: var(--t-sm); line-height: var(--lh-sm); }
.key-alt { margin: var(--s-4) 0 0; font-size: var(--t-sm); line-height: var(--lh-sm); }
.key-alt a { color: var(--ink); }
.key-qr-box { margin: 0; display: grid; justify-items: center; gap: var(--s-2); }
.key-qr-box figcaption { max-width: 160px; text-align: center; font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
@media (max-width: 900px) { .key-section { grid-template-columns: 1fr; } .key-qr-box { justify-items: start; } .key-qr-box figcaption { text-align: left; } }

/* ---------- Login by key and the certificate name (login.html, cert-issue.html) ---------- */
.page.narrow { max-width: 560px; }
.auth { padding: var(--s-8) 0; }
.auth h1, .issue h1 { margin: var(--s-2) 0 var(--s-3); font-size: var(--t-2xl); line-height: var(--lh-2xl); font-weight: 700; letter-spacing: -.02em; }
.auth-lead { margin: 0 0 var(--s-6); color: var(--ink-2); }
.auth-form label, #issue > label { display: block; margin-bottom: var(--s-2); font-size: var(--t-sm); line-height: var(--lh-sm); font-weight: 600; }
.auth-form input[type="password"], .auth-form input[type="text"], #issue input[type="text"] { width: 100%; height: 48px; padding: 0 var(--s-4); border: var(--stroke) solid var(--ink); border-radius: var(--r-md);
  background: #fff; color: var(--ink); font: inherit; font-size: var(--t-body); }
.auth-form input:focus-visible, #issue input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.auth-form #key { font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.auth-row { display: flex; gap: var(--s-2); align-items: center; }
.auth-row input { flex: 1; min-width: 0; }
.auth-row .key-btn { height: 48px; }
.auth-msg { min-height: var(--lh-sm); margin: var(--s-2) 0 var(--s-4); font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.auth-msg.err { color: var(--ink); font-weight: 600; }
.auth-note { margin: var(--s-7) 0 0; padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.auth-note a { color: var(--ink); }
.auth-form input.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.issue { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-8); align-items: center; padding: var(--s-8) 0; }
.issue-consent { display: flex; gap: var(--s-3); align-items: flex-start; margin: var(--s-4) 0 var(--s-5); font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); cursor: pointer; }
.issue-consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.issue-consent a { color: var(--ink); }
#issue .btn-ink:disabled { opacity: .35; cursor: default; }
.issue-preview .cert-sheet { transform: rotate(-1deg); box-shadow: 0 18px 40px rgba(28, 26, 25, .12); }
@media (max-width: 900px) { .issue { grid-template-columns: 1fr; gap: var(--s-6); padding-top: var(--s-6); } }

/* ---------- Course passed (course-state.js): the certificate in colour, results first, rereading next ---------- */
.cert-teaser.is-ready img, .cert-locked.is-issued img { filter: none; opacity: 1; }
.cert-locked.is-issued { border-color: var(--ink); }
.cert-locked .course-actions { margin-top: var(--s-4); }
button.btn-ink, button.btn-line { font-family: inherit; cursor: pointer; }
.course-card .course-actions { margin-top: var(--s-1); }

@media (max-width: 900px) {
  .course-hero { grid-template-columns: 1fr; }
  .course-hero video { width: 176px; height: 176px; justify-self: end; margin-top: calc(-1 * var(--s-3)); }
  .course-progress-row { flex-direction: column; gap: 2px; }
  .lessons, .achievements, .terms { grid-template-columns: 1fr; }
  .cert-teaser, .cert-locked, .course-card { grid-template-columns: 1fr; }
  .cert-teaser img, .cert-locked img, .course-card img { width: 112px; height: 112px; }
  .profile-head { flex-wrap: wrap; }
}

/* ---------- Certificate verification page (serious UI) ---------- */
.verify { padding: var(--s-8) 0 var(--s-6); border-bottom: var(--stroke) solid var(--ink); }
.verify-status { display: flex; gap: var(--s-4); align-items: flex-start; }
.verify-mark { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; }
.verify-mark svg { width: 24px; height: 24px; }
.verify-mark path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.verify h1 { font-size: var(--t-2xl); line-height: var(--lh-2xl); letter-spacing: -.025em; margin: 0; }
.verify-status p { margin: var(--s-2) 0 0; color: var(--ink-2); font-size: var(--t-sm); line-height: var(--lh-sm); max-width: 36em; }
.verify-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4) var(--s-6); margin: var(--s-6) 0 0; padding-left: calc(48px + var(--s-4)); }
.verify-facts div { border-top: 1px solid var(--line); padding-top: var(--s-3); }
.verify-facts dt { font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.verify-facts dd { margin: 2px 0 0; font-size: var(--t-sm); line-height: var(--lh-sm); font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.verify-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); padding-left: calc(48px + var(--s-4)); }
.verify-actions .btn-line { font-family: inherit; }

/* ---------- Certificate sheet: A4 landscape, double ink rule, colour only in the seal ----------
   A printable document, so its type scales with the sheet width (cqi). Four sizes, mirroring the site roles:
   course (display) · name · text (scope, values, brand; 400/600) · label (600 caps: kicker, «Выдан», field names). */
.cert-sheet { container-type: inline-size; position: relative; background: #fff; border: var(--stroke) solid var(--ink); padding: 14px; }
.cert-inner { border: 1px solid var(--ink); padding: 7cqi 7.5cqi 6cqi; display: flex; flex-direction: column; aspect-ratio: 297 / 210; }
.cert-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); font-size: max(12px, 1.6cqi); line-height: 1.5; }
.cert-brand { font-weight: 600; letter-spacing: -.01em; }
.cert-kicker, .cert-label, .cert-foot dt { font-size: max(11px, 1.3cqi); line-height: 1.5; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cert-main { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cert-course { font-size: max(26px, 6.6cqi); line-height: 1.02; font-weight: 700; letter-spacing: -.035em; }
.cert-issued { display: flex; align-items: baseline; gap: 1.6cqi; margin-top: 3.6cqi; padding-top: 2.4cqi; border-top: var(--stroke) solid var(--ink); max-width: 70%; }
.cert-name { font-size: max(20px, 3.9cqi); line-height: 1.1; font-weight: 600; letter-spacing: -.02em; }
.cert-scope { margin: 2.4cqi 0 0; max-width: 62%; font-size: max(12px, 1.6cqi); line-height: 1.5; color: var(--ink-2); }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-4); }
.cert-foot dl { display: flex; flex-wrap: wrap; gap: 1.2cqi 4cqi; margin: 0; font-size: max(12px, 1.6cqi); line-height: 1.5; }
.cert-foot dd { margin: 2px 0 0; font-weight: 600; }
.cert-seal { width: max(72px, 15cqi); height: max(72px, 15cqi); object-fit: contain; margin: 0 -1cqi -1.5cqi 0; }

@media (max-width: 700px) {
  .verify-facts { grid-template-columns: 1fr; padding-left: 0; }
  .verify-actions { padding-left: 0; }
  .cert-inner { aspect-ratio: auto; padding: var(--s-6) var(--s-5) var(--s-5); gap: var(--s-6); }
  .cert-issued, .cert-scope { max-width: none; }
  .cert-top { flex-direction: column; align-items: flex-start; gap: var(--s-1); }
}

@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; }
  .topbar, .verify, .section-title, .toast, .report-fab { display: none !important; }
  .page { max-width: none; padding: 0; margin: 0; }
  .cert-sheet { width: 297mm; height: 210mm; border: 0; padding: 10mm; }
  .cert-inner { height: 100%; aspect-ratio: auto; border-width: 1.5px; }
}
.cert-sample { display: inline-block; margin-top: var(--s-3); font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Course results («итоги»): story cards. Desktop: a vertical feed; phones: swipe sideways ---------- */
.results-cover { margin-top: var(--s-9); }
.wfeed { max-width: var(--wide); margin: 0 auto; display: grid; gap: var(--s-5); }
.wcard { position: relative; min-height: 560px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-6); align-items: center;
  padding: var(--s-8) var(--s-7) var(--s-8) var(--col-offset); border-radius: var(--r-xl); overflow: hidden; scroll-snap-align: center; }
.wcard.dark { background: var(--ink); color: #fff; }
.wcard.light { background: #fff; border: var(--stroke) solid var(--ink); }
.wkicker { font-size: var(--t-xs); line-height: var(--lh-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wcard.dark .wkicker { color: var(--on-ink-3); }
/* The one deliberate exception to the type roles: the Wrapped-style numeral on results cards (128/112, 76/72 on phones) */
.wbig { margin-top: var(--s-4); font-size: 128px; line-height: 112px; font-weight: 700; letter-spacing: -.055em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wbig small { font-size: var(--t-xl); line-height: var(--lh-xl); font-weight: 700; letter-spacing: -.02em; }
.wline { margin: var(--s-5) 0 0; max-width: 26em; font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink-2); }
.wcard.dark .wline { color: var(--on-ink-2); }
.wart { display: grid; place-items: center; }
.wart video { width: 288px; height: 288px; object-fit: contain; }
.wart.plate { width: 280px; height: 280px; border-radius: 50%; background: #fff; justify-self: center; }
.wart.plate video { width: 232px; height: 232px; }

/* reveal */
.wcard .wtext > * { transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.wcard:not(.in) .wtext > * { opacity: 0; transform: translateY(16px); }
.wcard.in .wtext > *:nth-child(2) { transition-delay: .08s; }
.wcard.in .wtext > *:nth-child(3) { transition-delay: .16s; }
.wcard.in .wtext > *:nth-child(4) { transition-delay: .24s; }

/* percentile meter */
.wmeter { margin-top: var(--s-5); max-width: 420px; }
.wmeter-track { height: 10px; border-radius: var(--r-pill); background: rgba(28,26,25,.1); overflow: hidden; }
.wcard.dark .wmeter-track { background: rgba(255,255,255,.16); }
.wmeter-track i { display: block; height: 100%; width: 0; border-radius: var(--r-pill); background: var(--ink); transition: width 1.1s cubic-bezier(.2, .7, .2, 1) .3s; }
.wcard.dark .wmeter-track i { background: #fff; }
.wmeter-label { display: block; margin-top: var(--s-2); font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--muted); }
.wcard.dark .wmeter-label { color: var(--on-ink-3); }
.wmeter-label b { color: var(--ink); font-weight: 600; }
.wcard.dark .wmeter-label b { color: #fff; }

/* chips, steps, quote, badges */
.wchips { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: var(--s-5) 0 0; }
.wchips li { height: 32px; display: inline-flex; align-items: center; padding: 0 var(--s-3); border-radius: var(--r-pill); font-size: var(--t-sm); line-height: var(--lh-sm); border: var(--stroke) solid rgba(255,255,255,.35); color: #fff; }
.wsteps { display: flex; gap: var(--s-2); list-style: none; padding: 0; margin: var(--s-5) 0 0; }
.wsteps li { width: 28px; height: 6px; border-radius: var(--r-pill); background: var(--ink); }
.wquote { margin: var(--s-3) 0 0; padding-left: var(--s-4); border-left: 3px solid #fff; font-size: var(--t-body); line-height: var(--lh-body); font-weight: 600; color: #fff; max-width: 24em; }
.wbadges { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3) var(--s-2); list-style: none; padding: 0; margin: 0; align-self: center; }
.wbadges li { text-align: center; font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--ink-2); }
.wbadges img { display: block; width: 84px; height: 84px; margin: 0 auto var(--s-1); object-fit: contain; }
.wbadges li.rare span { font-weight: 400; color: var(--ink); }
.wbadges li.locked img { filter: grayscale(1); opacity: .3; }
.wbadges li.locked span { color: var(--muted); }
.wdots { display: none; }

/* certificate on a black stage */
.cert-stage { max-width: var(--wide); margin: var(--s-8) auto var(--s-9); background: var(--ink); color: #fff; border-radius: var(--r-xl); padding: var(--s-8) var(--col-offset); scroll-margin-top: calc(var(--topbar-h) + var(--s-5)); }
.cert-stage-head .kicker { color: var(--on-ink-3); }
.cert-stage-head h2 { margin: var(--s-3) 0 var(--s-6); font-size: var(--t-xl); line-height: var(--lh-xl); color: #fff; }
.cert-stage .cert-sheet { color: var(--ink); border: 0; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); transform: rotate(-1deg); }
.cert-stage-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-7); }
.cert-stage-actions .btn-light::after { content: none; }
.cert-stage-actions .btn-ghost-light { font-family: inherit; }
.cert-stage-note { margin: var(--s-4) 0 0; max-width: 40em; font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--on-ink-3); }
.verify-dot { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; vertical-align: -3px; }
#results { scroll-margin-top: calc(var(--topbar-h) + var(--s-5)); }

@media (min-width: 901px) { html:has(body.results-page) { scroll-snap-type: y proximity; } }
@media (max-width: 900px) {
  .wfeed { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: var(--s-3); margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) var(--s-2);
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .wfeed::-webkit-scrollbar { display: none; }
  .wcard { flex: 0 0 86%; min-height: 70vh; grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: start; gap: var(--s-5); padding: var(--s-6) var(--s-5); scroll-snap-align: center; }
  .wcard .wart, .wcard .wbadges { order: -1; justify-self: start; }
  .wart video { width: 150px; height: 150px; }
  .wart.plate { width: 150px; height: 150px; }
  .wart.plate video { width: 124px; height: 124px; }
  .wbig { font-size: 76px; line-height: 72px; }
  .wbadges img { width: 64px; height: 64px; }
  .wdots { display: flex; justify-content: center; gap: var(--s-2); margin: var(--s-4) 0 0; }
  .wdots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--line); }
  .wdots button.on { width: 24px; border-radius: var(--r-pill); background: var(--ink); }
  .cert-stage { margin: var(--s-7) calc(-1 * var(--gutter)) var(--s-8); border-radius: 0; padding: var(--s-7) var(--gutter); }
  .cert-stage .cert-sheet { transform: none; }
}
.wtext { min-width: 0; }
@media (max-width: 900px) {
  .wcard { grid-template-columns: minmax(0, 1fr); }
  .wbig { white-space: normal; }
  .wsteps { flex-wrap: wrap; gap: 6px; }
  .wsteps li { width: 22px; }
}
.lesson-card.current .go { white-space: nowrap; }
@media (max-width: 900px) {
  .lesson-card { grid-template-columns: 72px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4); }
  .lesson-card img { width: 72px; height: 72px; }
  .lesson-card.current .go { padding: 0 var(--s-3); }
}

/* ---------- Privacy page and the small page footer ---------- */
.legal { max-width: calc(var(--measure) + 2 * var(--gutter)); padding-top: var(--s-8); }
.legal h1 { margin: var(--s-2) 0 var(--s-4); }
.legal-lead { margin: 0 0 var(--s-6); font-size: var(--t-lg); line-height: var(--lh-lg); color: var(--ink-2); }
.legal h2 { margin: var(--s-7) 0 var(--s-3); font-size: var(--t-lg); line-height: var(--lh-lg); }
.legal p { margin: 0; font-size: var(--t-body); line-height: var(--lh-body); color: var(--ink-2); }
.page-foot { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); justify-content: space-between; max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-7); border-top: 1px solid var(--line); font-size: var(--t-xs); line-height: var(--lh-xs); color: var(--muted); }
.page-foot a { color: var(--ink-2); }
.legal-note { margin: 0 0 var(--s-4); padding: var(--s-4) var(--s-5); border: 1.5px solid var(--ink); border-radius: var(--r-lg); background: var(--surface); }
.legal-note p { color: var(--ink); }
.legal a, .page-foot span a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- accounts (release 2): profile actions, the verification page, printing the certificate ---------- */
.account-actions { display: grid; justify-items: start; gap: var(--s-3); border: var(--stroke) solid var(--line); border-radius: var(--r-xl); padding: var(--s-6); }
.account-actions p { margin: 0; font-size: var(--t-sm); line-height: var(--lh-sm); color: var(--ink-2); }
.account-actions p + .btn-line { margin-bottom: var(--s-3); }
.btn-line.danger { color: #9B2C1F; }
.account-none { margin-top: var(--s-6); }
.account-none p { color: var(--ink-2); }
.cert-actions { margin-top: var(--s-5); }
.cert-check { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-5); margin: var(--s-4) 0 var(--s-6); font-size: var(--t-body); line-height: var(--lh-body); }
.cert-check dt { color: var(--muted); }
.cert-check dd { margin: 0; font-weight: 600; }
@media print {
  .no-print, .page-foot, .avatar { display: none !important; }
  .issue { display: block; padding: 0; }
  .issue-preview .cert-sheet { transform: none; box-shadow: none; }
}
.key-qr-slot { display: grid; place-items: center; width: 160px; height: 160px; border: var(--stroke) dashed var(--line); border-radius: var(--r-md); }
.key-qr-slot .key-qr { width: 160px; height: 160px; }
@media (max-width: 600px) { .key-qr-box { display: none !important; } }   /* on a phone the link is the way; the QR is for a laptop screen */
