/* BoubouStudies — même esprit que BoubouEnglish : boutons épais, retours francs, police arrondie du système. */
:root {
  --bg: #f7f7fb; --panel: #ffffff; --ink: #1b1c2b; --muted: #6f7186; --line: #e3e4ee; --line-d: #cfd1df;
  --pri: #5b5cf0; --pri-d: #4243c9; --pri-ink: #ffffff; --pri-soft: #ececfe;
  --ok: #2bb24c; --ok-d: #1f8b3a; --ok-soft: #dcf7e3; --ok-ink: #17742f;
  --ko: #ef4b4b; --ko-d: #c43333; --ko-soft: #ffe3e1; --ko-ink: #b42626;
  --warn: #f5a524; --warn-d: #cc8410; --warn-soft: #fff1d4; --warn-ink: #9a6000;
  --gold: #ffb020; --flame: #ff7a1a;
  --t-vocab: #5b5cf0; --t-gram: #13a8c9; --t-ear: #e0518f; --t-sprint: #f5a300;
  --nav: rgba(255, 255, 255, .92); --r: 20px; --spring: cubic-bezier(.2, .9, .25, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12131b; --panel: #1c1d29; --ink: #f1f1f7; --muted: #9c9eb4; --line: #2c2e3e; --line-d: #3a3d52;
    --pri: #7b7cff; --pri-d: #5556d6; --pri-soft: #272852;
    --ok: #3ccc61; --ok-d: #23963f; --ok-soft: #143222; --ok-ink: #6ee38c;
    --ko: #ff6363; --ko-d: #c63c3c; --ko-soft: #3a1a1c; --ko-ink: #ff8f8f;
    --warn: #ffb53d; --warn-d: #c98515; --warn-soft: #3a2b10; --warn-ink: #ffc96b;
    --nav: rgba(28, 29, 41, .92);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 17px/1.5 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
input, textarea, select, button { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; text-align: inherit; }
a { color: inherit; }
svg.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; }
svg.i.fill { fill: currentColor; stroke: none; }
h1 { font-size: 1.85rem; line-height: 1.1; letter-spacing: -.02em; font-weight: 800; margin: 0 0 .4rem; }
h2 { font-size: 1.2rem; line-height: 1.25; font-weight: 800; margin: 0 0 .5rem; }
h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 800; margin: 1.7rem 4px .65rem; display: flex; align-items: center; gap: 6px; }
p { margin: .5rem 0; }
code { font-size: .8em; background: var(--line); padding: 1px 5px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); font-size: .92rem; } .small { font-size: .82rem; } .center { text-align: center; } .lead { font-size: 1.1rem; } .grow { flex: 1; min-width: 0; }
.muted b { color: var(--ink); }
.bigemoji { font-size: 3.4rem; line-height: 1.1; margin-bottom: .4rem; } .pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

#app { max-width: 600px; margin: 0 auto; min-height: 100vh; }
.page { padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 104px); animation: pageIn .35s var(--spring); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.page.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding-bottom: 40px; text-align: center; }

nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px; padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px); background: var(--nav); border-top: 2px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
nav button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 14px; font-size: .72rem; font-weight: 800; color: var(--muted); text-align: center; }
nav button .i { width: 1.5rem; height: 1.5rem; }
nav button.on { color: var(--pri); background: var(--pri-soft); }
body.focus nav { display: none; }

/* ---------- boutons épais ---------- */
.btn { --c: var(--pri); --cd: var(--pri-d); display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 14px 18px; border-radius: 16px; background: var(--c); color: #fff; font-weight: 800; font-size: 1rem; letter-spacing: .04em; text-transform: uppercase; text-align: center; margin-top: 12px; box-shadow: 0 4px 0 var(--cd); transition: transform 90ms ease-out, box-shadow 90ms ease-out; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--cd); }
.btn:disabled { --c: var(--line); --cd: var(--line-d); color: var(--muted); cursor: default; }
.btn.ghost { background: var(--panel); color: var(--pri); box-shadow: 0 4px 0 var(--line-d), inset 0 0 0 2px var(--line); }
.btn.ghost:disabled { color: var(--muted); }
.btn.ghost:active:not(:disabled) { box-shadow: 0 0 0 var(--line-d), inset 0 0 0 2px var(--line); }
.btn.danger { background: var(--panel); color: var(--ko); box-shadow: 0 4px 0 var(--line-d), inset 0 0 0 2px var(--line); }
.btn.green { --c: var(--ok); --cd: var(--ok-d); }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: .85rem; }
.link { color: var(--pri); font-weight: 700; margin-top: .8rem; font-size: .95rem; display: inline-flex; gap: 6px; align-items: center; } .link.danger { color: var(--ko); display: flex; justify-content: center; width: 100%; margin-top: 1.6rem; }
.lnk { color: var(--pri); font-weight: 700; }
.back { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); flex: none; }
.ib { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); } .ib:hover { background: var(--line); }

