/* Learn With Me : prototype HTML v0.3. Direction visuelle : sobre, exécutive (marine, bleu, jaune, serif, fond blanc). Voir claude_cahier_design_v0.2.md */
:root {
  --paper: #ffffff; --bg: #ffffff; --bg2: #f3f5f9; --line: #e2e6ee; --line2: #c9d1de;
  --ink: #141c2b; --ink2: #566176;
  --navy: #14213d; --navy2: #273d6b; --side: #14213d; --side-ink: #b9c4dc;
  --brand: #2b59c3; --brand-d: #1f4399; --brand-soft: #e6edfb; --on-brand: #ffffff;
  --go: #1f7a4f; --go-d: #165a39; --go-soft: #dff1e6; --go-ink: #165a39;
  --bad: #c0432a; --bad-d: #8f2f1c; --bad-soft: #fbe6df; --bad-ink: #9c3320;
  --sun: #f5c86b; --sun-d: #d9a43a; --sun-soft: #fbf0d3; --sun-ink: #6d4e0e;
  --sky: #2b7ab3; --sky-soft: #e3f0fa; --sky-ink: #1d5a8a;
  --violet: #6b5b95; --violet-soft: #ebe7f3;
  --cta: #14213d; --on-cta: #ffffff;
  --r: 18px; --r-sm: 12px;
  --f: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --fs: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --shadow: 0 1px 2px rgba(20,33,61,.05), 0 6px 20px rgba(20,33,61,.06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0e1424; --bg: #151d33; --bg2: #1d2742; --line: #2a3555; --line2: #3a4870; --ink: #eaeefa; --ink2: #a6b2cf;
  --navy: #0b1120; --navy2: #273d6b; --side: #0b1120;
  --brand: #7ea2ff; --brand-d: #4f74d6; --brand-soft: #1f2c52; --on-brand: #0e1424;
  --go: #3fb67f; --go-d: #2a8a5c; --go-soft: #12372a; --go-ink: #8be3b5;
  --bad: #c9472d; --bad-d: #8f2f1c; --bad-soft: #43211b; --bad-ink: #ff9d86;
  --sun-soft: #3b3216; --sun-ink: #f5d58d; --sky: #5ba6e0; --sky-soft: #14304d; --sky-ink: #8cc3ee; --violet-soft: #2a2748;
  --cta: #f5c86b; --on-cta: #14213d; --shadow: 0 8px 24px rgba(0,0,0,.3); color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #0e1424; --bg: #151d33; --bg2: #1d2742; --line: #2a3555; --line2: #3a4870; --ink: #eaeefa; --ink2: #a6b2cf;
  --navy: #0b1120; --navy2: #273d6b; --side: #0b1120;
  --brand: #7ea2ff; --brand-d: #4f74d6; --brand-soft: #1f2c52; --on-brand: #0e1424;
  --go: #3fb67f; --go-d: #2a8a5c; --go-soft: #12372a; --go-ink: #8be3b5;
  --bad: #c9472d; --bad-d: #8f2f1c; --bad-soft: #43211b; --bad-ink: #ff9d86;
  --sun-soft: #3b3216; --sun-ink: #f5d58d; --sky: #5ba6e0; --sky-soft: #14304d; --sky-ink: #8cc3ee; --violet-soft: #2a2748;
  --cta: #f5c86b; --on-cta: #14213d; --shadow: 0 8px 24px rgba(0,0,0,.3); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--f); font-size: 16px; line-height: 1.55; font-weight: 400;
  padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px)); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; text-wrap: balance; color: var(--ink); }
