:root{
  /* Brand palette — three colours, everything else is a tint or shade of them:
     amber #f49e10 (accent/CTA), cocoa #611c03 (ink), cream #fcf2e5 (page). */
  --amber:#f49e10; --cocoa:#611c03; --cream:#fcf2e5;
  --bg:#fcf2e5; --surface:#fffcf7; --surface-2:#f7e8d5; --border:#ecd9bd;
  --fg:#611c03; --muted:#8a5a3c; --faint:#8f6039;
  --accent:#f49e10; --accent-2:#e08b06; --accent-deep:#611c03; --cta:#f49e10; --good:#611c03; --warn:#f49e10;
  /* text/marks sitting ON an amber fill — white only hits 2.2:1 there, cocoa hits 6.9:1 */
  --on-accent:#4a1502;
  /* amber that is legible AS TEXT on cream (raw #f49e10 is 2.0:1 and must never be text) */
  --amber-ink:#8a4102;
  --radius:14px; --shadow:0 6px 24px rgba(97,28,3,.10);
  --font:'Instrument Sans',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-head:var(--font);
  /* Instrument Serif ships ONE weight (400). Anything wearing it must set font-weight:400,
     or the browser synthesises a bold and the letterforms smear. */
  --font-display:'Instrument Serif',Georgia,'Times New Roman',serif;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font-family:var(--font);background:var(--bg);color:var(--fg);min-height:100vh;line-height:1.5;font-weight:400}
h1,h2,h3,h4,.brand,.page-title,.stat .n,.logo,.course-hero h1{font-family:var(--font-head)}
a{color:inherit;text-decoration:none}

/* ===== Brand type =====
   Instrument Sans carries everything readable. Instrument Serif is reserved for the
   accents — eyebrows, kickers, tier headings, big numbers, the wordmark, and any word
   marked .hl — so it stays a highlight and never turns into body copy.
   The serif has a single weight: every rule below must say font-weight:400, or the
   browser fakes a bold and the letterforms smear. */
.eyebrow,.hl{font-family:var(--font-display);font-weight:400}
.hl{color:var(--amber-ink)}
.eyebrow{display:inline-block;font-size:.85rem;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.btn{display:inline-flex;align-items:center;gap:.5rem;justify-content:center;border:1px solid var(--border);
  background:var(--surface-2);color:var(--fg);padding:.6rem 1rem;border-radius:10px;cursor:pointer;
  font-size:.95rem;font-weight:600;transition:.15s ease;font-family:inherit}
.btn:hover{border-color:var(--accent);transform:translateY(-1px)}
.btn-primary{background:var(--cta);border:none;color:var(--on-accent)}
.btn-primary:hover{filter:brightness(1.08)}
.btn-block{width:100%}

/* ---- Top nav ---- */
.nav{display:flex;align-items:center;gap:1.5rem;
  padding:.9rem max(2rem, calc((100% - 1320px) / 2 + 2rem));border-bottom:1px solid var(--border);
  background:rgba(252,242,229,.78);backdrop-filter:blur(8px);position:sticky;top:0;z-index:10}
.brand{display:flex;align-items:center;gap:.6rem;font-family:var(--font-display);font-weight:400;
  letter-spacing:0;font-size:1.45rem;line-height:1}
.nav .links{display:flex;align-items:center;gap:.25rem;margin-left:1rem}
.nav .links a{padding:.45rem .8rem;border-radius:8px;color:var(--muted);font-weight:600;font-size:.9rem}
.nav .links a:hover{color:var(--fg);background:var(--surface-2)}
.nav .links a.active{color:var(--fg);background:var(--surface-2)}
.nav-menu{flex:1;display:flex;align-items:center;justify-content:space-between;gap:1rem}
.nav-toggle{display:none;margin-left:auto;background:transparent;border:0;
  border-radius:9px;color:var(--fg);font-size:1.3rem;line-height:1;padding:.3rem .35rem;cursor:pointer;
  -webkit-tap-highlight-color:transparent}
/* no box, but keep a visible focus ring for keyboard users */
.nav-toggle:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(97,28,3,.28)}
.nav .spacer{flex:1}
.nav .who{display:flex;align-items:center;gap:.6rem;color:var(--muted);font-size:.9rem}
.nav .who form{margin:0}
.signout-btn{padding:.4rem .7rem}
.avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,#611c03,#3a1002);
  display:grid;place-items:center;font-weight:700;color:#fff;font-size:.85rem}

/* ---- Top utility bar ---- */
.topbar{background:linear-gradient(90deg,var(--accent),var(--accent-2));color:var(--fg)}
.topbar-inner{padding:.5rem max(2rem, calc((100% - 1320px) / 2 + 2rem));display:flex;align-items:center;
  justify-content:space-between;gap:1rem;font-size:.85rem}
.topbar-inner > span{font-weight:500}
.topbar-links{display:flex;gap:1.4rem}
.topbar a{color:var(--fg);opacity:.9;font-weight:600}
.topbar a:hover{opacity:1;text-decoration:underline}
@media(max-width:640px){.topbar-links{display:none}}

/* ---- Nav dropdown (works on hover AND click; no JS required) ---- */
.dropdown{position:relative;display:flex;align-items:center}
.drop-toggle{cursor:pointer;user-select:none}
/* invisible bridge covers the gap so moving toggle->menu doesn't close it */
.dropdown::after{content:"";position:absolute;left:0;top:100%;width:100%;height:.6rem}
.drop-menu{position:absolute;top:calc(100% + .5rem);left:0;min-width:172px;background:var(--surface);
  border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:.35rem;
  display:none;flex-direction:column;gap:.1rem;z-index:40}
.dropdown:hover .drop-menu,.dropdown:focus-within .drop-menu,.dropdown.open .drop-menu{display:flex}
.drop-menu a{padding:.55rem .7rem;border-radius:8px;color:var(--muted);font-weight:600;font-size:.9rem;white-space:nowrap}
.drop-menu a:hover{background:var(--surface-2);color:var(--fg)}

/* ---- Layout ---- */
.wrap{max-width:1320px;margin:0 auto;padding:1.75rem 2rem 4rem}
.page-title{font-size:1.6rem;font-weight:800;letter-spacing:-.02em;margin:0 0 .25rem}
.page-sub{color:var(--muted);margin:0 0 1.5rem}

/* ---- Footer ---- */
.footer{border-top:1px solid var(--border);background:var(--surface);margin-top:2.5rem}
.footer .fwrap{max-width:1320px;margin:0 auto;padding:2.5rem 2rem;display:grid;grid-template-columns:1.6fr 1fr 1fr 1fr;gap:2rem}
.footer .brand{margin-bottom:.7rem}
.footer p{color:var(--muted);font-size:.9rem;max-width:34ch;margin:0}
.footer h5{font-family:var(--font-display);font-weight:400;font-size:.9rem;text-transform:uppercase;letter-spacing:.09em;color:var(--faint);margin:0 0 .85rem}
.footer ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.55rem}
.footer .fcol a{color:var(--muted);font-size:.9rem}
.footer .fcol a:hover{color:var(--fg)}
.fbottom{border-top:1px solid var(--border)}
.fbottom .fwrap{padding:1.1rem 2rem;display:flex;justify-content:space-between;align-items:center;gap:1rem}
.fbottom span{color:var(--faint);font-size:.85rem}
@media(max-width:760px){
  .footer .fwrap{grid-template-columns:1fr 1fr;gap:1.5rem}
  .fbottom .fwrap{flex-direction:column;text-align:center}
}