/* ---------- blocs ---------- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.hello { font-size: .95rem; color: var(--muted); font-weight: 700; }
.chips { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); font-weight: 800; font-variant-numeric: tabular-nums; }
.chip.flame { color: var(--flame); } .chip.flame.off { color: var(--muted); } .chip .i { width: 1.15em; height: 1.15em; }
.chip.st { font-size: .8rem; color: var(--pri); } .chip.st.ancien { color: var(--warn-ink); background: var(--warn-soft); }
.panel { background: var(--panel); border-radius: var(--r); padding: 18px; margin: 12px 0; display: block; width: 100%; box-shadow: inset 0 0 0 2px var(--line); }
.panel > :first-child { margin-top: 0; } .panel p:last-child { margin-bottom: 0; }
.panel.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.panel.warn { background: var(--warn-soft); color: var(--warn-ink); box-shadow: none; }
button.panel { box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line-d); transition: transform 90ms, box-shadow 90ms; }
button.panel:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line-d); }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }

.lvl .lvlrow { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.meter { height: 12px; background: var(--line); border-radius: 12px; overflow: hidden; } .meter.big { height: 16px; }
.meter i { display: block; height: 100%; border-radius: 12px; background: var(--ok); transition: width .5s var(--spring); } .meter i.o2 { background: linear-gradient(90deg, var(--pri), #d9539a); }
.goalrow { display: flex; align-items: center; gap: 10px; margin: 12px 2px 0; font-size: .82rem; color: var(--muted); font-weight: 700; }
.goal { flex: 1; height: 12px; border-radius: 12px; background: var(--line); overflow: hidden; } .goal i { display: block; height: 100%; background: var(--gold); border-radius: 12px; transition: width .5s var(--spring); }
.hero { position: relative; overflow: hidden; padding: 20px; border-radius: var(--r); background: linear-gradient(150deg, var(--hc, #5b5cf0) 0%, #8f5cf0 60%, #d9539a 100%); color: #fff; box-shadow: 0 6px 0 rgba(0, 0, 0, .2); margin: 16px 0; }
.hero h2 { font-size: 1.45rem; margin-bottom: .2rem; } .hero .muted { color: rgba(255, 255, 255, .85); }
.hero .btn { --c: #fff; --cd: rgba(0, 0, 0, .2); color: var(--pri-d); margin-top: 16px; }
.hero .ring { position: absolute; right: -28px; top: -28px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .grid2 .btn { margin-top: 12px; padding: 12px 6px; letter-spacing: .02em; font-size: .92rem; min-width: 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tiles { margin: 14px 0 0; }
.tilebtn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel); border-radius: var(--r); padding: 16px 6px 12px; font-weight: 800; font-size: .92rem; text-align: center; box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line-d); transition: transform 90ms, box-shadow 90ms; }
.tilebtn small { color: var(--muted); font-weight: 600; font-size: .75rem; } .tilebtn:active { transform: translateY(4px); box-shadow: inset 0 0 0 2px var(--line), 0 0 0 var(--line-d); }
.bub { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; color: #fff; background: var(--tc, var(--pri)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15); flex: none; font-size: 1.4rem; }
.bub .i { width: 55%; height: 55%; } .bub.s { width: 38px; height: 38px; border-radius: 11px; font-size: 1.1rem; }
.course { display: flex; align-items: center; gap: 14px; padding: 14px; } .course .ct { flex: 1; min-width: 0; display: flex; flex-direction: column; } .course .ct b { font-size: 1.05rem; }
.ringm { flex: none; } .ringm .rb { fill: none; stroke: var(--line); stroke-width: 4; } .ringm .rf { fill: none; stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray .6s var(--spring); }
.ringm text { font-size: 10px; font-weight: 800; fill: var(--ink); } .ringm.g .rf { stroke: var(--ok); } .ringm.o .rf { stroke: var(--warn); } .ringm.r .rf { stroke: var(--ko); }
.statc { background: var(--panel); border-radius: var(--r); padding: 12px 6px; text-align: center; box-shadow: inset 0 0 0 2px var(--line); } .statc b { display: block; font-size: 1.35rem; line-height: 1.2; font-weight: 800; } .statc span { color: var(--muted); font-size: .78rem; font-weight: 600; }
.kpis { margin: 14px 0 4px; }
.chhead { display: flex; gap: 14px; align-items: center; }
.list { padding: 4px 14px; } .row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 0; } .row + .row { border-top: 2px solid var(--line); } .row .grow { display: flex; flex-direction: column; } .row u { text-decoration: none; color: var(--t-gram); font-weight: 800; }
.doc { display: flex; align-items: center; gap: 10px; padding: 8px 0; } .doc + .doc { border-top: 2px solid var(--line); } .doc .grow { display: flex; flex-direction: column; } .doc b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adddoc { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; flex-wrap: wrap; } .adddoc .btn { margin: 0; flex: 1; min-width: 120px; min-height: 48px; font-size: .8rem; } .adddoc select { flex: 0 0 100%; }

/* ---------- formulaires ---------- */
label { display: block; font-weight: 700; font-size: .9rem; margin-top: 12px; }
label.field { margin-top: 10px; }
input:not([type=checkbox]):not([type=file]), select, textarea { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-size: 1rem; font-weight: 600; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--pri); }
textarea { resize: vertical; line-height: 1.4; }
.num-in { width: 100px !important; margin: 0 !important; text-align: center; }
.seg { display: flex; gap: 6px; background: var(--line); padding: 4px; border-radius: 16px; margin: 10px 0; } .seg button { flex: 1; padding: 10px 6px; border-radius: 12px; font-weight: 800; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; color: var(--muted); }
.seg button small { font-weight: 600; font-size: .68rem; } .seg button.on { background: var(--panel); color: var(--pri); box-shadow: 0 2px 0 var(--line-d); }
.seg.mini button { flex-direction: row; gap: 6px; padding: 7px 4px; font-size: .85rem; }
.dotp { width: 9px; height: 9px; border-radius: 50%; background: var(--line-d); flex: none; display: inline-block; } .dotp.on { background: var(--ok); }
.set { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; font-weight: 700; } .set + .set { border-top: 2px solid var(--line); }
.sw { position: relative; width: 52px; height: 32px; margin: 0; } .sw input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; background: var(--line-d); border-radius: 32px; transition: .2s; } .sw i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: .2s; }
.sw input:checked + i { background: var(--ok); } .sw input:checked + i::after { transform: translateX(20px); }
.aiset + .aiset { border-top: 2px solid var(--line); margin-top: 10px; padding-top: 6px; } .aih { display: flex; align-items: center; gap: 8px; } .aih small { color: var(--muted); margin-left: auto; font-weight: 600; }
.pick { display: flex; align-items: center; gap: 12px; margin: 10px 0; cursor: pointer; } .pick input { width: 22px; height: 22px; margin: 0; accent-color: var(--pri); flex: none; } .pick .grow { display: flex; flex-direction: column; font-weight: 400; }

