
.ai-main{max-width:1080px;margin:0 auto;padding:28px 20px 65px;color:var(--text,#172c49)}
.ai-hero{background:linear-gradient(120deg,#172c49,#294d69);color:white;border-radius:20px;padding:30px;margin-top:20px}
.ai-kicker{font-size:12px;letter-spacing:.08em;color:#a9d6d3;font-weight:700}.ai-hero h1{color:white;margin:12px 0}.ai-hero p{color:#d8e4ee;margin:0}
.chapter-selector{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:24px 0}
.chapter-choice{font:inherit;text-align:left;display:flex;flex-direction:column;gap:8px;min-width:0;border:1px solid #cbd5e1;border-radius:15px;padding:18px;background:var(--card,#fff);color:inherit;cursor:pointer}
.chapter-choice b{font-size:14px;color:#3478B8}.chapter-choice span{font-size:17px;font-weight:700}.chapter-choice small{font-size:12px;opacity:.75;line-height:1.5}
.chapter-choice.active{border:2px solid #3478B8;box-shadow:0 4px 15px #387f8222}
.ai-chapter-head span{font-size:12px;color:#3478B8;font-weight:700;letter-spacing:.06em}.ai-chapter-head h2{margin:6px 0 15px}
.ai-tabs{display:flex;gap:9px;flex-wrap:wrap;margin:16px 0}.ai-tabs button{font:inherit;border:1px solid #cbd5e1;background:var(--card,#fff);color:inherit;padding:11px 14px;border-radius:11px;cursor:pointer}
.ai-tabs button[aria-selected=true]{background:#172c49;color:white;border-color:#172c49}
.ai-panel{border:1px solid #d6dfe8;border-radius:18px;padding:22px;background:var(--card,#fff);min-width:0}.ai-panel[hidden]{display:none!important}
.ai-video{aspect-ratio:16/9;background:#172c49;border-radius:14px;color:white;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:10px;padding:20px}.ai-video p{color:#c8d6e6;font-size:14px}.ai-play{font-size:30px;border:2px solid #b2d4d5;border-radius:50%;width:68px;height:68px;display:grid;place-items:center}
.ai-sheet{line-height:1.7}.ai-sheet h4{margin:20px 0 4px;color:#3478B8;font-size:16px}.ai-sheet p{margin:0 0 10px}
.ai-top{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:#3478B8;font-weight:700;margin-bottom:12px}
.ai-meter{height:7px;background:#e4eaf0;border-radius:20px;overflow:hidden;margin-bottom:18px}.ai-meter span{display:block;background:#3478B8;height:100%;transition:width .2s}
.ai-card{appearance:none;-webkit-appearance:none;display:flex!important;flex-direction:column;justify-content:space-between;align-items:center;text-align:center;width:100%!important;min-width:0;min-height:275px;box-sizing:border-box;background:#EAF2FA;color:#172c49;border:1px solid #a5d1c9;border-radius:17px;padding:25px 20px;cursor:pointer;font:inherit;gap:25px}
.ai-card.flipped{background:#172c49;color:white;border-color:#172c49}.ai-card strong{font-size:clamp(19px,4.5vw,26px);line-height:1.35;overflow-wrap:anywhere}.ai-card small,.ai-card span{font-size:12px;opacity:.8}
.ai-actions{display:flex;gap:10px;justify-content:space-between;margin-top:15px}.ai-actions button,.ai-primary{font:inherit;border:0;border-radius:10px;background:#3478B8;color:white;padding:12px 18px;cursor:pointer}.ai-actions button:disabled,.ai-primary:disabled{opacity:.4;cursor:not-allowed}
.ai-option{display:block;width:100%;font:inherit;text-align:left;margin:9px 0;padding:14px;border:1px solid #cbd5e1;border-radius:10px;background:var(--card,#fff);color:inherit;cursor:pointer}.ai-option.selected{border:2px solid #8270a8}.ai-option.correct{border-color:#3478B8;background:#EAF2FA;color:#172c49}.ai-option.incorrect{border-color:#c16e78;background:#f8e9ec;color:#172c49}
.ai-feedback{background:var(--surface,#edf1f5);padding:13px;border-radius:10px}.ai-primary{margin-top:10px}
.ai-map-center{margin:auto;max-width:380px;text-align:center;background:#172c49;color:white;padding:20px;border-radius:15px;font-weight:700}.ai-map-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:22px 0}.ai-map-node{font:inherit;font-weight:600;border:2px solid var(--accent);border-radius:12px;padding:17px 10px;background:var(--card,#fff);color:inherit;cursor:pointer;position:relative}.ai-map-node.active{box-shadow:0 0 0 3px #387f8230}.ai-detail{padding:16px;border-radius:12px;background:var(--surface,#edf1f5)}
body[data-theme=dark] .ai-panel,html[data-theme=dark] .ai-panel,body.dark .ai-panel{border-color:#42516a}
@media(max-width:650px){.ai-main{padding:18px 12px 50px}.ai-hero{padding:22px}.chapter-selector{grid-template-columns:1fr}.ai-panel{padding:15px}.ai-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.ai-tabs button{font-size:13px;padding:10px 6px}.ai-map-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ai-card{min-height:290px}.ai-video{min-height:210px}}

/* Study BFA — correctifs de contraste, de thèmes et de mise en page */
.ai-main{--card:#ffffff;--text:#172c49;color:var(--text);}
html[data-theme="dark"] .ai-main{--card:#182439;--text:#e2eaf6;--surface:#1d2b41;color:var(--text)}
.ai-panel{background:var(--card);color:var(--text);border-color:var(--line,#d6dfe8)}
.ai-panel h3,.ai-panel h2,.ai-chapter-head h2{color:var(--text)}
.ai-sheet{color:var(--text)}
.ai-sheet p,.ai-sheet li,.ai-panel>p{color:var(--text)}
.ai-sheet h4{color:#26787b}
.ai-video{aspect-ratio:auto;min-height:280px;height:clamp(280px,34vw,420px);max-height:420px;color:#fff}
.ai-video strong,.ai-video p,.ai-video .ai-play{color:#fff}
.ai-video p{color:#d6e5f2}
.ai-chapter-head span,.ai-top{color:#3478B8}
.ai-map-node,.chapter-choice,.ai-tabs button,.ai-option{background:var(--card);color:var(--text)}
.ai-detail,.ai-feedback{background:var(--surface,#edf1f5);color:var(--text)}
html[data-theme="dark"] .ai-sheet h4,html[data-theme="dark"] .ai-chapter-head span,html[data-theme="dark"] .ai-top,html[data-theme="dark"] .chapter-choice b{color:#8ed2ce}
html[data-theme="dark"] .ai-hero h1,html[data-theme="dark"] .ai-hero p{color:#fff}
html[data-theme="dark"] .ai-hero p{color:#d8e4ee}
html[data-theme="dark"] .ai-panel h3,html[data-theme="dark"] .ai-panel h2,html[data-theme="dark"] .ai-chapter-head h2{color:#e2eaf6}
html[data-theme="dark"] .ai-sheet p,html[data-theme="dark"] .ai-sheet li,html[data-theme="dark"] .ai-panel>p{color:#e2eaf6}
html[data-theme="dark"] .ai-video strong,html[data-theme="dark"] .ai-video .ai-play{color:#fff}
html[data-theme="dark"] .ai-video p{color:#d6e5f2}
html[data-theme="dark"] .ai-card:not(.flipped){background:#233f46;color:#f2fffd;border-color:#548b84}
html[data-theme="dark"] .ai-card.flipped{background:#10263e;color:#fff;border-color:#6487ac}
html[data-theme="dark"] .ai-tabs button[aria-selected="true"]{background:#345f85;color:#fff;border-color:#75a5c9}
html[data-theme="dark"] .ai-option.correct{background:#204c44;color:#edfff9;border-color:#6ac6ab}
html[data-theme="dark"] .ai-option.incorrect{background:#512e3b;color:#fff0f3;border-color:#d48d9d}
html[data-theme="dark"] .ai-map-center{background:#10263e;color:#fff}
html[data-theme="dark"] .ai-detail,html[data-theme="dark"] .ai-feedback{background:#24344c;color:#e2eaf6}
html[data-theme="dark"] .ai-map-node{border-color:var(--accent,#6487ac)}
@media(max-width:650px){.ai-video{height:auto;min-height:235px;max-height:none}.ai-main{overflow-wrap:anywhere}}