/* ---- Welcome hero ---- */
.hero{position:relative;overflow:hidden;border-radius:18px;padding:2.1rem 2.3rem;margin-bottom:1.5rem;
  background:linear-gradient(135deg,#f49e10,#e08b06);color:var(--fg);box-shadow:var(--shadow);
  display:flex;align-items:center;justify-content:space-between;gap:1.5rem}
.hero-content{position:relative;z-index:1}
/* full opacity on purpose: cocoa dimmed to .65 on the amber hero was 3.0:1 */
.hero-eyebrow{display:inline-block;font-family:var(--font-display);font-size:.9rem;font-weight:400;
  letter-spacing:.09em;text-transform:uppercase;opacity:1;margin-bottom:.5rem}
.hero h1{font-family:var(--font-head);font-size:2.05rem;margin:0 0 .5rem;letter-spacing:-.02em;line-height:1.1}
.hero p{margin:0 0 1.35rem;opacity:.88;font-size:1.02rem;max-width:42ch}
.hero-actions{display:flex;gap:.7rem;flex-wrap:wrap}
/* the hero IS amber, so an amber button would vanish into it — invert to cocoa-on-cream */
.hero .btn-primary{background:var(--on-accent);color:var(--cream)}
.hero .btn-primary:hover{filter:brightness(1.06)}
.hero-btn-ghost{background:rgba(97,28,3,.06);border:1px solid rgba(97,28,3,.25);color:var(--fg)}
.hero-btn-ghost:hover{background:rgba(97,28,3,.1);border-color:rgba(97,28,3,.45);transform:translateY(-1px)}
.hero-art{position:relative;z-index:1;font-size:4.6rem;flex:none;filter:drop-shadow(0 8px 16px rgba(0,0,0,.2))}
@media(max-width:640px){.hero{padding:1.6rem}.hero h1{font-size:1.6rem}.hero-art{display:none}}

/* ---- Stat cards with icons ---- */
.statx{display:flex;align-items:center;gap:1rem}
.statx-ico{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;font-size:1.3rem;flex:none}
.statx-ico.blue{background:rgba(244,158,16,.30);color:var(--accent-deep)}
.statx-ico.green{background:rgba(244,158,16,.30);color:var(--accent-deep)}
.statx-ico.purple{background:rgba(244,158,16,.14);color:var(--amber-ink)}
.statx .n{font-family:var(--font-display);font-size:2rem;font-weight:400;letter-spacing:0;display:block;line-height:1.1}
.statx .l{color:var(--muted);font-size:.85rem}

/* ---- Section cards (dashboard) ---- */
.section-cards-title{font-family:var(--font-head);font-size:1.15rem;margin:0 0 .8rem}
.section-cards{margin-bottom:1.75rem}
.section-card{display:flex;align-items:center;gap:1rem;cursor:pointer;transition:.15s ease;color:inherit}
.section-card:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:var(--shadow)}
.section-card.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.sc-ico{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;font-size:1.25rem;flex:none}
.sc-ico.green{background:rgba(244,158,16,.30);color:var(--accent-deep)}
.sc-ico.blue{background:rgba(244,158,16,.30);color:var(--accent-deep)}
.sc-ico.purple{background:rgba(244,158,16,.14);color:var(--amber-ink)}
.sc-body{flex:1;min-width:0}
.sc-body h3{margin:0 0 .15rem;font-size:1.02rem;font-family:var(--font-head)}
.sc-body p{margin:0;color:var(--muted);font-size:.82rem}
.sc-arrow{color:var(--faint);font-size:1.35rem;line-height:1;flex:none;transition:.15s ease}
.section-card:hover .sc-arrow{color:var(--accent);transform:translateX(2px)}
#content{scroll-margin-top:84px}

/* ---- Dynamic dashboard: training card / quick help / explore ---- */
#quick-help,#explore{scroll-margin-top:84px}
.dash-sub{color:var(--muted);margin:-.4rem 0 1rem;font-size:.92rem}
.training{padding:1.5rem 1.6rem;margin-bottom:1.9rem}
.tr-top{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap;margin-bottom:.8rem}
.tr-name{font-weight:700;font-size:.92rem;color:var(--muted)}
.tr-stage{font-family:var(--font-head);font-size:1.45rem;margin:0 0 .3rem;letter-spacing:-.02em}
.tr-body{margin:0 0 1.1rem;color:var(--muted);max-width:60ch}
/* today's lesson inside the card — the whole row opens it, same as the CTA */
.tr-lesson{display:block;background:var(--surface-2);border:1px solid var(--border);border-radius:10px;
  padding:.9rem 1.05rem;margin-bottom:1.2rem;max-width:640px;transition:.15s ease}
.tr-lesson:hover{border-color:var(--accent)}
.tr-lesson-title{display:block;font-weight:700}
.tr-lesson-blurb{display:block;margin-top:.2rem;color:var(--muted);font-size:.9rem;max-width:62ch}
.tr-foot{display:flex;align-items:center;gap:1.4rem;flex-wrap:wrap}
.tr-progress{flex:1;min-width:220px;max-width:420px}
.tr-progress .bar{margin-top:0}
.tr-count{display:block;color:var(--muted);font-size:.82rem;margin-top:.35rem}

.qh-chips{display:flex;gap:.7rem;flex-wrap:wrap;margin-bottom:1.9rem}
.qh-chip{display:inline-flex;align-items:center;gap:.5rem;padding:.7rem 1.15rem;background:var(--surface);
  border:1px solid var(--border);border-radius:999px;font-weight:600;font-size:.95rem;
  box-shadow:var(--shadow);transition:.15s ease}
.qh-chip:hover{border-color:var(--accent);transform:translateY(-1px)}
.qh-go{color:var(--faint);transition:.15s ease}
.qh-chip:hover .qh-go{color:var(--accent-deep);transform:translateX(2px)}

.topic{display:flex;align-items:center;gap:1rem;padding:1.05rem 1.2rem}
a.topic{transition:.15s ease}
a.topic:hover{border-color:var(--accent);transform:translateY(-2px)}
.topic-ico{width:56px;height:56px;border-radius:14px;background:linear-gradient(135deg,#f0dcc0,#f7e8d5);
  background-size:cover;background-position:center;display:grid;place-items:center;font-size:1.6rem;flex:none}
.topic-body{flex:1;min-width:0}
.topic-title{display:block;font-family:var(--font-head);font-weight:700;font-size:1.05rem}
.topic-sub{display:block;color:var(--muted);font-size:.85rem;margin-top:.1rem}
/* Mute a coming-soon card with explicit colours, NOT group opacity: opacity dims the
   descendants too, and it dragged the "Coming soon" label itself down to ~2.2:1 — the one
   word on the card a reader actually needs. Same muted look, legible label. */
.topic.is-soon{opacity:1}
.topic.is-soon .topic-title,.topic.is-soon .topic-sub{color:var(--muted)}
.topic.is-soon .topic-ico{filter:grayscale(.5) opacity(.65)}
.topic.is-soon .tag{background:var(--surface-2);color:var(--muted);flex:none}

/* ---- Dashboard shell ---- */
.shell{display:grid;grid-template-columns:220px 1fr;gap:1.5rem;align-items:start}
.side{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:.75rem}
.side h4{margin:.5rem .6rem;color:var(--faint);font-family:var(--font-display);font-weight:400;font-size:.85rem;text-transform:uppercase;letter-spacing:.09em}
.side a{display:flex;align-items:center;gap:.65rem;padding:.6rem .7rem;border-radius:9px;color:var(--muted);
  font-weight:600;font-size:.92rem;cursor:pointer}
.side a:hover{background:var(--surface-2);color:var(--fg)}
.side a.active{background:var(--surface-2);color:var(--fg);box-shadow:inset 3px 0 0 var(--accent)}
.side a svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:2}

