/* Shared lesson theme ("Water Cycle" direction). Active only when <html> has class "lt" + a house class. */
html.lt{--lt-1:#5B2A86;--lt-2:#1F4E79;--lt-3:#B8860B;--lt-4:#1E6B3A;--lt-5:#B4513A;--lt-ink:#1E2340;--lt-paper:#FBF3E0;--lt-ribbon:#1C2340;--lt-bg:none;--lt-glow:255,201,60}
html.lt.lt-agencyx{--lt-1:#5B2A86;--lt-2:#1F4E79;--lt-3:#B8860B;--lt-4:#1E6B3A;--lt-5:#B4513A;--lt-ribbon:#2B1640;--lt-bg:url(img/themes/bg-agencyx.webp)}
html.lt.lt-pythagoras{--lt-1:#1F5FA8;--lt-2:#2E8C9E;--lt-3:#C9962B;--lt-4:#5E7D2E;--lt-5:#B5523A;--lt-ribbon:#14304F;--lt-bg:url(img/themes/bg-pythagoras.webp)}
html.lt.lt-ahmes{--lt-1:#1D5C8C;--lt-2:#178F8A;--lt-3:#C79A2E;--lt-4:#4F8A3A;--lt-5:#B8562E;--lt-ribbon:#1A2E4A;--lt-bg:url(img/themes/bg-ahmes.webp)}
html.lt.lt-euclid{--lt-1:#3D4C9E;--lt-2:#2C6E91;--lt-3:#B88A2E;--lt-4:#3E7A5A;--lt-5:#A84E52;--lt-ribbon:#1D2550;--lt-bg:url(img/themes/bg-euclid.webp)}
html.lt.lt-mentalmath{--lt-1:#7A3FA0;--lt-2:#1F7A9E;--lt-3:#D08A1E;--lt-4:#2E8A50;--lt-5:#C4513E;--lt-ribbon:#22294F;--lt-bg:url(img/themes/bg-mentalmath.webp)}
html.lt.lt-thales{--lt-1:#1B5E7A;--lt-2:#2B7FA8;--lt-3:#C08A2A;--lt-4:#2F7D63;--lt-5:#B8553A;--lt-ribbon:#0F2C40;--lt-bg:url(img/themes/bg-thales.webp)}
html.lt.lt-quest{--lt-1:#6A3C9E;--lt-2:#245F8F;--lt-3:#C9932A;--lt-4:#3A7F3A;--lt-5:#B5513A;--lt-ribbon:#1F2347;--lt-bg:url(img/themes/bg-quest.webp)}

/* immersive backdrop */
html.lt,html.lt body{background:#140c22 var(--lt-bg) center top/cover fixed no-repeat!important}
@media (max-width:700px){html.lt,html.lt body{background-attachment:scroll!important;background-size:auto 100vh!important;background-repeat:repeat-y!important}}

/* one parchment paper sheet */
html.lt details.byy-teach-wrap{border:0!important;border-radius:26px!important;background:var(--lt-paper)!important;
  box-shadow:0 0 0 6px rgba(255,255,255,.08),0 18px 40px rgba(0,0,0,.45),inset 0 0 60px rgba(150,110,40,.18)!important;overflow:visible!important}
html.lt details.byy-teach-wrap>:not(summary){background:transparent!important;border-radius:0 0 26px 26px}
html.lt details.byy-teach-wrap>summary{margin:-10px 14px 0;padding:14px 100px 14px 22px!important;background:var(--lt-ribbon);color:#fff!important;border:0!important;
  clip-path:polygon(0 8%,3% 0,97% 4%,100% 0,99% 50%,100% 100%,96% 94%,4% 100%,0 92%,1% 50%);font-size:20px!important;letter-spacing:.01em;filter:drop-shadow(0 4px 0 rgba(0,0,0,.25))}
html.lt details.byy-teach-wrap>summary::after{background:linear-gradient(180deg,#FFD866,#E8A915)!important;box-shadow:0 0 12px rgba(var(--lt-glow),.6),0 3px 0 #9A6B05!important}

/* sections lose their separate boxes; they sit on the paper */
html.lt .byy-teach .panel{background:transparent!important;border:0!important;box-shadow:none!important;padding:8px 2px 10px!important;margin:6px 0 14px}
html.lt .byy-teach .panel+.panel{border-top:2px dashed rgba(120,90,40,.25)!important;padding-top:22px!important}
/* brush-stroke ribbon headings instead of pill tags */
html.lt .byy-teach .panel .tag{position:relative!important;top:auto!important;left:auto!important;display:inline-block;margin:0 0 10px -6px;
  background:var(--lt-ribbon)!important;color:#fff!important;font-size:14px!important;letter-spacing:.04em;padding:8px 22px 8px 16px!important;border-radius:0!important;
  clip-path:polygon(0 12%,4% 0,96% 6%,100% 0,98% 52%,100% 100%,94% 92%,3% 100%,0 88%,2% 50%)}
html.lt .byy-teach .panel p,html.lt .byy-teach .panel li{color:var(--lt-ink)!important;font-size:15px!important;line-height:1.55!important;text-align:left!important}

/* picture cards blend into the paper */
html.lt .byy-teach img.ah-card,html.lt img.ah-card{border:0!important;border-radius:14px!important;box-shadow:0 6px 16px rgba(60,40,10,.22)!important;margin:12px auto 10px!important}
@media (max-width:560px){html.lt .byy-teach img.ah-card{width:calc(100% + 28px)!important;max-width:none!important;margin-left:-14px!important;border-radius:10px!important}}

/* numbered rows: steps AND mistakes share one style; colors cycle gold, blue, purple, green */
html.lt .byy-teach .step,html.lt .byy-teach .mistake-item{display:flex!important;align-items:center!important;gap:14px!important;margin:10px 0!important;padding:12px 14px!important;
  border-radius:16px!important;background:color-mix(in srgb,var(--c) 14%,#fff)!important;border:2px solid color-mix(in srgb,var(--c) 35%,transparent)!important;box-shadow:0 3px 0 color-mix(in srgb,var(--c) 25%,transparent)}
html.lt .byy-teach :is(.worked-steps>.step,.mistake-item):nth-of-type(4n+1){--c:var(--lt-3)}
html.lt .byy-teach :is(.worked-steps>.step,.mistake-item):nth-of-type(4n+2){--c:var(--lt-2)}
html.lt .byy-teach :is(.worked-steps>.step,.mistake-item):nth-of-type(4n+3){--c:var(--lt-1)}
html.lt .byy-teach :is(.worked-steps>.step,.mistake-item):nth-of-type(4n+4){--c:var(--lt-4)}
html.lt .byy-teach .step{--c:var(--lt-3)}
html.lt .byy-teach :is(.step .num,.mistake-item .mnum){width:40px!important;height:40px!important;min-width:40px;border-radius:50%!important;background:var(--c)!important;color:#fff!important;
  font-size:19px!important;font-weight:800;display:flex!important;align-items:center;justify-content:center;box-shadow:inset 0 -3px 0 rgba(0,0,0,.2),0 2px 6px rgba(0,0,0,.2)}
html.lt .byy-teach :is(.step .expr,.mistake-item .mtext){color:var(--lt-ink)!important;font-size:15px!important}
html.lt .byy-teach .mistake-item .mtext b{color:var(--lt-5)!important}
html.lt .byy-teach .mistake-item::after{content:"⚠";margin-left:auto;opacity:.55;font-size:18px}
html.lt .byy-teach .worked-steps>.step::after{content:"✎";margin-left:auto;opacity:.45;font-size:18px}

/* dashed Pro Tip: meta-strategy + callback panels */
html.lt .byy-teach .panel.metastrategy{border:2px dashed color-mix(in srgb,var(--lt-2) 60%,transparent)!important;border-radius:16px!important;
  background:color-mix(in srgb,var(--lt-2) 7%,#fff)!important;padding:14px 14px 12px!important;margin-top:18px}
html.lt .byy-teach .panel.metastrategy+.panel{border-top:0!important}
html.lt .byy-teach .panel.metastrategy .tag::before{content:"💡 "}
html.lt .byy-teach .key-sentence{background:color-mix(in srgb,var(--lt-3) 16%,transparent);border-radius:6px;padding:1px 4px}

/* glowing gold buttons + soft depth (HUD) */
html.lt .btn:not(.secondary),html.lt #nextBtn{background:linear-gradient(180deg,#FFD866,#E8A915)!important;color:#2a1c00!important;border-radius:999px!important;font-size:18px!important;padding:14px 30px!important;
  box-shadow:0 0 18px rgba(var(--lt-glow),.55),0 6px 0 #9A6B05,0 12px 22px rgba(0,0,0,.35)!important;border:2px solid #FFF0B0!important}
html.lt .node-btn{box-shadow:0 6px 0 rgba(0,0,0,.25),0 12px 24px rgba(0,0,0,.3)!important}

/* polish: long unbroken math strings wrap instead of pushing the page sideways on phones */
html.lt .byy-teach :is(.step .expr,.mistake-item .mtext){min-width:0;overflow-wrap:anywhere}

/* contrast: per-house scrim behind text that sits directly on the backdrop (only those spots) */
html.lt{--lt-scrim:28,35,64;--lt-scrim-a:.74}
html.lt.lt-agencyx{--lt-scrim:43,22,64;--lt-scrim-a:.74}
html.lt.lt-pythagoras{--lt-scrim:20,48,79;--lt-scrim-a:.82}
html.lt.lt-ahmes{--lt-scrim:26,46,74;--lt-scrim-a:.82}
html.lt.lt-euclid{--lt-scrim:29,37,80;--lt-scrim-a:.74}
html.lt.lt-mentalmath{--lt-scrim:34,41,79;--lt-scrim-a:.76}
html.lt.lt-thales{--lt-scrim:15,44,64;--lt-scrim-a:.74}
html.lt.lt-quest{--lt-scrim:31,35,71;--lt-scrim-a:.8}
html.lt .bty-nav a,html.lt .wrap .hud>span:not(.sk-pts),html.lt .wrap .backlink{background:rgba(var(--lt-scrim),var(--lt-scrim-a))!important;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}
html.lt .bty-nav a.bty-parents{border-radius:999px;padding:5px 14px}
html.lt .wrap>:is(.eyebrow,.title-row,.subtitle){background:rgba(var(--lt-scrim),var(--lt-scrim-a));-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);margin:0!important;max-width:none;padding:4px 18px}
html.lt .wrap>.eyebrow{padding-top:12px;border-radius:18px 18px 0 0;width:fit-content;min-width:0}
html.lt .wrap>.eyebrow:has(+.title-row){width:auto}
html.lt .wrap>.eyebrow:not(:has(+.title-row)){border-radius:999px;padding:6px 14px;margin-bottom:8px!important}
html.lt .wrap>.subtitle{padding-bottom:14px;border-radius:0 0 18px 18px;margin-bottom:14px!important}
html.lt .wrap>.title-row:not(:has(+.subtitle)){border-radius:0 0 18px 18px;padding-bottom:12px;margin-bottom:14px!important}
html.lt .sk-mentor>b{width:fit-content;margin-inline:auto;padding:2px 14px;border-radius:999px;background:rgba(var(--lt-scrim),var(--lt-scrim-a))}
html.lt .wrap>div[style*="ink-soft"]{background:var(--lt-paper)!important;color:var(--lt-ink)!important}
html.lt .legal-links{width:fit-content;margin-inline:auto;padding:6px 16px;border-radius:999px;background:rgba(var(--lt-scrim),var(--lt-scrim-a))}
html.lt.sci .legal-links{background:rgba(251,243,224,.92)}

/* ===== Kid-friendly reading text (Faith, Oct 2026): Ahmes, Agency X (Al-Khwarizmi) and Pythagoras lessons only.
   Nunito (self-hosted, rounded) at roughly 1.4-1.6x the old reading size. Headings, buttons and card images untouched. ===== */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1){--kr-font:"Nunito",ui-rounded,system-ui,sans-serif;--kr-body:clamp(20px,1.1vw + 16px,23px);--kr-cap:clamp(18px,.6vw + 16px,20px)}
/* lesson intro paragraph */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .wrap>.subtitle{font-family:var(--kr-font)!important;font-weight:700!important;font-size:var(--kr-body)!important;line-height:1.5!important;max-width:none!important}
/* walkthrough + LearnIt panels, Big Idea, steps, mistakes */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach{font-family:var(--kr-font)!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach .panel :is(p,li){font-family:var(--kr-font)!important;font-weight:600;font-size:var(--kr-body)!important;line-height:1.6!important;color:var(--lt-ink)!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach .panel p b{font-weight:800}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach :is(.step .expr,.mistake-item .mtext){font-size:var(--kr-body)!important;line-height:1.5!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach .mistake-item .mtext{font-family:var(--kr-font)!important;font-weight:600}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach .step .expr{font-size:clamp(18px,.8vw + 15px,21px)!important}/* Fira Code kept: clearest for math */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach :is(.step .num,.mistake-item .mnum){width:44px!important;height:44px!important;min-width:44px;font-size:21px!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach .panel .tag{font-size:16px!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach :is(.li-check summary,.li-check div,.cpa-box .desc,.cpa-box .stage,.svg-box .cap,.bond-badge){font-family:var(--kr-font);font-size:var(--kr-cap)!important;line-height:1.4!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach .bond-badge{font-family:"Fira Code",monospace}
/* card captions / guide speech bubbles, incl. the small italic lines */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .tq b{font:800 var(--kr-body)/1.45 var(--kr-font)!important;max-width:520px;min-width:0;overflow-wrap:anywhere}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .tq b small{font-size:17px!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .tq b i.wh{font:italic 600 var(--kr-cap)/1.4 var(--kr-font)!important;color:#4E5B72!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .byy-teach [style*="italic"]{font-size:var(--kr-cap)!important;line-height:1.5!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .sk-scene .sk-bubble{font-size:clamp(19px,.6vw + 17px,21px)!important;line-height:1.45!important}
/* quiz */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .qtext{font-family:var(--kr-font)!important;font-weight:800!important;font-size:clamp(24px,1.6vw + 18px,30px)!important;line-height:1.35!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .opt{font-family:var(--kr-font)!important;font-weight:700!important;font-size:clamp(20px,1vw + 16px,23px)!important;line-height:1.4!important;min-height:56px;height:auto!important;white-space:normal!important;overflow-wrap:anywhere}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .opt::before,html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .opt .letter{width:40px!important;height:40px!important;font-size:20px}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .feedback{font-family:var(--kr-font)!important;font-size:var(--kr-cap)!important;line-height:1.5!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .feedback .lead{font-size:clamp(21px,.6vw + 19px,23px)!important}

/* ===== Ahmes "Learn it first" walkthrough text styled like the quiz question card (Faith, Oct 2026). Ahmes only. ===== */
html.lt.lt-ahmes .byy-teach .panel>p{font-family:var(--kr-font)!important;font-weight:800!important;font-size:clamp(28px,.8vw + 25px,34px)!important;line-height:1.3!important;hyphens:auto;color:#14213D!important;
  background:linear-gradient(180deg,#FFF6DE,#F7E9C6)!important;border:3px solid #D6B474!important;border-radius:26px!important;padding:18px 18px!important;margin:12px 0!important;
  box-shadow:0 6px 0 #B99650,0 10px 18px rgba(0,0,0,.18)!important;box-sizing:border-box;max-width:100%;overflow-wrap:anywhere}
html.lt.lt-ahmes .byy-teach .panel>p .key-sentence{background:transparent!important;padding:0}
/* italic key-idea lines: same font, gold-tinted bubble */
html.lt.lt-ahmes .byy-teach .panel>p[style*="italic"]{font-style:italic!important;background:linear-gradient(180deg,#FFE9A8,#FFD866)!important;border-color:#C79A2E!important;box-shadow:0 6px 0 #9A6B05,0 10px 18px rgba(0,0,0,.18)!important;color:#2A1C00!important}
@media (max-width:560px){html.lt.lt-ahmes .byy-teach .panel>p{padding:14px 14px!important;border-radius:22px!important}}

/* quiz screen small text: bigger, quiz font, question-card bubble colors (Faith, Oct 10) */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .qcount{display:inline-block;font-family:var(--kr-font)!important;font-weight:800!important;font-size:clamp(19px,.5vw + 17px,22px)!important;color:#14213D!important;background:linear-gradient(180deg,#FFF6DE,#F7E9C6);border:3px solid #D6B474;border-radius:999px;padding:4px 14px;margin-bottom:12px!important;box-shadow:0 3px 0 #B99650}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .feedback{font-weight:700!important;font-size:clamp(21px,.6vw + 19px,23px)!important;color:#14213D!important;background:linear-gradient(180deg,#FFF6DE,#F7E9C6)!important;border:3px solid #D6B474!important;border-radius:22px!important;padding:14px 16px!important;box-shadow:0 4px 0 #B99650!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .feedback .lead{font-weight:800!important;font-size:clamp(23px,.6vw + 21px,26px)!important}

/* quiz screen small text: bigger, quiz font, question-card bubble colors (Faith, Oct 10) */
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .qcount{display:inline-block;font-family:var(--kr-font)!important;font-weight:800!important;font-size:clamp(19px,.5vw + 17px,22px)!important;color:#14213D!important;background:linear-gradient(180deg,#FFF6DE,#F7E9C6);border:3px solid #D6B474;border-radius:999px;padding:4px 14px;margin-bottom:12px!important;box-shadow:0 3px 0 #B99650}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .feedback{font-weight:700!important;font-size:clamp(21px,.6vw + 19px,23px)!important;color:#14213D!important;background:linear-gradient(180deg,#FFF6DE,#F7E9C6)!important;border:3px solid #D6B474!important;border-radius:22px!important;padding:14px 16px!important;box-shadow:0 4px 0 #B99650!important}
html.lt:is(.lt-ahmes,.lt-agencyx,.lt-pythagoras,.lt-calc1) .feedback .lead{font-weight:800!important;font-size:clamp(23px,.6vw + 21px,26px)!important}

/* Calc 1 preview (Newton & Leibniz): Al-Khwarizmi's lesson palette and scrim values copied exactly; backdrop = Newton's window scene, night-graded */
html.lt.lt-calc1{--lt-1:#5B2A86;--lt-2:#1F4E79;--lt-3:#B8860B;--lt-4:#1E6B3A;--lt-5:#B4513A;--lt-ribbon:#2B1640;--lt-bg:url(img/themes/bg-calc1.webp)}
html.lt.lt-calc1{--lt-scrim:43,22,64;--lt-scrim-a:.74}
