/* =====================================================================
   GeoGebra 9-10-11 · Mathématiques & OS Maths-Physique
   Mise en forme reprise de la plateforme « Mathématiques 9-10-11 »
   ===================================================================== */
:root {
  --bg: #F3F1FA;
  --surface: #FFFFFF;
  --text: #1E2235;
  --muted: #646A80;
  --line: #E3E1EE;
  --night: #1D2452;
  --night-2: #2B3576;
  --sun: #FFC845;
  --ok: #1FA37A;
  --bug: #E0475B;
  --flou: #F47C14;
  --idee: #6C5CB4;
  --maths: #00ACD0;
  --eureka: #7B5CD6;
  --intro: #1FA37A;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  box-sizing: border-box;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12142A; --surface: #1C1F3B; --text: #ECEDF5; --muted: #A6AAC4; --line: #2D3158;
    --night: #0C0E22; --night-2: #1A1E44; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12142A; --surface: #1C1F3B; --text: #ECEDF5; --muted: #A6AAC4; --line: #2D3158;
  --night: #0C0E22; --night-2: #1A1E44; color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; font-family: var(--body); font-size: 1rem; line-height: 1.5; color: var(--text); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
svg.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- En-tête ---------- */
.hero { position: relative; overflow: hidden; background: var(--night); color: #fff; }
.hero-shapes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-inner { position: relative; max-width: 82rem; margin: 0 auto; padding: 1.75rem 1.25rem 0; }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.7rem, 4.2vw, 2.8rem); line-height: 1.05; margin: 0; letter-spacing: -.01em; }
.hero h1 .amp { color: var(--sun); }
.hero p { margin: .45rem 0 1.5rem; color: #C9CDEB; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hero p .ggb-dot { width: 1.1rem; height: 1.1rem; }
.tabs-top { display: flex; gap: .5rem; align-items: flex-end; overflow-x: auto; scrollbar-width: none; }
.tabs-top::-webkit-scrollbar { display: none; }
.tabs-top .spacer { flex: 1; }
.top-tab {
  border: 0; cursor: pointer; font-family: var(--display); font-weight: 800; text-decoration: none;
  font-size: 1.9rem; line-height: 1; padding: .7rem 1.4rem .8rem; border-radius: 14px 14px 0 0;
  background: var(--night-2); color: #AEB4E0; transition: background .15s, color .15s;
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap; flex: none;
}
.top-tab sup { font-size: .5em; }
.top-tab:hover { color: #fff; }
.top-tab[aria-selected="true"] { background: var(--bg); color: var(--text); padding-top: 1rem; }
.top-tab.feed-tab { font-size: 1.15rem; padding-top: .95rem; padding-bottom: .95rem; }
.top-tab.feed-tab[aria-selected="true"] { padding-top: 1.2rem; }
.top-tab.feed-tab svg.i { width: 1.35em; height: 1.35em; }
.top-tab .badge { display: grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--sun); color: #1E2235; font-family: var(--body); font-size: .78rem; font-weight: 700; }

/* ---------- Barre filière + identité ---------- */
.levels-bar { max-width: 82rem; margin: 0 auto; padding: 1.25rem 1.25rem .5rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.levels { display: inline-flex; gap: .35rem; background: var(--surface); padding: .3rem; border-radius: 999px; border: 1px solid var(--line); }
.level { border: 0; background: none; padding: .45rem 1.1rem; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--muted); white-space: nowrap; }
.level:hover { color: var(--text); }
.level[aria-pressed="true"] { background: var(--night); color: #fff; }
.levels-bar .spacer { flex: 1; }
.who { display: inline-flex; align-items: center; gap: .55rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .4rem .3rem .9rem; font-size: .92rem; }
.who strong { font-weight: 700; }
.who .classe { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--bg); color: var(--muted); }
.who button { border: 0; background: var(--bg); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font-size: .85rem; font-weight: 700; color: var(--muted); }
.who button:hover { color: var(--text); }
.who.anon { padding-right: .3rem; }
.who.anon button { background: var(--sun); color: #1E2235; }

/* ---------- Mise en page ---------- */
.layout { max-width: 82rem; margin: 0 auto; padding: .75rem 1.25rem 3rem; display: grid; grid-template-columns: 17.5rem 1fr; gap: 1.5rem; align-items: start; }
nav.chapters { position: sticky; top: 1rem; display: grid; gap: .75rem; max-height: calc(100vh - 2rem); overflow-y: auto; scrollbar-width: thin; }
.axis { background: var(--surface); border-radius: 14px; padding: .6rem; border: 1px solid var(--line); }
.axis-title { display: flex; align-items: center; gap: .55rem; padding: .2rem .35rem .45rem; font-weight: 700; font-size: .9rem; }
.axis-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--c); flex: none; }
.chapter-btn { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; padding: .4rem .55rem; border-radius: 8px; color: var(--muted); }
.chapter-btn .code { display: grid; place-items: center; min-width: 2.2rem; height: 1.6rem; padding: 0 .3rem; border-radius: 7px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-family: var(--display); font-weight: 800; font-size: .8rem; flex: none; }
.chapter-btn .t { flex: 1; min-width: 0; }
.chapter-btn .n { font-size: .78rem; font-weight: 700; color: var(--muted); opacity: .8; }
.chapter-btn:hover { background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--text); }
.chapter-btn[aria-current="true"] { background: var(--c); color: #fff; font-weight: 700; }
.chapter-btn[aria-current="true"] .code { background: rgba(255,255,255,.22); color: #fff; }
.chapter-btn[aria-current="true"] .n { color: #fff; }
.chapter-select { display: none; }

main { min-width: 0; }
.chapter-head { position: relative; overflow: hidden; border-radius: 20px; padding: 1.5rem 1.6rem 1.6rem; background: var(--c); color: #fff; margin-bottom: 1.25rem; }
.chapter-head .ghost { position: absolute; right: -.05em; bottom: -.3em; font-family: var(--display); font-weight: 800; font-size: clamp(6rem, 14vw, 10rem); line-height: 1; color: rgba(255,255,255,.16); pointer-events: none; }
.chapter-head .crumb { margin: 0; opacity: .92; font-size: .95rem; }
.chapter-head h2 { position: relative; font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 3.5vw, 2.4rem); line-height: 1.1; margin: .2rem 0 0; max-width: 22ch; }
.chapter-head .desc { position: relative; margin: .55rem 0 0; max-width: 60ch; opacity: .95; }
.chapter-head .prog { position: relative; display: inline-flex; align-items: center; gap: .45rem; margin-top: .85rem; background: rgba(255,255,255,.18); border-radius: 999px; padding: .25rem .75rem; font-size: .85rem; font-weight: 700; }

/* ---------- Cartes d'exercices ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 1rem; }
.card { background: var(--surface); border-radius: 16px; border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.card .thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; display: block; padding: .5rem; transition: transform .25s; }
.card .thumb:hover img { transform: scale(1.04); }
.card .thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 10%, #fff); color: var(--c); font-family: var(--display); font-weight: 800; font-size: 2.2rem; }
.card .num { position: absolute; left: .7rem; top: .7rem; background: var(--c); color: #fff; font-family: var(--display); font-weight: 800; font-size: .9rem; padding: .2rem .6rem; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.card .done { position: absolute; right: .7rem; top: .7rem; display: inline-flex; align-items: center; gap: .3rem; background: var(--ok); color: #fff; font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.card-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.15rem; line-height: 1.25; }
.card .consigne { margin: 0; color: var(--muted); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card .consigne.open { -webkit-line-clamp: unset; }
.card .more { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--c); font-weight: 700; font-size: .85rem; cursor: pointer; }
.card .consigne.eur { font-style: italic; }
.variants { display: grid; gap: .35rem; margin-top: .15rem; }
.variant { display: flex; align-items: center; gap: .55rem; background: var(--bg); border-radius: 10px; padding: .35rem .4rem .35rem .55rem; }
.variant .vl { display: grid; place-items: center; min-width: 1.8rem; height: 1.6rem; padding: 0 .45rem; border-radius: 7px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 700; font-size: .82rem; white-space: nowrap; }
.variant .vt { flex: 1; min-width: 0; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.variant .ok { color: var(--ok); display: inline-flex; }
.card-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: auto; padding-top: .35rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; font-weight: 700; font-size: .9rem; padding: .5rem .9rem; border-radius: 10px; white-space: nowrap; }
.btn-go { background: var(--c, var(--night)); color: #fff; }
.btn-go:hover { filter: brightness(1.08); }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; border-radius: 8px; }
.btn-sec { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-sec:hover { border-color: var(--c, var(--night)); }
.btn-sun { background: var(--sun); color: #1E2235; }
.btn-sun:hover { filter: brightness(1.05); }
.btn-night { background: var(--night); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.empty { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 2px dashed var(--line); border-radius: 16px; padding: 1.4rem 1.5rem; color: var(--muted); }
.empty svg.i { width: 2rem; height: 2rem; color: var(--c, var(--muted)); }

/* ---------- Vue Feedback ---------- */
.page { max-width: 82rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.page h2 { font-family: var(--display); font-weight: 800; font-size: 1.7rem; margin: 0 0 .25rem; }
.page .lead { margin: 0 0 1.25rem; color: var(--muted); max-width: 70ch; }
.fb-grid { display: grid; grid-template-columns: minmax(0, 23rem) 1fr; gap: 1.5rem; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.25rem 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.panel h3 { font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.panel-head h3 { margin: 0; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: .6rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 1.8rem 1fr; gap: .6rem; align-items: start; font-size: .95rem; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--night); color: #fff; font-weight: 700; font-size: .85rem; }
.steps li strong { display: block; }
.steps li span { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .4rem 0 .9rem; }
.stat { background: var(--bg); border-radius: 12px; padding: .6rem .7rem; }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: 1.6rem; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }
.me { display: flex; align-items: center; gap: .8rem; }
.avatar { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--sun); color: #1E2235; font-family: var(--display); font-weight: 800; font-size: 1.3rem; flex: none; }
.me .nm { font-family: var(--display); font-weight: 800; font-size: 1.3rem; line-height: 1.1; }
.me .cl { color: var(--muted); font-size: .9rem; }

.subtabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }
.subtab { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); padding: .45rem .85rem; border-radius: 12px; font-weight: 700; font-size: .92rem; }
.subtab .n { display: grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--bg); font-size: .78rem; color: var(--muted); }
.subtab[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.subtab[aria-selected="true"] .n { background: var(--sun); color: #1E2235; }

.fb-list { display: grid; gap: .6rem; }
.fb-item { border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; background: var(--surface); }
.fb-item .top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.fb-item .ex { font-weight: 700; }
.fb-item .when { margin-left: auto; font-size: .8rem; color: var(--muted); }
.fb-item p { margin: .35rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-item .meta { margin-top: .35rem; font-size: .8rem; color: var(--muted); display: flex; gap: .8rem; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--p) 14%, transparent); color: var(--p); white-space: nowrap; }
.todo { display: grid; gap: .35rem; }
.todo a { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 10px; text-decoration: none; background: var(--bg); }
.todo a:hover { outline: 1.5px solid var(--c); }
.todo .code { display: grid; place-items: center; min-width: 3.3rem; height: 1.6rem; padding: 0 .35rem; border-radius: 7px; background: var(--c); color: #fff; font-family: var(--display); font-weight: 800; font-size: .78rem; }
.todo .t { flex: 1; min-width: 0; font-size: .92rem; }
.todo .ch { font-size: .78rem; color: var(--muted); }

/* ---------- Identification ---------- */
.ident h4 { margin: .2rem 0 .5rem; font-size: .95rem; }
.class-choice { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .8rem; }
.class-btn { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: .7rem .5rem; cursor: pointer; text-align: center; }
.class-btn b { display: block; font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1.1; }
.class-btn span { font-size: .8rem; color: var(--muted); }
.class-btn[aria-pressed="true"] { border-color: var(--night); background: var(--night); color: #fff; }
.class-btn[aria-pressed="true"] span { color: #C9CDEB; }
.code-row { display: flex; gap: .5rem; }
.field { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .75rem; background: var(--surface); }
.field:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sun) 50%, transparent); }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .4rem; margin-top: .3rem; }
.name-btn { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: .55rem .4rem; cursor: pointer; font-weight: 700; font-size: .92rem; }
.name-btn:hover { border-color: var(--night); background: var(--bg); }
.msg { margin: .5rem 0 0; font-size: .9rem; }
.msg.err { color: var(--bug); font-weight: 700; }
.msg.ok { color: var(--ok); font-weight: 700; }
.hint { font-size: .85rem; color: var(--muted); margin: .35rem 0 0; }

/* ---------- Fenêtre « Donner mon avis » ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 1rem; background: rgba(12, 14, 34, .55); }
.modal-box { width: min(40rem, 100%); max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.5); }
.modal-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; gap: .8rem; padding: 1.1rem 1.25rem .9rem; background: var(--night); color: #fff; }
.modal-head h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1.15; }
.modal-head p { margin: .2rem 0 0; color: #C9CDEB; font-size: .9rem; }
.modal-head .x { margin-left: auto; border: 0; background: rgba(255,255,255,.12); color: #fff; border-radius: 10px; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; cursor: pointer; flex: none; }
.modal-body { padding: 1.1rem 1.25rem 1.25rem; display: grid; gap: 1rem; }
.q > .ql { display: block; font-weight: 700; margin-bottom: .4rem; }
.q > .ql small { font-weight: 400; color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: flex; align-items: center; gap: .45rem; height: 100%; border: 2px solid var(--line); border-radius: 12px; padding: .55rem .7rem; cursor: pointer; font-weight: 700; font-size: .92rem; }
.choice span svg.i { color: var(--p, var(--muted)); width: 1.3em; height: 1.3em; }
.choice input:checked + span { border-color: var(--p, var(--night)); background: color-mix(in srgb, var(--p, var(--night)) 12%, transparent); }
.choice input:focus-visible + span { outline: 3px solid var(--sun); outline-offset: 2px; }
.choices.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.small span { font-weight: 600; justify-content: center; padding: .45rem .5rem; }
textarea.field { min-height: 7rem; resize: vertical; }
.count { text-align: right; font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.modal-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.modal-foot .dev { font-size: .8rem; color: var(--muted); margin-right: auto; }
.success { text-align: center; padding: 1.5rem 1rem 1rem; }
.success .big { display: grid; place-items: center; width: 4rem; height: 4rem; margin: 0 auto .6rem; border-radius: 50%; background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.success .big svg.i { width: 2.2rem; height: 2.2rem; }
.success h4 { font-family: var(--display); font-weight: 800; font-size: 1.4rem; margin: 0; }
.success p { color: var(--muted); margin: .3rem 0 1rem; }

.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 60; background: var(--night); color: #fff; padding: .7rem 1.1rem; border-radius: 12px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); font-weight: 700; display: flex; align-items: center; gap: .5rem; max-width: calc(100% - 2rem); }

/* ---------- Pied de page ---------- */
.foot { max-width: 82rem; margin: 0 auto; padding: 1rem 1.25rem 2rem; display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.foot a { color: var(--muted); }
.foot .spacer { flex: 1; }

/* ---------- Page exercice ---------- */
body.player { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.pbar { flex: none; display: flex; align-items: center; gap: .6rem; padding: .5rem .75rem; background: var(--night); color: #fff; min-height: 3.4rem; }
.pbar a, .pbar button { color: #fff; }
.pbar .back { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; font-weight: 700; font-size: .9rem; padding: .4rem .65rem; border-radius: 10px; background: rgba(255,255,255,.1); white-space: nowrap; }
.pbar .back:hover { background: rgba(255,255,255,.18); }
.pbar .ttl { min-width: 0; display: flex; align-items: center; gap: .55rem; }
.pbar .ttl .num { background: var(--c); color: #fff; font-family: var(--display); font-weight: 800; font-size: .85rem; padding: .2rem .55rem; border-radius: 8px; white-space: nowrap; }
.pbar .ttl h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .vars { display: flex; gap: .25rem; background: rgba(255,255,255,.08); padding: .2rem; border-radius: 999px; overflow-x: auto; scrollbar-width: none; max-width: 40vw; }
.pbar .vars a { text-decoration: none; padding: .25rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 700; color: #C9CDEB; white-space: nowrap; }
.pbar .vars a[aria-current="true"] { background: #fff; color: var(--night); }
.pbar .spacer { flex: 1; }
.pbar .nav { display: inline-flex; gap: .3rem; }
.pbar .nav a { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 10px; background: rgba(255,255,255,.1); }
.pbar .nav a:hover { background: rgba(255,255,255,.2); }
.pbar .nav a.off { opacity: .3; pointer-events: none; }
.pbar .btn-sun { color: #1E2235; }
.pbar .reviewed { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700; color: #8EE3C3; white-space: nowrap; }
.ggb-wrap { flex: 1; min-height: 0; position: relative; background: #fff; }
#ggb-element { position: absolute; inset: 0; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: #646A80; font-weight: 700; }
.consigne-bar { flex: none; background: #FFF8E1; color: #1E2235; padding: .45rem .9rem; font-size: .9rem; border-bottom: 1px solid #F1E2A8; display: flex; gap: .5rem; align-items: flex-start; }
.consigne-bar svg.i { color: #C99A1A; margin-top: .15rem; }
.consigne-bar button { margin-left: auto; border: 0; background: none; cursor: pointer; color: #8A6D12; font-weight: 700; font-size: .85rem; white-space: nowrap; }

/* ---------- Page enseignant ---------- */
.login { max-width: 26rem; margin: 3rem auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; }
.tile b { display: block; font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1.05; }
.tile span { color: var(--muted); font-size: .88rem; }
.tile.bug b { color: var(--bug); }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .8rem; }
.filters select, .filters input { border: 1.5px solid var(--line); border-radius: 10px; padding: .45rem .6rem; background: var(--surface); font-size: .9rem; }
.filters input[type="search"] { min-width: 13rem; flex: 1; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg); position: sticky; top: 0; white-space: nowrap; }
.tbl th button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.c { white-space: pre-wrap; min-width: 16rem; max-width: 34rem; overflow-wrap: anywhere; }
.tbl td.nw { white-space: nowrap; }
.tbl .exn { font-weight: 700; white-space: nowrap; }
.tbl .sub { color: var(--muted); font-size: .8rem; }
.tbl a.fl { color: inherit; font-weight: 700; text-decoration: none; border-bottom: 1px dashed var(--muted); cursor: pointer; }
.del { border: 1.5px solid var(--line); background: none; border-radius: 8px; padding: .2rem .5rem; cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 700; }
.del:hover, .del.confirm { border-color: var(--bug); color: var(--bug); }
.bar { height: .5rem; border-radius: 999px; background: var(--bg); overflow: hidden; min-width: 5rem; }
.bar i { display: block; height: 100%; background: var(--ok); }
.notice { border-radius: 12px; padding: .7rem .9rem; margin-bottom: 1rem; font-size: .92rem; background: color-mix(in srgb, var(--flou) 14%, transparent); border: 1px solid color-mix(in srgb, var(--flou) 40%, transparent); }
.notice.err { background: color-mix(in srgb, var(--bug) 12%, transparent); border-color: color-mix(in srgb, var(--bug) 40%, transparent); }
.chk { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }

/* ---------- Petits écrans ---------- */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  nav.chapters { display: none; }
  .chapter-select { display: block; width: 100%; font-weight: 700; padding: .7rem .8rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); margin-bottom: 1rem; }
  .top-tab { font-size: 1.45rem; padding: .6rem .95rem .7rem; }
  .top-tab.feed-tab .lbl { display: none; }
  .fb-grid { grid-template-columns: 1fr; }
  .pbar { flex-wrap: wrap; }
  .pbar .vars { max-width: 100%; order: 5; }
  .pbar .btn-sun .lbl { display: none; }
}
@media (max-width: 700px) { .hero-shapes { opacity: .3; } }
@media (max-width: 520px) {
  .hero-inner { padding-left: 1rem; padding-right: 1rem; }
  .levels-bar, .layout, .page { padding-left: 1rem; padding-right: 1rem; }
  .level { padding: .45rem .8rem; font-size: .92rem; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .pbar .ttl h1 { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Ajouts v2 : connexion, versions, boutons empilés ---------- */
.login-eleve { max-width: 44rem; margin: 0 auto; padding: 1.4rem 1.5rem 1.6rem; }
.login-eleve h2 { margin-bottom: .3rem; }
.name-btn[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: #fff; }
.ident h4 .hint { font-weight: 400; }
.ident form h4 { margin-top: 1rem; }
.vpills { display: flex; flex-wrap: wrap; gap: .3rem; }
.vpill { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: .2rem .7rem; cursor: pointer; font-weight: 700; font-size: .82rem; color: var(--muted); }
.vpill:hover { border-color: var(--c); color: var(--text); }
.vpill[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.card .card-actions { flex-direction: column; flex-wrap: nowrap; gap: .45rem; }
.card .card-actions .btn { width: 100%; padding: .65rem .9rem; font-size: .95rem; }

/* ---------- v3 : cartes sans aperçu ---------- */
.cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card .card-top .num { position: static; box-shadow: none; font-size: 1rem; padding: .25rem .7rem; }
.card .card-top .done { position: static; }
.card h3 { min-height: 2.5em; }