/* ---- Cards ---- */
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1.25rem;box-shadow:var(--shadow)}
.grid{display:grid;gap:1rem}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}
.stat{display:flex;flex-direction:column;gap:.2rem}
.stat .n{font-size:1.9rem;font-weight:800;letter-spacing:-.02em}
.stat .l{color:var(--muted);font-size:.85rem}
.section-head{display:flex;align-items:center;justify-content:space-between;margin:0 0 1rem}
.section-head h2{font-size:1.25rem;margin:0;font-weight:800;letter-spacing:-.02em}
.tag{font-size:.72rem;padding:.2rem .55rem;border-radius:999px;font-weight:700;letter-spacing:.02em}
.tag.blue{background:rgba(244,158,16,.30);color:#611c03}
.tag.green{background:rgba(97,28,3,.16);color:#611c03}
.tag.amber{background:rgba(244,158,16,.14);color:var(--amber-ink)}

/* ---- Add form (checklist / routines) ---- */
.add-form{display:flex;gap:.6rem;margin-bottom:1rem;flex-wrap:wrap}
.add-form input{flex:1;min-width:140px;padding:.6rem .8rem;background:var(--surface-2);
  border:1px solid var(--border);border-radius:10px;color:var(--fg);font-family:inherit;font-size:.9rem}
.add-form input:focus{outline:none;border-color:var(--accent)}
.del{background:transparent;border:none;color:var(--faint);cursor:pointer;font-size:1.25rem;line-height:1;
  padding:0 .35rem;border-radius:6px;transition:.15s ease}
.del:hover{color:#c0392b;background:var(--surface)}

/* ---- Checklist ---- */
.check{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.6rem}
.check li{display:flex;align-items:center;gap:.8rem;padding:.75rem .9rem;background:var(--surface-2);
  border:1px solid var(--border);border-radius:10px}
.check input{width:18px;height:18px;accent-color:var(--accent);cursor:pointer}
.check label{cursor:pointer;flex:1}
.check input:checked + label{color:var(--faint);text-decoration:line-through}

/* ---- Routines / progress ---- */
.routine{display:flex;align-items:center;gap:1rem;padding:.9rem;background:var(--surface-2);
  border:1px solid var(--border);border-radius:10px}
.routine .ico{width:40px;height:40px;border-radius:10px;background:var(--surface);border:1px solid var(--border);display:grid;place-items:center;font-size:1.2rem}
.routine .meta{flex:1}
.routine .meta .t{font-weight:700}
.routine .meta .d{color:var(--muted);font-size:.85rem}
.bar{height:8px;border-radius:999px;background:#eeddc4;overflow:hidden;margin-top:.5rem}
.bar > i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--accent),var(--accent-2))}

/* ---- Courses ---- */
.course{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;overflow:hidden;display:flex;flex-direction:column;cursor:pointer;transition:.15s ease}
.course:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:var(--shadow)}
/* course card cover — same picture area as a section card (.lc-thumb), so the two
   card types read as one system. Falls back to the gradient+emoji with no image. */
