:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f1f0eb;
  --ink: #1b1b19;
  --ink-2: #52514e;
  --ink-3: #7b7a74;
  --line: #e2e0d8;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0fc;
  --ok: #0c7d0c;
  --ok-soft: #e3f4e3;
  --warn: #a86a00;
  --warn-soft: #fbf1dc;
  --ko: #c03030;
  --ko-soft: #fbe6e6;
  --l1: #1baf7a;
  --l2: #2a78d6;
  --l3: #6250d6;
  --rappel: #a8580e;
  --series-1: #2a78d6;
  --chart-surface: #fcfcfb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111110; --surface: #1c1c1a; --surface-2: #252523; --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #96958c;
    --line: #34332f; --accent: #3987e5; --accent-soft: #1b2c42; --ok: #3dbb3d; --ok-soft: #173017;
    --warn: #e0a030; --warn-soft: #362a12; --ko: #e66767; --ko-soft: #3a1c1c;
    --l1: #199e70; --l2: #3987e5; --l3: #9085e9; --rappel: #e5a15a; --series-1: #3987e5; --chart-surface: #1a1a19;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111110; --surface: #1c1c1a; --surface-2: #252523; --ink: #f0efec; --ink-2: #c3c2b7; --ink-3: #96958c;
  --line: #34332f; --accent: #3987e5; --accent-soft: #1b2c42; --ok: #3dbb3d; --ok-soft: #173017;
  --warn: #e0a030; --warn-soft: #362a12; --ko: #e66767; --ko-soft: #3a1c1c;
  --l1: #199e70; --l2: #3987e5; --l3: #9085e9; --rappel: #e5a15a; --series-1: #3987e5; --chart-surface: #1a1a19;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 24px; padding-bottom: 64px; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--ink-2); }

/* Barre du haut */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-in { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; }
.brand-logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 1.2rem; }
.mainnav { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.mainnav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-weight: 500; }
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a.on { background: var(--accent-soft); color: var(--accent); }
.mainnav .who { color: var(--ink-3); font-size: .9rem; padding: 0 8px; border-left: 1px solid var(--line); margin-left: 8px; }
.mainnav .logout { font-size: .9rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 1.1rem; color: var(--ink); }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .mainnav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  .nav-open .mainnav { display: flex; }
  .mainnav .who { border: 0; margin: 8px 0 0; padding: 8px 12px; }
}

/* Éléments génériques */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.narrow { max-width: 560px; margin: 0 auto; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-bottom: 16px; }
.grid2 > .card { margin-bottom: 0; }
.page-head { margin-bottom: 20px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: .9rem; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { color: var(--ink-2); }
.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); vertical-align: middle; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-parent { background: var(--warn-soft); color: var(--warn); }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--ko-soft); color: var(--ko); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }
.btn-sm { padding: 5px 12px; font-size: .9rem; }
.btn-block { width: 100%; justify-content: center; }

