/* Cahier Malin — feuille de style unique. Mobile d'abord, clair/sombre automatiques. */
:root {
  --bg: #fbf7ef; --card: #ffffff; --ink: #1f2a44; --muted: #5b6784; --line: #e6dfd0; --soft: #f3eee2;
  --brand: #3b5bdb; --brand-ink: #ffffff; --brand-soft: #e7ecff;
  --hl: #ffd6dd; --hl-ink: #8a1f3a; --yellow: #fff1b8;
  --ok: #2b9a5f; --ok-soft: #dff5e8; --ko: #d6364f; --ko-soft: #fde4e8; --part: #b7791f; --part-soft: #fdf0d5;
  --shadow: 0 1px 2px rgba(31, 42, 68, .08), 0 6px 18px rgba(31, 42, 68, .06);
  --r: 18px; --tab-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131a2c; --card: #1c2542; --ink: #eef1fb; --muted: #a4aecb; --line: #2c3659; --soft: #232d4d;
    --brand: #8da2ff; --brand-ink: #101733; --brand-soft: #27325f;
    --hl: #5a2a3d; --hl-ink: #ffd6e0; --yellow: #4a4220;
    --ok: #55d08a; --ok-soft: #1e3d2e; --ko: #ff7a8e; --ko-soft: #4a2230; --part: #f2c26b; --part-soft: #46391b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
img, svg { max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
p { margin: .6em 0; }
small { color: var(--muted); }
.muted, .hint { color: var(--muted); }
.hint { font-size: .88rem; margin: .5rem 0 0; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.loading { padding: 3rem 1rem; text-align: center; color: var(--muted); }
mark { background: linear-gradient(transparent 55%, var(--hl) 55%); color: inherit; padding: 0 .1em; }

/* ---------- mise en page ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.chapter { padding-bottom: calc(var(--tab-h) + 40px + env(safe-area-inset-bottom)); }
.h2 { font-size: 1.05rem; margin: 26px 0 10px; letter-spacing: .01em; }
.lead { font-size: 1.05rem; color: var(--ink); }
.stack { display: grid; gap: 10px; margin: 16px 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.empty { text-align: center; color: var(--muted); padding: 24px 8px; }
.plain { padding-left: 1.2rem; color: var(--muted); }

/* ---------- boutons ---------- */
.btn {
  appearance: none; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700;
  padding: 12px 18px; border-radius: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  transition: transform .08s ease, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.btn.primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 8px 14px; font-size: .92rem; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--ko); }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; }
.chip {
  appearance: none; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.chip.big { font-size: 1rem; padding: 10px 18px; min-height: 44px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }

/* ---------- accueil ---------- */
.hero {
  background: var(--brand); color: var(--brand-ink); padding: 28px 16px 54px; position: relative;
  background-image: linear-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 100% 22px, 22px 100%;
  border-radius: 0 0 28px 28px;
}
@media (prefers-color-scheme: dark) { .hero { background-color: #27325f; color: #eef1fb; } }
.hero-in { max-width: 760px; margin: 0 auto; }
.logo { font-size: 2rem; font-weight: 900; letter-spacing: -.01em; user-select: none; -webkit-user-select: none; }
.logo mark { background: linear-gradient(transparent 52%, #ff6b8b 52%); color: inherit; padding: 0 .12em; }
.tag { margin: 4px 0 18px; opacity: .92; }
.search { display: flex; align-items: center; gap: 10px; background: var(--card); color: var(--ink); border-radius: 16px; padding: 0 14px; box-shadow: var(--shadow); position: absolute; left: 16px; right: 16px; bottom: -26px; max-width: 728px; margin: 0 auto; }
.search svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; font: inherit; color: inherit; height: 52px; min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.home { padding-top: 48px; }
.resume { display: flex; align-items: center; gap: 10px; background: var(--yellow); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.resume b { flex: 1; }
.resume-k { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--brand-soft); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; font-size: .95rem; }
.part { margin-top: 12px; }
.part-t { font-size: .95rem; margin: 18px 0 8px; color: var(--muted); }
.part-t span { background: var(--soft); border-radius: 8px; padding: 2px 8px; margin-right: 6px; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.ch { display: flex; align-items: center; gap: 12px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: var(--ink); min-height: 66px; }
a.ch { box-shadow: var(--shadow); border-color: transparent; }
.ch.soon { opacity: .55; }
.ch-n { width: 30px; height: 30px; border-radius: 10px; background: var(--hl); color: var(--hl-ink); font-weight: 800; display: grid; place-items: center; flex: none; }
.ch-t { flex: 1; font-weight: 700; display: grid; }
.ch-t small { font-weight: 400; }
.ring { flex: none; color: var(--ink); }
.hit { display: grid; gap: 2px; background: var(--card); border-radius: var(--r); padding: 12px 14px; margin-bottom: 8px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.hit-t { font-weight: 700; }
.hit .badge { justify-self: start; }
.badge.k-cours, .badge.k-chapitre { background: var(--brand-soft); color: var(--brand); }
.badge.k-exos { background: var(--part-soft); color: var(--part); }
.badge.k-eval { background: var(--ko-soft); color: var(--ko); }

/* ---------- chapitre ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px; background: var(--bg); padding: 8px 12px 8px 4px; border-bottom: 1px solid var(--line); }
.back { width: 44px; height: 44px; display: grid; place-items: center; font-size: 2rem; text-decoration: none; color: var(--ink); line-height: 1; }
.topbar h1 { font-size: 1.15rem; }
.crumb { font-size: .78rem; color: var(--muted); font-weight: 600; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0, 0, 0, .05); }
.tab { flex: 1; height: var(--tab-h); display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 700; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--brand); }
.tab.on svg { transform: translateY(-1px); }
@media (min-width: 800px) { .tabbar { max-width: 760px; left: 50%; transform: translateX(-50%); border-radius: 18px 18px 0 0; border: 1px solid var(--line); border-bottom: 0; } }

.fiches { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.fiche-card { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: var(--r); padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.fiche-card span:nth-child(2) { flex: 1; display: grid; }
.fiche-card small { font-weight: 400; }
.fiche-n { width: 38px; height: 38px; border-radius: 12px; background: var(--hl); color: var(--hl-ink); font-weight: 900; display: grid; place-items: center; flex: none; }

/* ---------- fiche de cours ---------- */
.fiche { background: var(--card); border-radius: var(--r); padding: 18px 16px 8px; box-shadow: var(--shadow); margin-bottom: 14px; }
.fiche-k { font-size: .75rem; text-transform: uppercase; font-weight: 800; letter-spacing: .06em; color: var(--muted); }
.fiche-t { font-size: 1.5rem; margin: 4px 0 12px; }
.sub { font-size: 1.05rem; margin: 20px 0 4px; color: var(--brand); }
.box { border-radius: 14px; padding: 12px 14px; margin: 14px 0; border-left: 6px solid; }
.box-t { font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.box p { margin: .3em 0; } .box ul, .box ol { margin: .3em 0; padding-left: 1.2rem; }
.box.key { background: var(--yellow); border-color: #f0b429; }
.box.tip { background: var(--brand-soft); border-color: var(--brand); }
.box.warn { background: var(--ko-soft); border-color: var(--ko); }
.box.example { background: var(--ok-soft); border-color: var(--ok); }
.formula { text-align: center; font-size: 1.25rem; font-weight: 800; background: var(--soft); border-radius: 14px; padding: 12px; margin: 14px 0; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; background: var(--soft); border-radius: 12px; padding: 10px 12px 10px 48px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 10px; top: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 800; display: grid; place-items: center; }
.tbl-wrap { overflow-x: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.tbl { border-collapse: collapse; width: 100%; font-size: .95rem; }
.tbl caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.tbl thead th { background: var(--soft); }
.fig { margin: 14px 0; text-align: center; }
.fig img { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px; max-height: 380px; }
.fig.small img { max-width: 220px; }
.fig figcaption { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.tl { list-style: none; padding: 0; margin: 14px 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 11px; top: 6px; bottom: 6px; width: 3px; background: var(--line); border-radius: 3px; }
.tl-item { position: relative; padding: 0 0 18px 34px; }
.tl-item::before { content: ""; position: absolute; left: 3px; top: 5px; width: 19px; height: 19px; border-radius: 50%; background: var(--brand); border: 4px solid var(--card); box-shadow: 0 0 0 2px var(--brand); }
.tl-item.minor::before { background: var(--line); box-shadow: 0 0 0 2px var(--line); }
.tl-year { display: inline-block; font-weight: 900; font-size: .85rem; background: var(--hl); color: var(--hl-ink); border-radius: 8px; padding: 1px 9px; }
.tl-who { font-weight: 800; margin-top: 4px; }
.tl-body p { margin: .2em 0 .4em; }
.tl-fig { width: 120px; height: 120px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.pager { display: flex; justify-content: space-between; gap: 8px; margin: 14px 0; }
.pager .btn { flex: 1; font-size: .88rem; text-align: center; }
.azx { display: inline-flex; align-items: center; vertical-align: middle; font-weight: 800; }
.azx-n { display: inline-flex; flex-direction: column; font-size: .6em; line-height: 1.05; margin-right: 1px; text-align: right; }
.azx-n sup, .azx-n sub { vertical-align: baseline; font-size: 1em; position: static; }
.azx-x { font-size: 1.15em; }

/* ---------- tableau périodique ---------- */
.pt-scroll { overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.pt-tools { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.pt { container-type: inline-size; display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); grid-template-rows: repeat(7, auto) 8px repeat(2, auto) auto; gap: 2px; }
.pt-scroll.zoomed .pt { min-width: 760px; }
.pt-cell { appearance: none; border: 0; border-radius: 4px; padding: 0; display: grid; justify-items: center; align-content: center; font: inherit; cursor: pointer; color: #1f2a44; aspect-ratio: 1 / 1.12; line-height: 1.05; overflow: hidden; }
div.pt-cell { cursor: default; }
.pt-z { font-size: clamp(4.5px, 1.6cqw, 9px); opacity: .75; } .pt-s { font-weight: 800; font-size: clamp(7px, 2.9cqw, 16px); } .pt-n { font-size: clamp(3px, .9cqw, 6px); }
.pt-cell.sel { outline: 3px solid var(--ink); z-index: 1; }
.pt-mark, .pt-g { font-size: clamp(4px, 1.5cqw, 10px); text-align: center; color: var(--muted); align-self: center; }
.pt-mark { border: 1px dashed var(--line); border-radius: 4px; aspect-ratio: 1 / 1.12; display: grid; place-items: center; line-height: 1; }
.pt-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0; margin: 8px 0; font-size: .78rem; color: var(--muted); }
.pt-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.fam-hydrogene { background: #ffe066; } .fam-alcalin { background: #ffa8a8; } .fam-alcalino { background: #ffc9a0; } .fam-transition { background: #ffe8a3; }
.fam-metal { background: #c5d4e8; } .fam-metalloide { background: #b8e0d2; } .fam-nonmetal { background: #a9e5a0; } .fam-halogene { background: #8fd9f2; }
.fam-noble { background: #d0bfff; } .fam-lanthanide { background: #ffc2e2; } .fam-actinide { background: #e7a8d2; }
.pt-info { background: var(--soft); border-radius: 14px; padding: 12px 14px; margin-top: 8px; font-size: .95rem; min-height: 52px; color: var(--muted); }
.el-card { display: flex; gap: 12px; align-items: center; color: var(--ink); }
.el-sym { width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; align-content: center; flex: none; color: #1f2a44; }
.el-sym span { font-size: .75rem; } .el-sym b { font-size: 1.5rem; line-height: 1; }
dialog { border: 0; border-radius: 20px; padding: 0; width: min(96vw, 940px); max-height: 92vh; background: var(--bg); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(10, 14, 30, .55); }
.dlg-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 16px; position: sticky; top: 0; background: var(--bg); }
.pt-host { padding: 0 12px 16px; }
.fiche-dlg[open] { display: flex; flex-direction: column; }
.dlg-body { flex: 1; overflow-y: auto; padding: 0 12px; -webkit-overflow-scrolling: touch; }
.dlg-body .fiche { box-shadow: none; padding: 8px 6px; }
.dlg-foot { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }

/* ---------- exercices ---------- */
.subtabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 4px 16px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.subtab { flex: none; scroll-snap-align: start; position: relative; text-decoration: none; color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 8px 14px 12px; font-weight: 700; font-size: .92rem; min-height: 44px; display: grid; align-content: center; }
.subtab.on { border-color: var(--brand); background: var(--brand-soft); }
.subtab i { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--ok) var(--p), var(--line) var(--p)); }
.notion { background: var(--card); border-radius: var(--r); padding: 18px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.notion-t { font-size: 1.3rem; }
.notion-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.notion-stats .k { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: block; margin-bottom: 4px; }
.meter { height: 10px; background: var(--line); border-radius: 10px; overflow: hidden; margin: 4px 0; }
.meter i { display: block; height: 100%; background: var(--ok); border-radius: 10px; }
.stars { font-size: 1.3rem; letter-spacing: 2px; }
.stars.big { font-size: 2rem; }
.star-row span { color: var(--line); }
.star-row span.on { color: #f0b429; }

/* ---------- questions ---------- */
.quiz-page { padding-top: 8px; }
.q-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bar { flex: 1; height: 12px; background: var(--line); border-radius: 12px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 12px; transition: width .3s; }
.q-count { font-size: .85rem; font-weight: 700; color: var(--muted); min-width: 44px; text-align: right; }
.q-card { background: var(--card); border-radius: var(--r); padding: 18px 16px; box-shadow: var(--shadow); }
.q-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.q-kind { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; }
.q-text { font-size: 1.12rem; font-weight: 600; margin-bottom: 12px; }
.choices { display: grid; gap: 10px; }
.choice { appearance: none; text-align: left; font: inherit; color: inherit; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; cursor: pointer; min-height: 52px; }
.choice .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
[role="checkbox"].choice .mark { border-radius: 6px; }
.choice.sel { border-color: var(--brand); background: var(--brand-soft); }
.choice.sel .mark { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px var(--brand-soft); }
.choice.good { border-color: var(--ok); background: var(--ok-soft); }
.choice.bad { border-color: var(--ko); background: var(--ko-soft); }
.locked .choice { cursor: default; }
.inp { font: inherit; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 48px; max-width: 100%; }
.inp:focus { outline: none; border-color: var(--brand); }
.inp.good { border-color: var(--ok); background: var(--ok-soft); }
.inp.bad { border-color: var(--ko); background: var(--ko-soft); }
.inp.wide, .area { width: 100%; }
.area { resize: vertical; }
.num-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.num-row .inp { flex: 1; min-width: 150px; }
.unit { font-weight: 700; }
.fields { display: grid; gap: 10px; }
.frow { display: grid; grid-template-columns: 1fr 120px; gap: 10px; align-items: center; }
.frow label { font-weight: 600; }
.frow .unit { grid-column: 2; }
.frow select.inp { width: 100%; }
.cloze { line-height: 2.4; }
.blank { padding: 4px 6px; min-height: 38px; margin: 0 2px; }
.matches { display: grid; gap: 10px; }
.mrow { display: grid; gap: 6px; } .mleft { font-weight: 600; }
.mrow select { width: 100%; }
.seq { list-style: none; padding: 10px; margin: 0 0 10px; display: grid; gap: 8px; counter-reset: seq; background: var(--soft); border-radius: 14px; min-height: 56px; }
.seq li { counter-increment: seq; display: flex; align-items: center; gap: 8px; }
.seq li:not(.seq-empty)::before { content: counter(seq); font-weight: 900; color: var(--muted); width: 22px; text-align: center; }
.seq-empty { color: var(--muted); font-size: .92rem; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.placed { border-color: var(--brand); background: var(--brand-soft); flex: 1; text-align: left; }
.chip.placed.good { border-color: var(--ok); background: var(--ok-soft); } .chip.placed.bad { border-color: var(--ko); background: var(--ko-soft); }
.q-actions { margin-top: 16px; }
.q-actions .btn { width: 100%; }
.q-feedback { margin-top: 14px; border-radius: 14px; padding: 0; }
.q-feedback.show { padding: 12px 14px; }
.q-feedback.ok { background: var(--ok-soft); } .q-feedback.ko { background: var(--ko-soft); } .q-feedback.part { background: var(--part-soft); } .q-feedback.info { background: var(--brand-soft); }
.fb-title { font-weight: 800; margin-bottom: 4px; }
.ok .fb-title { color: var(--ok); } .ko .fb-title { color: var(--ko); } .part .fb-title { color: var(--part); }
.fb-sol { margin: 6px 0; } .fb-sol span { font-weight: 700; color: var(--muted); }
.fb-exp { font-size: .96rem; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 6px; }
.fb-link { display: inline-block; margin-top: 8px; font-weight: 700; }
.crit { margin-top: 8px; } .crit p { margin: 4px 0; font-weight: 700; }
.crit-i { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.crit-i input { width: 22px; height: 22px; flex: none; margin-top: 2px; }
.sol-list { margin: 4px 0; padding-left: 1.3rem; }

/* ---------- résultats / bilan ---------- */
.score-card { text-align: center; background: var(--card); border-radius: 24px; padding: 24px 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
.score-k { font-weight: 700; color: var(--muted); }
.score { font-size: 3.2rem; font-weight: 900; color: var(--brand); line-height: 1.1; }
.correction { display: grid; gap: 10px; }
.corr { background: var(--card); border-radius: 14px; padding: 12px 14px; border-left: 6px solid var(--ko); }
.corr.ok { border-color: var(--ok); } .corr.part { border-color: var(--part); }
.corr-h { display: flex; gap: 8px; font-weight: 600; } .corr-fig { max-height: 150px; background: #fff; border-radius: 10px; margin: 6px 0; }
.all { margin: 16px 0; } .all summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: var(--card); border-radius: var(--r); padding: 14px; display: grid; justify-items: center; gap: 4px; box-shadow: var(--shadow); text-align: center; }
.kpi b { font-size: 1.8rem; line-height: 1.1; } .kpi span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.notion-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.notion-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; background: var(--card); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.notion-list .meter { grid-column: 1 / 2; } .notion-list small { text-align: right; }
.nl-t { font-weight: 700; }
.st-ok { background: var(--ok-soft); color: var(--ok); } .st-mid { background: var(--part-soft); color: var(--part); } .st-low { background: var(--ko-soft); color: var(--ko); } .st-new { background: var(--soft); }
.hist { list-style: none; padding: 0; display: grid; gap: 6px; }
.hist li { display: flex; justify-content: space-between; background: var(--card); border-radius: 12px; padding: 10px 14px; }
.chart { width: 100%; height: auto; background: var(--card); border-radius: var(--r); padding: 8px; }
.data { margin-top: 24px; } .data summary { cursor: pointer; font-weight: 700; }
.toast { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 20; background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; max-width: 520px; margin: 0 auto; }

@media (min-width: 700px) { body { font-size: 18px; } .page { padding-left: 24px; padding-right: 24px; } .kpis { grid-template-columns: repeat(4, 1fr); } .frow { grid-template-columns: 220px 140px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* « Ta réponse » / « Correction » dans l'écran de correction */
.ans-row { display: grid; grid-template-columns: 5.2rem 1fr; gap: 2px 10px; align-items: baseline; margin: 6px 0 0; font-size: .96rem; }
.ans-k { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 2px; }
.ans-v { min-width: 0; overflow-wrap: anywhere; }
.ans-row.you.ko .ans-v, .ans-row.you.part .ans-v { color: var(--ko); }
.ans-row.you.ok .ans-v { color: var(--ok); font-weight: 600; }
.ans-row.sol .ans-v { color: var(--ok); font-weight: 700; }
.ans-row.sol .ans-v b { font-weight: 800; }
.ans-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ans-list li { display: flex; gap: 6px; align-items: baseline; }
.ans-list.ord { counter-reset: o; } .ans-list.ord li::before { counter-increment: o; content: counter(o) "."; color: var(--muted); font-weight: 700; min-width: 1.2em; }
.mk { font-style: normal; font-weight: 900; width: 1.2em; text-align: center; flex: none; }
.mk.y { color: var(--ok); } .mk.n { color: var(--ko); }
.ans-row.you .ans-list b { font-weight: 700; }
.ans-row.you .ans-list li:has(.mk.y) { color: var(--ok); } .ans-row.you .ans-list li:has(.mk.n) { color: var(--ko); }
.fill { border-bottom: 2px solid; padding: 0 3px; font-weight: 700; }
.fill.y { color: var(--ok); border-color: var(--ok); } .fill.n { color: var(--ko); border-color: var(--ko); text-decoration: line-through; text-decoration-thickness: 1px; }
.pre { white-space: pre-wrap; }
@media (max-width: 340px) { .ans-row { grid-template-columns: 1fr; } }