.course .thumb{height:180px;background:linear-gradient(135deg,#f0dcc0,#f7e8d5);
  background-size:cover;background-position:center;display:grid;place-items:center;font-size:2rem;flex:none}
.course .body{padding:1rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.course .body h3{margin:0;font-size:1.02rem}
.course .body p{margin:0;color:var(--muted);font-size:.85rem;flex:1}
.course .foot{display:flex;align-items:center;justify-content:space-between;font-size:.82rem;color:var(--muted)}

/* ---- Course detail ---- */
.crumb{color:var(--muted);font-size:.9rem;margin-bottom:1rem;display:inline-flex;gap:.4rem;align-items:center}
.crumb:hover{color:var(--fg)}
.course-hero{display:flex;gap:1.25rem;align-items:center;margin-bottom:1.5rem;flex-wrap:wrap}
.course-hero .big{width:72px;height:72px;border-radius:16px;background:linear-gradient(135deg,#f0dcc0,#f7e8d5);
  display:grid;place-items:center;font-size:2.2rem;flex:none}
.course-hero h1{margin:0 0 .3rem;font-size:1.6rem;letter-spacing:-.02em}
.course-hero p{margin:0;color:var(--muted);max-width:46ch}
.lessons{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}
.lessons li{display:flex;align-items:center;gap:.9rem;padding:.8rem .95rem;background:var(--surface-2);
  border:1px solid var(--border);border-radius:10px}
.lessons .st{width:24px;height:24px;border-radius:50%;flex:none;display:grid;place-items:center;font-size:.72rem;font-weight:800}
.lessons .st.done{background:rgba(244,158,16,.32);color:var(--accent-deep)}
/* "you are here" — a pulsing-still dot with a soft halo, not a play button: this lesson is
   already open, there is nothing to press */
.lessons .st.now{background:transparent;border:0}
.lessons .st.now::after{content:"";width:9px;height:9px;border-radius:50%;background:var(--cta);
  box-shadow:0 0 0 4px rgba(244,158,16,.18)}
.lessons .st.todo{background:var(--bg);color:var(--faint);border:1px solid var(--border)}
.lessons .ttl{flex:1;font-weight:600}
.lessons li.is-done .ttl{color:var(--muted)}
.lessons .dur{color:var(--muted);font-size:.82rem}

/* ---- Lesson viewer ---- */
.lshell{display:grid;grid-template-columns:330px 1fr;gap:1.5rem;align-items:start}
/* A standalone section has no list beside it, so it takes the whole width — and the body
   text goes with it, otherwise the card would just widen around a narrow column of prose. */
.lshell.solo{grid-template-columns:1fr}
.lshell.solo #lesson-view p,
.lshell.solo #lesson-view li,
.lshell.solo #lesson-view h3,
.lshell.solo #lesson-view h4,
.lshell.solo #lesson-view .lead{max-width:none}
.lshell.solo .lesson-nav{justify-content:flex-start}
/* Course navigation follows you down the lesson. The top nav is sticky at ~66px, so park
   below it and let a long lesson list scroll inside itself rather than run off-screen.
   (.lshell is align-items:start — without that a grid child has no room to stick.) */
.lshell > .card{position:sticky;top:5rem;max-height:calc(100vh - 6.5rem);overflow-y:auto;z-index:5}
.lesson-link{cursor:pointer}
.lesson-link:hover{border-color:var(--accent)}
.lesson-link.active{border-color:var(--accent);box-shadow:inset 3px 0 0 var(--accent)}
.lead{font-size:1.05rem;color:var(--muted);margin:0 0 1.1rem}
#lesson-view h3,#routine-view h3{font-size:1rem;margin:1.3rem 0 .5rem;letter-spacing:-.01em}
#lesson-view p,#routine-view p{margin:.5rem 0;color:var(--fg)}
.callout{margin-top:1.3rem;padding:.9rem 1rem;border-left:3px solid var(--accent);
  background:var(--surface-2);border-radius:0 10px 10px 0}
.callout b{color:var(--accent-deep)}
.mark-row{margin-top:1.25rem;display:flex;gap:.75rem;align-items:center}
.mark-btn.is-done{background:transparent;color:var(--good);border-color:var(--good)}
.lesson-nav{display:flex;justify-content:space-between;gap:.75rem;margin-top:1.5rem}
.lesson-nav .btn[disabled]{opacity:.4;pointer-events:none}

/* ---- Routines (polished) ---- */
.routine-summary{display:flex;align-items:center;gap:1.1rem}
.rsum-title{font-family:var(--font-head);font-weight:700;font-size:1.05rem}
.ring{width:66px;height:66px;border-radius:50%;display:grid;place-items:center;flex:none;
  background:conic-gradient(var(--accent) calc(var(--p,0)*1%),var(--border) 0)}
.ring > span{width:52px;height:52px;border-radius:50%;background:var(--surface);display:grid;place-items:center;
  font-family:var(--font-head);font-weight:700;font-size:.85rem;color:var(--fg)}
.routine-list{display:flex;flex-direction:column;gap:.5rem;margin-top:.65rem}
.routine-item{display:flex;align-items:center;gap:.75rem;padding:.65rem .75rem;border:1px solid var(--border);
  border-radius:12px;background:var(--surface-2);cursor:pointer;transition:.15s ease}
.routine-item:hover{border-color:var(--accent);transform:translateY(-1px)}
.routine-item.active{border-color:var(--accent);box-shadow:inset 3px 0 0 var(--accent)}
.routine-item .rico{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;font-size:1.15rem;
  flex:none;background:var(--surface);border:1px solid var(--border)}
.routine-item .rmeta{flex:1;min-width:0}
.routine-item .rmeta .rt{font-weight:700;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.routine-item .rmeta .rs{color:var(--muted);font-size:.78rem}
.routine-item .rcheck{width:24px;height:24px;border-radius:50%;flex:none;display:grid;place-items:center;
  font-size:.72rem;font-weight:800;border:1px solid var(--border);color:var(--faint)}
.routine-item.is-done .rcheck{background:rgba(244,158,16,.38);color:var(--accent-deep);border-color:transparent}
.routine-item .rchev{color:var(--faint);font-size:1.35rem;line-height:1;flex:none;transition:.15s ease}
.routine-item:hover .rchev{color:var(--accent);transform:translateX(2px)}
/* in-depth routine page sections */
.rsection{margin-top:1.7rem}
.rsection h3{font-family:var(--font-head);font-size:1.05rem;margin:0 0 .7rem}
.rsteps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem;counter-reset:rstep}
.rsteps li{display:flex;gap:.8rem;align-items:flex-start;background:var(--surface-2);border:1px solid var(--border);
  border-radius:10px;padding:.75rem .9rem}
.rsteps li::before{counter-increment:rstep;content:counter(rstep);flex:none;width:24px;height:24px;border-radius:50%;
  background:var(--surface);border:1px solid var(--border);display:grid;place-items:center;font-size:.74rem;
  font-weight:800;color:var(--accent-deep);font-family:var(--font-head)}
.rtips{margin:.1rem 0 0;padding-left:1.15rem;color:var(--fg)}
.rtips li{margin:.4rem 0}
.rhero{display:flex;gap:1rem;align-items:center;margin-bottom:1.1rem}
.rhero .rbig{width:64px;height:64px;border-radius:16px;display:grid;place-items:center;font-size:2rem;flex:none;
  color:#fff;box-shadow:var(--shadow)}
.rhero h2{margin:0 0 .2rem;font-size:1.4rem}
.rhero .rcad{color:var(--muted);font-size:.9rem;margin:0}
.rstats{display:grid;grid-template-columns:repeat(3,1fr);gap:.75rem;margin:0 0 1.2rem}
.rstat{background:var(--surface-2);border:1px solid var(--border);border-radius:12px;padding:.75rem .85rem}
.rstat .v{font-family:var(--font-head);font-size:1.25rem;font-weight:700;letter-spacing:-.01em}
.rstat .k{color:var(--muted);font-size:.76rem}
.rbar-label{display:flex;justify-content:space-between;color:var(--muted);font-size:.82rem;margin-bottom:.35rem}
.del-btn:hover{border-color:#c0392b;color:#c0392b}
@media(max-width:520px){.rstats{grid-template-columns:1fr 1fr}}

/* ---- Login ---- */
.auth{min-height:100vh;display:grid;place-items:center;padding:1.5rem;
  background:radial-gradient(1200px 600px at 50% -10%,rgba(244,158,16,.4),transparent),var(--bg)}
.auth .card{width:100%;max-width:400px}
.auth .brand{justify-content:center;margin-bottom:1.5rem;font-size:1.4rem}
.field{margin-bottom:1rem}
.field label{display:block;font-size:.85rem;color:var(--muted);margin-bottom:.4rem;font-weight:600}
.field input{width:100%;padding:.7rem .85rem;background:var(--surface-2);border:1px solid var(--border);
  border-radius:10px;color:var(--fg);font-size:.95rem;font-family:inherit}
.field input:focus{outline:none;border-color:var(--accent)}
.auth .muted{text-align:center;color:var(--faint);font-size:.85rem;margin-top:1.25rem}
.htmx-indicator{opacity:0;transition:opacity .2s}
.htmx-request .htmx-indicator{opacity:1}

@media(max-width:760px){
  .shell,.lshell{grid-template-columns:1fr}
  /* Stacked on a phone the list sits above the lesson, so sticking it just pins a panel over
     the reading area — and the 38vh cap clipped the last lesson into a nested scroll box.
     Let it be an ordinary block that scrolls away. */
  .lshell > .card{position:static;max-height:none;overflow:visible;top:auto}
  /* a heading and its tag have no room side by side at this width */
  .section-head{flex-wrap:wrap;align-items:flex-start;gap:.5rem}
  .section-head h2{flex:1 1 100%}
  #lesson-view .section-head .tag{order:-1}
  .grid.cols-3,.grid.cols-2{grid-template-columns:1fr}
  /* collapse header into a hamburger panel */
  .nav-toggle{display:block}
  /* Hamburger panel. Everything inside lines up with the brand, which sits at the nav's
     2rem gutter: the panel is inset 1.2rem and each row adds .8rem of its own padding,
     so text/rows land on 2rem while the tap highlights bleed slightly wider. */
  .nav-menu{position:absolute;top:100%;left:0;right:0;background:var(--surface);
    border-bottom:1px solid var(--border);box-shadow:var(--shadow);flex-direction:column;
    align-items:stretch;gap:0;padding:.5rem 1.2rem 1rem;display:none;z-index:25}
  .nav.open .nav-menu{display:flex}
  .nav .links{flex-direction:column;align-items:stretch;gap:.1rem;margin-left:0}
  .nav .links > a{padding:.7rem .8rem;border-radius:10px;font-size:.95rem;font-weight:600}
  .nav .links > a.active{background:var(--surface-2);color:var(--fg)}
  /* the account row isn't navigation — rule it off, align it to the same 2rem */
  .nav .who{margin-top:.55rem;padding:.85rem .8rem 0;border-top:1px solid var(--border);
    justify-content:flex-start;flex-wrap:nowrap;gap:.6rem}
  .nav .who > span:first-child{font-weight:600;color:var(--fg);white-space:nowrap;
    overflow:hidden;text-overflow:ellipsis;min-width:0}
  .nav .who form{margin-left:auto;flex:none}
  /* Sections becomes an inline group instead of a floating dropdown */
  .dropdown{display:block}
  .drop-menu{position:static;display:flex;border:none;box-shadow:none;background:transparent;
    padding:.1rem 0 .4rem 1rem;min-width:0}
  .drop-toggle{pointer-events:none;color:var(--faint);font-size:.74rem;text-transform:uppercase;
    letter-spacing:.09em;padding:.5rem .25rem .2rem}
}

/* ============ LMS backend additions ============ */
/* Flash messages */
.flash{padding:.7rem .95rem;border-radius:10px;margin:0 0 1.1rem;font-size:.9rem;font-weight:600;border:1px solid var(--border)}
.flash-success{background:rgba(97,28,3,.12);color:#611c03;border-color:rgba(97,28,3,.3)}
.flash-error{background:rgba(192,57,43,.10);color:#c0392b;border-color:rgba(192,57,43,.35)}
.flash-info{background:rgba(244,158,16,.20);color:#611c03;border-color:rgba(244,158,16,.5)}

/* Form controls (extend .field to textarea/select) */
.field textarea,.field select{width:100%;padding:.7rem .85rem;background:var(--surface-2);border:1px solid var(--border);
  border-radius:10px;color:var(--fg);font-size:.95rem;font-family:inherit;resize:vertical}
.field textarea:focus,.field select:focus{outline:none;border-color:var(--accent)}
.field textarea.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85rem;line-height:1.5}
.hint{color:var(--faint);font-size:.8rem;margin:.5rem 0 0}
.hint code{background:var(--surface-2);border:1px solid var(--border);border-radius:5px;padding:.05rem .3rem;font-size:.92em}
.check-inline{display:flex;align-items:center;gap:.5rem;font-weight:600;color:var(--fg);cursor:pointer;font-size:.92rem}
.check-inline input{width:17px;height:17px;accent-color:var(--accent)}
.form-grid{display:flex;gap:1rem;flex-wrap:wrap;align-items:flex-end}
.form-grid .field{margin-bottom:1rem}

/* Buttons / actions */
.actions{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}
.btn.sm{padding:.38rem .7rem;font-size:.82rem;border-radius:8px}
.del-btn{color:var(--faint)}
.del-btn:hover{border-color:#c0392b;color:#c0392b}

/* Admin header row */
.admin-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap}

/* 4-col grid */
.grid.cols-4{grid-template-columns:repeat(4,1fr)}

/* Tables */
.table-wrap{overflow-x:auto}
.table{width:100%;border-collapse:collapse;font-size:.92rem}
.table th{text-align:left;font-family:var(--font-display);font-weight:400;font-size:.85rem;text-transform:uppercase;letter-spacing:.08em;color:var(--faint);
  font-weight:700;padding:.5rem .7rem;border-bottom:1px solid var(--border)}
.table td{padding:.7rem .7rem;border-bottom:1px solid var(--border);vertical-align:middle}
.table tr:last-child td{border-bottom:none}
.table a{font-weight:600;color:var(--accent-deep)}
.table a:hover{text-decoration:underline}
.c-emoji{display:inline-block;width:1.4em}
.row-actions{display:flex;gap:.4rem;justify-content:flex-end}
.badge{font-size:.72rem;padding:.2rem .55rem;border-radius:999px;font-weight:700}
.badge-on{background:rgba(97,28,3,.16);color:#611c03}
.badge-off{background:var(--surface-2);color:var(--faint);border:1px solid var(--border)}
.sm-avatar{width:26px;height:26px;font-size:.7rem;vertical-align:middle;margin-right:.35rem}

/* Admin lessons list (course editor sidebar) */
.admin-lessons{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem}
.admin-lessons li{display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;background:var(--surface-2);
  border:1px solid var(--border);border-radius:9px}
.admin-lessons .ln{width:22px;height:22px;border-radius:50%;background:var(--surface);border:1px solid var(--border);
  display:grid;place-items:center;font-size:.72rem;font-weight:800;color:var(--accent-deep);flex:none}
.admin-lessons .lt{flex:1;font-weight:600;font-size:.9rem;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.admin-lessons .ld{color:var(--muted);font-size:.8rem;flex:none}

/* Lesson list rows become full-row links */
.lessons li > a{display:flex;align-items:center;gap:.9rem;flex:1;color:inherit;min-width:0}

@media(max-width:760px){
  .grid.cols-4{grid-template-columns:1fr 1fr}
}

/* Rich lesson content (h4/h5/lists) from imported documents */
#lesson-view h4{font-size:.98rem;margin:1.15rem 0 .35rem;letter-spacing:-.01em;font-family:var(--font-head)}
#lesson-view h5{font-size:.85rem;margin:.95rem 0 .3rem;color:var(--accent-deep);font-family:var(--font-head)}
#lesson-view ul{margin:.55rem 0 .95rem;padding-left:1.2rem}
#lesson-view li{margin:.35rem 0;color:var(--fg)}
#lesson-view strong{font-weight:700}

/* ===== WYSIWYG (Quill) editor in admin lesson form ===== */
.editor-wrap{margin-top:.15rem}
.ql-toolbar.ql-snow{border:1px solid var(--border);border-top-left-radius:10px;border-top-right-radius:10px;
  background:var(--surface-2)}
.ql-container.ql-snow{border:1px solid var(--border);border-top:none;
  border-bottom-left-radius:10px;border-bottom-right-radius:10px;
  font-family:var(--font);font-size:.95rem;background:var(--surface)}
.ql-editor{min-height:340px;line-height:1.55;color:var(--fg)}
.ql-editor h3{font-size:1.05rem;font-family:var(--font-head);margin:1rem 0 .4rem}
.ql-editor h4{font-size:.98rem;font-family:var(--font-head);margin:.9rem 0 .3rem}
.ql-editor h5{font-size:.85rem;font-family:var(--font-head);color:var(--accent-deep);margin:.85rem 0 .3rem}
.ql-editor.ql-blank::before{color:var(--faint);font-style:normal;left:15px;right:15px}
.ql-snow.ql-toolbar button:hover .ql-stroke,.ql-snow .ql-toolbar button:hover .ql-stroke{stroke:var(--accent-deep)}
.ql-snow.ql-toolbar button.ql-active .ql-stroke{stroke:var(--cta)}
.ql-snow .ql-picker.ql-header{width:130px}
/* friendlier heading labels (higher specificity via .card wins over quill.snow) */
.card .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.card .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before{content:'Heading'}
.card .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
.card .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before{content:'Subheading'}
.card .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before,
.card .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before{content:'Small heading'}
#toggle-html{margin-left:.4rem;font-weight:600;color:var(--accent-deep)}

/* ===== Media in lessons: images + YouTube/Vimeo embeds ===== */
#lesson-view img, .ql-editor img{max-width:100%;height:auto;border-radius:12px;margin:.7rem 0;display:block}
#lesson-view .ql-video, .ql-editor .ql-video{display:block;width:100%;aspect-ratio:16/9;height:auto;
  border:0;border-radius:12px;margin:1rem 0;background:#000}

/* ===== Section picker cards (course overview) ===== */
.lesson-cards{display:grid;grid-template-columns:repeat(2,1fr);gap:1rem}
.lesson-card{display:flex;flex-direction:column;gap:.7rem;padding:1.15rem 1.2rem;background:var(--surface);
  border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);color:inherit;
  cursor:pointer;transition:.15s ease}
.lesson-card:hover{border-color:var(--accent);transform:translateY(-2px)}
.lesson-card:hover .lc-arrow{color:var(--accent);transform:translateX(2px)}
.lesson-card.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent),var(--shadow)}
.lesson-card .lc-top{display:flex;align-items:center;justify-content:space-between}
.lesson-card .st{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:.74rem;font-weight:800;flex:none}
.lesson-card .st.done{background:rgba(244,158,16,.32);color:var(--accent-deep)}
.lesson-card .st.now{background:rgba(244,158,16,.16);color:var(--amber-ink)}
.lesson-card .st.todo{background:var(--bg);color:var(--faint);border:1px solid var(--border)}
.lesson-card .lc-dur{color:var(--muted);font-size:.82rem}
.lesson-card .lc-title{font-family:var(--font-head);font-size:1.05rem;margin:0;letter-spacing:-.01em;line-height:1.25}
.lesson-card.is-done .lc-title{color:var(--muted)}
.lesson-card .lc-foot{display:flex;align-items:center;justify-content:space-between;margin-top:auto}
.lesson-card .lc-status{font-size:.8rem;font-weight:700}
.lesson-card .lc-status.done{color:var(--good)}
.lesson-card .lc-status.now{color:var(--amber-ink)}
.lesson-card .lc-status.todo{color:var(--faint)}
.lesson-card .lc-arrow{color:var(--faint);font-size:1.35rem;line-height:1;transition:.15s ease}
@media(max-width:640px){.lesson-cards{grid-template-columns:1fr}}

/* ===== Step-by-step lesson (e.g. the four-week program) ===== */
.lesson-steps .step-head{margin:.2rem 0 1.3rem}
.lesson-steps .step-meta{font-size:.9rem;color:var(--muted);margin-bottom:.5rem}
.lesson-steps .step-meta strong{color:var(--fg);font-family:var(--font-head);font-weight:700}
.lesson-steps .step-bar{height:9px;border-radius:999px;background:#eeddc4;overflow:hidden}
.lesson-steps .step-bar > i{display:block;height:100%;border-radius:999px;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));transition:width .25s ease}
.lesson-steps .step-panel > *:first-child{margin-top:0}
.lesson-steps .step-nav{display:flex;justify-content:space-between;gap:.75rem;margin-top:1.6rem;
  padding-top:1.1rem;border-top:1px solid var(--border)}
.lesson-steps .step-nav .btn[disabled]{opacity:.4;pointer-events:none}

/* ===== 3-up section cards with cover image (overrides the 2-up rules above) ===== */
.lesson-cards{grid-template-columns:repeat(3,1fr)}
.lesson-card{padding:0;gap:0;overflow:hidden}
.lesson-card .lc-thumb{height:180px;background:linear-gradient(135deg,#f0dcc0,#f7e8d5);
  background-size:cover;background-position:center;display:grid;place-items:center;flex:none}
.lesson-card .lc-emoji{font-size:2.4rem;filter:drop-shadow(0 4px 8px rgba(0,0,0,.14))}
.lesson-card .lc-body{padding:1rem 1.1rem 1.15rem;display:flex;flex-direction:column;gap:.6rem;flex:1}
.lesson-card.is-done .lc-thumb{filter:grayscale(.35) opacity(.85)}
@media(max-width:900px){.lesson-cards{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.lesson-cards{grid-template-columns:1fr}}

/* cover-image uploader in the lesson form */
.cover-field{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap}
.cover-preview img{height:56px;width:96px;object-fit:cover;border-radius:8px;border:1px solid var(--border);display:block}

/* ===== Link card (a card that opens another course) ===== */
.lesson-card-link .lc-thumb{background:linear-gradient(135deg,#f7e3c8,#fbeedb)}
.lc-badge{display:inline-block;font-family:var(--font-display);font-size:.8rem;font-weight:400;letter-spacing:.06em;text-transform:uppercase;
  color:var(--accent-deep);background:rgba(97,28,3,.14);border-radius:999px;padding:.16rem .5rem}
.lesson-card-link .lc-status.now{color:var(--accent-deep)}
.lesson-card-link .lc-arrow{color:var(--accent-deep)}
.lesson-link-course .st.now{background:rgba(97,28,3,.16);color:var(--accent-deep)}
.lesson-link-course .dur{color:var(--accent-deep);font-weight:700;font-size:.75rem}

/* ===== Lesson content: readable body + strong heading hierarchy ===== */
/* lesson title */
#lesson-view .section-head h2{font-size:1.6rem;font-weight:700;letter-spacing:-.025em;line-height:1.18}
/* reading body — capped at 16px for readability */
#lesson-view{font-size:16px;font-weight:300}
#lesson-view p, #lesson-view li{line-height:1.75;max-width:68ch;font-weight:300;color:var(--fg)}
#lesson-view p{margin:0 0 1.05rem}
#lesson-view strong{font-weight:600}
#lesson-view .lead{font-size:16px;line-height:1.65;font-weight:400;color:var(--muted);max-width:66ch;margin:0 0 1.5rem}
/* headings — bigger, tighter, clearer steps between levels */
#lesson-view h3{font-size:1.55rem;font-family:var(--font-head);font-weight:700;letter-spacing:-.025em;
  line-height:1.2;margin:2.6rem 0 .75rem;max-width:68ch}
#lesson-view h4{font-size:1.2rem;font-family:var(--font-head);font-weight:700;letter-spacing:-.015em;
  line-height:1.3;margin:1.9rem 0 .5rem;max-width:68ch}
#lesson-view h5{font-size:1.02rem;font-family:var(--font-head);font-weight:700;
  color:var(--accent-deep);letter-spacing:-.005em;margin:1.5rem 0 .45rem;max-width:68ch}
#lesson-view ul{margin:.8rem 0 1.25rem;padding-left:1.35rem;max-width:68ch}
#lesson-view li{margin:.45rem 0}
#lesson-view .callout{max-width:68ch;margin:1.7rem 0;padding:1.05rem 1.2rem;line-height:1.62;font-weight:400;
  background:var(--surface-2);border-left:3px solid var(--accent);border-radius:0 12px 12px 0}
#lesson-view > *:first-child, #lesson-view .step-panel > *:first-child{margin-top:0}

/* ===== Course intro (sits under the title on the section picker) ===== */
.course-intro{margin:-.4rem 0 1.9rem}
.course-intro > *:first-child{margin-top:0}
.course-intro > *:last-child{margin-bottom:0}
.course-intro h5{font-family:var(--font-head);font-size:1rem;margin:1.1rem 0 0;color:var(--accent-deep)}

/* short "here you'll find…" line on a section card */
.lc-blurb{margin:-.1rem 0 0;color:var(--muted);font-size:.85rem;line-height:1.5}

/* ===== Daily checklist lesson ===== */
.chk{margin:1.6rem 0 0}
/* Two per row: 18 items down one column of a full-width page is a long, lopsided scroll.
   align-items:start lets each item keep its own height instead of stretching to match
   its neighbour, which matters because the explanations differ a lot in length. */
#lesson-view .chk-items{list-style:none;margin:1.4rem 0 0;padding:0;max-width:none;
  display:grid;grid-template-columns:repeat(2,1fr);gap:.6rem;align-items:start}
/* one column when there isn't room for two — must sit AFTER the base rule above,
   same specificity means source order decides */
@media(max-width:760px){#lesson-view .chk-items{grid-template-columns:1fr}}
/* Two-up only pays off in a full-width (solo) lesson. Beside a lessons list the pane is ~860px,
   so two columns squeeze each item to ~45 characters a line — one column there instead. */
.lshell:not(.solo) #lesson-view .chk-items{grid-template-columns:1fr}
/* the item is a card, not prose — #lesson-view li caps text at 68ch and was shrinking it */
#lesson-view .chk-item{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);
  padding:.85rem 1.1rem 1.05rem;transition:.15s ease;overflow:hidden;max-width:none}
/* The item's picture bleeds to the card edges above its title. Sized by the photo's own
   ratio (they're 800x340) rather than a fixed height, so it shows the whole frame
   uncropped and grows/shrinks with the item at any column width. */
.chk-thumb{display:block;aspect-ratio:800/340;margin:-.85rem -1rem .85rem;background-size:cover;
  background-position:center;background-color:var(--bg)}
.chk-item.is-ticked .chk-thumb{filter:grayscale(.35) opacity(.85)}
.chk-item.is-ticked{background:rgba(244,158,16,.14);border-color:var(--accent)}
.chk-line{display:flex;align-items:flex-start;gap:.7rem;cursor:pointer;font-family:var(--font-head);
  font-weight:600;font-size:1rem;line-height:1.35}
/* Custom tick. The native control can't be styled beyond accent-color and looks like the
   OS, not the brand — so hide it (appearance:none keeps it a real, keyboard-operable
   checkbox) and draw the box + tick ourselves. */
.chk-line input{appearance:none;-webkit-appearance:none;margin:.05rem 0 0;flex:none;
  /* --border is only 1.15:1 against the cream card — the box has to outline itself */
  width:23px;height:23px;border:1.5px solid var(--faint);border-radius:7px;
  background:var(--surface);cursor:pointer;position:relative;display:grid;place-items:center;
  transition:background .18s ease,border-color .18s ease,transform .1s ease,box-shadow .18s ease}
.chk-line:hover input{border-color:var(--accent-2)}
.chk-line input:active{transform:scale(.9)}
.chk-line input:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(97,28,3,.28);border-color:var(--accent-deep)}
.chk-line input:disabled{cursor:progress;opacity:.55}
/* amber fill, cocoa tick — an amber-to-cocoa fill would swallow the tick at its dark end */
.chk-line input:checked{background:linear-gradient(160deg,#f7b23c,var(--accent));
  border-color:var(--accent-2)}
/* the tick is drawn, so it stays crisp at any size and can spring in on check */
.chk-line input::after{content:"";width:5px;height:9.5px;margin-top:-2px;
  border:solid var(--on-accent);border-width:0 2.5px 2.5px 0;border-radius:1px;
  transform:rotate(45deg) scale(.3);opacity:0;
  transition:transform .2s cubic-bezier(.2,.9,.3,1.4),opacity .12s ease}
.chk-line input:checked::after{transform:rotate(45deg) scale(1);opacity:1}
.chk-item.is-ticked .chk-title{color:var(--muted);text-decoration:line-through;
  text-decoration-color:var(--accent);text-decoration-thickness:1.5px;text-underline-offset:2px}
/* Item prose reads at the same size/weight as the rest of the lesson. It used to be 14.4px
   at weight 300 — small and light at once, which is what made it hard to read. Scoped under
   #lesson-view because the generic prose rules there (weight 300) outrank a bare class. */
#lesson-view .chk-body{margin:.6rem 0 0 1.55rem;color:var(--fg);font-size:1rem;line-height:1.7}
#lesson-view .chk-body > *:first-child{margin-top:0}
#lesson-view .chk-body > *:last-child{margin-bottom:0}
#lesson-view .chk-body p{margin:.65rem 0;font-weight:400;line-height:1.7;max-width:62ch}

/* ===== Tier headings on the section picker ===== */
/* Tier heading — display type, not a shouty label. This is the house display voice:
   Instrument Serif, sentence case, normal tracking (the serif is already tightly fitted,
   so the old negative tracking would collide the letterforms), and it closes with a
   hairline that fades out rather than a hard slab rule. */
.tier-head{font-family:var(--font-display);font-size:1.85rem;font-weight:400;letter-spacing:0;
  line-height:1.15;color:var(--fg);margin:3.1rem 0 1.2rem;
  display:flex;align-items:center;gap:1.1rem;white-space:nowrap}
.tier-head::after{content:"";flex:1;height:1px;min-width:2rem;
  background:linear-gradient(90deg,var(--border),rgba(236,217,189,0))}
/* one line of guidance under a tier heading, before its cards */
.tier-note{margin:-.55rem 0 1.4rem;color:var(--muted);font-size:.95rem;line-height:1.6;max-width:68ch}
.lesson-cards + .tier-head{margin-top:2.4rem}
.section-head + .lesson-cards > .lesson-card{margin-top:0}
.tier-head:first-of-type{margin-top:.6rem}
/* On the picker the tier names are the headings, so "Choose a section to begin" steps back
   to a quiet instruction — otherwise a 1.6rem tier sits under a 1.15rem parent and the
   hierarchy reads upside-down. Scoped: .section-cards-title is shared with other pages. */
.picker-title{font-family:var(--font-display);font-size:.9rem;font-weight:400;letter-spacing:.16em;text-transform:uppercase;
  color:var(--faint)}
/* the badge is gone on unnumbered section cards — keep the duration hard right */
.lesson-card .lc-dur{margin-left:auto}
/* an untiered card group following a tier: separate it without inventing a heading */
.lesson-cards + .lesson-cards.untiered{margin-top:2.4rem;padding-top:2rem;border-top:1px solid var(--border)}

/* tier label inside the lesson-view side list — same grouping/order as the picker */
/* A week label inside the lessons list. It's an <li>, so it inherits the row chrome
   (surface, border, radius, padding) and read as a clickable lesson — strip all of that: it
   is a heading, not a row. Styled like .tier-head on the picker (Instrument Serif, sentence
   case, hairline fading out) rather than a shouty uppercase micro-label. */
.lessons .lessons-tier{list-style:none;background:none;border:0;border-radius:0;padding:0;
  margin:1.35rem 0 .35rem;display:flex;align-items:center;gap:.7rem;
  font-family:var(--font-display);font-size:1.1rem;font-weight:400;letter-spacing:0;
  text-transform:none;color:var(--fg);line-height:1.2}
.lessons .lessons-tier::after{content:"";flex:1;height:1px;min-width:1rem;
  background:linear-gradient(90deg,var(--border),rgba(236,217,189,0))}
.lessons .lessons-tier:first-child{margin-top:0}

/* admin: per-student activity feed */
.activity{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.activity li{display:flex;align-items:baseline;gap:.85rem;padding:.6rem 0;border-bottom:1px solid var(--border);font-size:.9rem}
.activity li:last-child{border-bottom:none}
.activity .when{color:var(--faint);font-size:.78rem;font-variant-numeric:tabular-nums;flex:none;min-width:8.5rem}
.activity .what{flex:1}
.activity .where{color:var(--muted);font-size:.8rem}
.table .muted-cell{color:var(--muted);font-size:.85rem}

/* back out of a course from inside the sticky lesson list */
.lessons-back{color:var(--muted);font-size:.82rem;font-weight:600;white-space:nowrap;flex:none}
.lessons-back:hover{color:var(--accent-deep)}

/* ===== Breadcrumbs (course pages) ===== */
.crumbs{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;margin-bottom:1rem;
  font-size:.85rem;color:var(--muted);line-height:1.4}
.crumbs a{color:var(--muted);font-weight:500}
.crumbs a:hover{color:var(--accent-deep);text-decoration:underline;text-underline-offset:3px}
.crumbs [aria-current="page"]{color:var(--fg);font-weight:600}
.crumbs-sep{color:var(--faint);user-select:none}

/* ===== Card lessons (e.g. the tea guide): each smallest heading becomes a card ===== */
#lesson-view .sub-head{font-family:var(--font-head);font-size:1.35rem;font-weight:700;
  letter-spacing:-.025em;color:var(--fg);margin:2.6rem 0 .6rem;max-width:none}
#lesson-view .sub-intro{color:var(--muted);margin-bottom:1.1rem}
#lesson-view .sub-intro p{margin:.3rem 0;max-width:70ch}
.sub-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:.85rem;margin:0 0 .5rem;align-items:start}
.sub-card{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);
  padding:1rem 1.1rem 1.1rem;overflow:hidden;transition:.15s ease}
.sub-card:hover{border-color:var(--accent)}
.sub-thumb{display:block;aspect-ratio:800/340;margin:-1rem -1.1rem .9rem;background-size:cover;
  background-position:center;background-color:var(--bg)}
#lesson-view .sub-card-title{font-family:var(--font-head);font-size:1.02rem;font-weight:600;
  letter-spacing:-.01em;margin:0 0 .4rem;color:var(--fg);max-width:none}
#lesson-view .sub-card-body{color:var(--fg);font-size:.95rem;line-height:1.65}
#lesson-view .sub-card-body p{margin:.45rem 0;font-weight:400;line-height:1.65;max-width:none}
#lesson-view .sub-card-body > *:first-child{margin-top:0}
#lesson-view .sub-card-body > *:last-child{margin-bottom:0}
@media(max-width:1000px){.sub-cards{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.sub-cards{grid-template-columns:1fr}}

/* ===== Navigation cards (a picker list that jumps to its sections) ===== */
.nav-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:.85rem;margin:1.1rem 0 1.6rem;align-items:stretch}
.nav-card{display:flex;flex-direction:column;gap:.45rem;padding:1.05rem 1.15rem;border-radius:12px;
  border:1px solid var(--border);background:var(--surface-2);color:inherit;transition:.15s ease}
.nav-card:hover{border-color:var(--accent);transform:translateY(-2px);box-shadow:var(--shadow)}
.nav-card:hover .nav-card-go{color:var(--accent-deep)}
#lesson-view .nav-card-title{font-family:var(--font-head);font-size:1.02rem;font-weight:700;
  letter-spacing:-.01em;color:var(--fg);line-height:1.3}