h1, h2 { font-family: var(--fs); letter-spacing: -.02em; } h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.08rem; font-family: var(--f); }
p { margin: 0; } a { color: var(--brand); font-weight: 600; } ol, ul { margin: 0; padding-left: 22px; }
.muted { color: var(--ink2); } .small { font-size: .9rem; } .tiny { font-size: .8rem; } .b { font-weight: 700; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; } .stack-s { display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; } .hide { display: none !important; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

/* ---------- Boutons ---------- */
.btn { --c: var(--bg); --t: var(--ink); --d: var(--line2); font: inherit; font-weight: 700; font-size: .95rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; cursor: pointer; text-decoration: none;
  background: var(--c); color: var(--t); border: 1px solid var(--d); transition: transform .15s, background .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20,33,61,.14); } .btn:active { transform: none; box-shadow: none; }
.btn.go { --c: var(--cta); --t: var(--on-cta); --d: var(--cta); }
.btn.brand { --c: var(--brand); --t: var(--on-brand); --d: var(--brand); }
.btn.sun { --c: var(--sun); --t: #14213d; --d: var(--sun); }
.btn.bad { --c: var(--bad); --t: #fff; --d: var(--bad); }
.btn.flat { --c: transparent; --d: transparent; color: var(--brand); box-shadow: none; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .85rem; border-radius: 10px; } .btn.block { width: 100%; }
.btn[disabled], .btn.off { background: var(--bg2); color: var(--ink2); border-color: var(--line); cursor: not-allowed; transform: none; box-shadow: none; }
.btn.chip-on { --c: var(--brand-soft); --d: var(--brand); --t: var(--brand); }

/* ---------- Cartes, pastilles, barres ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.soft { background: var(--bg2); box-shadow: none; } .card.lock { opacity: .62; }
.card.link { text-decoration: none; color: inherit; display: block; transition: transform .15s, border-color .15s; font-weight: 400; } .card.link:hover { transform: translateY(-2px); border-color: var(--brand); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--bg2); color: var(--ink2); white-space: nowrap; }
.pill.ok { background: var(--go-soft); color: var(--go-ink); } .pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.pill.warn { background: var(--sun-soft); color: var(--sun-ink); } .pill.info { background: var(--sky-soft); color: var(--sky-ink); } .pill.brand { background: var(--brand-soft); color: var(--brand); }
.fictif { display: inline-block; padding: 1px 9px; border-radius: 6px; background: var(--sun-soft); color: var(--sun-ink); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 1px dashed var(--sun-d); }
.bar { height: 10px; background: var(--bg2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); } .bar.thin { height: 8px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s; min-width: 0; }
.bar.go > i { background: var(--go); } .bar.sky > i { background: var(--sky); } .bar.sun > i { background: var(--sun-d); }
.banner { background: var(--sun-soft); color: var(--sun-ink); border: 1px dashed var(--sun-d); border-radius: var(--r-sm); padding: 10px 14px; font-size: .92rem; }
.note { border-radius: var(--r-sm); padding: 13px 16px; border: 1px solid var(--line); border-left: 4px solid var(--line2); background: var(--bg); font-size: .95rem; }
.note.ok { background: var(--go-soft); border-color: var(--go); color: var(--go-ink); } .note.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad-ink); }
.note.warn { background: var(--sun-soft); border-color: var(--sun-d); color: var(--sun-ink); } .note.human { background: var(--brand-soft); border-color: var(--brand); color: var(--ink); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); } .kv:last-child { border: 0; }
.empty { text-align: center; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.big { font-family: var(--fs); font-size: 2.2rem; font-weight: 700; line-height: 1.1; }

/* ---------- Coque : menu foncé, centre, colonne droite ---------- */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; min-height: 100vh; width: 100%; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 24px 16px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; gap: 3px; }
.logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; white-space: nowrap; padding: 2px 8px 24px; }
.mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--sun); color: #14213d; font-weight: 900; font-size: .95rem; letter-spacing: -.02em; flex: none; }
.logo b { display: block; font-family: var(--fs); font-size: 1.12rem; letter-spacing: -.01em; color: #fff; } .logo small { display: block; font-size: .7rem; color: #9aa8c7; font-weight: 500; }
.side h4 { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #8393b5; padding: 18px 12px 6px; font-family: var(--f); font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; min-height: 42px; border-radius: 12px; text-decoration: none; color: var(--side-ink); font-weight: 600; font-size: .93rem; border: 0; }
.nav a:hover { background: #1f3156; color: #fff; }
.nav a.on { background: var(--navy2); color: #fff; box-shadow: inset 3px 0 0 var(--sun); }
.nav .ic { width: 24px; display: grid; place-items: center; }
.nav .help { margin-top: auto; }
.side .btn { --c: transparent; --t: #d0d9ee; --d: #3a4d78; margin-top: 14px; }
.main { padding: 34px clamp(20px, 3vw, 44px) 100px; min-width: 0; }
.col { max-width: 1000px; margin: 0 auto; } .col.wide { max-width: 1240px; }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 34px 22px 22px 6px; display: flex; flex-direction: column; gap: 14px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; padding: 6px 12px; border-radius: 99px; font-size: .92rem; background: var(--bg); border: 1px solid var(--line); }
.stat.fire { color: #b8500a; } .stat.xp { color: var(--sun-ink); } .stat.hp { color: var(--bad-ink); } .stat.gem { color: var(--sky-ink); }
.stat svg { width: 18px; height: 18px; }
.topstats { display: none; }
.pagehead { margin-bottom: 26px; display: flex; flex-direction: column; gap: 8px; } .pagehead h1 { color: var(--navy); } :root[data-theme="dark"] .pagehead h1 { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pagehead h1 { color: var(--ink); } }
.pagehead p { color: var(--ink2); }
.back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; color: var(--ink2); margin-bottom: 14px; font-size: .88rem; }
.tabbar { display: none; }
@media (max-width: 1180px) { .app { grid-template-columns: 240px minmax(0, 1fr); } .rail { display: none; } }
@media (max-width: 820px) {
  .app { display: block; } .side { display: none; } .main { padding: 14px max(16px, env(safe-area-inset-left, 0px)) 120px max(16px, env(safe-area-inset-right, 0px)); }
  .topstats { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 0 14px; flex-wrap: wrap; position: sticky; top: 0; background: var(--paper); z-index: 20; margin: -14px 0 8px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--navy); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 56px; min-height: 52px; padding: 4px 6px; text-decoration: none; color: #b9c4dc; font-size: .7rem; font-weight: 600; border-radius: 12px; justify-content: center; }
  .tabbar a.on { color: #fff; background: var(--navy2); box-shadow: inset 0 -3px 0 var(--sun); } .tabbar .ic { display: grid; place-items: center; }
  h1 { font-size: 1.6rem; }
}

/* ---------- Bandeau marine (accueil) ---------- */
.hero { background: var(--navy); color: #fff; border-radius: 22px; padding: clamp(24px, 4vw, 40px); display: grid; grid-template-columns: 1.25fr .75fr; gap: 28px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 300px; height: 300px; border-radius: 50%; right: -90px; bottom: -150px; border: 42px solid rgba(245,200,107,.16); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1, .hero h2 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.08; margin: 8px 0 12px; }
.hero p, .hero .muted { color: #c9d3ea; } .hero .eyebrow { color: var(--sun); }
.hero .pill.brand { background: rgba(245,200,107,.18); color: var(--sun); }
.pcard { background: #22345a; border: 1px solid #3a4d78; padding: 18px; border-radius: 16px; align-self: end; color: #c9d3ea; font-size: .88rem; display: flex; flex-direction: column; gap: 8px; }
.pcard .row b { color: #fff; } .pcard .bar { background: #16233f; border-color: #16233f; } .pcard .bar > i { background: var(--sun); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.tiles3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 6px; }
.tl { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; } .tl b { display: block; font-family: var(--fs); font-size: 1.9rem; color: var(--navy); line-height: 1.1; } .tl span { font-size: .8rem; color: var(--ink2); }
.tl.acc { background: var(--brand-soft); border-color: var(--brand-soft); } :root[data-theme="dark"] .tl b { color: var(--ink); } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tl b { color: var(--ink); } }
@media (max-width: 560px) { .tiles3 { gap: 8px; } .tl { padding: 12px; } .tl b { font-size: 1.4rem; } }
.sect { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 30px 0 12px; } .sect h2 { font-size: 1.35rem; }
.wn { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 800; font-size: .9rem; }
:root[data-theme="dark"] .wn { background: var(--navy2); } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wn { background: var(--navy2); } }
.wn.done { background: var(--brand); color: var(--on-brand); }

/* ---------- Parcours : chemin vertical ---------- */
.unit { border-radius: var(--r); padding: 16px 20px; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 30px 0 10px; background: var(--navy); border-left: 5px solid var(--sun); }
.unit:first-of-type { margin-top: 0; } .unit h3 { font-family: var(--fs); font-size: 1.2rem; color: #fff; } .unit small { color: var(--sun); font-weight: 700; display: block; letter-spacing: .1em; font-size: .72rem; }
.unit .btn { --c: rgba(255,255,255,.1); --t: #fff; --d: rgba(255,255,255,.3); }
.trail { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 20px 0 8px; }
.node { position: relative; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; color: #fff; background: var(--navy); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--line2), var(--shadow); cursor: pointer; transform: translateX(var(--x, 0)); transition: box-shadow .15s; }
:root[data-theme="dark"] .node { background: var(--navy2); } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .node { background: var(--navy2); } }
.node:hover { box-shadow: 0 0 0 2px var(--brand), var(--shadow); }
.node.done { background: var(--brand); color: var(--on-brand); }
.node.lock, .node.soon { background: var(--bg2); color: var(--ink2); box-shadow: 0 0 0 2px var(--line); cursor: default; }
.node.soon { box-shadow: 0 0 0 2px var(--line2); }
.node.now { box-shadow: 0 0 0 4px var(--sun), var(--shadow); }
.node.mission { border-radius: 20px; background: var(--sun); color: #14213d; }
.node.mission.done { background: var(--brand); color: var(--on-brand); } .node.mission.lock { background: var(--bg2); color: var(--ink2); }
.node .tip { position: absolute; top: -46px; left: 50%; transform: translateX(-50%); background: var(--sun); color: #14213d; border-radius: 10px; padding: 5px 14px; font-weight: 800; font-size: .8rem; white-space: nowrap; animation: bob 1.8s ease-in-out infinite; }
.node .tip::after { content: ''; position: absolute; bottom: -5px; left: 50%; width: 10px; height: 10px; background: var(--sun); transform: translateX(-50%) rotate(45deg); }
.node-label { position: absolute; left: calc(100% + 16px); top: 50%; transform: translateY(-50%); font-size: .85rem; font-weight: 600; color: var(--ink2); width: 160px; line-height: 1.3; }
.node-label.l { left: auto; right: calc(100% + 16px); text-align: right; }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }

/* ---------- Leçon plein écran ---------- */
.ls { position: fixed; inset: 0; background: var(--paper); z-index: 50; display: flex; flex-direction: column; }
.ls-top { display: flex; align-items: center; gap: 14px; padding: 14px max(18px, env(safe-area-inset-left, 0px)) 10px; max-width: 860px; width: 100%; margin: 0 auto; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.xbtn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--ink2); font-size: 1.5rem; cursor: pointer; } .xbtn:hover { background: var(--bg2); }
.seg { flex: 1; display: flex; gap: 5px; } .seg i { flex: 1; height: 7px; border-radius: 99px; background: var(--line); } .seg i.on { background: var(--brand); } .seg i.cur { background: var(--sun-d); }
.ls-body { flex: 1; overflow-y: auto; display: flex; padding: 12px max(18px, env(safe-area-inset-left, 0px)) 30px; } .ls-in { max-width: 640px; width: 100%; margin: auto; display: flex; flex-direction: column; gap: 20px; padding-top: 14px; }
.ls-in h1 { font-size: 1.8rem; color: var(--ink); }
.ls-foot { border-top: 1px solid var(--line); background: var(--bg); padding: 16px max(18px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)); }
.ls-foot.ok { background: var(--go-soft); border-color: var(--go); } .ls-foot.bad { background: var(--bad-soft); border-color: var(--bad); }
.ls-foot-in { max-width: 640px; margin: 0 auto; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ls-foot .msg { flex: 1; min-width: 220px; } .ls-foot.ok .msg { color: var(--go-ink); } .ls-foot.bad .msg { color: var(--bad-ink); }
.ls-foot .msg b { font-family: var(--fs); font-size: 1.2rem; display: block; font-weight: 700; } .ls-foot .msg span { font-weight: 400; font-size: .95rem; display: block; margin-top: 2px; color: var(--ink); }
.ls-foot .btn { min-width: 170px; }
.say { display: flex; gap: 14px; align-items: flex-end; } .say .bubble { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 14px 18px; flex: 1; font-size: 1.12rem; line-height: 1.6; }
.say .bubble::before { content: ''; position: absolute; left: -7px; bottom: 22px; width: 12px; height: 12px; background: var(--bg); border: 1px solid var(--line); border-top: 0; border-right: 0; transform: rotate(45deg); }
.ls-in .note { font-size: 1.1rem; line-height: 1.6; padding: 16px 18px; border-left-color: var(--brand); box-shadow: var(--shadow); }
.steps { display: flex; flex-direction: column; gap: 8px; } .steps .st { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); } .steps .st b { min-width: 118px; color: var(--brand); }
.opt { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; font: inherit; font-weight: 500; font-size: 1.02rem; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; min-height: 58px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--brand); } .opt .k { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border: 1.5px solid var(--line2); border-radius: 9px; font-size: .82rem; color: var(--ink2); font-weight: 700; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); } .opt.sel .k { border-color: var(--brand); color: var(--brand); background: var(--bg); }
.opt.ok { border-color: var(--go); background: var(--go-soft); color: var(--go-ink); } .opt.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-ink); }
.opt[disabled] { cursor: default; }
.bank { display: flex; flex-wrap: wrap; gap: 10px; min-height: 64px; padding: 6px 0; }
.tok { font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line2); border-radius: 12px; padding: 10px 16px; min-height: 46px; cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.tok:hover { border-color: var(--brand); } .tok.ghost { visibility: hidden; }
.answer { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 0; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.answer .slot { display: flex; align-items: center; gap: 10px; min-height: 50px; border-bottom: 1px dashed var(--line2); } .answer .slot .n { width: 26px; font-weight: 700; color: var(--ink2); }
.doc { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; line-height: 2; background: var(--bg); font-size: 1.05rem; }
.doc .sg { cursor: pointer; border-radius: 6px; padding: 2px 3px; border-bottom: 3px solid transparent; } .doc .sg:hover { background: var(--sun-soft); } .doc .sg.sel { background: var(--sky-soft); border-color: var(--sky); }
.doc .sg.hit { background: var(--go-soft); border-color: var(--go); } .doc .sg.miss { background: var(--bad-soft); border-color: var(--bad); } .doc .sg.fp { background: var(--sun-soft); border-color: var(--sun-d); text-decoration: line-through; }
.recap { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.recap .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.tile { border-radius: 16px; border: 1px solid var(--line); overflow: hidden; text-align: center; background: var(--bg); } .tile .t { padding: 6px; color: #fff; font-weight: 800; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; } .tile .v { padding: 14px 4px; font-family: var(--fs); font-weight: 700; font-size: 1.5rem; }
.tile.sun .t { background: var(--sun); color: #14213d; } .tile.go .t { background: var(--brand); color: var(--on-brand); } .tile.sky .t { background: var(--navy); }

/* ---------- Cartes à retourner (mode Quizlet) ---------- */
.deck { perspective: 1200px; } .fc { position: relative; height: 300px; cursor: pointer; transform-style: preserve-3d; transition: transform .45s; border: 0; background: none; width: 100%; padding: 0; font: inherit; color: inherit; }
.fc.flip { transform: rotateY(180deg); }
.fc .face { position: absolute; inset: 0; backface-visibility: hidden; border: 1px solid var(--line); border-radius: 22px; background: var(--bg); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 26px; gap: 10px; overflow: auto; }
.fc .face h3 { font-family: var(--fs); font-size: 1.5rem; } .fc .face p { font-size: 1.1rem; } .fc .back { transform: rotateY(180deg); background: var(--navy); border-color: var(--navy); color: #fff; } .fc .back h3, .fc .back p { color: #fff; }
.fc .hint { position: absolute; bottom: 12px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); } .fc .back .hint { color: #9aa8c7; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .match .tok { min-height: 76px; text-align: left; font-size: .95rem; font-weight: 500; display: flex; align-items: center; }
.match .tok.sel { border-color: var(--brand); background: var(--brand-soft); } .match .tok.done { visibility: hidden; } .match .tok.shake { animation: shake .3s; border-color: var(--bad); background: var(--bad-soft); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.mode { text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.mode:hover { border-color: var(--brand); } .mode .e { font-size: 1.8rem; }

/* ---------- Rail : quêtes, semaine ---------- */
.railcard h3 { margin-bottom: 10px; } .quest { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; } .quest + .quest { border-top: 1px solid var(--line); }
.week-dots { display: flex; gap: 8px; } .week-dots span { flex: 1; text-align: center; font-size: .7rem; font-weight: 700; color: var(--ink2); } .week-dots i { display: block; margin: 0 auto 4px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line2); background: var(--bg2); } .week-dots i.on { background: var(--sun); border-color: var(--sun-d); }
.pub { max-width: 1100px; margin: 0 auto; padding: 20px max(20px, env(safe-area-inset-left, 0px)) 60px; }
.pubhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 18px; }
.pubhead .logo { padding: 0; color: var(--ink); } .pubhead .logo b { color: var(--ink); }

/* ---------- Tableaux, formulaires, divers ---------- */
.scroll { overflow-x: auto; } table { border-collapse: collapse; width: 100%; font-size: .95rem; } th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; } th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink2); }
label.f { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=date], select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line2); border-radius: 12px; padding: 11px 14px; min-height: 46px; width: 100%; }
textarea { min-height: 120px; resize: vertical; } input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
label.chk { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 500; min-height: 46px; background: var(--bg); } label.chk:hover { border-color: var(--brand); background: var(--brand-soft); }
pre.t { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86rem; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; } .cmsg { max-width: 82%; padding: 10px 14px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line); } .cmsg.me { align-self: flex-end; background: var(--brand-soft); border-color: var(--brand); }
.badge { text-align: center; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 16px 10px; } .badge .b-ic { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; background: var(--sun); box-shadow: 0 0 0 4px var(--sun-soft); } .badge.off .b-ic { background: var(--bg2); box-shadow: none; filter: grayscale(1); opacity: .6; }
.kan { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: start; }
.cert { text-align: center; border: 4px double var(--sun-d); border-radius: 20px; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--bg); }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 12px; font-weight: 600; z-index: 100; max-width: 92vw; box-shadow: var(--shadow); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; } .confetti i { position: absolute; top: -20px; width: 8px; height: 12px; border-radius: 2px; animation: fall 1.6s ease-in forwards; } @keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .9; } }
.pop { animation: pop .35s; } @keyframes pop { 40% { transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .confetti { display: none; } }
@media (max-width: 560px) { .node-label { display: none; } .ls-foot .btn { width: 100%; } .recap .tiles { gap: 6px; } .match { gap: 8px; } .fc { height: 330px; } }

.card.link.row { display: flex; } .row.nowrap { flex-wrap: nowrap; }

.seal { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--sun); color: #14213d; box-shadow: 0 0 0 8px var(--sun-soft); }
:root[data-theme="dark"] .hero { background: #1a2748; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: #1a2748; } }
:root[data-theme="dark"] .unit { background: #1a2748; } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .unit { background: #1a2748; } }