.input, .form input, .form select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.input:focus, .form input:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.form label { display: block; font-weight: 500; margin-bottom: 12px; }
.form label input, .form label select { margin-top: 4px; font-weight: 400; display: block; }
.form fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 16px; padding: 12px 16px 4px; }
.form legend { font-weight: 700; padding: 0 6px; }
.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.form-inline .input { width: auto; flex: 1 1 180px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tab { padding: 10px 16px; text-decoration: none; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chip { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kv { list-style: none; padding: 0; margin: 12px 0 0; }
.kv li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* Connexion */
.login { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; min-height: 60vh; }
.login-hero h1 { font-size: 2.2rem; }
.login-hero p { font-size: 1.15rem; color: var(--ink-2); }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; } .login-hero h1 { font-size: 1.6rem; } }

/* Matières */
.subject-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.subject-tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600; }
.subject-tab:hover { border-color: var(--accent); color: var(--ink); }
.subject-tab.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.subject-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; }
.subject-tab.on .subject-ico { background: rgba(255,255,255,.2); color: var(--accent-ink); }
.subject-ico.big { width: 44px; height: 44px; border-radius: 12px; font-size: 1.4rem; }
.subjects { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; margin-bottom: 16px; }
.subjects > .card { margin-bottom: 0; }
.subject-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.subject-card h2 { margin: 0; }
.subject-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.resume-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.resume-card h2 { margin: 6px 0 2px; }
.login-subjects { list-style: none; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.login-subjects li { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.fig { display: block; margin: 12px auto; width: min(100%, 440px); max-width: 100%; height: auto; background: var(--chart-surface); border-radius: 8px; }
.fig .fg-grid { stroke: var(--line); stroke-width: 1; }
.fig .fg-axe { stroke: var(--ink-2); stroke-width: 1.5; }
.fig .fg-arrow { fill: var(--ink-2); }
.fig .fg-arrowv { fill: var(--l3); }
.fig .fg-num { fill: var(--ink-3); font-size: 11px; font-family: inherit; }
.fig .fg-nom { fill: var(--ink); font-size: 14px; font-weight: 600; font-family: inherit; }
.fig .fg-vecnom { fill: var(--l3); }
.fig .fg-courbe { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.fig .fg-courbe2 { fill: none; stroke: var(--l1); stroke-width: 2.5; }
.fig .fg-seg { stroke: var(--ink); stroke-width: 2; }
.fig .fg-dash { stroke: var(--ink-3); stroke-width: 1.2; stroke-dasharray: 4 3; }
.fig .fg-vec { stroke: var(--l3); stroke-width: 2.5; }
.fig .fg-pt { fill: var(--ink); }
.fig .fg-poly { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.figs-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
pre.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; overflow-x: auto; font-size: .92rem; line-height: 1.5; }
.es { font-style: italic; }
.vocab td:first-child { font-weight: 600; text-align: left; }

/* Tuiles de stats */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); }
.tile-k { font-size: .85rem; color: var(--ink-2); }
.tile-v { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-v small { font-size: 1rem; color: var(--ink-3); font-weight: 500; }
@media (max-width: 480px) { .tile { padding: 12px; } .tile-v { font-size: 1.4rem; } .card { padding: 16px; } .cours-section { padding: 16px; } h1 { font-size: 1.35rem; } }
.tile-s { font-size: .8rem; color: var(--ink-3); }

.howto li { margin-bottom: 8px; }

/* Programme */
.theme { margin-bottom: 28px; }
.theme-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: 10px; }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.chapter { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.chapter header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.chapter h3 { margin: 0; }
.chapter-soon { background: var(--surface-2); box-shadow: none; }
.notions { margin: 0; padding-left: 22px; }
.notion-row { padding: 5px 0; }
.notion-row > a, .notion-row > span:first-child { margin-right: 8px; }
.notion-row a { color: var(--ink); text-decoration: none; font-weight: 500; }
.notion-row a:hover { color: var(--accent); text-decoration: underline; }
.lvl-dots { display: inline-flex; gap: 4px; vertical-align: middle; float: right; margin-top: 6px; }
.lvl-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); vertical-align: middle; }
.lvl-dot.l1.part { border-color: var(--l1); } .lvl-dot.l1.ok { background: var(--l1); border-color: var(--l1); }
.lvl-dot.l2.part { border-color: var(--l2); } .lvl-dot.l2.ok { background: var(--l2); border-color: var(--l2); }
.lvl-dot.l3.part { border-color: var(--l3); } .lvl-dot.l3.ok { background: var(--l3); border-color: var(--l3); }

/* Notion : cours */
.notion-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.notion-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.side-box h3 { font-size: .95rem; margin-bottom: 6px; }
.side-box ul, .side-box ol { margin: 0; padding-left: 18px; font-size: .92rem; }
.side-box .chips { font-size: .9rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
@media (max-width: 900px) { .notion-layout { grid-template-columns: 1fr; } .notion-side { position: static; } }
.cours { min-width: 0; }
.cours-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; scroll-margin-top: 80px; }
.cours-section h2 { color: var(--accent); }
.cours p, .rappel-content p { margin: .6em 0; }
.cours-end { text-align: center; }