#lesson-view .nav-card-body{color:var(--muted);font-size:.9rem;line-height:1.6;flex:1;font-weight:400}
#lesson-view .nav-card-go{font-size:.8rem;font-weight:700;color:var(--faint);margin-top:.2rem;transition:.15s ease}
/* the jump target must clear the sticky top nav (~66px) */
#lesson-view h3[id]{scroll-margin-top:5.5rem}
html{scroll-behavior:smooth}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
@media(max-width:1000px){.nav-cards{grid-template-columns:1fr}}

/* ===== Product CTA (a lesson's "AIM CALM SLEEP …" callout) ===== */
.cta{display:flex;align-items:center;gap:1.25rem;flex-wrap:wrap;margin:1.6rem 0;
  padding:1.15rem 1.25rem;border-radius:14px;border:1px solid var(--accent);
  background:linear-gradient(135deg,rgba(244,158,16,.20),rgba(244,158,16,.07))}
.cta-main{flex:1;min-width:16rem}
/* no uppercase micro-label: where the copy doesn't already name the product, the name simply
   leads the sentence in bold, the way a person would write it */
#lesson-view .cta-text{margin:0;color:var(--fg);font-size:.95rem;line-height:1.65;font-weight:400;max-width:68ch}
#lesson-view .cta-lead{font-weight:700;color:var(--accent-deep)}
.cta-btn{flex:none;display:inline-flex;align-items:center;gap:.45rem;white-space:nowrap;
  padding:.7rem 1.15rem;border-radius:10px;font-weight:700;font-size:.9rem;
  background:var(--cta);color:#fff;border:1px solid transparent;transition:.15s ease}
.cta-btn:hover{filter:brightness(1.06);transform:translateY(-1px);box-shadow:var(--shadow)}
.cta-btn:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(244,158,16,.35)}
@media(max-width:640px){.cta-btn{width:100%;justify-content:center}}
/* nested inside a timeline step there's less width to share, so stack rather than squeeze */
.tl-body .cta{margin:1.1rem 0 .2rem;padding:1rem 1.1rem;gap:.9rem}
.tl-body .cta-main{min-width:0;flex-basis:100%}
.tl-body .cta-btn{margin-left:0}