.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 20, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 600px; max-height: 92vh; overflow: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 20px 16px calc(env(safe-area-inset-bottom) + 20px); animation: slideUp .3s var(--spring); } .sheet.center { text-align: center; }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 96px); transform: translateX(-50%); z-index: 80; max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .92rem; animation: pop .3s var(--spring); }
.toast.ko { background: var(--ko); color: #fff; } .toast.ok { background: var(--ok-d); color: #fff; } .toast.out { opacity: 0; transition: opacity .35s; }
@keyframes pop { from { transform: translate(-50%, 14px); opacity: 0; } }

/* ---------- pieuvre ---------- */
.octowrap { margin: 10px -6px 0; }
.octo { width: 100%; height: auto; display: block; overflow: visible; }
.octo .tent { cursor: pointer; transform-origin: 180px 120px; animation: sway 6s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.9s); }
@keyframes sway { from { transform: rotate(-.9deg); } to { transform: rotate(.9deg); } }
.octo .tbase { fill: none; stroke: var(--c); stroke-opacity: .22; stroke-width: 14; stroke-linecap: round; }
.octo .tfill { fill: none; stroke: var(--c); stroke-width: 14; stroke-linecap: round; }
.octo .tent:hover .tbase { stroke-opacity: .4; }
.octo .dot { fill: var(--panel); stroke: var(--c); stroke-width: 3; cursor: help; transition: r .15s; } .octo .dot:hover, .octo .dot:focus { r: 8; fill: var(--gold); outline: none; }
.octo .nbg { fill: var(--panel); stroke: var(--line); stroke-width: 3; } .octo .node { cursor: pointer; outline: none; transform-box: fill-box; transform-origin: center; transition: transform .15s; } .octo .node:hover, .octo .node:focus { transform: scale(1.08); }
.octo .nring { fill: none; stroke-width: 7; stroke-linecap: round; } .octo .node.r .nring { stroke: var(--ko); } .octo .node.o .nring { stroke: var(--warn); } .octo .node.g .nring { stroke: var(--ok); } .octo .node.n .nring { stroke: var(--line-d); }
.octo .npct { font-size: 14px; font-weight: 800; fill: var(--ink); text-anchor: middle; }
.octo .nlab { font-size: 13.5px; font-weight: 800; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.octo .hbody { filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .12)); } .octo .htitle { font-size: 17px; font-weight: 800; fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(0, 0, 0, .25); stroke-width: 3px; }
.octo .eyes { animation: blink 5s infinite; transform-origin: 180px 120px; } @keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.octo .head { animation: bob 4s ease-in-out infinite alternate; } @keyframes bob { to { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .octo .tent, .octo .eyes, .octo .head, .pulse { animation: none; } }

/* ---------- infobulles des symboles ---------- */
.sym { border-bottom: 2px dotted var(--pri); cursor: help; font-weight: 700; color: var(--pri); border-radius: 3px; outline: none; } .sym:hover, .sym:focus { background: var(--pri-soft); }
.symlist { display: flex; flex-wrap: wrap; gap: 8px; } .chipsym { border: 0 !important; padding: 6px 12px; background: var(--pri-soft); font-size: 1.05rem; border-radius: 12px; }
#tip { position: fixed; left: 0; top: 0; z-index: 90; max-width: 280px; padding: 10px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: .88rem; line-height: 1.35; pointer-events: none; opacity: 0; transition: opacity .12s; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
#tip.on { opacity: 1; } #tip b { display: block; margin-bottom: 2px; color: var(--gold); } #tip span { display: block; }

/* ---------- chapitre ---------- */
.fiche p { margin: .45rem 0; } .fiche ul, .notion ul { margin: .4rem 0; padding-left: 1.2rem; } .fiche li { margin: .25rem 0; } .fiche strong { color: var(--pri); }
.notion { padding: 8px 0; } .notion + .notion { border-top: 2px solid var(--line); } .notion summary { font-weight: 800; cursor: pointer; padding: 4px 0; } .notion p { margin: .3rem 0 .3rem; color: var(--muted); }

/* ---------- exercices ---------- */
.exopage { padding-bottom: calc(env(safe-area-inset-bottom) + 40px); }
.exohead { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; } .exohead .prog { flex: 1; height: 14px; }
.tag { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; font-size: .85rem; margin: 6px 2px; }
.lvldots { display: inline-flex; gap: 4px; } .lvldots i { width: 12px; height: 12px; border-radius: 50%; background: var(--line-d); } .lvldots i.on { background: var(--gold); }
.method { background: var(--pri-soft); box-shadow: none; } .method h3 { margin: 0 0 .5rem; color: var(--pri); } .method p { margin: .35rem 0; }
.stmt { font-size: 1.12rem; } .stmt p { margin: .3rem 0; }
.choices { display: grid; gap: 10px; margin: 12px 0; } .choice { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line-d); font-weight: 700; transition: transform 90ms, box-shadow 90ms; }
.choice b { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--line); flex: none; font-size: .85rem; } .choice p { margin: 0; }
.choice.sel { box-shadow: inset 0 0 0 2px var(--pri), 0 3px 0 var(--pri-d); background: var(--pri-soft); } .choice.sel b { background: var(--pri); color: #fff; }
.choice.good { box-shadow: inset 0 0 0 2px var(--ok), 0 3px 0 var(--ok-d); background: var(--ok-soft); } .choice.good b { background: var(--ok); color: #fff; }
.choice.bad { box-shadow: inset 0 0 0 2px var(--ko), 0 3px 0 var(--ko-d); background: var(--ko-soft); animation: shake .35s; } .choice.bad b { background: var(--ko); color: #fff; }
.choice:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.ans { margin: 12px 0 !important; font-size: 1.2rem !important; text-align: center; }
textarea.ans { text-align: left; font-size: 1rem !important; }
.hintb { display: flex; gap: 10px; background: var(--warn-soft); color: var(--warn-ink); border-radius: 14px; padding: 10px 14px; margin: 8px 0; animation: pageIn .3s; } .hintb p { margin: 0; } .hintb .i { margin-top: 3px; }
.exoact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .exoact .btn { margin-top: 8px; }
.chatpane { margin-top: 10px; }
.fb { margin-top: 18px; padding: 16px; border-radius: 20px; animation: slideUp .3s var(--spring); } .fb.ok { background: var(--ok-soft); color: var(--ok-ink); } .fb.ko { background: var(--ko-soft); color: var(--ko-ink); }
.fbh { display: flex; gap: 12px; align-items: center; } .fbh b { font-size: 1.25rem; display: block; } .fbh > div > span { display: block; font-weight: 700; } .fbi { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--ok); color: #fff; flex: none; } .fb.ko .fbi { background: var(--ko); } .fbi .i { width: 26px; height: 26px; stroke-width: 3; }
.fb .sol { margin-top: 10px; color: var(--ink); background: var(--panel); border-radius: 14px; padding: 4px 14px; } .fb .sol p { margin: .5rem 0; }
.panel.sol h3 { margin: 0 0 .4rem; }
.chg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; } .pill { padding: 5px 12px; border-radius: 999px; background: var(--panel); color: var(--ink); font-weight: 700; font-size: .8rem; } .pill.up { background: var(--gold); color: #3a2800; } .pill.down { background: var(--panel); color: var(--muted); }
.fb .btn { margin-top: 14px; }
.xppop { position: fixed; z-index: 70; transform: translateX(-50%); font-weight: 900; font-size: 1.5rem; color: var(--gold); text-shadow: 0 2px 0 rgba(0, 0, 0, .25); pointer-events: none; animation: xpup 1.1s ease-out forwards; } @keyframes xpup { to { transform: translate(-50%, -70px); opacity: 0; } }
#confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.gate .btn { margin-top: 12px; } .done .kpis { width: 100%; }

/* ---------- flashcards ---------- */
.fcard { display: block; width: 100%; perspective: 1000px; margin: 14px 0; } .fin { position: relative; min-height: 270px; transition: transform .5s var(--spring); transform-style: preserve-3d; } .fcard.flipped .fin { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--r); padding: 22px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line), 0 5px 0 var(--line-d); display: flex; flex-direction: column; justify-content: center; text-align: center; font-size: 1.2rem; font-weight: 700; }
.face small { position: absolute; top: 14px; left: 0; right: 0; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-size: .7rem; } .face p { margin: .3rem 0; }
.face.back { transform: rotateY(180deg); background: var(--pri-soft); } .face .tap { position: absolute; bottom: 14px; left: 0; right: 0; font-size: .78rem; font-weight: 600; color: var(--muted); }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .gbtn { padding: 14px 2px 10px; border-radius: 14px; font-weight: 800; font-size: .8rem; text-align: center; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 4px 0 rgba(0, 0, 0, .22); } .gbtn:active { transform: translateY(4px); box-shadow: none; }
.gbtn kbd { font: inherit; font-size: .7rem; opacity: .7; } .g0 { background: var(--ko); } .g1 { background: var(--warn); } .g2 { background: var(--ok); } .g3 { background: var(--pri); }

/* ---------- prof IA ---------- */
.chat .msgs { max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; margin: 8px 0; padding: 4px 2px; scroll-behavior: smooth; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 18px; font-weight: 500; line-height: 1.45; word-wrap: break-word; } .msg p { margin: .3rem 0; } .msg ul { margin: .3rem 0; padding-left: 1.2rem; }
.msg.me { align-self: flex-end; background: var(--pri); color: #fff; border-bottom-right-radius: 6px; } .msg.ai { align-self: flex-start; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); border-bottom-left-radius: 6px; } .msg.ai small { display: block; color: var(--muted); font-weight: 800; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.msg.ai .sym { color: var(--pri); }
.hint { text-align: center; margin: 14px 0; }
.send { display: flex; gap: 8px; align-items: flex-end; } .send textarea { margin: 0; flex: 1; max-height: 140px; } .sendb { width: 52px; min-height: 48px !important; padding: 0 !important; margin: 0 !important; flex: none; } 
.dots { display: inline-flex; gap: 4px; } .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; } .dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; } @keyframes dot { 50% { transform: translateY(-5px); opacity: .5; } }
.grid-ai { display: grid; gap: 10px; } .ai .aih { margin-bottom: 8px; } .ai .aitext p { margin: .4rem 0; } .ai.err { background: var(--ko-soft); } .ai.load { text-align: center; } .ai .grid2 { margin-top: 6px; }
.srow { display: flex; align-items: center; gap: 10px; padding: 8px 0; } .srow + .srow { border-top: 2px solid var(--line); } .srow .grow { display: flex; flex-direction: column; } .srow .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.acts { margin-top: 4px; }
@media (min-width: 700px) { .grid-ai { grid-template-columns: 1fr 1fr; } .octo { max-width: 460px; margin: 0 auto; } }