/* Encadrés pédagogiques */
.box { border-radius: 10px; padding: 12px 16px; margin: 14px 0; border-left: 4px solid; background: var(--surface-2); }
.box > :first-child { margin-top: 0; } .box > :last-child { margin-bottom: 0; }
.box-title { display: block; font-weight: 700; margin-bottom: 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; }
.def { border-color: var(--accent); background: var(--accent-soft); }
.def .box-title { color: var(--accent); }
.prop { border-color: var(--l3); }
.prop .box-title { color: var(--l3); }
.methode { border-color: var(--l1); }
.methode .box-title { color: var(--l1); }
.exemple { border-color: var(--ink-3); background: var(--surface); border: 1px dashed var(--line); border-left: 4px solid var(--ink-3); }
.attention { border-color: var(--ko); background: var(--ko-soft); }
.attention .box-title { color: var(--ko); }
.astuce { border-color: var(--warn); background: var(--warn-soft); }
.astuce .box-title { color: var(--warn); }
details.check { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0; background: var(--surface); }
details.check summary { cursor: pointer; font-weight: 600; color: var(--l1); }
details.check summary::before { content: "✎ "; }
details.check[open] summary { margin-bottom: 6px; }
.cours table, .rappel-content table { border-collapse: collapse; margin: 10px 0; max-width: 100%; }
.cours td, .cours th, .rappel-content td, .rappel-content th { border: 1px solid var(--line); padding: 6px 10px; text-align: center; }
.cours th, .rappel-content th { background: var(--surface-2); }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.figure { display: block; margin: 12px auto; max-width: 100%; height: auto; }
.figure text { fill: var(--ink); font-size: 13px; font-family: inherit; }
.figure .axe { stroke: var(--ink-2); stroke-width: 1.5; }
.figure .zone { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.figure .pt { fill: var(--accent); }

/* Lien de rappel */
.rappel-link { color: var(--rappel); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; font-weight: 500; }
.rappel-ico { font-size: .75em; margin-left: 2px; vertical-align: super; }
.notion-link { font-weight: 500; }

/* Exercices : niveaux */
.levels { display: grid; gap: 14px; }
.level { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--lc); border-radius: var(--radius); padding: 16px 20px; }
.level-1 { --lc: var(--l1); } .level-2 { --lc: var(--l2); } .level-3 { --lc: var(--l3); }
.level header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.level h3 { margin: 0; }
.level-badge { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--lc, var(--accent)); }
h1 .level-badge { display: block; margin-bottom: 4px; }
.series { display: flex; flex-wrap: wrap; gap: 8px; }
.serie-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; background: var(--surface-2); }
.serie-btn:hover { border-color: var(--lc); }
.serie-btn.done { background: var(--warn-soft); }
.serie-btn.ok { background: var(--ok-soft); }
.serie-btn.surprise { background: transparent; border-style: dashed; color: var(--lc); }
.serie-score { font-size: .8rem; font-weight: 700; }