/* ===== Step timeline (e.g. the reset protocol) ===== */
#lesson-view .timeline{list-style:none;margin:1.3rem 0 1.6rem;padding:0;max-width:none}
#lesson-view .tl-step{position:relative;padding:0 0 1.45rem 2.4rem;margin:0;max-width:none}
#lesson-view .tl-step:last-child{padding-bottom:0}
/* the connector runs from under one marker to the next */
.tl-step::before{content:"";position:absolute;left:8px;top:1.5rem;bottom:.1rem;width:2px;
  border-radius:1px;background:var(--border)}
.tl-step:last-child::before{display:none}
.tl-dot{position:absolute;left:0;top:.3rem;width:18px;height:18px;border-radius:50%;
  background:linear-gradient(160deg,var(--accent-2),var(--accent-deep));
  border:3px solid var(--surface);box-shadow:0 0 0 1px var(--accent)}
#lesson-view .tl-label{display:block;font-family:var(--font-head);font-size:.98rem;font-weight:700;
  letter-spacing:-.01em;color:var(--fg);margin-bottom:.2rem}
/* Cap the reading measure on the prose, not on the step itself — a max-width here also
   squeezed anything else in the step (a product CTA got crushed to ~45 chars a line). */
#lesson-view .tl-body{margin:0;color:var(--fg);font-size:1rem;line-height:1.7;font-weight:400}
#lesson-view .tl-step .tl-body > p{max-width:64ch}