/* ---------- dépôt de fichiers ---------- */
.drops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 26px 16px; border-radius: var(--r); border: 3px dashed var(--line-d); background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.drop:hover, .drop.over { border-color: var(--pri); background: var(--pri-soft); }
.drop.over { transform: scale(1.02); } .drop.busy { opacity: .7; pointer-events: none; }
.drop.small { padding: 16px; margin-top: 12px; flex-direction: column; } .drop.small > .i { width: 1.6rem; height: 1.6rem; color: var(--pri); }
.drop .seg { margin-top: 8px; width: 100%; max-width: 360px; }
.flist { list-style: none; padding: 0; margin: 8px 0 0; width: 100%; display: grid; gap: 6px; text-align: left; }
.flist li { display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 10px; padding: 6px 10px; font-weight: 600; font-size: .9rem; cursor: default; }
.flist li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .flist li small { color: var(--muted); } .flist li button { color: var(--muted); display: flex; }
.form2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; } .form2 label { margin-top: 8px; } .form2 .span2 { grid-column: 1 / -1; }
.brand { display: none; }
@media (max-width: 640px) { .drops, .form2 { grid-template-columns: 1fr; } nav .navnew { display: none; } }

/* ---------- ordinateur : barre latérale, contenu large, colonnes ---------- */
@media (min-width: 1000px) {
  body { font-size: 16px; }
  nav { top: 0; right: auto; width: 232px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 22px 14px; border-top: 0; border-right: 2px solid var(--line); }
  nav .brand { display: block; font-weight: 900; font-size: 1.15rem; padding: 4px 12px 18px; }
  nav button { flex: none; max-width: none; flex-direction: row; gap: 12px; padding: 12px 14px; font-size: .95rem; }
  nav button:hover { background: var(--line); color: var(--ink); } nav button.on:hover { background: var(--pri-soft); color: var(--pri); }
  nav .navnew { background: var(--pri); color: #fff; margin-bottom: 14px; box-shadow: 0 3px 0 var(--pri-d); } nav .navnew:hover, nav .navnew.on { background: var(--pri-d); color: #fff; }
  #app { max-width: none; margin: 0 0 0 232px; }
  .page { max-width: 760px; margin: 0 auto; padding: 36px 40px 60px; } .page.wide { max-width: 1180px; }
  body.focus nav { display: flex; }
  .cols { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .colL > h3:first-child, .colR > h3:first-child { margin-top: .6rem; }
  .sticky { position: sticky; top: 24px; }
  .exocols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .exocols .chatpane { margin-top: 0; }
  .exocols .chat .msgs { max-height: 58vh; }
  .octo { max-width: 520px; margin: 0 auto; }
  .btn { min-height: 50px; } .btn:hover:not(:disabled) { filter: brightness(1.06); }
  button.panel:hover, .tilebtn:hover, .choice:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--pri), 0 4px 0 var(--line-d); }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page.wide > .course, .page.wide > h3 { max-width: none; }
  .fcard, .grades { max-width: 640px; margin-left: auto; margin-right: auto; } .fin { min-height: 320px; }
  .toast { bottom: 32px; left: calc(50% + 116px); }
  .sheet-back { align-items: center; } .sheet { border-radius: 24px; max-width: 560px; }
}
@media (min-width: 1000px) { .cgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; } .cgrid .course { margin: 7px 0; } }

