/* Step2Success polish layer (v1.43). Loaded last on every page.
   The comfort and consistency fixes from the December 2026 design review, in one file:
   one clear next step per page, phone navigation in thumb reach, readable lessons,
   bigger tap targets, calm feedback. Colours and type stay the portal's own. */

:root {
  --r-btn: 8px;
  --r-card: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --read: #3d4b57;          /* lesson body text */
  --tabbar-h: 62px;
}

/* ---------- 1. Instant feedback when a link is tapped ---------- */
html.nav-busy::after {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000; pointer-events: none;
  background: linear-gradient(90deg, #35a7e0, #7fd0a4); transform-origin: 0 50%;
  animation: nav-busy 8s cubic-bezier(.1, .6, .1, 1) both;
}
@keyframes nav-busy { from { transform: scaleX(0); } 12% { transform: scaleX(.4); } to { transform: scaleX(.94); } }
@media (prefers-reduced-motion: reduce) { html.nav-busy::after { animation: none; transform: scaleX(.6); } }

/* ---------- 2. Buttons and fields: one shape, a pressed state, a clear focus ---------- */
.btn, .cta, .botbar a, .gbtn, .authbox input, .acct-wide input, .search input { border-radius: var(--r-btn); }
.authbox { border-radius: var(--r-card); }
.cta { min-height: 48px; }
.btn, .cta, .btn-big, .gbtn, .botbar a, .resume-btn, .su-nudge-go, .menu a.contact {
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), background-color .18s, border-color .18s, color .18s, box-shadow .18s;
}
.btn:active, .cta:active, .btn-big:active, .gbtn:active, .botbar a:active, .resume-btn:active, .su-nudge-go:active { transform: translateY(1px) scale(.985); }
.authbox input:focus-visible, .acct-wide input:focus-visible, .search input:focus-visible { border-color: #35a7e0; outline: 3px solid #35a7e040; outline-offset: 0; }
summary:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }

/* Show / Hide inside password fields (added by ui.js) */
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 70px !important; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-width: 58px; height: 40px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: #1b6fa8; font-size: 14px; font-weight: 700; }
.pw-eye:hover { background: #eef6fc; }

/* ---------- 3. Header on phones ---------- */
/* Visitors: Start free stays in the bar (with Log in where it fits); the menu keeps the other links. */
.quick { display: none; }
@media (max-width: 900px) {
  .is-guest .quick { display: flex; align-items: center; gap: 2px; }
  .is-guest .quick a { padding: 10px 7px; color: #fff; font-size: 15px; text-decoration: none; white-space: nowrap; }
  .is-guest .quick a.contact { margin-left: 3px; padding: 9px 12px; border-radius: var(--r-btn); background: var(--ok-strong); font-weight: 600; }
  .is-guest .quick a.contact:active { transform: translateY(1px) scale(.985); }
  .is-guest .menu .m-dup { display: none; }                 /* Start free is already in the bar */
}
@media (min-width: 386px) and (max-width: 900px) { .is-guest .menu .m-in { display: none; } }   /* so is Log in */
@media (max-width: 385px) { .is-guest .quick .quick-in { display: none; } }                   /* narrow phones: Log in moves into the menu */
@media (max-width: 600px) { .site-header.is-guest .hud-sound { display: none; } }             /* the sound switch stays on lesson pages */

/* Signed-in learners: the main sections sit in a tab bar at the bottom, in thumb reach. */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: space-around;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: #fffffff5; border-top: 1px solid #dfe7ee;
    -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
    view-transition-name: tabbar;
  }
  .tabbar a { flex: 1; max-width: 132px; min-height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: #5f6b77; font-size: 11.5px; font-weight: 600; line-height: 1.2; text-decoration: none; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { box-sizing: content-box; width: 22px; height: 22px; padding: 3px 16px; border-radius: 99px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: background-color .2s; }
  .tabbar a[aria-current="page"] { color: #0573b4; }
  .tabbar a[aria-current="page"] svg { background: #e3f1fb; stroke-width: 2.2; }
  .tabbar a:active svg { background: #eef6fc; }
  body:has(.tabbar), body.has-tabs { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .site-header:has(~ .tabbar) .burger, .site-header:has(~ .tabbar) .menu { display: none !important; }   /* the tab bar replaces the menu */
}

/* ---------- 4. Chapters page: the next step comes first ---------- */
.lead { background: #fdfefe; box-shadow: 0 0 0 100vmax #fdfefe; clip-path: inset(0 -100vmax); }
.lead-me { padding: clamp(14px, 2.4vw, 26px) 0 14px; }   /* room below for the card's shadow */
.lead-me + .pagehead { padding-top: 8px; }

/* 4a. Learners: carry on from where they stopped */
.resume { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 28px; min-height: 0; margin: 0; padding: 20px 26px; border-radius: 14px;
  background: linear-gradient(105deg, #1a5479, #0f2d44); color: #fff; box-shadow: 0 10px 28px #0f2d4424; }
.resume::before { left: 46%; } .resume::after { right: 24%; }
.resume-main { flex: 1; min-width: 230px; }
.resume b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: .01em; white-space: normal; color: #a9d3ee; }
.resume p { margin: 2px 0 0; font-size: clamp(19px, 2vw, 23px); font-weight: 700; line-height: 1.3; }
.resume small { font-size: 15px; font-weight: 400; opacity: .86; }
.resume-meter { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; color: #cfe3f0; }
.resume-meter .bar { flex: none; width: 128px; margin: 0; background: #ffffff2e; }
.resume-meter .bar i { background: #7fd0a4; }
.resume .resume-btn { flex: none; padding: 14px 28px; border: 0; border-radius: var(--r-btn); background: #fff; color: #0f2d44; font-size: 15px; font-weight: 700; letter-spacing: .02em; text-transform: none; box-shadow: 0 4px 14px #00000033; }
.resume .resume-btn:hover { background: #e6f3fb; color: #0f2d44; }

/* 4b. Visitors: what this is, and one button */
.lead:not(.lead-me) { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); align-items: center; gap: 24px 56px; padding: clamp(24px, 4.4vw, 54px) 0 clamp(20px, 3vw, 34px); }
.lead-h { text-wrap: balance; margin: 0 0 14px; font-size: clamp(34px, 5.3vw, 62px); font-weight: 300; line-height: 1.05; letter-spacing: -.6px; color: #1b78b4; }
.lead-sub { margin: 0 0 24px; max-width: 33em; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--read); }
.lead-go { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.lead .lead-go .resume-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 34px; border: 0; border-radius: var(--r-btn);
  background: var(--blue); color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; text-decoration: none; box-shadow: 0 8px 20px #1b5e8e3d; }
.lead .lead-go .resume-btn:hover { background: var(--navy); color: #fff; }
.lead-note { font-size: 15px; color: var(--muted); }
.lead-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 0; margin: 24px 0 0; padding: 0; font-size: 15px; color: var(--ink); }
.lead-facts li { padding: 0 14px; border-left: 1px solid #d5e0e8; }
.lead-facts li:first-child { padding-left: 0; border-left: 0; }
.lead-facts b { color: var(--navy); }
.lead-side { display: grid; gap: 10px; }
.lead .mentor-line { margin: 0; }
/* the path motif: the same line and numbered stops as the chapter path below; it draws once */
.lead-path { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 auto; overflow: visible; }
.lp-glow { fill: none; stroke: #eaf5fc; stroke-width: 54; stroke-linecap: round; stroke-linejoin: round; }
.lp-line { fill: none; stroke: #cde5f4; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: lp-draw 1.5s .15s var(--ease) forwards; }
.lp-stop circle { fill: #fff; stroke: #cde5f4; stroke-width: 3; }
.lp-stop:first-of-type circle { stroke: #2fae78; }
.lp-stop text { fill: #005b94; font-size: 26px; font-weight: 300; text-anchor: middle; }
.lp-stop { opacity: 0; transform-box: fill-box; transform-origin: center; animation: lp-pop .45s calc(.25s + var(--i) * .3s) var(--ease) forwards; }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }
@keyframes lp-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lp-line { animation: none; stroke-dashoffset: 0; } .lp-stop { animation: none; opacity: 1; } }
/* the header already offers Log in and Start free, so the chip that repeated it goes */
.site-header.is-guest ~ main.chapters #chips { display: none; }
.site-header.is-guest ~ main.chapters .viewrow .search { margin-left: auto; }
/* visitors already read "Chapters | PYTHON" just above, so the second heading is for screen readers only */
.site-header.is-guest ~ main.chapters .ctitle { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-header.is-guest ~ main.chapters .panel { margin-top: 22px; }
/* visitors have no saved progress, so the list view drops its empty progress bars */
.site-header.is-guest ~ main.chapters .row .bar { display: none; }
/* Bookmarks and notes buttons appear once there is something saved */
.roadmap-bookmarks:not(:has([data-bookmark-count]:not(:empty), [data-mark-count]:not(:empty), details[open])) { display: none; }

@media (max-width: 860px) {
  .lead:not(.lead-me) { grid-template-columns: 1fr; gap: 18px; padding-top: 22px; }
  .lead-path { display: none; }       /* the real path is one scroll away */
  .lead .mentor-line { padding: 12px 14px; }
  .lead .mentor-line a { display: none; }
}
/* The Google rating under the mentor's name: a quiet text link, shown on phones too. */
.lead .mentor-line p a.mentor-rating { display: inline; align-self: flex-start; font-size: 14px; font-weight: 400;
  color: var(--muted); text-decoration: underline; text-underline-offset: 2px; white-space: normal; }
.lead .mentor-line p a.mentor-rating:hover { color: var(--navy); }
/* The open mentor batch and its seats: the one line on the card that asks for something, so it carries the colour. */
.lead .mentor-line p a.mentor-batch { display: inline; align-self: flex-start; margin-top: 6px; font-size: 14px; font-weight: 700;
  color: var(--blue2); white-space: normal; }
@media (max-width: 640px) {
  .lead-sub { margin-bottom: 18px; }
  .lead-go { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; }
  .lead-facts { margin-top: 16px; font-size: 14.5px; }
  .lead-facts li:nth-child(n+3) { display: none; }
  .resume { padding: 18px; gap: 14px; }
  .resume .resume-btn { width: 100%; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
  .resume-meter .bar { flex: 1; width: auto; max-width: 150px; }

  /* fewer rows before the path: title + course switch, then view + search */
  .pagehead { align-items: center; gap: 8px 10px; padding-top: 12px; }
  .pagehead .ph-title { font-size: 28px; padding-bottom: 0; margin: 4px 0 8px; }
  .pagehead .course-badge { display: none; }        /* the switch beside it already names the course */
  .course-switch { width: auto; margin: 0 0 8px auto; }
  .course-switch .cs-label { display: none; }
  .course-switch a { flex: none; padding: 7px 14px; font-size: 14px; }
  .viewrow { gap: 4px 6px; padding: 8px 0; }
  .viewrow > span { display: none; }                /* the "Change View:" label */
  .viewrow .search { order: 3; flex: 1; width: auto; margin-left: 6px; }
  .viewrow .search input { min-height: 44px; }
  .viewrow .chips { order: 4; }
  .ctitle { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .chapter-index { padding: 18px 16px; }
}

/* chapter lessons: a sheet that rises from the bottom on phones, a gentle pop on larger screens */
#chapter-dialog[open] { animation: dialog-in .2s var(--ease); }
#chapter-dialog::backdrop { animation: fade-in .2s ease-out; }
#lesson-list .lrow { font-weight: 400; }
@keyframes dialog-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes sheet-up { from { transform: translateY(28px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 640px) {
  #chapter-dialog { width: 100%; max-width: 100%; max-height: min(84dvh, 680px); margin: auto 0 0; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #chapter-dialog[open] { animation: sheet-up .28s var(--ease); }
  #chapter-dialog .dh { position: relative; padding-top: 24px; }
  #chapter-dialog .dh::before { content: ""; position: absolute; top: 9px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 99px; background: #d5dee6; }
  #lesson-list .lrow { min-height: 58px; }
  #close { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { #chapter-dialog[open], #chapter-dialog::backdrop { animation: none; } }

/* a drawn lock, the same on every phone (was an emoji) */
.lk { display: inline-block; width: .78em; height: .78em; margin-left: .3em; vertical-align: -.04em; background: #9aabb9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 10V8a6 6 0 1 1 12 0v2h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1zm2 0h8V8a4 4 0 1 0-8 0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 10V8a6 6 0 1 1 12 0v2h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1zm2 0h8V8a4 4 0 1 0-8 0z'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- 5. Lessons: comfortable to read, easy to answer, obvious what is next ---------- */
/* body text in regular weight and a darker grey (was light weight, mid grey) */
.lesson-page .blk-text, .lesson-page .blk-text p, .lesson-page .blk-text li, .lesson-page .blk-hl, .lesson-page .blk-must .bd,
.lesson-page .blk-ex .q, .lesson-page .blk-ex .opt { font-weight: 400; color: var(--read); }
.lesson-page .blk-must .bd p, .lesson-page .blk-must .bd li { font-weight: 400; }
/* about 75 characters a line on a laptop (was close to 90) */
.lesson-page .blk-text p, .lesson-page .blk-text ul, .lesson-page .blk-text ol { max-width: 58ch; }
/* Key takeaways: the text was dark grey on navy and could not be read */
.lesson-page .blk-sum, .lesson-page .blk-sum p, .lesson-page .blk-sum li { color: #eef5fa; font-weight: 400; }
.lesson-page .blk-sum a { color: #9fd6f5; }

/* quiz choices: full-width cards with a 52px tap area */
.lesson-page .blk-ex .opts { display: grid; gap: 8px; }
.lesson-page .blk-ex .opt { min-height: 52px; padding: 12px 14px; gap: 14px; border: 1px solid #dfe7ec; border-radius: 10px; background: #fff;
  transition: border-color .15s, background-color .15s, transform .12s var(--ease); }
.lesson-page .blk-ex .opt:hover:not([disabled]) { border-color: #9cc3df; background: #f6fafd; }
.lesson-page .blk-ex .opt:active:not([disabled]) { transform: scale(.99); }
.lesson-page .blk-ex .opt.right { border-color: var(--t-ok); background: var(--t-ok-bg); }
.lesson-page .blk-ex .opt.wrong { border-color: var(--t-warn-line); background: var(--t-warn-bg); }

/* end of the lesson: Next is the main button; saving progress is the green one */
.lesson-page .finishbox a.btn:not(.ghost) { background: var(--ok-strong); }
.lesson-page .finishbox a.btn:not(.ghost):hover { background: #176b41; }
.lesson-page .botbar a.next { display: inline-flex; align-items: center; justify-content: center; gap: 0; }
.nx-t { display: none; }

@media (max-width: 700px) {
  /* chapter line wraps instead of being cut off; the lesson title is the heading */
  .lesson-page .chtitle { white-space: normal; overflow: visible; text-overflow: clip; font-size: 25px !important; line-height: 1.2; margin-bottom: 12px; }
  .lesson-page .lestitle { font-size: 23px; line-height: 1.25; }
  .lesson-page .botbar { padding: 4px 14px 84px; }
  .lesson-page .botbar .in { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
  .lesson-page .botbar a { min-width: 0; min-height: 58px; padding: 12px 18px; display: flex; align-items: center; justify-content: center; }
  .lesson-page .botbar a.off { display: none; }
  .lesson-page .botbar a.off ~ a.next { grid-column: 1 / -1; }
  .lesson-page .botbar a.next { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; text-align: left; text-transform: none; letter-spacing: 0; }
  .nx-k { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; opacity: .82; }
  .nx-t { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 17px; font-weight: 700; line-height: 1.25; }
  .lesson-page .finishbox .btn { min-width: 0; padding: 14px 22px; }
  /* the five rating faces stay on one row */
  .lesson-page .faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; min-width: 0; width: 100%; }
  .lesson-page .face { width: auto; min-height: 76px; padding: 4px 0; font-size: 11.5px; line-height: 1.25; justify-content: flex-start; }
}

/* ---------- 6. Chapter test ---------- */
/* a fieldset draws its legend on the border; floating it puts the question inside the card */
.tq { min-width: 0; }
.tq legend.qn { float: left; width: 100%; padding: 0; margin: 0 0 6px; }
.tq legend.qn + *, .tq .opt-row { clear: both; }
/* room for the floating question bar so it no longer covers the title */
@media (max-width: 1500px) { body:has(form[data-test-form]) main.kit { padding-top: 62px; } }
.opt-row { min-height: 52px; align-items: center; transition: border-color .15s, background-color .15s; }
.opt-row input { margin-top: 0; }

/* ---------- 7. Amber, never red, for "not yet" (wrong answers, pending fees) ---------- */
.due { background: #fff6ec; border-color: #f7d3ad; color: #b45309; }
.tag.bad { background: #fff6ec; color: #b45309; }
.tq.no { border-left-color: #f0a050; }
.opts-review .wrong { color: #b45309; }
.feebar { background: #fbe6cf; }
.practice-verdict.fail { background: #fff6ec; border-color: #f0a050; color: #8a4b0b; }
.python-practice[data-state=tried] { border-top-color: #f0a050; }
.state-chip.tried { background: #fff6ec; color: #b45309; }

/* ---------- 8. My course ---------- */
.ch .t .ch-no { color: #5b7183; font-weight: 600; }

/* ---------- 9. Small phones ---------- */
@media (max-width: 420px) {
  .site-header.is-guest .brand-main { font-size: 14px; letter-spacing: 1px; }
}
@media (max-width: 345px) {
  .is-guest .brand-txt { display: none; }          /* the logo alone, so both buttons fit */
  .site-header.is-portal .brand-main { font-size: 13px; letter-spacing: .6px; }
}

/* ---------- 10. Sizes that never applied ("font: … inherit" is not valid CSS, so browsers dropped the whole rule) ---------- */
.br-dot { font-size: 11px; font-weight: 700; line-height: 1; }
.qnav a { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.nb .nb-add { font-size: 13px; font-weight: 600; line-height: 1.2; }
.q-flag { font-size: 12px; font-weight: 600; line-height: 1.3; }

/* ---------- 11. Not-found page ---------- */
.lost-go { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; margin-top: 6px; }
.lost-help { margin-top: 18px !important; }

/* ---------- App feel (v1.45): pages slide like screens, taps answer at once, nothing jumps ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Phones: forward pushes the new screen in from the right, back slides it away, the header and tab bar stay put. */
@media (max-width: 760px) {
  html[data-nav="forward"]::view-transition-old(root) { animation: vt-push-out .26s var(--ease) both; }
  html[data-nav="forward"]::view-transition-new(root) { animation: vt-push-in .26s var(--ease) both; }
  html[data-nav="back"]::view-transition-old(root) { animation: vt-pop-out .26s var(--ease) both; z-index: 1; }
  html[data-nav="back"]::view-transition-new(root) { animation: vt-pop-in .26s var(--ease) both; }
  html[data-nav="same"]::view-transition-old(root), html[data-nav="same"]::view-transition-new(root) { animation: none; }
}
@keyframes vt-push-out { to { transform: translateX(-22%); opacity: .5; } }
@keyframes vt-push-in { from { transform: translateX(100%); } }
@keyframes vt-pop-out { to { transform: translateX(100%); } }
@keyframes vt-pop-in { from { transform: translateX(-22%); opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  html[data-nav]::view-transition-old(root), html[data-nav]::view-transition-new(root) { animation: none; }
}
/* Touch screens: every tappable row answers the finger. */
@media (hover: none) {
  .tabbar a, .node, .lesson-row, .chapter-card, .card a, .menu a, .resume-btn { transition: transform .12s var(--ease), opacity .12s; }
  .tabbar a:active, .lesson-row:active, .chapter-card:active, .resume-btn:active { transform: scale(.97); opacity: .85; }
  /* Map circles are centred with translate: keep it while pressed, or the circle jumps sideways. */
  .node:active { transform: translate(-50%, -50%) scale(.97); opacity: .85; }
  .syl-node:has(.syl-mod:active) { transform: translate(-50%, -50%); opacity: 1; }
  /* iPhone zooms the page when a field's text is under 16px; keep fields at 16px so the layout never jumps. */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: max(16px, 1em); }
  img, svg { -webkit-user-drag: none; }
}
/* Installed app: behave like an app, not a web page. */
.is-app body { overscroll-behavior: none; -webkit-touch-callout: none; }
.is-app a, .is-app img { -webkit-touch-callout: none; }
.is-app .tabbar, .is-app .site-header { -webkit-user-select: none; user-select: none; }
.is-app .lesson-body, .is-app pre, .is-app code, .is-app input, .is-app textarea { -webkit-touch-callout: default; -webkit-user-select: text; user-select: text; }

/* Chapter sheet on touch screens: no focus box around the close button (keyboard users keep theirs). */
@media (hover: none) { #chapter-dialog #close:focus { outline: 0; box-shadow: none; } }
/* ---------- Install bar (v1.46): one tap to open the portal full screen from the home screen ---------- */
.install-bar {
  position: fixed; left: 10px; right: 10px; z-index: 60;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px;
  padding: 12px 8px 12px 14px; background: #fff; color: var(--navy, #0f2d44);
  border: 1px solid #dfe6ec; border-radius: var(--r-card); box-shadow: 0 8px 28px rgba(15, 45, 68, .16);
  animation: install-in .28s var(--ease) both;
}
body:has(.tabbar) .install-bar, body.has-tabs .install-bar { bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); }
.install-bar p { margin: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.35; color: var(--muted, #5f6b77); }
.install-bar p b { font-size: 15px; color: var(--navy, #0f2d44); }
.install-bar .install-go { font: inherit; font-size: 14px; font-weight: 700; min-height: 44px; padding: 0 16px; border: 0;
  border-radius: var(--r-btn); background: var(--navy, #0f2d44); color: #fff; cursor: pointer; }
.install-bar .install-x { font: inherit; font-size: 22px; line-height: 1; width: 44px; height: 44px; border: 0; background: none;
  color: var(--muted, #5f6b77); cursor: pointer; }
.install-bar .install-how { grid-column: 1 / -1; display: block; padding-top: 8px; border-top: 1px solid #eef2f5; color: var(--navy, #0f2d44); }
.install-bar .install-how[hidden] { display: none; }
@keyframes install-in { from { transform: translateY(16px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .install-bar { animation: none; } }

/* ---------- A tap is answered at once (v1.46.1): the page steps back and the tapped item shows it is opening ---------- */
html.nav-go main { opacity: .45; transition: opacity .12s linear; pointer-events: none; }
html.nav-go #chapter-dialog #lesson-list { opacity: .55; transition: opacity .12s linear; }
.going { position: relative; }
.tabbar a.going { color: var(--blue2, #0b6fb3); background: #e4f2fb; }
.lrow.going, .resume-btn.going, .cta.going, .btn.going, .btn-big.going, .course-switch a.going { opacity: 1; }
.lrow.going::after, .resume-btn.going::after, .cta.going::after, .btn-big.going::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; opacity: .7; animation: going-spin .6s linear infinite;
}
.course-switch a.going { background: var(--blue2, #0b6fb3); color: #fff; }
@keyframes going-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .going::after { animation: none; } html.nav-go main { transition: none; } }
html.nav-go .tabbar:has(a.going) a[aria-current]:not(.going) { color: #5f6b77; background: none; }

/* Mentor program syllabus for signed-out visitors (learning/syllabus.py): steps in order, each module a link.
   Open modules go to the course; locked ones say "Premium plan" and open WhatsApp. */
.syllabus { max-width: 1240px; margin: 28px auto 8px; padding: 0 clamp(12px, 3vw, 40px); }
.syllabus .syl-head h1, .syllabus .syl-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; color: var(--navy); }
.syllabus .syl-head p { margin: 0 0 16px; color: #5b6b78; font-size: 15px; max-width: 760px; }
.syllabus .syl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); counter-reset: none; }
.syllabus .syl-step { background: #fff; border: 1px solid #dfe7ee; border-radius: 8px; padding: 14px 16px; display: flex;
  flex-direction: column; gap: 4px; }
.syllabus .syl-when { font-size: 13px; color: var(--blue2); font-weight: 600; }
.syllabus .syl-title { font-size: 17px; color: var(--navy); line-height: 1.3; }
.syllabus .syl-mods { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.syllabus .syl-mod { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 18px;
  background: #eaf2f9; color: #1f4f78; font-size: 14px; font-weight: 600; text-decoration: none; }
.syllabus .syl-mod:hover { background: #d8e8f5; }
.syllabus .syl-mod span { white-space: nowrap; }
.syllabus .syl-mod.locked { flex-wrap: wrap; row-gap: 2px; border-radius: 12px; background: #f4f5f7; color: #5b6b78; border: 1px dashed #c3ccd5; }
.syllabus .syl-mod.locked:hover { background: #eceff2; }
.syllabus .syl-mod svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.syllabus .syl-mod small { font-size: 11px; font-weight: 700; color: #9a5b00; background: #fff3dc; border-radius: 10px; padding: 1px 7px; }

/* The syllabus on the same winding path as the chapter map (app.js sylNode). */
.syllabus .syl-map { position: relative; margin-top: 6px; background: #fff; border: 1px solid #e3ebf1; border-radius: 10px; }
.syl-node { cursor: default; display: flex; align-items: center; justify-content: center; }
.syllabus .roadmap svg.syl-path { position: absolute; inset: 0; }
.syllabus .syl-mod svg { position: static; inset: auto; overflow: visible; }
.syl-node .label small.syl-when { margin: 0 0 2px; }
.syl-node .syl-mod small { display: inline-block; margin: 0; color: #9a5b00; }
.syl-node .label.b { top: calc(100% + 14px); left: 50%; transform: translateX(-50%); text-align: center; }
.syl-node .label.b .syl-mods { justify-content: center; }
.syl-node:hover { transform: translate(-50%, -50%); }
.syl-node .label { color: var(--navy); font-weight: 600; }
.syl-node .label .syl-when { display: block; margin: 0 0 2px; font-size: 13px; font-weight: 700; color: var(--blue2); }
.syl-node .syl-mods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-weight: 600; }
.syl-node .label.l .syl-mods { justify-content: flex-end; }
.syl-node .label.t .syl-mods { justify-content: center; }
.syl-node .syl-mod { font-size: 13px; min-height: 32px; padding: 4px 11px; }

/* Two parts: foundations (open) and cloud data engineering (students only, locked stops that list their topics). */
.syllabus .syl-part { margin-top: 18px; }
.syllabus .syl-part-h { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 700; color: var(--navy); }
.syllabus .syl-part-note { margin: 2px 0 8px; color: #5b6b78; font-size: 14px; }
.syllabus svg.syl-lock { position: static; inset: auto; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: none; }
.syllabus .syl-part-h svg.syl-lock { width: 18px; height: 18px; color: #9a5b00; }
.syllabus .syl-part.students .syl-map { background: #fbfaf7; border-color: #ece3d3; }
button.syl-node { font: inherit; cursor: pointer; padding: 0; }
.syl-node.syl-locked { color: #8a6a3c; }
.syl-node.syl-locked:hover, .syl-node.syl-locked:focus-visible { transform: translate(-50%, -50%) scale(1.04); }
.syl-node .syl-badge { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; border-radius: 50%; background: #fff3dc;
  color: #9a5b00; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fff; }
.syl-node .syl-count { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 13px; font-weight: 600; color: #9a5b00;
  background: #fff3dc; border-radius: 12px; padding: 3px 10px; }
.syl-dialog { border: 0; border-radius: 12px; padding: 22px 22px 20px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 20px 60px #0f2d4440; color: var(--navy); }
.syl-dialog::backdrop { background: #0f2d4466; }
.syl-dialog .syl-d-close { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: none; font-size: 26px; color: #5b6b78; cursor: pointer; }
.syl-dialog .syl-d-tag { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; font-weight: 700; color: #9a5b00;
  background: #fff3dc; border-radius: 12px; padding: 4px 10px; }
.syl-dialog h3 { margin: 10px 0 12px; font-size: 22px; }
.syl-dialog .syl-d-topics { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.syl-dialog .syl-d-topics li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; padding: 10px 12px; border-radius: 8px; background: #f4f6f8; }
.syl-dialog .syl-d-topics li.locked { color: #5b6b78; }
.syl-dialog .syl-d-topics a { color: var(--blue2); font-weight: 600; }
.syl-dialog .syl-d-topics small { color: #2e7d4f; font-size: 12px; }
.syl-dialog .syl-d-go { display: flex; gap: 10px; flex-wrap: wrap; }
.syl-dialog .syl-d-go a { flex: 1 1 160px; text-align: center; padding: 12px 14px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.syl-dialog .syl-d-plans { background: var(--navy); color: #fff; }
.syl-dialog .syl-d-ask { border: 1px solid #c9d6e0; color: var(--navy); }
.syl-node .syl-count { display: flex; width: fit-content; }
.syl-node .label.b .syl-count { margin-inline: auto; }
.syl-node .label.l .syl-count { margin-left: auto; }

/* The number circle of an open syllabus step is itself a link to that step's course. */
.syl-node .syl-go { position: absolute; inset: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #005b94; text-decoration: none; }
.syl-node:has(.syl-go) { cursor: pointer; }

/* "You are here" pin and the finish flag on the mentor syllabus (app.js sylMarks). */
.syl-node .syl-here { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 4px 10px; border-radius: 14px;
  background: #1b78b4; color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.2; box-shadow: 0 4px 10px #1b78b440; }
.syl-node .syl-here::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #1b78b4; }
.syl-node .syl-here span { font-size: 15px; }
.syl-node .syl-goal { position: absolute; top: -14px; right: -12px; z-index: 3; font-size: 22px; line-height: 1; }
.syl-node:has(.syl-here) .n { box-shadow: 0 0 0 4px #1b78b455; }

/* Open syllabus stops: the whole stop (number, week, title) opens its lessons. */
.syl-node.syl-open { cursor: pointer; }
.syl-node .label .syl-title { display: inline; color: var(--navy); font-size: 1em; text-decoration: none; }
.syl-node.syl-open:hover .syl-title, .syllabus .syl-title:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.syl-node.syl-open:hover .n { box-shadow: 0 0 0 4px #d8e8f5; }
#chapters { scroll-margin-top: 80px; }

/* The syllabus has its own page (/syllabus/), reached from the tab bar and the menu. */
.syllabus-page { padding-bottom: 32px; }
.syllabus-page .syllabus { margin-top: clamp(16px, 3vw, 32px); }

/* Topics page (v1.54.0): the same layout as a course's Chapters page. One white panel, one path, the map's
   own circles and labels; these rules undo the older boxed syllabus look for it. */
.syllabus-page .syllabus { max-width: none; margin: 0; padding: 0; }
.syllabus-page .pagehead { margin-bottom: 4px; }
.syllabus-page a.syl-node, .syllabus-page button.syl-node { text-decoration: none; color: #005b94; cursor: pointer; }
.syllabus-page .syl-node:hover, .syllabus-page .syl-node.syl-locked:hover, .syllabus-page .syl-node.syl-locked:focus-visible { transform: translate(-50%, -50%) scale(1.05); }
.syllabus-page .syl-node .label { color: #005b94; font-weight: 400; }
.syllabus-page .syl-node.syl-locked { color: #005b94; }
.syllabus-page .roadmap svg.syl-lock { position: static; inset: auto; }
