:root {
  color-scheme: light;
  --paper: #f7f5ef; --panel: #fffdf8; --ink: #202827; --muted: #575f5b;
  --line: #e4ded2; --track: #eae4db; --orange: #e38646; --soft: #fae8d9;
  --warm: #854016; --green: #286349; --green-bg: #e2f1e5; --red: #8e3e2e; --red-bg: #fae6df;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #162023; --panel: #1f2b2f; --ink: #f8f3e8; --muted: #c2c9c4; --line: #3c494a;
  --track: #394546; --orange: #f6a66c; --soft: #493225; --warm: #ffd3af;
  --green: #b2ecc6; --green-bg: #273f35; --red: #ffb7a4; --red-bg: #4a302e;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --paper: #162023; --panel: #1f2b2f; --ink: #f8f3e8; --muted: #c2c9c4; --line: #3c494a;
    --track: #394546; --orange: #f6a66c; --soft: #493225; --warm: #ffd3af;
    --green: #b2ecc6; --green-bg: #273f35; --red: #ffb7a4; --red-bg: #4a302e;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #c6682c; outline-offset: 4px;
}
h1, h2, p { margin: 0; }
h1, h2 { letter-spacing: -.04em; line-height: 1.12; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: 1.4rem; }
a { color: var(--warm); }
svg { flex: none; vertical-align: middle; }
.skip { position: fixed; top: -100px; left: 1rem; z-index: 9; background: var(--panel); padding: .7rem; }
.skip:focus { top: 1rem; }
.loading { max-width: 660px; margin: 4rem auto; padding: 2rem; }
main:focus { outline: none; }
.eyebrow { color: var(--warm); font-size: .72rem; letter-spacing: .12em; font-weight: 800; }
.primary {
  --button-fill: #ffa862;
  --button-edge: #bb6032;
  --button-text: #271c14;
}
.section-lead { margin-top: .7rem; color: var(--muted); }
.notice { color: var(--warm); margin-top: 1rem; }
.notice:empty { display: none; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 207px minmax(0, 1fr); }
.rail { min-height: 100dvh; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; padding: 25px 15px; border-right: 1px solid var(--line); background: var(--panel); }
.brand { display: flex; gap: 9px; text-align: left; border: 0; align-items: center; padding: 4px 7px; border-radius: 12px; background: none; cursor: pointer; font-size: 1.1rem; line-height: 1; font-weight: 900; letter-spacing: -.055em; }
.brand-academy { display: block; font-size: .61rem; letter-spacing: .17em; margin-top: 4px; }
.rail nav { display: grid; gap: 8px; margin-top: 42px; }
.nav-btn { min-height: 48px; border: 1px solid transparent; border-radius: 12px; background: none; display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--muted); text-align: left; cursor: pointer; font-weight: 700; }
.nav-btn:hover { background: var(--paper); }
.nav-btn[aria-current] { background: var(--soft); color: var(--warm); border-color: color-mix(in srgb, var(--orange) 35%, transparent); }
.offline { margin-top: auto; font-size: .74rem; gap: 8px; }
.shell-body { min-width: 0; }
.top { height: 78px; display: flex; align-items: center; gap: 12px; padding: 0 34px; border-bottom: 1px solid var(--line); background: var(--panel); }
.crumb { flex: 1; color: var(--muted); font-size: .88rem; font-weight: 650; }
.crumb span { padding: 0 .5rem; color: var(--warm); }
.xp-pill, .profile-pill { display: inline-flex; align-items: center; min-height: 44px; gap: 7px; border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; background: var(--panel); cursor: pointer; white-space: nowrap; font-size: .85rem; }
.xp-pill { color: var(--warm); background: var(--soft); border-color: transparent; }
.profile-pill > span:last-child { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #22312e; color: #fff2e4; font-weight: 800; flex: none; }
.main { max-width: 1120px; margin: 0 auto; padding: 30px 34px 50px; }
.hero { min-height: 305px; position: relative; isolation: isolate; display: flex; align-items: center; border-radius: 22px; overflow: hidden; padding: 34px 38px; background: #20292b; color: #fff6e8; }
.hero-copy { position: relative; z-index: 1; width: min(100%, 454px); }
.hero .eyebrow { color: #ffd0a9; }
.hero .eyebrow span { display: inline-block; width: 8px; height: 8px; margin: 0 6px 1px 0; border-radius: 50%; background: #ffa862; }
.hero h1 { margin: 9px 0 12px; font-size: clamp(2.5rem, 4.25vw, 3.65rem); letter-spacing: -.065em; line-height: .99; }
.hero p:not(.eyebrow) { max-width: 32ch; color: #eddfd2; font-size: .97rem; }
.hero .primary { margin-top: 20px; }
.chassis { position: absolute; z-index: 0; right: -1%; bottom: 0; width: 61%; max-height: 100%; object-fit: contain; object-position: center right; }
.hero:is([data-domain="culture"], [data-domain="diagnostic"], [data-domain="physique"], [data-domain="materiaux"]) .chassis { right: 3%; bottom: 10%; width: 48%; }
.path-grid { display: grid; grid-template-columns: minmax(0, 1fr) 246px; gap: 30px; margin-top: 27px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-head h2 { margin-top: 2px; font-size: clamp(1.3rem, 2.5vw, 1.85rem); }
.chapter-lead { color: var(--muted); margin: -.35rem 0 .9rem; font-size: .92rem; }
.count { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.stops { position: relative; display: grid; gap: 11px; list-style: none; padding: 0; margin: 0; }
.stops::before { content: ""; position: absolute; top: 31px; bottom: 31px; left: 24px; width: 2px; background: var(--line); }
.stop { z-index: 1; display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: center; gap: 12px; }
.milestone { display: grid; place-items: center; width: 50px; height: 50px; border: 1px solid var(--line); border-bottom-width: 4px; border-radius: 15px; background: var(--panel); color: var(--muted); }
.stop.ready .milestone { background: #ffa862; color: #271c14; border-color: #bb6032; }
.stop.complete .milestone { background: var(--green-bg); color: var(--green); }
.tile { min-height: 68px; justify-content: space-between; text-align: left; gap: 9px; padding: 8px 13px; }
.tile:disabled { opacity: 1; color: var(--muted); background: color-mix(in srgb, var(--panel), var(--paper) 50%); }
.stop.ready .tile { --button-edge: color-mix(in srgb, var(--orange) 55%, var(--line)); }
.tile-copy { min-width: 0; display: grid; }
.tile-copy small { color: var(--muted); font-size: .72rem; font-weight: 650; }
.tile-copy strong { letter-spacing: -.022em; font-size: 1rem; }
.tile-copy small span { color: var(--warm); }
.tile-right { display: flex; gap: 8px; align-items: center; flex: none; }
.tile-status { font-size: .71rem; font-weight: 750; color: var(--muted); }
.stop.ready .tile-status { color: var(--warm); }
.stop.complete .tile-status { color: var(--green); }
.summary { display: grid; align-content: start; gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 17px; }
.card h2 { font-size: 1.12rem; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: .89rem; }
.side-icon, .lesson-icon { display: inline-grid; place-items: center; background: var(--soft); color: var(--warm); border-radius: 12px; width: 41px; height: 41px; margin-bottom: 9px; }
.summary .progress { margin-top: 12px; height: .58rem; }
.side-foot { display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--line); margin-top: 13px; padding-top: 11px; }
.next .eyebrow { font-size: .65rem; color: var(--warm); margin-bottom: 5px; }
.next p:last-child { display: flex; align-items: center; gap: 6px; }
.profiles h1 { margin-top: .45rem; }
.profiles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin: 1.5rem 0 1rem; }
.domains-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 15px; margin-top: 1.5rem; }
.domain-card { display: flex; flex-direction: column; gap: 8px; }
.domain-card h2 { margin-bottom: 0; }
.domain-card .raised { align-self: start; margin-top: auto; }
.domain-card.future .side-icon { color: var(--muted); background: var(--track); }
.domain-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.domain-top .side-icon { margin-bottom: 0; }
.domain-count { color: var(--muted); font-size: .8rem; font-weight: 650; }
.profile-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; overflow-wrap: anywhere; }
.profile-title h2 { margin: 0; }
.profile-card form { display: grid; gap: 6px; margin: .9rem 0; }
.profile-input { display: flex; flex-wrap: wrap; gap: 7px; }
.profile-input input { flex: 1 1 100px; min-width: 0; }
input:not([type="range"], [type="radio"], [type="checkbox"], [type="file"]), select { min-height: 44px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; }
.settings { margin: 1rem 0; }
.settings h2, .settings p { margin-bottom: .65rem; }
.settings select { margin: 0 0 .8rem .45rem; }
.settings-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.text-button { background: none; border: none; color: var(--warm); padding: 8px 0; text-decoration: underline; cursor: pointer; text-align: left; }
.course { max-width: 780px; margin: 0 auto; padding: 24px 28px 42px; }
.course-top { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.icon-button { width: 46px; height: 46px; flex: none; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; }
.course-percent { min-width: 4ch; text-align: right; color: var(--muted); font-weight: 750; font-size: .83rem; }
.course-main { margin-top: clamp(22px, 5vw, 46px); }
.course-main h1 { margin: .42rem 0 1rem; font-size: clamp(1.64rem, 4vw, 2.8rem); }
.question-scenario { color: var(--muted); max-width: 60ch; margin: .55rem 0 .7rem; font-size: 1.05rem; }
.question-scenario p + p { margin-top: .3rem; }
.test-review .question-scenario { margin-top: 0; }
.course-main .raised.primary { margin-top: 15px; }
.intro { max-width: 640px; }
.intro-notes { padding: 8px 18px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 12px; margin-top: 17px; }
.intro-notes p { margin: 9px 0; }
.intro-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 15px; }
.course-main .intro-actions .raised { margin-top: 0; }
.batch-list { display: grid; gap: 14px; margin: 24px 0; }
.batch-group .batch-list { margin-top: 12px; }
.batch-series h3 { font-size: 1.12rem; margin-bottom: 6px; }
.batch-index { display: flex; gap: 16px; margin: 16px 0 28px; }
.batch-series .eyebrow { margin: 0 0 6px; }
.batch-series .intro-actions .raised { display: inline-flex; align-items: center; gap: 6px; }
.batch-link { display: inline-block; padding: 8px 0; }
.result-actions { justify-content: center; }
.test-review { margin: 1rem auto 0; max-width: 620px; text-align: left; }
.test-review summary { cursor: pointer; color: var(--warm); text-align: center; padding: .45rem; font-weight: 650; }
.test-review .card { margin-top: .55rem; }
.test-review .card ul { padding-left: 1.15rem; margin: .4rem 0 0; }
.intro-diagram { margin: 1rem 0 0; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px; }
.intro-diagram img { display: block; width: 100%; max-height: 230px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo-grid.single-photo { grid-template-columns: minmax(0, 1fr); }
.photo-tile {
  position: relative; padding: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
  background: var(--paper); color: var(--ink); cursor: zoom-in;
}
.photo-tile img { height: auto; aspect-ratio: 3 / 2; max-height: none; object-fit: contain; }
.photo-tile span {
  position: absolute; bottom: 5px; left: 5px; padding: 2px 8px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font-weight: 800;
}
.photo-credits { color: var(--warm); font-size: .85rem; margin-top: 7px; }
.photo-credits summary { cursor: pointer; padding: 4px; }
.photo-credits ul { padding-left: 1.25rem; }
.photo-credits a { color: inherit; }
.photo-dialog {
  max-width: min(920px, 95vw); max-height: 95vh; margin: auto; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink);
}
.photo-dialog::backdrop { background: rgb(0 0 0 / 78%); }
.photo-dialog header { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.photo-dialog img { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; }
.chapter-photo { align-self: center; width: 100%; max-width: 340px; }
.chapter-photo .photo-board { margin: 0; }
.chapter-photo .photo-tile span { display: none; }
.question .intro-diagram { margin-bottom: 12px; }
.sources, .help, .lesson-terms { margin: 13px 0 0; color: var(--warm); font-weight: 650; }
.sources summary, .help summary, .lesson-terms summary { cursor: pointer; padding: 7px 0; }
.lesson-insight .intro-notes { margin-top: 4px; color: var(--ink); font-weight: 450; }
.terms-table { width: 100%; border-collapse: collapse; background: var(--panel); color: var(--ink); font-size: .9rem; text-align: left; }
.terms-table th, .terms-table td { border: 1px solid var(--line); padding: 9px 11px; vertical-align: top; }
.terms-table thead { color: var(--warm); background: var(--soft); }
.terms-table td { font-weight: 500; }
.terms-table td span { display: block; color: var(--muted); font-size: .83rem; margin-top: 3px; }
.help p, .sources ul { color: var(--muted); margin: .2rem 0; font-weight: 450; }
.photo-clue { display: block; margin-bottom: .45rem; }
.choices { display: grid; gap: 9px; }
.choice { display: flex; align-items: center; gap: 10px; padding: .65rem .9rem; min-height: 55px; border: 1px solid var(--line); border-bottom-width: 4px; border-radius: 12px; background: var(--panel); cursor: pointer; font-weight: 600; }
.choice input { width: 20px; height: 20px; flex: none; accent-color: #a55325; margin: 0; }
.choice:has(input:checked) { border-color: var(--orange); background: var(--soft); }
.choice > span { flex: 1; }
.choice:has(:disabled) { cursor: default; }
.choice.right, .correction.right { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); background: var(--green-bg); color: var(--green); }
.choice.wrong, .correction.wrong { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); background: var(--red-bg); color: var(--red); }
.number-answer { display: grid; width: fit-content; gap: 7px; font-weight: 700; }
.number-answer input { width: 112px; margin-right: 8px; }
.correction { margin-top: 13px; padding: 12px 16px; border: 1px solid; border-radius: 12px; }
.correction:focus { outline: 2px solid currentColor; outline-offset: 2px; }
.correction strong { display: flex; gap: 7px; align-items: center; }
.correction ul { padding-left: 1.15rem; margin: .35rem 0 0; }
.correction p { margin-top: .35rem; }
.workshop { margin: 0 0 15px; padding: 12px 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3px 18px; align-items: center; }
.workshop figcaption { grid-column: 1 / -1; display: grid; }
.workshop figcaption span { color: var(--muted); font-size: .76rem; }
.workshop svg { width: 100%; height: auto; }
.workshop svg path { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.workshop svg .axis, .workshop svg .reference { stroke: var(--line); stroke-width: 1.5; stroke-dasharray: 4 4; }
.workshop svg .fixture, .workshop svg .force-arrow { stroke: var(--muted); }
.workshop svg #coil { stroke: var(--orange); }
.workshop svg #plate { fill: var(--warm); }
.workshop-values label, .force { display: flex; justify-content: space-between; gap: 8px; font-size: .87rem; }
.workshop-values output { color: var(--warm); font-weight: 800; white-space: nowrap; }
.workshop-values input { width: 100%; accent-color: #b26333; height: 28px; margin: 0; }
.force { margin-top: 5px; padding-top: 6px; border-top: 1px solid var(--line); }
.result { text-align: center; }
.result .lesson-icon { width: 92px; height: 92px; border-radius: 26px; }
.result h1 { margin-bottom: 0; }
.scorecards { display: grid; grid-template-columns: repeat(2, minmax(0, 200px)); justify-content: center; gap: 12px; margin: 20px 0 13px; }
.scorecards .card { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); }
.scorecards strong { font-size: 1.7rem; color: var(--warm); }
@media (max-width: 1030px) {
  .shell { grid-template-columns: 161px minmax(0, 1fr); }
  .main { padding-inline: 23px; }
  .path-grid { grid-template-columns: minmax(0, 1fr) 190px; gap: 17px; }
  .tile-status { max-width: 11ch; text-align: right; }
  .chassis { right: -6%; width: 65%; opacity: .8; }
}
@media (max-width: 790px) {
  .shell { display: block; }
  .rail { position: static; display: contents; }
  .brand { position: absolute; top: 10px; left: 12px; z-index: 2; }
  .rail nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); margin: 0; }
  .rail nav button { justify-content: center; gap: 5px; padding-inline: 2px; font-size: .85rem; }
  .offline, .crumb { display: none; }
  .top { height: 66px; justify-content: end; padding: 0 12px 0 148px; gap: 7px; }
  .main { padding-bottom: 85px; }
}
@media (max-width: 590px) {
  .main { padding-inline: 14px; padding-top: 14px; }
  .profile-pill { padding-inline: 6px; }
  .profile-pill > span:last-child { max-width: 82px; }
  .hero { padding: 21px; min-height: 315px; align-items: start; border-radius: 17px; }
  .hero[data-domain="culture"] { flex-direction: column; gap: 16px; }
  .hero h1 { font-size: clamp(2.4rem, 10vw, 3.35rem); }
  .hero p:not(.eyebrow) { max-width: 28ch; }
  .chassis { right: -11%; bottom: -5%; width: 77%; opacity: .53; }
  .hero:is([data-domain="culture"], [data-domain="diagnostic"], [data-domain="physique"], [data-domain="materiaux"]) .chassis { right: 0; bottom: -1%; width: 72%; }
  .path-grid { display: block; margin-top: 21px; }
  .summary { display: none; }
  .section-head { align-items: start; }
  .count { margin-top: .9rem; font-size: .72rem; }
  .stop { grid-template-columns: 43px minmax(0, 1fr); gap: 8px; }
  .milestone { width: 43px; height: 45px; }
  .stops::before { left: 21px; }
  .tile { padding-inline: 8px; }
  .tile-copy strong { font-size: .91rem; }
  .tile-status { font-size: .65rem; }
  .profiles-grid { grid-template-columns: 1fr; }
  .course { padding: 14px 13px 36px; }
  .course-top { gap: 10px; }
  .workshop { grid-template-columns: 1fr; gap: 0; }
  .workshop svg { max-height: 82px; }
  .workshop-values input { height: 37px; }
}
@media (max-width: 365px) {
  .profile-pill > span:last-child { display: none; }
  .tile-right { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
}