/* ---------- méthode A3 ---------- */
.note-b { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--pri-soft); color: var(--pri); font-weight: 700; font-size: .9rem; margin: 8px 0; } .note-b.warn { background: var(--warn-soft); color: var(--warn-ink); }
.chrono { font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 10px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); }
.draftl { margin-top: 12px; } .draftl textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92rem; }
.exoact.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .exoact.three .btn { font-size: .72rem; padding: 8px 4px; letter-spacing: 0; text-transform: none; }
.errpick { margin-top: 12px; color: var(--ink); } .chips2 { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips2 button { padding: 7px 12px; border-radius: 999px; background: var(--panel); font-weight: 700; font-size: .82rem; box-shadow: inset 0 0 0 2px var(--line); } .chips2 button.on { background: var(--ink); color: var(--bg); }
.recall { margin-top: 4px; } .recall textarea { margin: 0; } .mineb { background: var(--panel); border-radius: 14px; padding: 10px 14px; margin: 0 0 10px; box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; } .mineb small { display: block; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.fiche.masked > * { filter: blur(7px); user-select: none; transition: filter .3s; } .fiche { cursor: default; } .mlauto { margin: 0 0 0 auto; text-transform: none; letter-spacing: 0; }
.copy.ok { box-shadow: inset 0 0 0 2px var(--ok); } .copy.ko { box-shadow: inset 0 0 0 2px var(--ko); } .copy details { margin-top: 8px; } .copy summary { cursor: pointer; font-weight: 700; color: var(--pri); }
.hero.rep { background: linear-gradient(150deg, #f08a24 0%, #e0518f 100%); }
.dash .statc span { font-size: .72rem; } .errs .erow { display: grid; grid-template-columns: 170px 1fr 30px; gap: 10px; align-items: center; margin-top: 8px; font-size: .9rem; } .errs .erow b { text-align: right; }
.meter i.r { background: var(--ko); } .meter i.o { background: var(--warn); }
.devcode { margin-top: 12px; padding: 14px; border-radius: 14px; background: var(--pri-soft); } .devcode p { margin: .3rem 0; }
.bigcode { font: 800 2rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 10px; background: var(--panel); border-radius: 12px; margin: 6px 0; user-select: all; }
.warnline { background: var(--warn-soft); color: var(--warn-ink); padding: 10px 14px; border-radius: 12px; font-weight: 600; }

/* Base sombre par défaut (choix d'Arthur, 2026-11-20), quel que soit le réglage du système. */
:root {
    --bg: #12131b; --panel: #1c1d29; --ink: #f1f1f7; --muted: #9c9eb4; --line: #2c2e3e; --line-d: #3a3d52;
    --pri: #7b7cff; --pri-d: #5556d6; --pri-soft: #272852;
    --ok: #3ccc61; --ok-d: #23963f; --ok-soft: #143222; --ok-ink: #6ee38c;
    --ko: #ff6363; --ko-d: #c63c3c; --ko-soft: #3a1a1c; --ko-ink: #ff8f8f;
    --warn: #ffb53d; --warn-d: #c98515; --warn-soft: #3a2b10; --warn-ink: #ffc96b;
    --nav: rgba(28, 29, 41, .92);
  }
body { color-scheme: dark; }

/* ---------- TD découpés ---------- */
.kicker { display: block; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.hero .kicker { color: rgba(255, 255, 255, .8); }
.loader { font-size: 3.4rem; text-align: center; margin-top: 30vh; animation: pulse 1.4s ease-in-out infinite; }
.mlauto { margin-left: auto; font-weight: 700; text-transform: none; letter-spacing: 0; }
h3 .link { font: inherit; color: var(--ink); padding: 0; text-transform: none; letter-spacing: 0; font-size: 1rem; }
.pctn { font-weight: 800; font-size: .9rem; } .pctn.g { color: var(--ok); } .pctn.o { color: var(--warn); } .pctn.r { color: var(--ko); }
.steprail { display: flex; gap: 5px; align-items: center; min-width: 0; }
.steprail i { flex: 1; height: 12px; border-radius: 99px; background: var(--line); }
.steprail i.done { background: var(--ok); } .steprail i.cur { background: var(--warn); animation: pulse 1.6s ease-in-out infinite; }
.hero .steprail i { background: rgba(255, 255, 255, .28); } .hero .steprail i.done { background: #fff; } .hero .steprail i.cur { background: var(--gold); }
.steprail.big { margin: 12px 0 6px; max-width: 440px; }
.stepn { font-weight: 800; color: var(--muted); }
.tdhead { margin: 10px 0 14px; } .tdhead h1 { font-size: 1.6rem; }
details.stmt > summary, details.docs > summary { cursor: pointer; font-weight: 800; color: var(--muted); }
details.stmt[open] > summary { margin-bottom: 8px; }
.stepcard { border: 2px solid var(--pri); padding: 18px; }
.stephd { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .stephd b { font-size: 1.15rem; }
.sn { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; background: var(--pri); color: #fff; font-weight: 800; font-size: .85rem; box-shadow: 0 3px 0 var(--pri-d); }
.stepcard .q { font-size: 1.08rem; margin-bottom: 12px; }
.rappel { margin: 10px 0 14px; border-radius: 16px; background: var(--pri-soft); padding: 0 14px; }
.rappel > summary { cursor: pointer; padding: 12px 0; font-weight: 800; color: var(--pri); display: flex; gap: 8px; align-items: center; }
.rappel[open] { padding-bottom: 12px; }
.steptools { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.row3 { display: flex; flex-wrap: wrap; gap: 8px; } .row3 .btn { flex: 1 1 150px; width: auto; }
.miss { color: var(--ko-ink); font-weight: 800; display: flex; gap: 6px; align-items: center; animation: shake .35s; }
.stepdone { padding: 10px 14px; margin-bottom: 8px; }
.stepdone > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 800; list-style: none; }
.stepdone > summary::-webkit-details-marker { display: none; }
.stepdone > summary .sn { background: var(--ok); box-shadow: 0 3px 0 var(--ok-d); } .stepdone > summary .i:last-child { margin-left: auto; color: var(--ok); }
.fb.neutral { background: var(--pri-soft); }
.tdend { text-align: center; }
.tdblock { padding: 14px 16px; margin-bottom: 12px; }
.tdbh { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; } .tdbh .muted { display: block; font-size: .85rem; }
.tdbh .btn { width: auto; flex: none; }
.tdrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 4px; text-align: left; }
.tdrow .lbl { flex: none; padding: 3px 8px; border-radius: 8px; background: var(--pri-soft); color: var(--pri); font-weight: 800; font-size: .75rem; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.tdrow .grow b { display: block; } .tdrow .grow .muted { font-size: .82rem; }
.tdrow .bar { flex: none; width: 60px; height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; } .tdrow .bar i { display: block; height: 100%; background: var(--pri); border-radius: 99px; }
.tdrow.fini .bar i { background: var(--ok); } .tdrow.fini .lbl { background: var(--ok-soft); color: var(--ok-ink); }
@media (max-width: 480px) { .tdrow .lbl { display: none; } }

/* ---------- progression des tâches longues ---------- */
.sheet.prog { text-align: left; }
.proghead { display: flex; align-items: center; gap: 10px; } .proghead h2 { flex: 1; margin: 0; }
.prog .meter.big { margin: 14px 0 8px; }
.psteps { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.psteps li { display: flex; gap: 12px; align-items: flex-start; opacity: .45; transition: opacity .2s; }
.psteps li.run, .psteps li.ok, .psteps li.ko { opacity: 1; }
.psteps .pi { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--line-d); margin-top: 1px; display: grid; place-items: center; }
.psteps li.run .pi { border-color: var(--pri); border-top-color: transparent; animation: spin .9s linear infinite; }
.psteps li.ok .pi { background: var(--ok); border-color: var(--ok); } .psteps li.ok .pi::after { content: "✓"; color: #fff; font-weight: 900; font-size: .8rem; }
.psteps li.ko .pi { background: var(--ko); border-color: var(--ko); } .psteps li.ko .pi::after { content: "✕"; color: #fff; font-weight: 900; font-size: .75rem; }
.psteps li > div { min-width: 0; } .psteps b { display: block; }
.psteps small { display: block; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.psteps li.run small { color: var(--ink); }
.psteps small[data-quiet]::after { content: " · " attr(data-quiet); color: var(--muted); }
@keyframes spin { to { transform: rotate(360deg); } }
.limits { border-top: 2px solid var(--line); padding-top: 10px; margin-top: 6px; }
.lim { display: grid; grid-template-columns: 70px 1fr 44px; gap: 4px 10px; align-items: center; font-size: .85rem; margin-bottom: 6px; }
.lim small { grid-column: 2 / 4; color: var(--muted); font-size: .76rem; margin-top: -4px; } .lim b { text-align: right; }
.ko { color: var(--ko); }

/* pastille des tâches ChatGPT en arrière-plan */
#jobpill { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 86px); z-index: 30; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 28px)); }
#jobpill button { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--pri); color: #fff; box-shadow: 0 4px 0 var(--pri-d), 0 8px 24px rgba(0, 0, 0, .35); text-align: left; }
#jobpill b { display: block; font-size: .88rem; } #jobpill small { display: block; font-size: .76rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
#jobpill .spin { flex: none; width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .9s linear infinite; }
@media (min-width: 1000px) { #jobpill { bottom: 20px; } }
body.focus #jobpill { bottom: calc(env(safe-area-inset-bottom) + 14px); }
#phide { margin-top: 10px; }

/* ---------- cartes d'exercices et de chapitres (lisibles : nom, théorème, description, à apprendre) ---------- */
.steprail i.cur { animation: none; }
.exgrid, .chgrid { display: grid; gap: 12px; }
@media (min-width: 700px) { .exgrid, .chgrid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); } }
.excard, .chcard { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; padding: 16px 18px; border-radius: 20px; background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line-d); transition: transform .15s var(--spring), box-shadow .15s; }
.excard:hover, .chcard:hover { box-shadow: inset 0 0 0 2px var(--pri), 0 4px 0 var(--pri-d); }
.excard:active, .chcard:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--pri), 0 1px 0 var(--pri-d); }
.excard.encours { box-shadow: inset 0 0 0 2px var(--warn), 0 4px 0 var(--warn-d); }
.excard.fini { opacity: .8; }
.exc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.exc-lbl { padding: 3px 10px; border-radius: 99px; background: var(--pri-soft); color: var(--pri); font-weight: 800; font-size: .75rem; white-space: nowrap; }
.excard.fini .exc-lbl { background: var(--ok-soft); color: var(--ok-ink); } .excard.encours .exc-lbl { background: var(--warn-soft); color: var(--warn-ink); }
.exc-st { font-size: .8rem; font-weight: 700; color: var(--muted); text-align: right; }
.excard h4, .chcard h4 { margin: 2px 0 0; font-size: 1.12rem; line-height: 1.3; font-weight: 800; }
.exc-th { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); font-weight: 700; font-size: .9rem; line-height: 1.35; }
.exc-th .i { margin-top: 1px; }
.exc-desc { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.5; }
.exc-learn > span { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ok-ink); margin-bottom: 4px; }
.exc-learn ul { margin: 0; padding-left: 1.1em; font-size: .9rem; line-height: 1.5; } .exc-learn li::marker { color: var(--ok); }
.exc-learn .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.exc-learn .tags i { font-style: normal; font-size: .82rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--ok-soft); color: var(--ok-ink); }
.exc-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; } .exc-bar i { display: block; height: 100%; border-radius: 99px; background: var(--pri); }
.excard.fini .exc-bar i { background: var(--ok); } .excard.encours .exc-bar i { background: var(--warn); }
.chcard small { font-size: .8rem; }
.exhead { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 14px; padding: 18px 20px; }
.exhead h1 { margin: 0; font-size: 1.55rem; }
.tdblock .exgrid { margin-top: 6px; }

/* ---------- LaTeX et énoncés façon feuille de TD ---------- */
.katex { font-size: 1.08em; }
.mathblock { margin: .7rem 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.mathblock .katex-display { margin: 0; }
code.tex { background: var(--ko-soft); color: var(--ko-ink); }
.qn { display: flex; gap: 10px; align-items: baseline; margin: .55rem 0; } .qn > b { flex: none; min-width: 1.4em; }
/* la feuille : papier clair, encre noire, police à empattements, comme le TD imprimé */
.paper, .panel.stmt { background: #fbfaf5; color: #1a1b22; font-family: "Latin Modern Roman", "CMU Serif", Cambria, "Iowan Old Style", Georgia, serif; font-size: 1.04rem; line-height: 1.6;
  padding: 22px 24px; border-radius: 6px; box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 10px 30px rgba(0, 0, 0, .35); border: 0; margin-bottom: 14px; }
.paper .sym, .panel.stmt .sym { color: #2f39b5; border-color: #2f39b5; }
.paper .qn > b, .panel.stmt .qn > b { font-weight: 700; }
.paperhd { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1.5px solid #1a1b22; padding-bottom: 6px; margin-bottom: 12px; }
.paperhd span { font-size: .8rem; font-variant: small-caps; letter-spacing: .04em; color: #555; } .paperhd b { font-size: 1.05rem; }
/* étape : question en grand, formules du rappel encadrées */
.stepcard .q .mathblock { background: var(--bg); border-radius: 12px; padding: 8px 12px; }
.rappel .mathblock { background: var(--panel); border: 2px solid var(--pri); border-radius: 12px; padding: 10px 14px; }
.sol .mathblock, .fb .mathblock { background: rgba(0, 0, 0, .18); border-radius: 12px; padding: 8px 12px; }
.choice .katex { font-size: 1.12em; }
.exp p { display: inline; margin: 0; }
@media (max-width: 999px) { .exocols { display: flex; flex-direction: column; } .exocols .colR { order: -1; } .exocols .colR.sticky { position: static; } }
@media (max-width: 480px) { .paper, .panel.stmt { padding: 16px; font-size: 1rem; } }

/* ---------- page d'exercice : la feuille à gauche (comme le TD posé sur la table), le travail à droite ---------- */
.tdgrid { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.tdsheet { display: flex; flex-direction: column; gap: 12px; }
.tdtitle { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.tdtitle h1 { margin: 0; font-size: 1.5rem; line-height: 1.2; }
.tdtitle .exc-th { align-self: stretch; }
.tdsheet .paper { margin: 0; }
.tdlearn { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.tdwork { display: flex; flex-direction: column; min-width: 0; }
.tdwork .chatpane { margin-top: 14px; }
.oldtd { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--warn-soft); color: var(--warn-ink); }
.oldtd > div { flex: 1 1 220px; } .oldtd b { display: block; } .oldtd > div > span { font-size: .85rem; } .oldtd .btn { width: auto; }
@media (min-width: 1000px) {
  .tdgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .tdsheet { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding: 2px 6px 10px 2px; }
}
/* symbole du cours dans une formule : pas de soulignement pointillé qui gêne la lecture */
.paper .sym, .stepcard .sym, .choice .sym { border-bottom: 0; background: none; color: inherit; font-weight: inherit; }

/* ---------- flashcards : retournement simple et fiable (pas de 3D : Safari affichait les faces à l'envers avec les formules) ---------- */
.fcard { display: block; width: 100%; margin: 14px 0; cursor: pointer; perspective: none; transition: transform .16s ease-in; transform-origin: center; outline: none; }
.fcard.turning { transform: scaleX(0); }
.fcard.flipped { animation: flipIn .18s ease-out; }
@keyframes flipIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.fcard .face { position: relative; inset: auto; transform: none; backface-visibility: visible; -webkit-backface-visibility: visible; min-height: 240px; padding: 40px 22px 26px;
  display: flex; flex-direction: column; justify-content: center; text-align: center; border-radius: 20px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line), 0 5px 0 var(--line-d); }
.fcard .face.back { background: var(--pri-soft); box-shadow: inset 0 0 0 2px var(--pri), 0 5px 0 var(--pri-d); }
.fcard .face small { position: absolute; top: 14px; left: 0; right: 0; }
.fcard .fbody { font-size: 1.12rem; overflow-x: auto; } .fcard .fbody p { margin: .35rem 0; }
.fcard:focus-visible .face { box-shadow: inset 0 0 0 3px var(--pri), 0 5px 0 var(--pri-d); }
@media (min-width: 1000px) { .fcard .face { min-height: 300px; } }

/* ---------- accueil compact : tient avec beaucoup de cours ---------- */
.minilist { padding: 4px 6px; }
.mini { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; border-radius: 12px; text-align: left; }
.mini + .mini { border-top: 2px solid var(--line); border-radius: 0; }
.mini:hover { background: var(--pri-soft); }
.mini .grow b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mini small { color: var(--muted); font-size: .8rem; }
.mini .go { transform: rotate(180deg); color: var(--muted); }
.cgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ctile { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--panel); text-align: left; min-width: 0;
  box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line-d); border-top: 4px solid var(--cc, var(--pri)); }
.ctile:hover { box-shadow: inset 0 0 0 2px var(--cc, var(--pri)), 0 4px 0 var(--line-d); }
.ctile:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--cc), 0 1px 0 var(--line-d); }
.ctile .cic { font-size: 1.3rem; } .ctile b { font-size: .95rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ctile small { color: var(--muted); font-size: .76rem; }
.ctile .cbar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 4px; } .ctile .cbar i { display: block; height: 100%; background: var(--cc, var(--pri)); }
.ctile.add { border-top-color: var(--line-d); box-shadow: inset 0 0 0 2px var(--line); background: none; } .ctile.add .cic { color: var(--pri); font-weight: 800; }
details.tdblock > summary { list-style: none; cursor: pointer; flex-wrap: wrap; } details.tdblock > summary::-webkit-details-marker { display: none; }
details.tdblock:not([open]) > summary { margin-bottom: 0; }
.tdbar { flex: 1 0 100%; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; } .tdbar i { display: block; height: 100%; background: var(--ok); }
.fcard .face { width: 100%; box-sizing: border-box; }
.fcard .face.back { color: var(--ink); }
/* les formules gardent toujours leur mise en page, quel que soit le conteneur */
.fb .exp { display: block; font-weight: 600; margin-top: 4px; } .fb .exp p { display: inline; }

/* ---------- parcours d'un exercice de TD : Cours → QCM → Exercice ---------- */
.phasebar { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 4px; }
.phasebar button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 6px; border-radius: 10px; font-weight: 700; font-size: .92rem; color: var(--muted); }
.phasebar button .sn { width: 22px; height: 22px; border-radius: 7px; font-size: .75rem; background: var(--line-d); box-shadow: none; }
.phasebar button.done .sn { background: var(--ok); }
.phasebar button.on { background: var(--pri-soft); color: var(--pri-ink); } .phasebar button.on .sn { background: var(--pri); }
.phasebar button:disabled { opacity: .45; cursor: default; }
.phasebar svg { width: 16px; height: 16px; }
@media (max-width: 480px) { .phasebar button svg { display: none; } }
.prepcard .cours { line-height: 1.6; overflow-x: auto; } .prepcard .cours h3, .mdh { margin: 1.1em 0 .3em; font-size: 1.05rem; } .mdh:first-child { margin-top: .4em; }
.prepcard .exc-learn { margin: 10px 0 4px; }
.acquis { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok-ink); }
.acquis > span { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.acquis ul { margin: 4px 0 0; padding-left: 18px; } .acquis small { opacity: .75; font-weight: 700; }
.prepex > summary, .fichem h3, .tipsp h3 { display: flex; align-items: center; gap: 8px; font-weight: 800; margin: 0 0 8px; font-size: 1rem; cursor: pointer; }
.prepex { overflow-x: auto; } .prepex[open] > summary { margin-bottom: 10px; }
.fichem dl { margin: 0; display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 8px 14px; }
.fichem dt { font-weight: 800; font-size: .85rem; color: var(--muted); } .fichem dd { margin: 0; } .fichem dd p { margin: 0; }
.fichem dt:last-of-type { color: var(--ko-ink); }
@media (max-width: 480px) { .fichem dl { grid-template-columns: 1fr; gap: 2px; } .fichem dd { margin-bottom: 8px; } }
.tipsp ul { margin: 0; padding-left: 20px; } .tipsp li + li { margin-top: 6px; } .tipsp li p { margin: 0; }
.qcmq .stephd { align-items: flex-start; } .qcmq .q p:first-child { margin-top: 2px; }
.qcmq.ok { box-shadow: inset 0 0 0 2px var(--ok); } .qcmq.ko { box-shadow: inset 0 0 0 2px var(--ko); }
.qcmq .qexp:not(:empty) { margin-top: 10px; }
.qscore { text-align: center; } .qscore > b { font-size: 1.6rem; display: block; }
.qscore.ok { background: var(--ok-soft); color: var(--ok-ink); } .qscore.ko { background: var(--warn-soft); color: var(--warn-ink); }
.qscore .link { margin-top: 8px; }
.tdbh > .grow { flex: 1 1 220px; min-width: 0; }

/* ---------- choisir des TD à préparer (rattrapage, plusieurs à la fois) ---------- */
.pickpanel { display: flex; flex-direction: column; gap: 12px; }
.pickpanel > div:first-child b { display: flex; align-items: center; gap: 8px; } .pickpanel > div:first-child span { display: block; margin-top: 4px; }
.picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; min-width: 0; }
.pick.on { box-shadow: inset 0 0 0 2px var(--pri); background: var(--pri-soft); }
.pick input { width: 18px; height: 18px; accent-color: var(--pri); flex: none; }
.pick b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; } .pick small { color: var(--muted); font-size: .78rem; }

/* ---------- comptes (2026-11-25) : connexion Discord, rôles, panel d'Arthur ---------- */
.adminonly { display: none; }
body.is-admin nav .adminonly { display: flex; }
@media (max-width: 640px) { body.is-admin nav .navnew { display: none; } }
nav .brand .who { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .8rem; font-weight: 700; color: var(--muted); }
nav .brand .who img { width: 22px; height: 22px; border-radius: 50%; }
body.auth nav { display: none !important; }
body.auth #app { margin-left: 0 !important; padding-left: 0 !important; }
.authpage { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.authcard { max-width: 430px; width: 100%; text-align: center; padding: 30px 26px; }
.authcard h1 { margin: 6px 0 8px; }
.authlogo { font-size: 3.4rem; line-height: 1; }
.btn.discord { --c: #5865f2; --cd: #3f49c9; text-decoration: none; }
.btn.discord .i { width: 22px; height: 22px; }
.authst { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 16px; margin-top: 14px; }
.authst img { width: 44px; height: 44px; border-radius: 50%; } .authst b { display: block; } .authst span { font-size: .9rem; }
.authst.wait { background: var(--warn-soft); color: var(--warn-ink); } .authst.ko { background: var(--ko-soft); color: var(--ko-ink); }
.devlogin { text-align: left; margin-top: 10px; }
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-grid; place-items: center; background: var(--pri-soft); color: var(--pri); font-weight: 800; object-fit: cover; }
.account { display: flex; align-items: center; gap: 12px; } .account .grow b { display: block; } .account .btn { width: auto; margin: 0; }
.ulist { padding: 4px 8px; }
.urow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.urow + .urow { border-top: 2px solid var(--line); }
.urow.pending { background: var(--warn-soft); border-radius: 12px; padding: 10px; }
.urow.blocked { opacity: .6; }
.ulink { text-align: left; min-width: 0; } .ulink b { display: block; } .ulink small { color: var(--muted); font-size: .8rem; }
.urow.pending .ulink small { color: var(--warn-ink); }
.tagadm { font-size: .7rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--pri-soft); color: var(--pri); vertical-align: middle; }
.uact { display: flex; gap: 6px; align-items: center; flex: none; } .uact .btn { width: auto; margin: 0; min-height: 38px; }
@media (max-width: 560px) { .urow { flex-wrap: wrap; } .uact { width: 100%; justify-content: flex-end; } }
.uhead { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; } .uhead .av { width: 64px; height: 64px; font-size: 1.6rem; } .uhead h1 { margin: 0; }
.tdlog { list-style: none; margin: 8px 0 0; padding: 0; }
.tdlog li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: .92rem; }
.tdlog li + li { border-top: 1px solid var(--line); }
.tdlog .grow small { display: block; color: var(--muted); font-size: .78rem; }
.tdlog b.g { color: var(--ok); } .tdlog b.o { color: var(--warn); } .tdlog b { font-size: .82rem; text-align: right; }
.okd { color: var(--ok); font-weight: 800; } .kod { color: var(--ko); font-weight: 800; }
.erow2 { display: flex; align-items: center; gap: 10px; padding: 8px 0; } .erow2 + .erow2 { border-top: 1px solid var(--line); } .erow2 small { display: block; color: var(--muted); font-size: .78rem; }
.num-in.wide { width: auto; min-width: 130px; }

