/* 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 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; } }