/* ===== Locked lessons (a course that unlocks one at a time) ===== */
.lesson-card.is-locked{cursor:default;opacity:.62;box-shadow:none}
.lesson-card.is-locked:hover{border-color:var(--border);transform:none}
.lesson-card.is-locked .lc-thumb{filter:grayscale(.75) opacity(.75)}
.lesson-card.is-locked .lc-arrow{font-size:.95rem}
.lessons li.is-locked{opacity:.6}
.lessons li.is-locked > span{display:flex;align-items:center;gap:.65rem;padding:.6rem .7rem;cursor:default}
.lessons li.is-locked .st{background:var(--bg);border:1px solid var(--border);font-size:.6rem}
.lessons li.is-locked .dur{font-size:.72rem}

/* weekly roll-up beside a tier heading */
.tier-count{font-family:var(--font);font-size:.78rem;font-weight:600;letter-spacing:0;
  text-transform:none;color:var(--muted);white-space:nowrap;flex:none;
  padding:.2rem .6rem;border-radius:999px;background:var(--surface-2);border:1px solid var(--border)}
.tier-count.is-done{color:var(--accent-deep);background:rgba(244,158,16,.22);border-color:var(--accent)}

/* ===== Choose your evening routine ===== */
.routine-pick{margin:1.4rem 0 .5rem;padding:1.1rem 1.2rem;border:1px solid var(--accent);border-radius:14px;
  background:linear-gradient(135deg,rgba(244,158,16,.18),rgba(244,158,16,.06))}