/* ---------- exercice : le chat juste sous l'énoncé ---------- */
.exomain { display: flex; flex-direction: column; max-width: 860px; margin: 0 auto; }
.exomain .chatpane { margin: 0 0 14px; }
.exomain .chat .msgs, .tdsheet .chat .msgs { max-height: 46vh; }
.tdsheet .chatpane { margin: 0; }

/* ---------- guidage des TD et corrections développées ---------- */
.levelbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 12px; }
.levelbar .kicker { margin: 0; } .levelbar .seg { margin: 0; flex: 0 1 360px; } .levelbar small { font-size: .8rem; }
.skipnote { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn-ink); margin-bottom: 12px; font-size: .92rem; }
.skipnote ol { margin: 4px 0 0; padding-left: 22px; } .skipnote .i { flex: none; margin-top: 2px; }
details.expl { margin-top: 10px; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .2); box-shadow: inset 3px 0 0 var(--pri); color: var(--ink); }
details.expl > summary { cursor: pointer; font-weight: 800; display: flex; align-items: center; gap: 8px; font-size: .92rem; }
details.expl[open] > summary { margin-bottom: 6px; }
details.expl p { margin: .45rem 0; }
.corrstep { padding: 10px 0; } .corrstep + .corrstep { border-top: 1px solid var(--line); }
.corrstep .sn { width: 24px; height: 24px; font-size: .78rem; }

