/* EJU foundation scope only: use shared materials, typography and accessible ink. */
body[data-foundation-layout="v2"]{--foundation-accent:var(--tl-subject-math);--atelier-accent:var(--foundation-accent)!important;color:var(--tl-ink);background:var(--tl-paper);font:var(--tl-text-body-large)/1.75 var(--tl-font-ui)}
html[data-mode="dark"] body[data-foundation-layout="v2"],html[data-theme="dark"] body[data-foundation-layout="v2"]{--foundation-accent:color-mix(in srgb,var(--tl-subject-math) 30%,var(--tl-ink));--tl-success:#92d5b0;--tl-danger:#f4b3a8}
body[data-foundation-layout="v2"] .aa-atmosphere{background:var(--tl-paper-soft)}
body[data-foundation-layout="v2"] .aa-shell,.foundation-index{max-width:1020px;margin:auto;padding:var(--tl-space-4)}
body[data-foundation-layout="v2"] .aa-header,.foundation-header{display:flex;align-items:center;justify-content:space-between;gap:var(--tl-space-3);padding:var(--tl-space-3) 0;position:static}
body[data-foundation-layout="v2"] .aa-brand small{display:none}body[data-foundation-layout="v2"] .aa-brand b{font-size:17px}.foundation-header a{color:var(--tl-ink);text-decoration:none;font-weight:600}
body[data-foundation-layout="v2"] .aa-seal{border:0;border-radius:0;width:auto;height:auto;background:none;box-shadow:none;color:var(--foundation-accent);font-size:24px}
body[data-foundation-layout="v2"] .aa-paper{background:var(--tl-paper);border:0;border-radius:0;box-shadow:none;backdrop-filter:none;overflow:visible}
body[data-foundation-layout="v2"] .aa-hero{display:block;min-height:0;padding:var(--tl-space-4) 0 var(--tl-space-5);background:none;border-bottom:1px solid var(--tl-hair);overflow:visible}
body[data-foundation-layout="v2"] .aa-hero::after,body[data-foundation-layout="v2"] .bio-map::before,body[data-foundation-layout="v2"] .bio-map::after{display:none;content:none}
body[data-foundation-layout="v2"] .aa-hero .aa-kicker{display:none}body[data-foundation-layout="v2"] .aa-hero h1,.foundation-index h1{font:700 clamp(28px,4vw,42px)/1.2 var(--tl-font-ui);letter-spacing:-.025em;margin:var(--tl-space-2) 0 var(--tl-space-3);overflow-wrap:normal;text-wrap:balance}
body[data-foundation-layout="v2"] .aa-hero>div>p{margin:var(--tl-space-2) 0;color:var(--tl-ink-soft);font-size:18px;max-width:760px}
body[data-foundation-layout="v2"] .aa-content{padding:var(--tl-space-5) 0;display:block}.foundation-index main{padding:var(--tl-space-4) 0}
body[data-foundation-layout="v2"] .aa-section{max-width:none}body[data-foundation-layout="v2"] .aa-section+.aa-section{margin-top:var(--tl-space-6);padding-top:var(--tl-space-5)}
body[data-foundation-layout="v2"] .aa-section h2{font:650 clamp(23px,3vw,30px)/1.4 var(--tl-font-ui);letter-spacing:-.015em}
body[data-foundation-layout="v2"] .aa-kicker{color:var(--tl-ink-soft);font-size:12px}
body[data-foundation-layout="v2"] .science-concept-term,body[data-foundation-layout="v2"] .bio-concepts b,body[data-foundation-layout="v2"] .bio-step__ja,body[data-foundation-layout="v2"] .science-math,body[data-foundation-layout="v2"] .bio-step__no,body[data-foundation-layout="v2"] .bio-pitfall strong{color:var(--foundation-accent)}
body[data-foundation-layout="v2"] .bio-pitfall h3{color:var(--tl-danger)}
body[data-foundation-layout="v2"] [data-lang="ja"],body[data-foundation-layout="v2"] [lang="ja"]{word-break:normal;overflow-wrap:normal;line-break:strict}
body[data-foundation-layout="v2"] ruby{white-space:nowrap;word-break:keep-all}body[data-foundation-layout="v2"] rt{color:inherit;opacity:1;font-size:max(11px,.5em)}
body[data-foundation-layout="v2"] .science-concept-term,.foundation-term{white-space:normal;word-break:keep-all;overflow-wrap:normal}
body[data-foundation-layout="v2"] .aa-settings,body[data-foundation-layout="v2"] .science-language button{min-height:44px;color:var(--tl-ink);border:1px solid var(--tl-hair);background:var(--tl-paper);font:inherit}
body[data-foundation-layout="v2"] .science-language button[aria-pressed="true"]{background:var(--tl-ink);color:var(--tl-paper-solid,var(--tl-glass-strong))}
/* Explicit foreground on selected controls avoids translucent inverse ink. */
body[data-foundation-layout="v2"] .science-language button[aria-pressed="true"]{background:var(--foundation-accent);color:#fff}html[data-mode="dark"] body[data-foundation-layout="v2"] .science-language button[aria-pressed="true"]{color:#081a2b}
body[data-foundation-layout="v2"] .bio-choice{color:var(--tl-ink);box-shadow:none}body[data-foundation-layout="v2"] .bio-choice[data-state="wrong"]{color:var(--tl-ink);border-color:var(--tl-danger)}body[data-foundation-layout="v2"] .bio-choice[data-state="correct"]{color:var(--tl-ink);border-color:var(--tl-success)}
body[data-foundation-layout="v2"] .bio-example{padding:var(--tl-space-4);background:none;border-left:3px solid var(--foundation-accent)}
body[data-foundation-layout="v2"] .foundation-figure{color:var(--foundation-accent);max-width:360px;margin:var(--tl-space-5) auto}
body[data-foundation-layout="v2"] .foundation-figure svg{color:inherit;fill:currentColor}
body[data-foundation-layout="v2"] .bio-nav{padding:var(--tl-space-5) 0}body[data-foundation-layout="v2"] a{color:var(--foundation-accent)}
body[data-foundation-layout="v2"] :focus-visible{outline:3px solid var(--tl-focus);outline-offset:4px}
.foundation-list{list-style:none;padding:0;margin:var(--tl-space-5) 0}.foundation-list li{border-top:1px solid var(--tl-hair)}.foundation-list li:last-child{border-bottom:1px solid var(--tl-hair)}
.foundation-list a{display:grid;grid-template-columns:36px minmax(0,1fr) 24px;gap:var(--tl-space-3);padding:var(--tl-space-4) 0;min-height:80px;text-decoration:none;align-items:center;color:var(--tl-ink)!important}.foundation-number{font:500 14px var(--tl-font-mono);color:var(--foundation-accent)}.foundation-list strong{display:block;font-weight:650;font-size:19px}.foundation-list .foundation-jp{display:block;margin-top:var(--tl-space-1);font:400 18px/1.5 var(--tl-font-jp);color:var(--tl-ink-soft);word-break:normal}.foundation-list a:hover strong{text-decoration:underline;text-underline-offset:5px}.foundation-list .foundation-arrow{color:var(--foundation-accent)}
.foundation-next{display:flex;flex-wrap:wrap;gap:var(--tl-space-4);padding-block:var(--tl-space-4)}.foundation-next a,.foundation-header button{min-height:44px;display:inline-flex;align-items:center;font:inherit;padding:var(--tl-space-2) 0}.foundation-header button{border:0;background:none;color:var(--tl-ink);cursor:pointer}
.foundation-note{color:var(--tl-ink-soft);margin:0;max-width:720px}.foundation-source{border-top:1px solid var(--tl-hair);margin-top:var(--tl-space-5);padding-top:var(--tl-space-3)}.foundation-source summary,body[data-foundation-layout="v2"] .foundation-example summary{min-height:44px;cursor:pointer;padding:var(--tl-space-3) 0;font-weight:600}
.foundation-opening h2{margin-top:0}.foundation-example{border-block:1px solid var(--tl-hair);margin:var(--tl-space-4) 0;padding-block:var(--tl-space-2)}.foundation-step{padding:var(--tl-space-3) 0}.foundation-step p{margin:var(--tl-space-2) 0}.foundation-relations{border-collapse:collapse;width:100%;margin:var(--tl-space-4) 0;font-size:17px}.foundation-relations th,.foundation-relations td{padding:var(--tl-space-3) var(--tl-space-2);border-block:1px solid var(--tl-hair);text-align:left;vertical-align:top}.foundation-relations th{font-weight:600}.foundation-relations strong{color:var(--foundation-accent);text-decoration:underline;text-underline-offset:4px}.foundation-relations caption{text-align:left;font-weight:600;margin-bottom:var(--tl-space-2)}
.foundation-term{display:inline-block;color:var(--foundation-accent);font-family:var(--tl-font-jp)}.foundation-selfcheck{margin-top:var(--tl-space-4);border-left:3px solid var(--foundation-accent);padding-left:var(--tl-space-4)}.foundation-selfcheck summary{min-height:44px;cursor:pointer;font-weight:600}.foundation-objectives{margin-bottom:var(--tl-space-5)}.foundation-objectives summary{min-height:44px;padding-block:var(--tl-space-2);cursor:pointer}
@media(max-width:600px){body[data-foundation-layout="v2"] .aa-shell,.foundation-index{padding:var(--tl-space-3) var(--tl-space-4)}body[data-foundation-layout="v2"] .aa-hero h1{font-size:30px}.foundation-relations{font-size:16px}.foundation-list a{grid-template-columns:28px minmax(0,1fr) 18px}.foundation-list strong{font-size:18px}.foundation-list .foundation-jp{font-size:17px}body[data-foundation-layout="v2"] .bio-step{grid-template-columns:36px minmax(0,1fr)}body[data-foundation-layout="v2"] .bio-step__no{width:32px;height:32px;border:0;border-radius:0}.foundation-header{padding:var(--tl-space-2) 0}}

body[data-foundation-layout="v2"] .aa-hero>div>p:not(.foundation-title-ja){display:none}body[data-foundation-layout="v2"] .aa-hero .foundation-title-ja{font:400 22px/1.6 var(--tl-font-jp);color:var(--tl-ink-soft);word-break:keep-all;overflow-wrap:normal}body[data-foundation-layout="v2"] .aa-hero{padding-bottom:var(--tl-space-4)}
body[data-foundation-layout="v2"]{--foundation-surface:rgb(from var(--tl-paper) r g b / 1);background:var(--foundation-surface)}body[data-foundation-layout="v2"] .aa-atmosphere,body[data-foundation-layout="v2"] .aa-paper{background:var(--foundation-surface)}
body[data-foundation-layout="v2"] .aa-hero>div>div>p{display:none}html[data-study-lang="ja"] body[data-foundation-layout="v2"] .foundation-title-ja{display:none}body[data-foundation-layout="v2"] .bio-choice [data-lang="vi"]{font-family:var(--tl-font-ui)}
.foundation-stage[hidden]{display:none!important}.foundation-flow-nav{margin-bottom:26px;padding-bottom:18px;border-bottom:1px solid var(--tl-hair)}.foundation-flow-nav p{font-size:14px;color:var(--tl-ink-soft);margin:0 0 12px}.foundation-flow-nav select{max-width:100%;min-height:44px;padding:8px 12px;font:inherit;border:1px solid var(--tl-hair);border-radius:12px;background:var(--foundation-surface);color:var(--tl-ink)}.foundation-flow-nav button,.foundation-flow-actions button,.foundation-stage button{min-height:44px;font:inherit;padding:8px 12px;border:1px solid var(--tl-hair);border-radius:12px;background:var(--foundation-surface);color:var(--tl-ink);cursor:pointer}.foundation-flow-nav button{margin:8px 0 8px 12px}.foundation-flow-actions{display:flex;justify-content:space-between;gap:12px;border-top:1px solid var(--tl-hair);padding-top:18px;margin-top:26px}.foundation-flow-actions button:disabled{opacity:.5;cursor:default}.foundation-stage{min-width:0;max-width:100%}.foundation-stage label{display:block;font-weight:600;margin:18px 0 10px}.foundation-stage textarea{display:block;width:100%;min-height:160px;box-sizing:border-box;font:inherit;line-height:1.8;background:var(--foundation-surface);color:var(--tl-ink);border:1px solid var(--tl-hair);border-radius:12px;padding:12px}.foundation-recall-model{margin-top:18px;border-left:3px solid var(--foundation-accent);padding-left:18px}.foundation-stage .bio-formula{min-width:0}.foundation-stage .science-math{max-width:100%;overflow-x:auto}.foundation-stage :focus{scroll-margin-top:20px}
body[data-foundation-layout="v2"] .bio-concepts>li{min-width:0}body[data-foundation-layout="v2"] .bio-concepts p{max-width:100%}@media(max-width:820px){body[data-foundation-layout="v2"] .bio-concepts{grid-template-columns:minmax(0,1fr)}}
.foundation-recall-options{list-style:upper-alpha;padding-left:1.7em;margin:18px 0}.foundation-recall-options li{padding:8px 0;border-bottom:1px solid var(--tl-hair)}.foundation-recall-history{margin-top:20px;border-top:1px solid var(--tl-hair)}.foundation-recall-history summary{min-height:44px;cursor:pointer;padding:12px 0;font-weight:600}.foundation-recall-history article{border-top:1px solid var(--tl-hair);padding:12px 0}.foundation-recall-history article p{white-space:pre-wrap;overflow-wrap:anywhere}
body[data-foundation-extension="r9"] .bio-example [data-lang],body[data-foundation-extension="r9"] .foundation-transfer p{overflow-wrap:anywhere}body[data-foundation-extension="r9"] .foundation-transfer{margin-top:24px;padding-top:16px;border-top:1px solid var(--tl-hair)}body[data-foundation-extension="r9"] .foundation-transfer summary{cursor:pointer;padding:12px 0;min-height:44px}