/* Exercice */
.exo { position: relative; }
.exo-num { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.exo-q { font-size: 1.05rem; margin-bottom: 12px; }
.exo-q p:first-child { margin-top: 0; }
.answer-row { display: flex; align-items: center; gap: 8px; }
.answer-prefix { white-space: nowrap; }
.answer { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.05rem; max-width: 420px; }
.keypad { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.key { min-width: 38px; padding: 5px 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 8px; font: inherit; cursor: pointer; }
.key:hover { border-color: var(--accent); }
.preview { margin-left: 8px; color: var(--ink-2); min-height: 1.5em; }
.qcm { display: grid; gap: 8px; }
.qcm-opt { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.qcm-opt:hover { border-color: var(--accent); }
.qcm-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
details.aide { margin-top: 12px; }
details.aide summary { cursor: pointer; color: var(--warn); font-weight: 600; font-size: .92rem; }
details.aide > div { background: var(--warn-soft); border-radius: 8px; padding: 10px 14px; margin-top: 6px; }
.serie-submit { display: flex; align-items: center; gap: 16px; margin-top: 20px; }

/* Correction */
.result-head { display: flex; gap: 20px; align-items: center; border-left: 6px solid var(--rc); }
.res-ok { --rc: var(--ok); } .res-mid { --rc: var(--warn); } .res-low { --rc: var(--ko); }
.result-score { font-size: 2.4rem; font-weight: 800; color: var(--rc); white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-head h1 { font-size: 1.2rem; }
.result-msg { margin: 0 0 4px; font-weight: 500; }
.corr { border-left: 5px solid var(--cc); }
.corr.is-ok { --cc: var(--ok); } .corr.is-ko { --cc: var(--ko); } .corr.is-pending { --cc: var(--warn); }
.verdict { color: var(--cc); }
.corr-answers { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 8px; }
.corr-answers dt { color: var(--ink-3); font-size: .9rem; }
.corr-answers dd { margin: 0; }
.corr-msg { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 8px; font-size: .92rem; }
details.solution summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.solution > div { background: var(--surface-2); border-radius: 8px; padding: 10px 16px; margin-top: 8px; }
.autoeval { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; flex-wrap: wrap; }

/* Statistiques */
.score { display: inline-block; font-weight: 700; font-size: .85rem; padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.score-ok { background: var(--ok-soft); color: var(--ok); }
.score-mid { background: var(--warn-soft); color: var(--warn); }
.score-low { background: var(--ko-soft); color: var(--ko); }
.status { font-size: .85rem; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--line); vertical-align: middle; }
.st-encours::before { background: var(--warn); }
.st-acquis::before { background: var(--l1); }
.st-maitrise::before { background: var(--l2); }
.st-expert::before { background: var(--l3); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid var(--line); padding: 8px; white-space: nowrap; }
.table td { border-bottom: 1px solid var(--line); padding: 8px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-group td { background: var(--surface-2); font-weight: 700; font-size: .85rem; color: var(--ink-2); }

.chart { width: 100%; height: auto; display: block; background: var(--chart-surface); border-radius: 8px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--ink-3); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 15px; font-family: inherit; }
.chart .mark { fill: var(--series-1); }
.chart .hit { fill: transparent; }
.chart .bar:hover .hit, .chart .dot:hover .hit { fill: var(--line); opacity: .35; }
.chart .mark-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.chart .mark-dot { fill: var(--series-1); stroke: var(--chart-surface); stroke-width: 2; }
.tip { position: fixed; z-index: 50; background: var(--ink); color: var(--bg); font-size: .82rem; padding: 6px 10px; border-radius: 6px; pointer-events: none; max-width: 260px; }

/* Fenêtre de rappel */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface); border-radius: 14px; width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-kicker { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--rappel); }
.modal-close { margin-left: auto; }
.modal-head button { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; color: var(--ink); font: inherit; }
.modal-body { overflow-y: auto; padding: 16px 22px 20px; }
.rappel-page { max-width: 820px; }
.rappel-groups { columns: 2 380px; column-gap: 16px; }
.rappel-group { break-inside: avoid; }
#rappel-filter { max-width: 420px; margin-top: 8px; }
table.signes { border-collapse: collapse; margin: 12px auto; }
table.signes th, table.signes td { border: none; border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: center; min-width: 28px; }
table.signes th { border-right: 2px solid var(--ink-3); background: transparent; text-align: left; white-space: nowrap; }
table.signes tr:first-child { border-bottom: 2px solid var(--ink-3); }
table.signes .signes-total td { font-weight: 700; }
blockquote { margin: 8px 0 12px; padding: 10px 16px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.notion-link.soon { color: var(--ink-3); font-weight: 400; cursor: default; }
.flash-info { background: var(--accent-soft); color: var(--ink); border-left: 4px solid var(--accent); }
.serie-btn .serie-voir { font-size: .75rem; font-weight: 500; opacity: .8; }

/* Espace parent : configuration des comptes élèves */
.eleve-configs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.eleve-config { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.eleve-config h3 { margin: 0 0 12px; font-size: 1.05rem; }
.eleve-config:target { outline: 2px solid var(--accent); }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Connexion persistante et application installable ---------- */
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink-2); }
.check-line input { width: auto; margin: 0; }
.mainnav a.who { text-decoration: none; }
.install-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; width: min(560px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: 12px 14px; }
.install-banner[hidden] { display: none; }
.install-banner-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 1.3rem; }
.install-banner-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: .92rem; line-height: 1.35; }
.install-banner-txt span { color: var(--ink-2); }
.install-banner-close { flex: none; background: none; border: 0; color: var(--ink-3); font-size: 1.1rem; cursor: pointer; padding: 6px; }
@media (display-mode: standalone) { .install-banner { display: none !important; } }