/* ---------- cours façon livre de prépa (Ellipses) : page claire, encadrés numérotés ---------- */
.livre { background: #fbfaf5; color: #1a1b22; font-family: "Latin Modern Roman", "CMU Serif", Cambria, "Iowan Old Style", Georgia, serif; font-size: 1.04rem; line-height: 1.62;
  padding: 24px 28px; border-radius: 6px; box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 10px 30px rgba(0, 0, 0, .35); overflow-x: auto; }
.livrehd { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1.5px solid #1a1b22; padding-bottom: 6px; margin-bottom: 12px; }
.livrehd span { font-size: .8rem; font-variant: small-caps; letter-spacing: .04em; color: #555; } .livrehd b { font-size: 1.05rem; }
.livre .exc-learn > span { color: #6b6658; } .livre .tags i { background: #ece7d8; color: #3a3527; }
.livre .sym { color: #2f39b5; border-color: #2f39b5; }
.livre .mathblock { background: none; }
.livre .mdh.sec { display: flex; align-items: baseline; gap: 12px; font-size: 1.28rem; font-weight: 700; color: #7a1f1f; margin: 1.5em 0 .6em; padding-bottom: 4px; border-bottom: 1px solid #d6cfba; }
.livre .mdh.sec:first-child { margin-top: .4em; }
.livre .secn { font-size: 1.5rem; color: #a3262a; min-width: 1.2em; }
.livre .oldfmt { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: #fff1d4; color: #7a4d00; font-family: system-ui, sans-serif; font-size: .88rem; display: flex; gap: 8px; align-items: center; }
.sommaire { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; padding: 10px 0; border-bottom: 1px dashed #d6cfba; }
.sommaire > span { width: 100%; font-size: .78rem; font-variant: small-caps; letter-spacing: .05em; color: #6b6658; }
.sommaire a { font-size: .86rem; padding: 2px 10px; border-radius: 99px; text-decoration: none; border: 1px solid currentColor; }
.sommaire a.d { color: #1f4e9a; } .sommaire a.t { color: #a3262a; }
.bk { --bc: #1f4e9a; --bb: #eef3fb; margin: 1.05rem 0; border: 1.5px solid var(--bc); background: var(--bb); border-radius: 3px; color: #1a1b22; overflow-x: auto;
  font-family: "Latin Modern Roman", "CMU Serif", Cambria, "Iowan Old Style", Georgia, serif; line-height: 1.58; }
.bkh { display: inline-block; max-width: 100%; padding: 3px 12px 4px; background: var(--bc); color: #fff; border-bottom-right-radius: 8px; font-size: .98rem; }
.bkh b { font-weight: 700; letter-spacing: .01em; }
.bkh .bkt { font-style: italic; margin-left: 8px; } .bkh .bkt::before { content: "("; } .bkh .bkt::after { content: ")"; }
.bkh .katex { color: inherit; }
.bkb { padding: 6px 14px 10px; } .bkb > p:first-child { margin-top: .3rem; } .bkb > p:last-child { margin-bottom: .2rem; }
.bk .mathblock { background: none !important; border: 0 !important; padding: 2px 0 !important; }
.bk-theoreme { --bc: #a3262a; --bb: #fbf0ee; }
.bk-propriete, .bk-proposition, .bk-lemme, .bk-corollaire { --bc: #6b3fa0; --bb: #f4effa; }
.bk-methode { --bc: #1d7a46; --bb: #edf7f0; border-width: 0 0 0 5px; }
.bk-exemple { --bc: #6f6a5a; --bb: transparent; border-width: 0 0 0 3px; }
.bk-exemple .bkh, .bk-remarque .bkh, .bk-demo .bkh, .bk-attention .bkh, .bk-methode .bkh { background: none; color: var(--bc); padding: 6px 14px 0; }
.bk-remarque { --bc: #555; --bb: transparent; border: 0; } .bk-remarque .bkh b { font-style: italic; } .bk-remarque .bkb { padding-top: 0; font-size: .97rem; }
.bk-attention { --bc: #b5651d; --bb: #fdf3e6; border-width: 0 0 0 5px; } .bk-attention .bkh b::before { content: "⚠ "; }
.bk-demo { --bc: #333; --bb: transparent; border: 0; } .bk-demo .bkh b { font-style: italic; } .bk-demo .bkh b::after { content: "."; }
.bk-demo .bkb { padding-top: 0; } .bk-demo .bkb > :last-child::after { content: "∎"; float: right; margin-left: 10px; }
.bk-rappel, .bk-prerequis { --bc: #57606f; --bb: #f1f2f5; border-style: dashed; }
@media (max-width: 480px) { .livre { padding: 16px; font-size: 1rem; } .bkb { padding: 4px 10px 8px; } }

/* prérequis : à savoir avant de commencer, mis en avant au-dessus du cours */
.prereq { box-shadow: inset 0 0 0 2px var(--ok); }
.prereq .kicker { display: flex; align-items: center; gap: 6px; color: var(--ok-ink); }
.prereq dl { margin: 6px 0 0; display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 14px; }
.prereq dt { font-weight: 800; } .prereq dt small { display: inline-block; font-size: .72rem; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--ok-soft); color: var(--ok-ink); }
.prereq dd { margin: 0; } .prereq dd p { margin: 0; }
@media (max-width: 560px) { .prereq dl { grid-template-columns: 1fr; gap: 2px; } .prereq dd { margin-bottom: 8px; } }
.prepex .cours { line-height: 1.6; }

/* séance de test d'Arthur : bandeau pour revenir admin */
#testbar { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 999px; background: var(--warn); color: #3a2800; font-weight: 800; font-size: .85rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
#testbar button { padding: 6px 12px; border-radius: 999px; background: #3a2800; color: #fff; font-weight: 800; }
.testpanel { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; } .testpanel .grow b, .testpanel .grow span { display: block; } .testpanel .btn { width: auto; margin: 0; }

/* page d'un cours : ce qui est à faire en haut, ce qui est déjà fait en bas et en discret */
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; box-shadow: inset 0 0 0 2px var(--warn); background: var(--warn-soft); color: var(--warn-ink); margin-bottom: 14px; }
.todo.run { box-shadow: inset 0 0 0 2px var(--pri); background: var(--pri-soft); color: var(--ink); }
.todo .grow { flex: 1 1 260px; } .todo .grow > b { display: flex; align-items: center; gap: 8px; } .todo ul { margin: 6px 0 0; padding-left: 20px; font-size: .9rem; }
.todo .btn { width: auto; margin: 0; }
.tdst { flex: none; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 99px; }
.tdst.ok { color: var(--ok-ink); background: var(--ok-soft); } .tdst.warn { color: var(--warn-ink); background: var(--warn-soft); }
details.advanced { margin-top: 28px; padding: 10px 4px; color: var(--muted); font-size: .88rem; opacity: .75; }
details.advanced[open] { opacity: 1; }
details.advanced > summary { cursor: pointer; font-weight: 700; }
details.advanced p { margin: 8px 0; }
.advrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.advrow .grow b { display: block; color: var(--ink); font-weight: 700; } .advrow .grow small { font-size: .78rem; }
.advrow .link { color: var(--muted); text-decoration: underline; }
details.advanced .danger { margin-top: 12px; }

/* correction ultra détaillée : on prend le temps, sections numérotées, points clés en avant */
.expl.ultra { box-shadow: inset 3px 0 0 var(--ok); line-height: 1.7; font-size: 1rem; }
.expl.ultra .mdh { font-size: 1rem; color: var(--ok-ink); margin: 1em 0 .3em; }
.expl.ultra strong { color: var(--warn-ink); }
.expl.ultra .mathblock { background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 6px 10px; }
div.expl.ultra { margin-top: 10px; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .2); }
.levelbar .seg + small + .kicker { margin-left: 8px; }

/* cours en fiches (maquette B, choix d'Arthur 2026-11-25) : intuition pleine largeur, résultats en cartes côte à côte */
@media (min-width: 1000px) { .tdgrid.cv { grid-template-columns: minmax(0, .72fr) minmax(0, 1.5fr); } }
.bkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; margin: .9rem 0 1.2rem; align-items: stretch; }
.bkgrid .bk { margin: 0; }
.bkgrid .bk-demo, .bkgrid .bk-remarque { grid-column: 1 / -1; }
.bkgrid .bk-demo, .bkgrid .bk-exemple, .bkgrid .bk-attention, .bkgrid .bk-methode { border-radius: 0; }
.livre .cours > p { max-width: 75ch; }
.livre .mdh.sec + p { font-size: 1.05rem; color: #3a3527; }