.routine-pick-label{display:block;font-family:var(--font-head);font-size:1.05rem;font-weight:700;
  letter-spacing:-.01em;color:var(--fg);margin:0 0 .2rem}
#lesson-view .routine-pick-hint{margin:0 0 .8rem;color:var(--muted);font-size:.9rem;max-width:60ch}
.routine-pick-row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.routine-pick select{flex:1;min-width:16rem;padding:.6rem .7rem;border:1px solid var(--border);
  border-radius:10px;background:var(--surface);color:var(--fg);font-family:inherit;font-size:.95rem}
.routine-pick select:focus{outline:none;border-color:var(--accent-deep)}
#lesson-view .routine-pick-current{margin:.75rem 0 0;font-size:.88rem;color:var(--muted)}
.routine-pick-current a{color:var(--accent-deep);font-weight:700}
/* the chip a day shows on its evening-routine step */
.routine-chip{display:inline-flex;align-items:center;gap:.5rem;margin-top:.7rem;
  padding:.5rem .8rem;border-radius:999px;border:1px solid var(--accent);
  background:rgba(244,158,16,.18);color:var(--fg);font-size:.85rem;transition:.15s ease}
.routine-chip:hover{background:rgba(244,158,16,.3);transform:translateY(-1px)}
.routine-chip-k{font-weight:700;color:var(--accent-deep)}
.routine-chip-v{color:var(--fg)}
.routine-chip.is-empty{border-style:dashed;background:transparent}
/* a jumped-to routine heading must clear the sticky nav */
#lesson-view h4[id]{scroll-margin-top:5.5rem}

/* A card with no picture is a compact text card — not a gradient placeholder block. Used by
   the programme's 32 plan cards, where 7 identical week photos read as a mistake. */
.lesson-card.is-compact .lc-body{padding:1.05rem 1.1rem 1.15rem}
.lesson-card.is-compact .lc-title{font-size:1rem}

/* A locked card states its lock once, in the badge, and its foot says what opens it —
   that's the only question the card raises, so it shouldn't just repeat "Locked". */
.lesson-card.is-locked .st{background:var(--bg);border:1px solid var(--border);font-size:.72rem}
.lesson-card .lc-status.locked{color:var(--faint);font-weight:600;line-height:1.35}
