/* =========================================================================
   Projet de gestion — feuille de style unique, sans dépendance externe.
   Mobile d'abord ; barre latérale à partir de 900 px ; mode sombre.
   ========================================================================= */

/* Inter (SIL Open Font License, voir static/fonts/Inter-LICENSE.txt), servie par le site lui-même */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-var-latin.8e433c0592f7.woff2") format("woff2-variations"), url("../fonts/inter-var-latin.8e433c0592f7.woff2") format("woff2");
}

:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #171a23;
  --muted: #5b6273;
  --faint: #8a90a0;
  --border: #e2e5ee;
  --border-strong: #cfd4e0;
  --primary: #2748c9;
  --primary-ink: #ffffff;
  --primary-soft: #e8edfd;
  --success: #17804a;
  --success-soft: #e3f4ea;
  --warn: #a45f00;
  --warn-soft: #fdf1dd;
  --danger: #c0322b;
  --danger-soft: #fce7e6;
  --violet: #6a45cf;
  --violet-soft: #efe9fc;
  --info: #2459c2;
  --info-soft: #e5eefc;
  --neutral-soft: #eef0f4;
  --shadow: 0 1px 2px rgba(20, 24, 40, .06), 0 2px 8px rgba(20, 24, 40, .05);
  --shadow-lg: 0 8px 28px rgba(20, 24, 40, .14);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  /* SF Pro (la police d'Apple) sur iPhone, iPad et Mac ; Inter, sa jumelle libre, partout ailleurs */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1c2e;
    --surface: #152640;
    --surface-2: #1b3050;
    --text: #e8eef7;
    --muted: #aebdd1;
    --faint: #8397b2;
    --border: #25405f;
    --border-strong: #33537a;
    --primary: #7d97ff;
    --primary-ink: #0d1330;
    --primary-soft: #1f3563;
    --success: #5fd08f;
    --success-soft: #15372f;
    --warn: #f0b456;
    --warn-soft: #3b3020;
    --danger: #ff8078;
    --danger-soft: #3d2130;
    --violet: #b39cff;
    --violet-soft: #2b2c5c;
    --info: #86aefc;
    --info-soft: #1c3458;
    --neutral-soft: #213a5c;
    --shadow: 0 1px 2px rgba(3, 10, 25, .35);
    --shadow-lg: 0 8px 28px rgba(3, 10, 25, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1c2e; --surface: #152640; --surface-2: #1b3050; --text: #e8eef7; --muted: #aebdd1; --faint: #8397b2;
  --border: #25405f; --border-strong: #33537a; --primary: #7d97ff; --primary-ink: #0d1330; --primary-soft: #1f3563;
  --success: #5fd08f; --success-soft: #15372f; --warn: #f0b456; --warn-soft: #3b3020; --danger: #ff8078; --danger-soft: #3d2130;
  --violet: #b39cff; --violet-soft: #2b2c5c; --info: #86aefc; --info-soft: #1c3458; --neutral-soft: #213a5c;
  --shadow: 0 1px 2px rgba(3, 10, 25, .35); --shadow-lg: 0 8px 28px rgba(3, 10, 25, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.45rem; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.ic { flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- structure */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center; font-size: .8rem; font-weight: 800; letter-spacing: .02em; flex: none; }
.brand-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  color: var(--text); background: transparent; border: 0; cursor: pointer; }
.icon-btn:hover { background: var(--neutral-soft); text-decoration: none; }
.dot { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700; display: grid; place-items: center; }

.layout { display: block; }
.sidebar { display: none; }
main { padding: 16px; max-width: 1120px; margin: 0 auto; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.bottomnav a, .bottomnav button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .72rem; font-weight: 600; min-height: 44px; background: none; border: 0; font-family: inherit; cursor: pointer;
}
.bottomnav a:hover { text-decoration: none; color: var(--text); }
.bottomnav a[aria-current="page"] { color: var(--primary); }
.bottomnav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
.bottomnav .dot { top: 4px; right: calc(50% - 22px); }

.moremenu { position: fixed; inset: 0; z-index: 40; background: rgba(10, 12, 20, .45); display: none; }
.moremenu.open { display: block; }
.moremenu .sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0;
  padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); max-height: 80vh; overflow: auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 2px auto 10px; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottomnav, .topbar .only-mobile { display: none; }
  .layout { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 61px); }
  .sidebar { display: block; position: sticky; top: 61px; height: calc(100vh - 61px); overflow: auto;
    padding: 14px 10px; border-right: 1px solid var(--border); background: var(--surface); }
  main { padding: 24px 28px 48px; width: 100%; }
}
.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); font-weight: 550; }
.side-link:hover { background: var(--neutral-soft); text-decoration: none; }
.side-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.side-link .count { margin-left: auto; font-size: .75rem; font-weight: 700; background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 7px; }
.side-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 12px 6px; font-weight: 700; }

/* ---------------------------------------------------------------- blocs */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { color: var(--muted); margin: 2px 0 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin-bottom: 8px; min-height: 36px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 10px; }
.card-title h2, .card-title h3 { margin: 0; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .875rem; }
.xs { font-size: .78rem; }
.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } .grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
@media (min-width: 640px) and (max-width: 899px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hr { height: 1px; background: var(--border); margin: 14px 0; border: 0; }

/* ---------------------------------------------------------------- héros élève */
.hero { background: linear-gradient(135deg, #2748c9 0%, #5237cf 100%);
  color: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lg); }
.hero a { color: #fff; }
.hero .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; opacity: .85; font-weight: 700; }
.hero h2 { font-size: 1.25rem; margin: 4px 0 6px; color: #fff; }
.hero .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; opacity: .95; }
.hero .btn { background: #fff; color: #1d2f8f; border-color: #fff; }
.hero .btn:hover { background: #eef2ff; }
:root[data-theme="dark"] .hero .btn, .hero .btn { color: #1d2f8f; }

/* ---------------------------------------------------------------- avancement */
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .top { display: flex; justify-content: space-between; align-items: baseline; font-weight: 650; }
.progress .pct { font-variant-numeric: tabular-nums; font-size: 1.05rem; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 0; border-radius: 99px; overflow: hidden; background: var(--neutral-soft); }
progress::-webkit-progress-bar { background: var(--neutral-soft); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 99px; }
progress.on-hero { background: rgba(255, 255, 255, .25); }
progress.on-hero::-webkit-progress-bar { background: rgba(255, 255, 255, .25); }
progress.on-hero::-webkit-progress-value { background: #fff; }
progress.on-hero::-moz-progress-bar { background: #fff; }
progress.success::-webkit-progress-value { background: var(--success); }
progress.success::-moz-progress-bar { background: var(--success); }
progress.thin { height: 6px; }

.ring { --size: 76px; width: var(--size); height: var(--size); position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- statuts */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.chip-neutral { background: var(--neutral-soft); color: var(--muted); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip.cia-ia { background: var(--violet-soft); color: var(--violet); }
.cia-bandeau details { margin-top: 6px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--neutral-soft); color: var(--muted); letter-spacing: .02em; }
.tag-code { background: var(--primary-soft); color: var(--primary); }

/* ---------------------------------------------------------------- listes de tâches */
.tasklist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tasklist li + li { border-top: 1px solid var(--border); }
.taskrow { display: flex; align-items: center; gap: 12px; padding: 14px 14px; color: var(--text); min-height: 64px; }
.taskrow:hover { background: var(--surface-2); text-decoration: none; }
.taskrow .code { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; flex: none; background: var(--neutral-soft); color: var(--muted); }
.taskrow .code.s-ouverte, .taskrow .code.s-prolongee { background: var(--info-soft); color: var(--info); }
.taskrow .code.s-a_reprendre { background: var(--warn-soft); color: var(--warn); }
.taskrow .code.s-rendue { background: var(--violet-soft); color: var(--violet); }
.taskrow .code.s-validee { background: var(--success-soft); color: var(--success); }
.taskrow .code.s-verrouillee { background: var(--danger-soft); color: var(--danger); }
.taskrow .title { font-weight: 650; line-height: 1.3; }
.taskrow .sub { font-size: .82rem; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.taskrow .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.taskrow .chev { color: var(--faint); }

/* ---------------------------------------------------------------- boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: color-mix(in srgb, var(--success) 88%, #000); }
.btn-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--neutral-soft); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- formulaires */
label, .label { display: block; font-weight: 650; margin-bottom: 6px; font-size: .92rem; }
.help { font-size: .82rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=datetime-local], input[type=url],
select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
input[type=number] { font-variant-numeric: tabular-nums; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 550; min-height: 36px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--danger); font-size: .88rem; font-weight: 600; }
.otp-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- alertes */
.flash { list-style: none; padding: 0; margin: 0 0 14px; }
.flash li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-weight: 600; margin-bottom: 8px; }
.flash .success { background: var(--success-soft); color: var(--success); }
.flash .error { background: var(--danger-soft); color: var(--danger); }
.flash .info, .flash .warning { background: var(--info-soft); color: var(--info); }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.callout.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.callout.info { background: var(--info-soft); border-color: transparent; color: var(--info); }
.callout.success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.callout p { margin: 0; }
.callout strong { display: block; }

/* ---------------------------------------------------------------- page tâche */
.task-head { display: flex; flex-direction: column; gap: 10px; }
.task-head .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.countdown { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 4px 10px; border-radius: 99px; background: var(--neutral-soft); color: var(--text); font-size: .85rem; }
.countdown.soon { background: var(--warn-soft); color: var(--warn); }
.countdown.late { background: var(--danger-soft); color: var(--danger); }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); margin: 6px 0 14px; background: var(--bg); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 12px 12px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; border-bottom: 3px solid transparent; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .badge { background: var(--danger); color: #fff; font-size: .7rem; border-radius: 9px; padding: 0 6px; }
[hidden] { display: none !important; }
[role="tabpanel"][hidden] { display: none; }

.help-block h3 { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.help-block h3:first-child { margin-top: 0; }
.help-block ul { padding-left: 1.2rem; margin: 0 0 .5rem; }
.help-block li { margin-bottom: 4px; }
.sites { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sites a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 600; min-height: 48px; }
.sites a:hover { border-color: var(--primary); text-decoration: none; }
.sites .url { color: var(--faint); font-weight: 500; font-size: .8rem; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }

/* éditeur */
.editor-wrap { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); }
.editor-wrap .toolbar { border-radius: 14px 14px 0 0; }
.toolbar { display: flex; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 65px; z-index: 5; }
.toolbar::-webkit-scrollbar { display: none; }
.toolbar button { flex: none; }
.toolbar button { min-width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.toolbar button:hover { background: var(--neutral-soft); }
.toolbar .sep { width: 1px; background: var(--border); margin: 6px 4px; }
.editor, .rendered { padding: 16px; min-height: 280px; outline: none; overflow-wrap: anywhere; }
.editor:focus { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.editor table, .rendered table, .prose table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: .95rem; display: block; overflow-x: auto; }
.editor td, .editor th, .rendered td, .rendered th, .prose td, .prose th { border: 1px solid var(--border-strong); padding: 8px; min-width: 130px; vertical-align: top; text-align: left; }
.editor th, .rendered th, .prose th { background: var(--surface-2); }
.editor h3, .rendered h3 { margin-top: 14px; }
.savebar { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.savestate { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.savestate.ok { color: var(--success); }
.savestate.pending { color: var(--muted); }
.savestate.err { color: var(--danger); }
.actionbar { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 15; display: flex; gap: 8px; padding: 10px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (min-width: 900px) { .actionbar { bottom: 0; } }

.comment { display: flex; gap: 10px; padding: 12px 0; }
.comment + .comment { border-top: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; background: var(--primary-soft); color: var(--primary); }
.avatar.teacher { background: var(--violet-soft); color: var(--violet); }
.avatar.sm { width: 30px; height: 30px; font-size: .68rem; letter-spacing: -.02em; }
.quote { border-left: 3px solid var(--warn); background: var(--warn-soft); padding: 6px 10px; border-radius: 0 8px 8px 0; font-size: .88rem; margin: 4px 0 6px; color: var(--text); }
mark.annot { background: color-mix(in srgb, var(--warn) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; cursor: pointer; }
mark.annot.flash { outline: 2px solid var(--warn); }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -5px; }
.avatars .avatar:first-child { margin-left: 0; }

/* ---------------------------------------------------------------- tableau de bord enseignant */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi .n { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi.alert .n { color: var(--danger); }
.kpi.todo .n { color: var(--violet); }
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.filters a { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text); font-weight: 600; font-size: .88rem; background: var(--surface); min-height: 40px; display: inline-flex; align-items: center; }
.filters a[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters a:hover { text-decoration: none; }
.gcards { display: grid; gap: 12px; }
@media (min-width: 640px) { .gcards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .gcards { grid-template-columns: repeat(3, 1fr); } }
.gcard { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
.gcard:hover { border-color: var(--primary); text-decoration: none; }
.gcard .gname { font-weight: 800; font-size: 1.05rem; }
.gcard .org { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .step { font-size: .88rem; display: flex; gap: 8px; align-items: center; }
.gcard .flags { display: flex; gap: 6px; flex-wrap: wrap; }
.gcard .foot { display: flex; justify-content: space-between; align-items: center; color: var(--faint); font-size: .8rem; }

/* tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.data { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: 0; }
table.data .sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
table.data th.sticky { background: var(--surface-2); z-index: 2; }
.unpub { color: var(--faint); font-style: italic; }

/* ---------------------------------------------------------------- messagerie */
.threads { list-style: none; padding: 0; margin: 0; }
.thread { display: flex; gap: 12px; align-items: center; padding: 14px; color: var(--text); border-bottom: 1px solid var(--border); background: var(--surface); min-height: 68px; }
.threads li:first-child .thread { border-radius: var(--radius) var(--radius) 0 0; }
.threads li:last-child .thread { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.thread:hover { background: var(--surface-2); text-decoration: none; }
.thread .name { font-weight: 700; }
.thread.unread .name::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-left: 8px; vertical-align: middle; }
.thread .preview { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 10px; }
.bubble-row { display: flex; gap: 8px; align-items: flex-end; }
.bubble-row.me { flex-direction: row-reverse; }
.bubble { max-width: 82%; padding: 10px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--border); overflow-wrap: anywhere; }
.bubble .body { white-space: pre-wrap; }
.bubble-row.me .bubble { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); border-radius: 16px 16px 4px 16px; }
.bubble-row.teacher .bubble { background: var(--violet-soft); border-color: transparent; }
.bubble .who { font-size: .75rem; font-weight: 700; opacity: .8; margin-bottom: 2px; }
.bubble .when { font-size: .7rem; opacity: .7; margin-top: 4px; }
.bubble.deleted { font-style: italic; opacity: .6; }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 10px 0; background: var(--bg); }
@media (min-width: 900px) { .composer { bottom: 0; } }
.composer textarea { min-height: 48px; height: 48px; border-radius: 24px; padding: 12px 16px; }
.composer .btn { border-radius: 24px; }

/* ---------------------------------------------------------------- divers */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .ic { color: var(--faint); margin-bottom: 6px; }
.notif { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif.unread { background: var(--primary-soft); }
.notif:hover { text-decoration: none; background: var(--surface-2); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.score-big { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.score-big small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.criteria { display: grid; gap: 10px; }
.crit { display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: center; }
.crit .max { color: var(--muted); font-size: .85rem; }
.bank { display: flex; gap: 6px; flex-wrap: wrap; }
.bank button { border: 1px dashed var(--border-strong); background: var(--surface); color: var(--text); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; text-align: left; }
.bank button:hover { border-color: var(--primary); color: var(--primary); }
.selection-pop { position: absolute; z-index: 50; display: none; }
.selection-pop.show { display: block; }
.creds { border-collapse: collapse; width: 100%; }
.creds td, .creds th { border: 1px solid var(--border-strong); padding: 10px; text-align: left; }
.creds .pw { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.05rem; font-weight: 700; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand-mark { width: 48px; height: 48px; border-radius: 14px; font-size: 1.1rem; margin-bottom: 14px; }
.tour { position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 20, .55); display: grid; place-items: end center; padding: 16px; }
@media (min-width: 640px) { .tour { place-items: center; } }
.tour[hidden] { display: none; }
.tour .card { max-width: 420px; width: 100%; }
.tour .steps { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.tour .steps span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.tour .steps span.on { background: var(--primary); width: 22px; border-radius: 4px; }
.tour-slide[hidden] { display: none; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.4rem; }
.prose ul { padding-left: 1.2rem; }
details.fold { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
details.fold + details.fold { margin-top: 8px; }
details.fold summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); }
details.fold[open] summary::after { content: "–"; }
details.fold > div { padding: 0 14px 14px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 10px; padding: 8px 0; font-size: .88rem; }
.timeline li + li { border-top: 1px dashed var(--border); }
.plus { color: var(--success); font-weight: 700; }
.minus { color: var(--danger); font-weight: 700; }

/* ---------------------------------------------------------------- projection */
body.projection { padding: 0; background: var(--surface); font-size: 22px; }
.proj { max-width: 1200px; margin: 0 auto; padding: 32px 48px; }
.proj h1 { font-size: 2rem; }
.proj .rendered { font-size: 1.1em; padding: 0; }
.proj-bar { position: fixed; top: 12px; right: 12px; display: flex; gap: 8px; font-size: 14px; }

@media print {
  .topbar, .sidebar, .bottomnav, .no-print, .actionbar { display: none !important; }
  body { background: #fff; padding: 0; }
  main { padding: 0; }
  .card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 22px; }
.mb { margin-bottom: 12px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.ring .track { stroke: var(--neutral-soft); }
.ring .bar { stroke: var(--primary); }
.nopad { padding: 0; }
.taskrow .m-chip { display: none; }
@media (max-width: 639px) {
  .taskrow .m-chip { display: inline-flex; }
  .taskrow .d-chip { display: none; }
  .taskrow { padding: 12px; gap: 12px; }
}
@media (max-width: 639px) {
  .tabs button { padding: 12px 10px; }
  .tabs button .ic { display: none; }
}
@media (min-width: 900px) {
  .layout { background: linear-gradient(to right, var(--surface) 248px, transparent 248px); }
}
main, .gcards > *, .grid > *, .gcard, .card { min-width: 0; }
.gcard .step .grow { min-width: 0; }
.thread .name, .thread .preview { display: block; }
.thread .grow > .row { min-width: 0; }
.thread .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap, .tabs, .filters, .toolbar { position: relative; } .toolbar { position: sticky; }

@media (max-width: 639px) {
  .tabs { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .tabs button:last-child { margin-right: 28px; }
}
.notions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.notion { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 10px; padding: 6px 12px; font: inherit; font-size: .86rem; line-height: 1.35; cursor: pointer; text-align: left; min-height: 36px; }
.notion:hover { border-color: var(--primary); color: var(--primary); }
.notion mark { background: color-mix(in srgb, var(--warn) 30%, transparent); color: inherit; border-radius: 3px; }
.prog-q + .prog-q { border-top: 1px dashed var(--border); }
.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; font-size: .9rem; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 70; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow-lg); max-width: 560px; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.classe-switch select { min-height: 38px; padding: 6px 10px; width: auto; max-width: 170px; font-weight: 650; font-size: .9rem; }
@media (max-width: 639px) { .topbar .brand-text { display: none; } }
.hr-top { border-top: 1px solid var(--border); padding-top: 12px; }

.save-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.save-actions form { margin: 0; }
.save-hint { margin: 6px 0 0; text-align: center; }
.save-hint.depot-manquant { color: var(--warn); font-weight: 600; }
.depot-obligatoire .small p + p, .depot-obligatoire .small ul { margin-top: 4px; }
.depot-obligatoire .small ul { padding-left: 18px; margin-bottom: 0; }
@media (max-width: 380px) { .save-actions { grid-template-columns: 1fr; } }
.actionbar-col { flex-direction: column; gap: 0; }
.presence { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent, #3b5bdb); }
.presence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.side-form { margin: 0; }
.side-form .side-link { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.side-demo { color: var(--warn); }
.demo-banner { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); }
.demo-banner form { margin: 0; }
@media (max-width: 600px) { .demo-sub { display: none; } .demo-banner { padding: 8px 10px; gap: 8px; } }

/* ---------------------------------------------------------------- STMGATE : portail */
.test-ribbon { background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: .85rem; text-align: center;
  padding: 6px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--border); }

.afaire { margin-bottom: 18px; }
.afaire-titre { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 0 0 8px; }
.afaire-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.afaire-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 600; min-height: 48px; }
.afaire-item:hover { text-decoration: none; border-color: var(--border-strong); }
.afaire-item > .ic { flex: none; }
.afaire-item.tone-warn > .ic { color: var(--warn); }
.afaire-item.tone-info > .ic { color: var(--info); }
.afaire-item.tone-violet > .ic { color: var(--violet); }
.afaire-item.tone-success > .ic { color: var(--success); }
.afaire-quand { color: var(--muted); font-size: .82rem; font-weight: 600; white-space: nowrap; }

.tuiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tuile { display: flex; align-items: flex-start; gap: 14px; height: 100%; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); }
a.tuile:hover { text-decoration: none; border-color: var(--primary); box-shadow: var(--shadow-lg); }
a.tuile:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.tuile-ic { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary); }
.tuile-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.tuile-nom { font-weight: 800; font-size: 1.02rem; display: flex; align-items: center; gap: 6px; }
.tuile-desc { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.tuile .chip { align-self: flex-start; margin-top: 4px; }
.tuile-bientot { opacity: .62; box-shadow: none; }
.tuile-grand_oral .tuile-ic, .tuile-parcoursup .tuile-ic { background: var(--violet-soft); color: var(--violet); }
.tuile-quiz .tuile-ic, .tuile-calcul .tuile-ic { background: var(--success-soft); color: var(--success); }
.tuile-ap .tuile-ic, .tuile-orientation .tuile-ic { background: var(--warn-soft); color: var(--warn); }
.tuile-bientot .tuile-ic { background: var(--neutral-soft); color: var(--muted); }

/* ---------------------------------------------------------------- STMGATE : réglages et ressources */
.gap-lg { gap: 18px; }
.field-inline { margin-bottom: 0; min-width: 180px; }
.outils-choix { border: 0; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.outils-choix legend { width: 100%; }
.outil-check { display: inline-flex; margin: 0; font-weight: 600; cursor: pointer; }
.outil-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.outil-check span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); }
.outil-check input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.outil-check input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }
.classe-reglage.is-archivee { opacity: .75; }
.ressources { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ressource .card-title { flex-wrap: wrap; }
.ressource-texte { margin: 0 0 12px; max-width: 70ch; }

/* ---------------------------------------------------------------- STMGATE : Quiz (bibliothèque) */
.liste-lignes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ligne { display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 48px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border); color: var(--text); }
a.ligne:hover { text-decoration: none; border-color: var(--primary); }
.ligne-forte { border-color: var(--primary); box-shadow: var(--shadow); }
.quiz-cols { align-items: start; gap: 24px; }
.questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qcard { display: flex; align-items: flex-start; gap: 12px; }
.questions.compact .qcard { padding: 10px 0; border-bottom: 1px solid var(--border); }
.qcard.is-bad { border-color: var(--warn); }
.qcard-enonce { margin: 0 0 6px; font-weight: 700; white-space: pre-line; overflow-wrap: anywhere; }
.qcard-choix { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 3px; font-size: .92rem; }
.qcard-choix li { display: flex; gap: 8px; align-items: baseline; overflow-wrap: anywhere; }
.qcard-choix li.is-ok { color: var(--success); font-weight: 700; }
.qcard-choix li.is-faux { color: var(--danger); }
.qcard-choix .ic { flex: none; align-self: center; }
.puce { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--border-strong); align-self: center; margin: 0 4px; }
.qnum { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: .9rem; }
.qcard-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.qcard-actions form { display: flex; gap: 2px; }
.qcard-check { min-height: 0; padding-top: 2px; }
.msg-err { color: var(--warn); font-weight: 700; font-size: .88rem; margin: 4px 0 0; display: flex; gap: 6px; align-items: center; }
.qcm-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
/* Nom du QCM : crayon à côté du titre, champ à la place du titre pour le renommer */
.qcm-nom-vue { display: flex; align-items: center; gap: 6px; }
.qcm-nom-btn { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.qcm-nom-btn:hover { background: var(--surface-2); color: var(--primary); }
.qcm-nom-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.qcm-nom-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qcm-nom-form input[type=text] { flex: 1 1 22rem; min-width: 0; max-width: 46rem; font-size: 1.25rem; font-weight: 600; padding: 8px 12px; }
@media (min-width: 1100px) { .qcm-layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.qcm-side { display: grid; gap: 12px; }
.qcm-side h2 { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.btn-col { display: grid; gap: 8px; }
.seg { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); height: 100%; }
.seg small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.seg input:checked + span { border-color: var(--primary); background: var(--primary-soft); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choix-edit { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.choix-ligne { display: flex; align-items: center; gap: 10px; }
.choix-ligne .check { min-height: 0; margin: 0; }
.choix-lettre { flex: none; font-weight: 800; color: var(--muted); width: 1.2em; text-transform: uppercase; }
.q-image-mini { max-height: 90px; border-radius: 8px; border: 1px solid var(--border); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; }
.import-layout { display: grid; gap: 16px; }
@media (min-width: 1100px) { .import-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.rejoindre input { font-size: 1.3rem; letter-spacing: .2em; font-variant-numeric: tabular-nums; max-width: 12ch; }
.note-chip { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.note-grande { font-size: 2.4rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.note-grande small { font-size: 1rem; color: var(--muted); }
.explication { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.analyse { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.analyse h3 { font-size: 1rem; margin: 0; }
.barres { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.barres li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, 2fr) 2.5em; gap: 10px; align-items: center; font-size: .88rem; }
.barres li.is-ok { color: var(--success); font-weight: 700; }
.barre-lib { display: flex; gap: 4px; align-items: center; overflow-wrap: anywhere; }
.barre-n { text-align: right; font-variant-numeric: tabular-nums; }
progress.barre, progress.proj-barre { appearance: none; width: 100%; height: 12px; border: 0; border-radius: 99px; background: var(--neutral-soft); overflow: hidden; }
progress.barre::-webkit-progress-bar, progress.proj-barre::-webkit-progress-bar { background: var(--neutral-soft); border-radius: 99px; }
progress.barre::-webkit-progress-value, progress.proj-barre::-webkit-progress-value { background: var(--faint); border-radius: 99px; }
progress.barre::-moz-progress-bar, progress.proj-barre::-moz-progress-bar { background: var(--faint); border-radius: 99px; }
.is-ok progress.barre::-webkit-progress-value, .is-ok progress.proj-barre::-webkit-progress-value { background: var(--success); }
.is-ok progress.barre::-moz-progress-bar, .is-ok progress.proj-barre::-moz-progress-bar { background: var(--success); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- STMGATE : Quiz (TNI) */
.tni-accueil { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; }
.tni-qr { text-align: center; }
.tni-qr img { border-radius: 12px; background: #fff; padding: 8px; width: 260px; height: 260px; }
.tni-code { font-size: 1.4rem; margin: 10px 0 0; }
.tni-code strong { letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.tni-url { max-width: 260px; overflow-wrap: anywhere; }
.tni-etapes { padding-left: 1.2em; }
.tni-connectes { font-weight: 700; color: var(--success); margin: 4px 0 0; }
.outil-check.is-connecte span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--success); }
.outil-check.is-connecte input:not(:checked) + span { border-color: var(--success); }
.tni-reco { display: flex; align-items: center; gap: 20px; padding: 12px 18px; }
.tni-reco img { border-radius: 8px; background: #fff; padding: 4px; width: 132px; height: 132px; flex: none; }
.tni-reco .tni-code { margin: 0 0 4px; }
.tni-reco .small { margin: 0; color: var(--muted); max-width: 52ch; }
.suivi-wrap { margin-top: 18px; }
.suivi-tete { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.suivi-tete h2 { margin: 0; font-size: 1.1rem; }
.suivi-compteurs { color: var(--muted); font-weight: 650; font-size: .9rem; }
.suivi-chrono { font-weight: 800; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
table.suivi tr.is-hors td { background: var(--danger-soft); color: var(--danger); }
table.suivi tr.is-absent td { color: var(--faint); }
.projection { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.proj-tete { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.proj-num { font-weight: 800; color: var(--muted); }
.proj-compte { font-weight: 700; color: var(--muted); }
.proj-chrono { display: grid; place-items: center; min-width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.proj-chrono.is-urgent, .chrono.is-urgent { background: var(--danger); color: #fff; }
.proj-question { font-size: clamp(1.4rem, 2.6vw, 2.2rem); line-height: 1.25; margin: 0 0 16px; text-wrap: balance; }
.proj-image { display: block; max-height: 38vh; margin: 0 auto 16px; border-radius: 10px; }
.proj-choix { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.proj-choix li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); border: 2px solid var(--border); font-size: clamp(1.05rem, 1.6vw, 1.35rem); font-weight: 650; }
.proj-choix li .proj-barre { grid-column: 1 / -2; }
.proj-choix li .proj-n { grid-row: 2; grid-column: 3; font-weight: 800; }
.proj-lettre { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: #fff; font-weight: 800; }
.proj-choix-0 .proj-lettre { background: #c0322b; } .proj-choix-1 .proj-lettre { background: #2459c2; }
.proj-choix-2 .proj-lettre { background: #a45f00; } .proj-choix-3 .proj-lettre { background: #17804a; }
.proj-choix-4 .proj-lettre { background: #6a45cf; } .proj-choix-5 .proj-lettre { background: #0f766e; }
.proj-choix li.is-ok { border-color: var(--success); background: var(--success-soft); }
.proj-choix li.is-faux { opacity: .55; }
.proj-explication { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--info-soft); color: var(--info); font-weight: 600; }
.proj-boutons { margin-top: 16px; justify-content: flex-end; }
.podium { margin-top: 18px; }
.podium h3 { margin: 0 0 8px; }
.podium-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 560px; }
.podium-liste li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-weight: 700; font-size: 1.1rem; }
.podium-rang { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--neutral-soft); font-weight: 800; }
.podium-nom { flex: 1; }
.podium-pts { font-variant-numeric: tabular-nums; color: var(--muted); }
.rang-1 .podium-rang { background: #e8b923; color: #3b2a00; } .rang-2 .podium-rang { background: #c4cad6; color: #222; }
.rang-3 .podium-rang { background: #cd7f32; color: #fff; }

/* ---------------------------------------------------------------- STMGATE : Quiz (élève) */
body.page-passer .sidebar, body.page-passer .bottomnav { display: none; }
body.page-passer main { padding-bottom: 24px; }
.passer-tete { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.passer-titre { margin: 0; font-weight: 800; }
.passer-chronos { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chrono { display: inline-block; padding: 6px 12px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chrono-total { background: var(--neutral-soft); color: var(--text); font-size: .85rem; }
.alerte-triche { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 12px;
  background: var(--danger-soft); color: var(--danger); border: 2px solid var(--danger); }
.alerte-triche p { margin: 0; }
.passer-num { color: var(--muted); font-weight: 700; margin: 0 0 4px; }
.passer-enonce { font-size: 1.3rem; line-height: 1.3; margin: 0 0 10px; overflow-wrap: anywhere; }
.passer-image { display: block; max-width: 100%; border-radius: 10px; margin-bottom: 10px; }
.passer-choix { display: grid; gap: 10px; margin: 8px 0 16px; }
.choix-carte { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 12px; align-items: center; margin: 0; padding: 14px; min-height: 56px;
  border-radius: 14px; border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600; }
.choix-carte input { width: 22px; height: 22px; accent-color: var(--primary); }
.choix-carte:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choix-carte .choix-lettre { color: var(--primary); }
.choix-txt { overflow-wrap: anywhere; }
.passer-valider { min-height: 52px; font-size: 1.05rem; }
.passer-envoye { display: flex; gap: 8px; align-items: center; font-weight: 700; color: var(--success); }
.verdict { font-size: 1.5rem; font-weight: 800; margin: 0 0 8px; }
.verdict.is-ok { color: var(--success); } .verdict.is-faux { color: var(--danger); }
.score-ligne { font-weight: 800; color: var(--primary); }
.qcard-choix.corr li.is-coche.is-faux { font-weight: 700; }
body.page-passer .topbar .icon-btn { display: none; }
body.mode-projection .sidebar, body.mode-projection .topbar, body.mode-projection .bottomnav, body.mode-projection .test-ribbon { display: none; }
body.mode-projection .layout { display: block; }
body.mode-projection main { max-width: none; }
[data-plein-ecran][aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); }
input[type=date], input[type=time] { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; }
.qcm-side fieldset { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.import-fichier { padding: 12px; border: 2px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.import-fichier label { display: flex; align-items: center; gap: 6px; }
.import-fichier input[type=file] { flex: 1; min-width: 0; }
.ou { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; font-weight: 700; margin: 14px 0; }
.ou::before, .ou::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- STMGATE : menu propre à chaque outil */
.side-retour { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 4px; border-radius: 10px;
  color: var(--muted); font-weight: 650; font-size: .9rem; }
.side-retour:hover { text-decoration: none; background: var(--neutral-soft); color: var(--text); }
.side-espace { display: flex; align-items: center; gap: 10px; padding: 10px 12px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
  font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.side-espace small { font-weight: 600; color: var(--muted); font-size: .8rem; }
.side-espace .tuile-ic { width: 36px; height: 36px; border-radius: 10px; }
.side-bas { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--border); }
.side-bas .side-title-bas { padding-top: 6px; }

/* ---------------------------------------------------------------- STMGATE : barre d'outils permanente (en haut) */
.entete { position: sticky; top: 0; z-index: 20; }
.entete .topbar { position: static; }
.barre-outils { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none;
  padding: 8px max(16px, env(safe-area-inset-left, 0px)); background: var(--surface); border-bottom: 1px solid var(--border); }
.barre-outils::-webkit-scrollbar { display: none; }
.bo-item { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 10px;
  color: var(--text); font-weight: 750; font-size: .9rem; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.bo-item:hover { text-decoration: none; background: var(--neutral-soft); }
.bo-item:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
.bo-item .ic { opacity: .8; }
.bo-item.is-actif { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow); }
.bo-item.is-actif .ic { opacity: 1; }
@media (min-width: 900px) {
  body.a-barre .sidebar { top: 117px; height: calc(100vh - 117px); }
  body.a-barre .layout { min-height: calc(100vh - 117px); }
}
body.mode-projection .barre-outils { display: none; }
.side-aide { color: var(--muted); font-size: .85rem; padding: 4px 12px; margin: 0; }

/* ---------------------------------------------------------------- STMGATE : en-tête (bonjour, déconnexion) */
.bonjour { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; color: var(--text); font-size: .92rem; white-space: nowrap; }
.bonjour:hover { text-decoration: none; background: var(--neutral-soft); }
.form-deco { margin: 0; }
.btn-deco { gap: 6px; }
@media (max-width: 639px) {
  .bonjour > span { display: none; }
  .btn-deco > span { display: none; }
  .btn-deco { padding: 6px 10px; }
}
body.page-passer .form-deco, body.page-passer .bonjour { display: none; }

/* ================================================================ STMGATE : tuiles v2 (une couleur par outil) */
.tuile-projet { --c1: #3b5bdb; --c2: #5f3dc4; }
.tuile-grand_oral { --c1: #ae3ec9; --c2: #d6336c; }
.tuile-quiz { --c1: #0ca678; --c2: #087f5b; }
.tuile-calcul { --c1: #f76707; --c2: #d9480f; }
.tuile-classe_virtuelle { --c1: #1c7ed6; --c2: #0b7285; }
.tuile-ap { --c1: #0b7285; --c2: #2b8a3e; }
.tuile-orientation { --c1: #e8590c; --c2: #c92a2a; }
.tuile-parcoursup { --c1: #364fc7; --c2: #1864ab; }
.tuile-annales { --c1: #9c36b5; --c2: #5f3dc4; }
.tuile-convertisseur { --c1: #495057; --c2: #212529; }
.tuile-pgi { --c1: #2b8a3e; --c2: #5c940d; }

.tuiles { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.tuile { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  min-height: 190px; padding: 20px; border: 0; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--c1, #3b5bdb), var(--c2, #5f3dc4));
  box-shadow: 0 1px 2px rgba(10, 20, 40, .12), 0 8px 24px -8px color-mix(in srgb, var(--c2, #5f3dc4) 60%, transparent);
  transition: transform .18s ease, box-shadow .18s ease; }
a.tuile:hover { text-decoration: none; transform: translateY(-3px); border: 0;
  box-shadow: 0 2px 4px rgba(10, 20, 40, .14), 0 18px 36px -10px color-mix(in srgb, var(--c2, #5f3dc4) 75%, transparent); }
a.tuile:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.tuile::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255, 255, 255, .22), transparent 55%); }
.tuile-filigrane { position: absolute; right: -18px; bottom: -22px; z-index: -1; color: #fff; opacity: .14; transform: rotate(-12deg);
  transition: transform .25s ease, opacity .25s ease; }
a.tuile:hover .tuile-filigrane { transform: rotate(-4deg) scale(1.06); opacity: .2; }
.tuile-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tuile .tuile-ic { width: 52px; height: 52px; border-radius: 16px; background: rgba(255, 255, 255, .2); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); backdrop-filter: blur(2px); }
.tuile-badge { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 99px;
  background: rgba(255, 255, 255, .22); color: #fff; }
.tuile .tuile-txt { gap: 6px; }
.tuile .tuile-nom { font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.tuile .tuile-desc { color: rgba(255, 255, 255, .88); font-size: .9rem; line-height: 1.45; }
.tuile-go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: .85rem; color: #fff; opacity: .85; }
a.tuile:hover .tuile-go { opacity: 1; }
a.tuile:hover .tuile-go .ic { transform: translateX(3px); }
.tuile-go .ic { transition: transform .18s ease; }

/* Outils pas encore disponibles : discrets, sans couleur */
.tuile.tuile-bientot { background: var(--surface); color: var(--muted); border: 2px dashed var(--border-strong); box-shadow: none; opacity: 1; }
.tuile.tuile-bientot::after { display: none; }
.tuile.tuile-bientot .tuile-ic { background: var(--neutral-soft); color: var(--faint); box-shadow: none; }
.tuile.tuile-bientot .tuile-nom { color: var(--muted); }
.tuile.tuile-bientot .tuile-desc { color: var(--faint); }
.tuile.tuile-bientot .tuile-badge { background: var(--neutral-soft); color: var(--muted); }

/* Barre du haut : l'outil ouvert prend sa couleur */
.bo-item.is-actif { background: linear-gradient(135deg, var(--c1, var(--primary)), var(--c2, var(--primary))); color: #fff; }
.bo-projet { --c1: #3b5bdb; --c2: #5f3dc4; } .bo-grand_oral { --c1: #ae3ec9; --c2: #d6336c; }
.bo-quiz { --c1: #0ca678; --c2: #087f5b; } .bo-calcul { --c1: #f76707; --c2: #d9480f; }
.bo-classe_virtuelle { --c1: #1c7ed6; --c2: #0b7285; } .bo-ap { --c1: #0b7285; --c2: #2b8a3e; }
.bo-orientation { --c1: #e8590c; --c2: #c92a2a; } .bo-parcoursup { --c1: #364fc7; --c2: #1864ab; }
.bo-convertisseur { --c1: #495057; --c2: #212529; } .bo-pgi { --c1: #2b8a3e; --c2: #5c940d; } .bo-annales { --c1: #9c36b5; --c2: #5f3dc4; }
.bo-item:not(.is-actif) .ic { color: var(--c1, var(--muted)); opacity: 1; }
/* En-tête du menu de gauche aux couleurs de l'outil */
.side-espace .tuile-ic { background: linear-gradient(135deg, var(--c1, var(--primary-soft)), var(--c2, var(--primary-soft))); color: #fff; box-shadow: none; }
.side-espace:not([class*="tuile-"]) .tuile-ic { background: var(--primary-soft); color: var(--primary); }
@media (prefers-reduced-motion: reduce) { .tuile, .tuile-filigrane, .tuile-go .ic { transition: none; } a.tuile:hover { transform: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bo-convertisseur:not(.is-actif) .ic { color: var(--muted); } }
:root[data-theme="dark"] .bo-convertisseur:not(.is-actif) .ic { color: var(--muted); }

/* Tuiles v2.1 : nom à côté du picto, format compact */
.tuiles { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.tuile { min-height: 0; gap: 8px; padding: 14px 16px; border-radius: 16px; }
.tuile-haut { justify-content: flex-start; gap: 12px; padding-right: 0; }
.tuile .tuile-ic { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.tuile .tuile-nom { font-size: 1.02rem; line-height: 1.2; }
.tuile .tuile-desc { font-size: .84rem; line-height: 1.4; }
.tuile-badge { position: absolute; top: 10px; right: 10px; font-size: .64rem; padding: 3px 8px; }
.tuile:has(.tuile-badge) .tuile-haut { padding-right: 78px; }
.tuile-go { font-size: .8rem; }
.tuile-filigrane { right: -12px; bottom: -16px; }
.tuile-badge { position: static; }
.tuile:has(.tuile-badge) .tuile-haut { padding-right: 0; }
.tuile-bas { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tuile-bas .tuile-go { margin-top: 0; }

/* ---------------------------------------------------------------- marque : STMGATE + sceau « Made in STMG » */
:root { --wm-prune: #4b1240; --wm-vert: #7cb82f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wm-prune: #e7b6dc; --wm-vert: #9ad94a; } }
:root[data-theme="dark"] { --wm-prune: #e7b6dc; --wm-vert: #9ad94a; }
.topbar .brand { gap: 6px; }
.brand-text { font-weight: 900; font-size: 1.22rem; letter-spacing: .06em; line-height: 1; }
.wm-stm { color: var(--wm-prune); }
.wm-gate { color: var(--wm-vert); }
.brand-sceau {
  width: 50px; height: 50px; flex: none; border-radius: 50%; margin: -12px 0 -12px 4px;
  transform: rotate(-12deg) translateY(-3px);
  box-shadow: 0 0 0 2px var(--surface), 0 4px 10px rgba(75, 18, 64, .28);
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s;
}
.brand:hover .brand-sceau, .brand:focus-visible .brand-sceau {
  transform: rotate(348deg) scale(1.12); box-shadow: 0 0 0 2px var(--surface), 0 6px 16px rgba(124, 184, 47, .45);
}
@media (prefers-reduced-motion: reduce) { .brand-sceau { transition: none; } }

.login-sceau { position: relative; width: 112px; height: 112px; margin: 10px auto 16px; }
.login-sceau::before {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--wm-vert), var(--wm-prune), var(--wm-vert));
  opacity: .22; filter: blur(10px); animation: sceau-halo 8s linear infinite;
}
.login-sceau img { position: relative; width: 112px; height: 112px; border-radius: 50%; transform: rotate(-8deg);
  box-shadow: 0 0 0 3px var(--surface), 0 10px 24px rgba(75, 18, 64, .25); }
.login-card { text-align: center; }
.login-card form { text-align: left; }
.login-titre { font-weight: 900; letter-spacing: .08em; font-size: 2rem; margin: 0 0 4px; }
@keyframes sceau-halo { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-sceau::before { animation: none; } }
.login-card .callout, .login-card .hr ~ * { text-align: left; }

/* Pastilles de niveau (Terminale / Première) sur les tuiles */
.tuile-badges { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tuile-niveau { display: inline-flex; align-items: center; gap: 4px; background: #fff; color: var(--c2, #343a40); }
.tuile.tuile-bientot .tuile-niveau { background: var(--neutral-soft); color: var(--muted); }
.tuile-etude_gestion { --c1: #ae3ec9; --c2: #d6336c; }
.bo-etude_gestion { --c1: #ae3ec9; --c2: #d6336c; }

/* Sceau à gauche, en grand, à cheval sur les deux barres ; STMGATE à sa droite (écrans ≥ 640 px) */
.brand-sceau { width: 44px; height: 44px; margin: -8px 2px -8px 0; }
.brand-text { font-size: 1.3rem; }
@media (min-width: 640px) {
  .entete { --sceau: 100px; --sceau-x: 18px; }
  .entete .topbar { padding-left: calc(var(--sceau-x) + var(--sceau) + 18px); }
  .entete .barre-outils { padding-left: calc(var(--sceau-x) + var(--sceau) + 14px); }
  .entete .brand-sceau {
    position: absolute; left: var(--sceau-x); top: 11px; z-index: 2; margin: 0; /* repère : la barre du haut (backdrop-filter) */
    width: var(--sceau); height: var(--sceau);
    transform: rotate(-10deg);
    box-shadow: 0 0 0 3px var(--surface), 0 8px 22px rgba(75, 18, 64, .30);
  }
  .entete .brand:hover .brand-sceau, .entete .brand:focus-visible .brand-sceau {
    transform: rotate(350deg) scale(1.06);
  }
  .brand-text { font-size: 1.5rem; letter-spacing: .08em; }
}

/* Rendu « à la Apple » : approche légèrement resserrée, titres plus serrés */
body { letter-spacing: -0.011em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, .page-head h1, .tuile-nom { letter-spacing: -0.021em; }

/* ---------------------------------------------------------------- Progression annuelle */
.tuile-progression { --c1: #12b886; --c2: #1971c2; }
.bo-progression { --c1: #12b886; --c2: #1971c2; }
.prog-classes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.prog-classe { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; color: var(--text); min-height: 40px; display: inline-flex; align-items: center; }
.prog-classe.is-actif { background: linear-gradient(135deg, #12b886, #1971c2); color: #fff; border-color: transparent; }
.prog-outils { display: grid; gap: 8px; margin-bottom: 18px; }
.prog-outils details.fold + details.fold { margin-top: 0; }
.prog-outils details.fold > form { padding: 0 14px 14px; }
.prog-grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }
.prog-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.prog-tete h2 { margin: 0; font-size: 1.15rem; }
.prog-compte { font-weight: 800; color: var(--success); font-variant-numeric: tabular-nums; }
.prog-maintenant { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); display: flex; gap: 6px; align-items: flex-start; font-size: .9rem; }
.prog-maintenant strong { color: var(--text); font-weight: 700; }
.prog-liste { list-style: none; margin: 14px 0 0; padding: 0; position: relative; }
.prog-etape { position: relative; display: flex; gap: 12px; padding: 0 0 14px; }
.prog-etape:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--border); }
.prog-etape.is-vu:not(:last-child)::before { background: var(--success); }
.prog-puce { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: #fff; margin-top: 1px; }
.prog-etape.is-vu .prog-puce { background: var(--success); border-color: var(--success); }
.prog-etape.is-en_cours .prog-puce { border-color: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); background: var(--warn); }
.prog-corps { min-width: 0; flex: 1; }
.prog-titre { font-weight: 650; line-height: 1.35; }
.prog-etape.is-vu .prog-titre { color: var(--muted); }
.prog-etape.is-en_cours .prog-titre { font-weight: 800; }
.prog-code { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px; background: var(--neutral-soft); color: var(--muted); font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.prog-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: .8rem; color: var(--muted); align-items: center; }
.prog-meta .ic { vertical-align: -2px; }
.prog-statut { font-weight: 700; }
.prog-etape.is-vu .prog-statut { color: var(--success); }
.prog-etape.is-en_cours .prog-statut { color: var(--warn); }
.prog-note { margin: 6px 0 0; font-size: .88rem; color: var(--muted); }
.prog-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.prog-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.prog-seg button { border: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: .78rem; font-weight: 700; padding: 6px 10px; min-height: 34px; cursor: pointer; }
.prog-seg button + button { border-left: 1px solid var(--border); }
.prog-seg button.is-on[value="vu"] { background: var(--success); color: #fff; }
.prog-seg button.is-on[value="en_cours"] { background: var(--warn); color: #fff; }
.prog-seg button.is-on[value="a_venir"] { background: var(--neutral-soft); color: var(--text); }
.prog-ordre { display: inline-flex; gap: 2px; }
.prog-ordre .icon-btn { width: 34px; height: 34px; border-radius: 8px; }
.prog-ordre .icon-btn:disabled { opacity: .3; cursor: default; }
.prog-modif { width: 100%; }
.prog-modif > summary { list-style: none; display: inline-flex; width: auto; }
.prog-modif > summary::-webkit-details-marker { display: none; }
.prog-modif[open] { padding: 10px; border: 1px solid var(--border); border-radius: 12px; margin-top: 4px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prog-seg button.is-on[value="vu"], :root:not([data-theme="light"]) .prog-seg button.is-on[value="en_cours"] { color: #10161f; } }
:root[data-theme="dark"] .prog-seg button.is-on[value="vu"], :root[data-theme="dark"] .prog-seg button.is-on[value="en_cours"] { color: #10161f; }

/* Logo STMGATE (arche + barres) à gauche du nom — remplace le grand sceau dans la barre du haut */
.logo-stmgate { width: 44px; height: 44px; flex: none; margin: -6px 0; transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.lg-arche { fill: none; stroke: var(--wm-prune); stroke-width: 8; }
.lg-barres { fill: var(--wm-vert); }
.brand:hover .logo-stmgate { transform: translateY(-2px) scale(1.06); }
.topbar .brand { gap: 10px; }
@media (min-width: 640px) {
  .entete .topbar, .entete .barre-outils { padding-left: 16px; }
  .brand-text { font-size: 1.6rem; letter-spacing: .03em; }
  .logo-stmgate { width: 50px; height: 50px; }
}
@media (prefers-reduced-motion: reduce) { .logo-stmgate { transition: none; } }
.prog-maintenant { display: block; }
.prog-maintenant .ic { vertical-align: -3px; margin-right: 4px; }
.prog-modif { width: auto; }
.prog-modif[open] { flex-basis: 100%; }
.prog-actions { margin-top: 6px; }

/* ---------------------------------------------------------------- Inspiration apple.com : fonds gris très clair, barre d'outils sobre */
:root:not([data-theme="dark"]) { --bg: #f5f5f7; --text: #1d1d1f; --muted: #6e6e73; --faint: #86868b; --border: #e5e5ea; --border-strong: #d2d2d7; }
/* Mode sombre façon apple.com : noir et graphite au lieu du bleu nuit */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --surface: #1d1d1f; --surface-2: #2c2c2e; --text: #f5f5f7; --muted: #a1a1a6; --faint: #86868b;
  --border: #38383a; --border-strong: #48484a; --neutral-soft: #2c2c2e; --primary: #2997ff; --primary-ink: #ffffff; --primary-soft: #0a2a4a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6); } }
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1d1d1f; --surface-2: #2c2c2e; --text: #f5f5f7; --muted: #a1a1a6; --faint: #86868b;
  --border: #38383a; --border-strong: #48484a; --neutral-soft: #2c2c2e; --primary: #2997ff; --primary-ink: #ffffff; --primary-soft: #0a2a4a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6); }
.topbar { border-bottom: 0; }
.barre-outils { justify-content: safe center; gap: 4px 30px; min-height: 44px; padding-top: 0; padding-bottom: 0; border-bottom: 0;
  background: color-mix(in srgb, var(--surface) 86%, transparent); }
.bo-item, .bo-item.is-actif {
  background: none; box-shadow: none; border-radius: 0; padding: 0; min-height: 44px; position: relative;
  font-size: .875rem; font-weight: 400; letter-spacing: -0.01em; text-transform: none;
  color: color-mix(in srgb, var(--text) 80%, transparent); transition: color .2s;
}
.bo-item .ic { display: none; }
.bo-item:hover { background: none; color: var(--text); }
.bo-item.is-actif { color: var(--text); font-weight: 600; }
.bo-item.is-actif::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c1, var(--primary)), var(--c2, var(--primary))); }
@media (min-width: 900px) {
  body.a-barre .sidebar { top: 109px; height: calc(100vh - 109px); }
  body.a-barre .layout { min-height: calc(100vh - 109px); }
}

/* ---------------------------------------------------------------- Inspiration apple.com : fonds gris très clair, barre d'outils sobre */
:root:not([data-theme="dark"]) { --bg: #f5f5f7; --text: #1d1d1f; --muted: #6e6e73; --faint: #86868b; --border: #e5e5ea; --border-strong: #d2d2d7; }
/* Mode sombre façon apple.com : noir et graphite au lieu du bleu nuit */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #000000; --surface: #1d1d1f; --surface-2: #2c2c2e; --text: #f5f5f7; --muted: #a1a1a6; --faint: #86868b;
  --border: #38383a; --border-strong: #48484a; --neutral-soft: #2c2c2e; --primary: #2997ff; --primary-ink: #ffffff; --primary-soft: #0a2a4a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6); } }
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1d1d1f; --surface-2: #2c2c2e; --text: #f5f5f7; --muted: #a1a1a6; --faint: #86868b;
  --border: #38383a; --border-strong: #48484a; --neutral-soft: #2c2c2e; --primary: #2997ff; --primary-ink: #ffffff; --primary-soft: #0a2a4a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5); --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6); }
.topbar { border-bottom: 0; }
.barre-outils { justify-content: safe center; gap: 4px 30px; min-height: 44px; padding-top: 0; padding-bottom: 0; border-bottom: 0;
  background: color-mix(in srgb, var(--surface) 86%, transparent); }
.bo-item, .bo-item.is-actif {
  background: none; box-shadow: none; border-radius: 0; padding: 0; min-height: 44px; position: relative;
  font-size: .875rem; font-weight: 400; letter-spacing: -0.01em; text-transform: none;
  color: color-mix(in srgb, var(--text) 80%, transparent); transition: color .2s;
}
.bo-item .ic { display: none; }
.bo-item:hover { background: none; color: var(--text); }
.bo-item.is-actif { color: var(--text); font-weight: 600; }
.bo-item.is-actif::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--c1, var(--primary)), var(--c2, var(--primary))); }
@media (min-width: 900px) {
  body.a-barre .sidebar { top: 109px; height: calc(100vh - 109px); }
  body.a-barre .layout { min-height: calc(100vh - 109px); }
}

/* Bandeau slogan (à la place du « Choisissez un pays » d'apple.com) */
.slogan { background: #e8e8ed; color: #1d1d1f; padding: 14px 16px; }
.slogan p { margin: 0 auto; max-width: 1100px; font-size: .875rem; line-height: 1.45; letter-spacing: -0.01em; }
.slogan strong { font-weight: 600; }
.slogan-suite { color: #424245; }
@media (max-width: 639px) { .slogan { padding: 10px 16px; } .slogan p { font-size: .8rem; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slogan { background: #161617; color: #f5f5f7; } :root:not([data-theme="light"]) .slogan-suite { color: #a1a1a6; } }
:root[data-theme="dark"] .slogan { background: #161617; color: #f5f5f7; }
:root[data-theme="dark"] .slogan-suite { color: #a1a1a6; }

/* Logo et slogan alignés sur le bord gauche des tuiles (menu 248 px + contenu centré de 1120 px) ; fond gris Apple */
:root:not([data-theme="dark"]) { --bg: #e8e8ed; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #000000; } }
.slogan p { max-width: none; margin: 0; }
@media (min-width: 900px) {
  .entete .topbar, .slogan {
    padding-left: calc(248px + max(0px, (100% - 1368px) / 2) + 28px);
    padding-right: calc(max(0px, (100% - 1368px) / 2) + 28px);
  }
}
@media (min-width: 640px) { .topbar .logo-stmgate { margin-left: -8px; } }
@media (min-width: 900px) {
  .entete .barre-outils { padding-left: calc(248px + max(0px, (100% - 1368px) / 2) + 28px); padding-right: calc(max(0px, (100% - 1368px) / 2) + 28px); }
}
/* Logo calé à gauche, au-dessus des icônes du menu de gauche */
@media (min-width: 900px) { .entete .topbar { padding-left: 22px; } }

/* Bonjour, notifications, aide et déconnexion remontés dans le bandeau gris, à droite du slogan */
.slogan { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 6px; padding-bottom: 6px; }
.slogan p { flex: 1; min-width: 0; }
.slogan-outils { display: flex; align-items: center; gap: 4px; flex: none; }
.slogan .bonjour { color: inherit; font-size: .875rem; }
.slogan .bonjour:hover, .slogan .icon-btn:hover { background: rgba(0, 0, 0, .06); }
.slogan .icon-btn { width: 38px; height: 38px; color: inherit; }
.slogan .btn-deco { background: transparent; border-color: rgba(0, 0, 0, .18); color: inherit; min-height: 34px; padding: 4px 12px; font-size: .85rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slogan .btn-deco { border-color: rgba(255, 255, 255, .25); } :root:not([data-theme="light"]) .slogan .bonjour:hover, :root:not([data-theme="light"]) .slogan .icon-btn:hover { background: rgba(255, 255, 255, .08); } }
:root[data-theme="dark"] .slogan .btn-deco { border-color: rgba(255, 255, 255, .25); }
@media (max-width: 639px) { .slogan p { display: none; } .slogan { justify-content: flex-end; padding-top: 2px; padding-bottom: 2px; } }
.topbar { min-height: 64px; }
@media (max-width: 639px) { .topbar .brand-text { display: inline; font-size: 1.25rem; } .topbar { min-height: 56px; } }
@media (min-width: 900px) { .slogan { padding-left: 22px; } }
.slogan p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1199px) { .slogan-suite { display: none; } }

/* Une seule bande blanche, comme apple.com : logo à gauche, outils sur la même ligne */
@media (min-width: 900px) {
  .entete { display: flex; align-items: center; background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
  .entete .topbar { flex: none; min-height: 52px; padding: 0 12px 0 22px; background: none; backdrop-filter: none; border: 0; }
  .entete .barre-outils { flex: 1; min-width: 0; min-height: 52px; background: none; padding: 0 22px; justify-content: safe center; }
  .entete .bo-item, .entete .bo-item.is-actif { min-height: 52px; }
  .entete .bo-item.is-actif::after { bottom: 9px; }
  .logo-stmgate { width: 36px; height: 36px; margin: 0 0 0 -6px; }
  .brand-text { font-size: 1.3rem; letter-spacing: .03em; }
  body.a-barre .sidebar { top: 53px; height: calc(100vh - 53px); }
  body.a-barre .layout { min-height: calc(100vh - 53px); }
}
@media (min-width: 900px) { .entete .classe-switch { margin-left: 14px; } .entete .classe-switch select { max-width: 160px; min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: .85rem; } .entete .topbar .spacer { display: none; } }

/* ---------------------------------------------------------------- Progression : tableau semaine par semaine */
.prog-sep { align-self: center; margin: 0 4px 0 10px; font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.prog-classe-coll { border-style: dashed; gap: 6px; }
.prog-copie { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.prog-depart { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.prog-depart h2 { display: flex; gap: 8px; align-items: center; font-size: 1.15rem; margin: 0 0 6px; }
.prog-outils { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-bottom: 16px; }
.prog-outils form { margin: 0; }
.prog-menu { position: relative; }
.prog-menu > summary { list-style: none; cursor: pointer; }
.prog-menu > summary::-webkit-details-marker { display: none; }
.prog-pop { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; width: min(92vw, 520px); padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); }
.prog-menu:last-child .prog-pop { left: auto; right: 0; }
.btn-xs { min-height: 28px; padding: 3px 8px; font-size: .75rem; border-radius: 8px; gap: 4px; }
.btn-valider { background: var(--success); color: #fff; border-color: transparent; }
.prog-bilan { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); margin-bottom: 16px; }
.prog-bilan-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 4px; }
.prog-bilan-item .prog-tete { margin: 0; }
.prog-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.prog-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.prog-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; padding: 10px; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--border); min-width: 180px; }
.prog-table th.pt-sem { min-width: 118px; width: 118px; }
.prog-table td, .prog-table tbody th { padding: 10px; vertical-align: top; border-bottom: 1px solid var(--border); text-align: left; }
.prog-table td + td, .prog-table th + td { border-left: 1px solid var(--border); }
.prog-table tbody th { font-weight: 400; border-left: 5px solid transparent; }
.prog-table tr.risque-vert th { border-left-color: #40c057; }
.prog-table tr.risque-jaune th { border-left-color: #fab005; }
.prog-table tr.risque-rouge th { border-left-color: #fa5252; }
.prog-table tr.risque-gris th { border-left-color: #adb5bd; }
.pt-code { display: block; font-weight: 800; font-size: 1rem; }
.pt-dates { display: block; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.pt-badge { display: inline-block; margin: 2px 0; padding: 1px 7px; border-radius: 99px; background: var(--warn); color: #fff; font-size: .68rem; font-weight: 800; }
.pt-ok { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; color: var(--success); font-weight: 700; font-size: .76rem; }
.pt-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pt-actions form { margin: 0; }
.pt-texte { line-height: 1.4; }
.pt-pied { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: .74rem; color: var(--muted); font-weight: 700; }
.pt-st { padding: 1px 7px; border-radius: 99px; }
.st-vu { background: var(--success-soft); color: var(--success); }
.st-encours { background: var(--warn-soft); color: var(--warn); }
.pt-note { margin-top: 4px; font-size: .76rem; color: var(--muted); }
.prog-table td.is-vu { background: color-mix(in srgb, var(--success-soft) 55%, transparent); }
.prog-table td.is-vu .pt-texte { color: var(--muted); }
.prog-table td.is-en_cours { background: color-mix(in srgb, var(--warn-soft) 70%, transparent); }
.prog-table tr.is-courante > * { box-shadow: inset 0 2px 0 var(--warn), inset 0 -2px 0 var(--warn); }
.prog-table tr.is-passee:not(.is-validee) .pt-code::after { content: " · à valider"; font-size: .7rem; font-weight: 700; color: var(--warn); }
.pt-obj { min-width: 220px; color: var(--muted); }
.prog-legende { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg-vert { background: #40c057; } .lg-jaune { background: #fab005; } .lg-rouge { background: #fa5252; } .lg-gris { background: #adb5bd; }
.section-title { margin: 24px 0 10px; }
/* Téléphone : chaque semaine devient une carte */
@media (max-width: 759px) {
  .prog-table-wrap { border: 0; background: none; overflow: visible; }
  .prog-table, .prog-table tbody, .prog-table tr, .prog-table td, .prog-table tbody th { display: block; width: auto; }
  .prog-table thead { display: none; }
  .prog-table tr { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
  .prog-table tbody th { border-left-width: 0; border-top: 5px solid transparent; }
  .prog-table tr.risque-vert th { border-top-color: #40c057; } .prog-table tr.risque-jaune th { border-top-color: #fab005; }
  .prog-table tr.risque-rouge th { border-top-color: #fa5252; } .prog-table tr.risque-gris th { border-top-color: #adb5bd; }
  .prog-table td + td, .prog-table th + td { border-left: 0; }
  .prog-table td.is-vide { display: none; }
  .prog-table td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); margin-bottom: 3px; }
  .prog-table tr.is-courante { border: 2px solid var(--warn); }
  .prog-table tr.is-courante > * { box-shadow: none; }
  .pt-code { display: inline; } .pt-dates { display: inline; margin-left: 8px; }
}
/* Édition d'une semaine */
.prog-case { border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px 4px; margin: 0 0 12px; }
.prog-case legend { font-weight: 800; padding: 0 6px; }
.prog-case-bas { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: flex-end; }
.input-court { max-width: 90px; }
.prog-radios { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.prog-radios label { position: relative; }
.prog-radios input { position: absolute; opacity: 0; inset: 0; }
.prog-radios span { display: inline-block; padding: 7px 12px; font-size: .82rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.prog-radios label + label span { border-left: 1px solid var(--border); }
.prog-radios input:checked + span { background: var(--primary); color: var(--primary-ink); }
.prog-radios input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -2px; }
.prog-edit-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; }
.pt-actions { flex-wrap: nowrap; align-items: center; }
.prog-table th.pt-sem { min-width: 132px; width: 132px; }
@media (max-width: 759px) {
  .prog-table th.pt-sem { width: auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .pt-dates { margin-left: 0; }
  .prog-bilan { grid-template-columns: 1fr 1fr; }
  .prog-bilan-item .xs { display: none; }
}
/* Validation matière par matière */
.pt-pied { flex-wrap: wrap; }
.pt-valid { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.pt-btn { font: inherit; font-size: .74rem; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; min-height: 28px;
  border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); cursor: pointer; }
.pt-btn:hover { color: var(--text); border-color: var(--text); }
.pt-btn-ok { border-color: var(--success); color: var(--success); }
.pt-btn-ok:hover { background: var(--success); color: #fff; border-color: var(--success); }
.pt-st { display: inline-flex; align-items: center; gap: 3px; }
.pt-lien { font: inherit; font-size: .72rem; background: none; border: 0; padding: 4px; color: var(--muted); text-decoration: underline; cursor: pointer; }
/* Périodes de vacances entre les semaines */
.prog-table tr.pt-vacances td { padding: 8px 14px; border-left: 0; text-align: left;
  background: repeating-linear-gradient(135deg, var(--neutral-soft) 0 10px, var(--surface-2) 10px 20px); color: var(--muted); font-size: .84rem; }
.prog-table tr.pt-vacances td strong { color: var(--text); margin-right: 6px; }
.prog-table tr.pt-vacances .ic { vertical-align: -3px; margin-right: 4px; }
@media (max-width: 759px) {
  .prog-table tr.pt-vacances { border: 1px dashed var(--border-strong); background: var(--surface-2); }
  .prog-table tr.pt-vacances td { background: none; }
}
/* Bilan par matière dans l'en-tête du tableau (cartes seulement sur téléphone) */
.prog-bilan-mobile { display: none; }
.prog-table thead th { vertical-align: bottom; }
.pt-th-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pt-th-compte { color: var(--success); font-weight: 800; font-size: .9rem; text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.prog-table thead progress { display: block; margin: 6px 0 4px; }
.pt-th-h { display: block; font-size: .72rem; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--faint); }
@media (max-width: 759px) { .prog-bilan-mobile { display: grid; } }
/* Liste déroulante de matières à cocher */
.mat-select { position: relative; max-width: 460px; }
.mat-select > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer;
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); font-size: .92rem; }
.mat-select > summary::-webkit-details-marker { display: none; }
.mat-select[open] > summary { border-color: var(--primary); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.mat-select[open] > summary .ic { transform: rotate(180deg); }
.mat-resume { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mat-liste { max-height: 300px; overflow-y: auto; border: 1px solid var(--primary); border-top: 0; border-radius: 0 0 10px 10px; background: var(--surface); padding: 4px 0; }
.mat-groupe { margin: 8px 12px 2px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.mat-item { display: flex; align-items: center; gap: 10px; padding: 7px 12px; cursor: pointer; font-size: .92rem; }
.mat-item:hover { background: var(--neutral-soft); }
.mat-item input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.prog-pop .mat-select { max-width: none; }
/* Modification directe d'une case */
.prog-table td { position: relative; }
.pt-edit > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; color: var(--faint); border-radius: 8px; padding: 4px 6px; }
.pt-edit > summary::-webkit-details-marker { display: none; }
.pt-edit > summary:hover { color: var(--text); background: var(--neutral-soft); }
td:not(.is-vide) > .pt-edit > summary { position: absolute; top: 4px; right: 4px; opacity: .45; }
td:not(.is-vide):hover > .pt-edit > summary, .pt-edit > summary:focus-visible { opacity: 1; }
td.is-vide > .pt-edit > summary { opacity: 0; }
td.is-vide:hover > .pt-edit > summary, td.is-vide > .pt-edit > summary:focus-visible, td.is-vide > .pt-edit[open] > summary { opacity: 1; }
.pt-edit[open] > summary { position: static; opacity: 1; color: var(--primary); }
.pt-edit form { margin-top: 6px; display: grid; gap: 6px; }
.pt-edit textarea { width: 100%; font: inherit; font-size: .84rem; padding: 8px; border: 1px solid var(--primary); border-radius: 8px; background: var(--surface); color: var(--text); resize: vertical; }
.pt-edit-bas { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pt-edit-h { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.pt-edit-h input { width: 56px; min-height: 30px; padding: 4px 6px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); }
@media (hover: none) { td.is-vide > .pt-edit > summary, td:not(.is-vide) > .pt-edit > summary { opacity: .7; } }
/* Bouton « Modifier » d'une case : même style que « En cours », à sa droite */
.pt-pied .pt-edit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pt-pied .pt-edit[open] { flex-basis: 100%; }
.pt-edit > summary.pt-btn, td:not(.is-vide) > .pt-edit > summary, .pt-pied .pt-edit > summary { position: static; opacity: 1; padding: 3px 9px; font-size: .74rem; color: var(--muted); }
.pt-edit > summary.pt-btn:hover { color: var(--text); background: var(--surface); border-color: var(--text); }
.pt-edit[open] > summary.pt-btn { color: var(--primary); border-color: var(--primary); }
.pt-edit[open] > form { flex-basis: 100%; }
td.is-vide > .pt-edit > summary.pt-btn { opacity: 0; }
td.is-vide:hover > .pt-edit > summary.pt-btn, td.is-vide > .pt-edit > summary.pt-btn:focus-visible, td.is-vide > .pt-edit[open] > summary.pt-btn { opacity: 1; }
@media (hover: none) { td.is-vide > .pt-edit > summary.pt-btn { opacity: .8; } }
.pt-pied .pt-edit > summary.pt-btn { padding: 3px 8px; }
.pt-edit textarea, .pt-edit-h { font-weight: 400; }
.prog-table thead th { min-width: 205px; }
.pt-pied, .pt-valid { gap: 5px; }
.pt-btn { padding: 3px 8px; }
.prog-table thead th { min-width: 220px; }
/* Liste déroulante d'avancement dans chaque case */
.pt-select { font: inherit; font-size: .76rem; font-weight: 700; min-height: 28px; padding: 2px 24px 2px 10px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--border-strong); background-color: var(--surface); color: var(--muted); width: auto; }
.pt-select.st-vu { border-color: var(--success); color: var(--success); background-color: var(--success-soft); }
.pt-select.st-en_cours { border-color: var(--warn); color: var(--warn); background-color: var(--warn-soft); }
.pt-select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pt-select.st-absent { border-color: var(--danger); color: var(--danger); background-color: var(--danger-soft); }
.st-absent { background: var(--danger-soft); color: var(--danger); }
.prog-table td.is-absent { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
.prog-table td.is-absent .pt-texte { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--muted); }
.pt-heures { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 99px; background: var(--neutral-soft); color: var(--muted); font-size: .74rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pt-heures strong { color: var(--text); }
.pt-heures.is-complet { background: var(--success-soft); color: var(--success); }
.pt-heures.is-complet strong { color: var(--success); }
.pt-dispo { display: block; margin-top: 3px; font-size: .72rem; color: var(--faint); white-space: nowrap; }
.pt-heures { margin-top: 6px; }
.btn.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
/* Crayon « modifier la semaine » en haut à droite de la case Semaine */
.prog-table tbody th.pt-sem { position: relative; padding-right: 44px; }
.pt-sem-edit { position: absolute; top: 8px; right: 8px; text-decoration: none; }
.pt-sem-edit:hover { text-decoration: none; }
@media (max-width: 759px) { .pt-sem-edit { top: 10px; right: 10px; } }
.prog-table th.pt-sem { min-width: 158px; width: 158px; } .prog-table tbody th.pt-sem { padding-right: 40px; } .pt-dates, .pt-ok { white-space: nowrap; }
/* Colonne Période */
.prog-table th.pt-per, .prog-table td.pt-per { width: 44px; min-width: 44px; padding: 8px 4px; text-align: center; }
.prog-table td.pt-per { vertical-align: middle; background: var(--surface-2); border-right: 1px solid var(--border); }
.prog-table td.pt-per span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; font-size: .9rem; letter-spacing: .06em; color: var(--muted); }
.prog-table td.pt-per + th { border-left-width: 5px; }
.prog-legende { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin: 0 0 10px; font-size: .78rem; color: var(--muted); }
.prog-legende > span { display: inline-flex; align-items: center; gap: 6px; }
.prog-legende .lg { margin: 0; width: 5px; height: 16px; border-radius: 2px; }
.prog-legende-titre { font-weight: 700; color: var(--text); }
@media (max-width: 759px) { .prog-table td.pt-per { display: none; } }
.prog-table td.pt-per { vertical-align: top; padding-top: 14px; }
.prog-table td.pt-per span { writing-mode: horizontal-tb; transform: none; font-size: .82rem; letter-spacing: 0; }
/* Légende des couleurs dans l'espace libre à droite des boutons */
.prog-legende-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; font-size: .78rem; color: var(--muted); margin-bottom: 12px; }
.prog-legende-box .prog-legende-titre { margin: 0 0 6px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text); }
.prog-legende-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.prog-legende-box li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; }
.prog-legende-box .lg { flex: none; margin: 1px 0 0; width: 5px; height: 16px; border-radius: 2px; }
.prog-legende-box strong { color: var(--text); font-weight: 700; }
@media (min-width: 1100px) {
  .prog-legende-box { float: right; width: 360px; margin: -4px 0 12px 16px; }
  .prog-table-wrap, .prog-bilan, .section-title { clear: both; }
}
.prog-legende-box ul { grid-template-columns: auto auto; gap: 4px 14px; }
.prog-legende-box small { color: var(--faint); font-size: .72rem; }
@media (min-width: 1100px) { .prog-legende-box { width: auto; max-width: 320px; } }
.prog-legende-box ul { grid-template-columns: auto auto; gap: 5px 16px; }
@media (min-width: 1100px) { .prog-legende-box { max-width: 230px; margin-top: 0; } }
.pt-h-fait { color: #0b6b3a; font-weight: 800; }
.pt-h-total { color: var(--text); font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pt-h-fait { color: var(--success); } }
:root[data-theme="dark"] .pt-h-fait { color: var(--success); }
/* Contenu des cases : même police et même taille que « faites sur » dans l'en-tête */
.prog-table td .pt-texte { font-size: .72rem; font-weight: 600; line-height: 1.45; }
.pt-th-nom { font-size: .72rem; }
/* Compteur de semaines faites de chaque matière, entouré */
.pt-th-compte { display: inline-block; padding: 1px 8px; border: 1.5px solid var(--success); border-radius: 99px; font-size: .74rem; line-height: 1.4; white-space: nowrap; }
/* En-tête : traits fins entre les colonnes, comme dans le corps du tableau */
.prog-table thead th + th { border-left: 1px solid var(--border); }
/* Colonne Période plus étroite */
.prog-table th.pt-per, .prog-table td.pt-per { width: 32px; min-width: 32px; max-width: 32px; padding-left: 2px; padding-right: 2px; }
.prog-table td.pt-per span { font-size: .74rem; }
.prog-table thead th.pt-per { font-size: .66rem; }
/* Progression : le tableau utilise toute la largeur de l'écran */
main:has(.prog-table-wrap), main:has(.prog-edit), main:has(.prog-depart) { max-width: none; }
body.pleine-largeur main { max-width: none !important; }
/* Choix de l'affichage : vue complète / vue compacte */
.prog-vues { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.prog-vue { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 36px; font-size: .88rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.prog-vue + .prog-vue { border-left: 1px solid var(--border-strong); }
.prog-vue:hover { color: var(--text); text-decoration: none; }
.prog-vue.is-on { background: var(--primary); color: var(--primary-ink); }
/* Vue compacte : on masque le détail des contenus, on garde heures, état et crayon */
.prog-table.is-compacte td .pt-texte, .prog-table.is-compacte td .pt-note { display: none; }
.prog-table.is-compacte td .pt-pied { margin-top: 0; }
.prog-table.is-compacte td, .prog-table.is-compacte tbody th { padding-top: 6px; padding-bottom: 6px; }
.prog-table.is-compacte .pt-heures { margin-top: 2px; }
.prog-table.is-compacte tbody th.pt-sem .pt-code { display: inline; margin-right: 6px; }
.prog-table.is-compacte tbody th.pt-sem .pt-dates { display: inline; font-size: .72rem; }
.prog-table.is-compacte tbody th.pt-sem .pt-heures { display: table; }
.prog-table.is-compacte .pt-ok, .prog-table.is-compacte .pt-badge { display: none; }
.prog-table.is-compacte .pt-sem-edit { top: 5px; }
/* Première colonne : période + numéro de semaine ensemble */
.prog-table tr.is-passee:not(.is-validee) .pt-code::after { content: none; }
.prog-table th.pt-per, .prog-table td.pt-per { width: 54px; min-width: 54px; max-width: 54px; padding: 10px 4px; text-align: center; }
.prog-table td.pt-per { vertical-align: top; background: var(--surface-2); border-right: 1px solid var(--border); }
.prog-table td.pt-per .pt-code { display: block; font-size: 1rem; font-weight: 800; color: var(--text); writing-mode: horizontal-tb; transform: none; letter-spacing: 0; }
.prog-table td.pt-per .pt-per-tag { display: inline-block; margin-bottom: 4px; padding: 1px 6px; border-radius: 6px; background: var(--wm-prune, #4b1240); color: #fff;
  font-size: .64rem; font-weight: 800; letter-spacing: .03em; writing-mode: horizontal-tb; transform: none; }
.prog-table tr:has(> td.is-debut-per) > * , .prog-table td.is-debut-per { border-top: 2px solid var(--border-strong); }
.prog-table thead th.pt-per { font-size: .7rem; }
.pt-avalider { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--warn); margin-bottom: 2px; }
.prog-table th.pt-sem { min-width: 140px; width: 140px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prog-table td.pt-per .pt-per-tag { background: #7a2e6a; } }
@media (max-width: 759px) {
  .prog-table td.pt-per { display: flex; gap: 8px; align-items: center; width: auto; max-width: none; text-align: left; padding: 8px 12px 0; background: none; border: 0; }
  .prog-table td.pt-per .pt-per-tag { margin: 0; }
}
/* La couleur de la semaine passe sur la première colonne */
.prog-table tbody th.pt-sem, .prog-table td.pt-per + th { border-left: 1px solid var(--border); }
.prog-table tr.risque-vert td.pt-per { box-shadow: inset 5px 0 0 #40c057; }
.prog-table tr.risque-jaune td.pt-per { box-shadow: inset 5px 0 0 #fab005; }
.prog-table tr.risque-rouge td.pt-per { box-shadow: inset 5px 0 0 #fa5252; }
.prog-table tr.risque-gris td.pt-per { box-shadow: inset 5px 0 0 #adb5bd; }
@media (max-width: 759px) {
  .prog-table tbody th.pt-sem { border-top: 0; }
  .prog-table tr.risque-vert td.pt-per, .prog-table tr.risque-jaune td.pt-per, .prog-table tr.risque-rouge td.pt-per, .prog-table tr.risque-gris td.pt-per { box-shadow: none; }
  .prog-table tr.risque-vert { border-top: 5px solid #40c057; } .prog-table tr.risque-jaune { border-top: 5px solid #fab005; }
  .prog-table tr.risque-rouge { border-top: 5px solid #fa5252; } .prog-table tr.risque-gris { border-top: 5px solid #adb5bd; }
}
/* Tableau de progression : défilement horizontal et vertical dans un cadre, en-tête et 2 premières colonnes figés */
@media (min-width: 760px) {
  .prog-table-wrap { max-height: calc(100vh - 150px); overflow: auto; scrollbar-width: auto; }
  .prog-table thead th { position: sticky; top: 0; z-index: 3; }
  .prog-table td.pt-per, .prog-table thead th.pt-per { position: sticky; left: 0; z-index: 2; }
  .prog-table tbody th.pt-sem, .prog-table thead th.pt-sem { position: sticky; left: 54px; z-index: 2; background: var(--surface); }
  .prog-table thead th.pt-per, .prog-table thead th.pt-sem { z-index: 4; background: var(--surface-2); }
  .prog-table tr.pt-vacances td { position: sticky; left: 0; }
  .prog-table tbody th.pt-sem { box-shadow: 4px 0 6px -4px rgba(0, 0, 0, .15); }
}
.prog-defil { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 6px; }
.prog-defil[hidden] { display: none; }
/* ---------------------------------------------------------------- Lancer un QCM (mode expert) */
.lancer { display: grid; gap: 14px; }
.lancer .label { margin-bottom: 6px; }
.lancer-resume { margin: -4px 0 0; display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.lancer-bloc { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.lancer-etape { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: .78rem; font-weight: 800; margin-top: 1px; }
.lancer-corps { min-width: 0; }
.lancer .seg { margin: 0; }
.lancer .seg strong { display: inline-flex; align-items: center; gap: 6px; }
.pastilles { display: flex; flex-wrap: wrap; gap: 6px; }
.pastille { position: relative; margin: 0; }
.pastille input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pastille span { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--border-strong); font-weight: 700; font-size: .88rem; cursor: pointer; background: var(--surface); }
.pastille input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pastille input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
.bascule { display: flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.bascule label { flex: 1; margin: 0; position: relative; }
.bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bascule span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 6px 8px; font-size: .84rem; font-weight: 650; color: var(--muted); cursor: pointer; text-align: center; }
.bascule label + label span { border-left: 1px solid var(--border-strong); }
.bascule input:checked + span { background: var(--primary-soft); color: var(--primary); }
.bascule input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: -3px; }
.mt-s { margin-top: 8px; }
.lancer-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.lancer-ligne[hidden] { display: none; }
.lancer-ligne input[type=date], .lancer-ligne input[type=time] { width: auto; flex: 1; min-width: 120px; min-height: 40px; }
.lancer-inline { margin: 0; font-size: .88rem; }
.champ-unite { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; background: var(--surface); }
.champ-unite input { border: 0; width: 72px; min-height: 38px; padding: 6px 10px; border-radius: 0; }
.champ-unite input:focus { outline: 0; }
.champ-unite:focus-within { outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.champ-unite > span { padding: 0 10px; color: var(--muted); font-size: .84rem; border-left: 1px solid var(--border); align-self: stretch; display: grid; place-items: center; background: var(--surface-2); }
.lancer-bareme { border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-top: 14px; }
.lancer-bareme > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; font-weight: 700; font-size: .88rem; }
.lancer-bareme > summary::-webkit-details-marker { display: none; }
.lancer-bareme > summary > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.lancer-bareme-resume { font-weight: 500; font-size: .76rem; color: var(--muted); }
.lancer-bareme-corps { padding: 0 12px 12px; display: grid; gap: 8px; }
.pastilles-s { gap: 4px; }
.pastille-btn { font: inherit; font-size: .78rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.pastille-btn:hover { border-color: var(--primary); color: var(--primary); }
.interrupteur { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; font-size: .88rem; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interrupteur > span { width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; transition: background .15s; }
.interrupteur > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.interrupteur input:checked + span { background: var(--success); }
.interrupteur input:checked + span::after { transform: translateX(16px); }
.interrupteur input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; }
.lancer-recap { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: .84rem; font-weight: 650; line-height: 1.4; }
.lancer-recap:empty { display: none; }
.btn-lg { min-height: 52px; font-size: 1.02rem; }
@media (prefers-reduced-motion: reduce) { .interrupteur > span, .interrupteur > span::after { transition: none; } }
/* QCM : vue compacte (énoncés seuls, sans les réponses) */
.questions.is-compacte { gap: 6px; }
.questions.is-compacte .qcard { padding: 8px 12px; align-items: center; }
.questions.is-compacte .qcard-choix, .questions.is-compacte .qcard > .grow > .xs.muted { display: none; }
.questions.is-compacte .qcard-enonce { margin: 0; font-size: .92rem; }
.questions.is-compacte .qnum { width: 26px; height: 26px; font-size: .78rem; }
.questions.is-compacte .qcard-actions { flex-direction: row; align-items: center; }
.questions.is-compacte .qcard-actions form { display: inline-flex; }
.questions.is-compacte .icon-btn { width: 34px; height: 34px; }

/* ---------------------------------------------------------------- Lancer un QCM : barre horizontale en haut de page */
.lancer-barre { --q1: #0ca678; --q2: #087f5b; position: relative; margin-bottom: 18px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 32px -18px rgba(8, 127, 91, .35); overflow: visible; }
.lancer-barre::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; border-radius: 20px 20px 0 0; background: linear-gradient(90deg, var(--q1), var(--q2), #1c7ed6); }
.lancer-barre > .muted { padding: 18px 20px; margin: 0; }
.lb { display: grid; }
.lb-tete { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); }
.lb-titre { display: flex; align-items: center; gap: 12px; }
.lb-ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--q1), var(--q2)); box-shadow: 0 6px 14px -6px var(--q2); flex: none; }
.lb-titre h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.01em; }
.lb-titre p { margin: 4px 0 0; display: flex; gap: 6px; }
.lb-puce { font-size: .74rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--neutral-soft); color: var(--muted); }
.lb-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.lb-recap { margin: 0; max-width: 420px; font-size: .82rem; font-weight: 600; color: var(--muted); text-align: right; line-height: 1.4; }
.lb-bouton { font: inherit; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; border: 0; border-radius: 14px; cursor: pointer;
  font-size: 1.05rem; font-weight: 800; letter-spacing: -.01em; color: #fff; background: linear-gradient(135deg, var(--q1), var(--q2));
  box-shadow: 0 10px 22px -10px var(--q2), inset 0 1px 0 rgba(255, 255, 255, .25); transition: transform .15s ease, box-shadow .15s ease, filter .15s; }
.lb-bouton:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 14px 26px -10px var(--q2), inset 0 1px 0 rgba(255, 255, 255, .25); }
.lb-bouton:active { transform: translateY(0); }
.lb-bouton:focus-visible { outline: 3px solid color-mix(in srgb, var(--q1) 50%, transparent); outline-offset: 2px; }
.lb-bouton .ic { transition: transform .15s ease; }
.lb-bouton:hover .ic { transform: translateX(3px); }
.lb-etapes { display: flex; flex-wrap: wrap; }
.lb-col { flex: 1 1 200px; padding: 14px 20px 18px; min-width: 0; }
.lb-col + .lb-col { border-left: 1px solid var(--border); }
.lb-col-large { flex: 2 1 340px; }
.lb-col[hidden] { display: none; }
.lb-label { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.lb-num { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; color: #fff; background: linear-gradient(135deg, var(--q1), var(--q2)); letter-spacing: 0; }
.lb .pastille input:checked + span { background: linear-gradient(135deg, var(--q1), var(--q2)); border-color: transparent; color: #fff; box-shadow: 0 4px 10px -6px var(--q2); }
.lb-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lb-mode { position: relative; margin: 0; cursor: pointer; }
.lb-mode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lb-mode > span { display: flex; align-items: center; gap: 10px; height: 100%; padding: 10px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); transition: border-color .15s, background .15s; }
.lb-mode-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--neutral-soft); color: var(--muted); }
.lb-mode strong { display: block; font-size: .9rem; }
.lb-mode small { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.lb-mode input:checked + span { border-color: var(--q1); background: color-mix(in srgb, var(--q1) 9%, var(--surface)); }
.lb-mode input:checked + span .lb-mode-ic { background: linear-gradient(135deg, var(--q1), var(--q2)); color: #fff; }
.lb-mode-chal input:checked + span { border-color: #f59f00; background: color-mix(in srgb, #f59f00 10%, var(--surface)); }
.lb-mode-chal input:checked + span .lb-mode-ic { background: linear-gradient(135deg, #fab005, #f76707); }
.lb-mode input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--q1) 45%, transparent); outline-offset: 1px; }
.lb-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lb-ligne + .lb-ligne { margin-top: 8px; }
.lb-ligne[hidden] { display: none; }
.lb-ligne .bascule { flex: 1 1 auto; }
.lb .bascule input:checked + span { background: color-mix(in srgb, var(--q1) 12%, var(--surface)); color: var(--q2); }
.bascule-s span { min-height: 34px; font-size: .8rem; }
.lb-ligne input[type=date], .lb-ligne input[type=time] { width: auto; flex: 1; min-width: 130px; min-height: 38px; padding: 6px 10px; }
.lb .champ-unite input { width: 64px; }
.lb-bareme { position: relative; }
.lb-bareme > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 12px;
  border: 1px dashed var(--border-strong); border-radius: 12px; font-size: .82rem; font-weight: 600; color: var(--text); background: var(--surface-2); }
.lb-bareme > summary::-webkit-details-marker { display: none; }
.lb-bareme > summary:hover, .lb-bareme[open] > summary { border-style: solid; border-color: var(--q1); }
.lb-bareme > summary .ic { color: var(--muted); flex: none; }
.lb-pop { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(92vw, 380px); padding: 14px; display: grid; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); }
.lb-info p:last-child { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.lb-info strong { color: var(--text); }
@media (max-width: 899px) {
  .lb-col + .lb-col { border-left: 0; border-top: 1px solid var(--border); }
  .lb-col { flex-basis: 100%; }
  .lb-go { width: 100%; justify-content: stretch; }
  .lb-recap { text-align: left; max-width: none; flex: 1 1 100%; }
  .lb-bouton { width: 100%; justify-content: center; }
  .lb-pop { left: 0; right: auto; }
}
@media (prefers-reduced-motion: reduce) { .lb-bouton, .lb-bouton .ic, .lb-mode > span { transition: none; } }
.lb-col-mode { flex: 0 1 330px; min-width: 300px; }
.lb-col-large { flex: 2 1 380px; }
@media (max-width: 899px) { .lb-col-mode { min-width: 0; flex-basis: 100%; } }
/* Page d'un QCM en pleine largeur : questions à gauche, outils à droite */
.lb-col-classe { flex: 0 1 220px; min-width: 180px; }
.lb-select { min-height: 44px; font-weight: 700; border-radius: 12px; cursor: pointer; }
.lb-select:focus { border-color: var(--q1); outline-color: color-mix(in srgb, var(--q1) 35%, transparent); }
@media (max-width: 899px) { .lb-col-classe { flex-basis: 100%; } }
/* Modes l'un sous l'autre, en lignes compactes */
.lb-col-mode { flex: 0 1 250px; min-width: 220px; }
.lb-modes { grid-template-columns: 1fr; gap: 6px; }
.lb-mode > span { padding: 8px 10px; gap: 10px; }
.lb-mode-ic { width: 28px; height: 28px; border-radius: 9px; }
.lb-mode strong { display: inline; font-size: .88rem; }
.lb-mode small { display: inline; margin-left: 6px; }
/* Numéros d'étape : pastille douce, chiffre vert, liseré */
.lb-label { gap: 10px; color: var(--text); letter-spacing: .06em; }
.lb-num { width: 24px; height: 24px; border-radius: 8px; font-size: .78rem; font-weight: 800; letter-spacing: 0;
  color: var(--q2); background: color-mix(in srgb, var(--q1) 13%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--q1) 35%, transparent); font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lb-num { color: #63e6be; } }
:root[data-theme="dark"] .lb-num { color: #63e6be; }
.lb-mode strong, .lb-mode small { display: block; margin-left: 0; } .lb-mode small { line-height: 1.3; }
/* Barre de lancement dans la colonne des questions : Exporter / Réglages remontent en haut à droite */
.qcm-main > .lancer-barre { margin-bottom: 14px; }
.lb-col { padding: 12px 14px 14px; }
.lb-col-classe { flex: 0 1 170px; min-width: 150px; }
.lb-col-mode { flex: 0 1 215px; min-width: 200px; }
.lb-col-large { flex: 1 1 320px; }
.lb-col:not(.lb-col-classe):not(.lb-col-mode):not(.lb-col-large) { flex: 1 1 190px; }
.lb-tete { padding: 14px 16px 12px; }
.lb .bascule span { white-space: nowrap; }
.lb-col:not(.lb-col-classe):not(.lb-col-mode):not(.lb-col-large) { flex: 0 1 180px; min-width: 160px; }
/* Bouton principal en haut de la colonne de droite, au-dessus d'Exporter */
.lb-cta { --q1: #0ca678; --q2: #087f5b; display: grid; gap: 8px; margin-bottom: 14px; }
.lb-cta .lb-bouton { width: 100%; justify-content: center; min-height: 58px; font-size: 1.1rem; }
.lb-cta .lb-recap { text-align: center; max-width: none; font-size: .8rem; }
.lb-tete { border-bottom: 1px solid var(--border); }
.lb-cta-mobile { padding: 0 16px 16px; margin: 0; }
@media (min-width: 1100px) { .lb-cta-mobile { display: none; } }
@media (max-width: 1099px) { .qcm-side > .lb-cta { display: none; } }
@media (max-width: 899px) { .lb-col, .lb-col:not(.lb-col-classe):not(.lb-col-mode):not(.lb-col-large) { flex-basis: 100%; min-width: 0; } }
/* « Enregistrer » dans le bandeau, « Lancer le QCM » à droite */
.lb-enregistrer { font: inherit; display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; cursor: pointer;
  font-weight: 800; font-size: .95rem; color: var(--q2); background: var(--surface); border: 1.5px solid var(--q1); transition: background .15s; }
.lb-enregistrer:hover { background: color-mix(in srgb, var(--q1) 10%, var(--surface)); }
.lb-enregistrer:focus-visible { outline: 3px solid color-mix(in srgb, var(--q1) 45%, transparent); outline-offset: 2px; }
.lb-bouton:disabled { cursor: not-allowed; filter: grayscale(.85); opacity: .55; transform: none; box-shadow: none; }
.lb-cta-note { margin: 0; font-size: .8rem; color: var(--muted); text-align: center; line-height: 1.4; }
.lb-cta-note[hidden] { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lb-enregistrer { color: #63e6be; } }
:root[data-theme="dark"] .lb-enregistrer { color: #63e6be; }
/* Modification d'une question directement dans la liste du QCM */
.qcard.is-edition { box-shadow: 0 0 0 2px var(--primary), var(--shadow); }
.qcard.is-edition .qcard-actions { visibility: hidden; }
.qedit { display: grid; gap: 10px; min-width: 0; }
.qedit[hidden] { display: none; }
.qedit-enonce { min-height: 0; font-weight: 700; font-size: .98rem; padding: 8px 10px; }
.qedit-choix { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.qedit-ligne { display: grid; grid-template-columns: 30px 18px 1fr; align-items: center; gap: 8px; }
.qedit-ligne input[type=text] { min-height: 38px; padding: 6px 10px; }
.qedit-ok { position: relative; margin: 0; cursor: pointer; width: 30px; height: 30px; }
.qedit-ok input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.qedit-coche { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; border: 1.5px solid var(--border-strong); color: transparent; background: var(--surface); }
.qedit-ok input:checked + .sr-only + .qedit-coche { background: var(--success); border-color: var(--success); color: #fff; }
.qedit-ok input:focus-visible + .sr-only + .qedit-coche { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.qedit-ligne:has(input:checked) input[type=text] { border-color: var(--success); background: var(--success-soft); font-weight: 650; }
.qedit-lettre { font-weight: 800; color: var(--muted); font-size: .82rem; text-align: center; }
.qedit-vf { border: 0; margin: 0; padding: 0; display: flex; gap: 8px; }
.qedit-vf[hidden], .qedit-choix[hidden] { display: none; }
.qedit-reglages { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.qedit-mini { display: grid; gap: 4px; margin: 0; font-size: .74rem; font-weight: 700; color: var(--muted); }
.qedit-mini select, .qedit-mini input[type=text] { min-height: 38px; padding: 6px 10px; font-size: .88rem; color: var(--text); font-weight: 500; }
.qedit-mini .champ-unite input { width: 64px; }
.qedit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.qedit-plus { margin-left: auto; }

/* ---------------------------------------------------------------- Bibliothèque Quiz : sous-tuiles */
.bq-tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 4px 0 20px; }
.bq-tuile { --c1: #0ca678; --c2: #087f5b; position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.bq-tuile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 30px -18px var(--c2); border-color: color-mix(in srgb, var(--c1) 45%, var(--border)); }
.bq-ep { --c1: #7048e8; --c2: #ae3ec9; }
.bq-mat { --c1: #1c7ed6; --c2: #4263eb; }
.bq-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; color: var(--c2);
  background: color-mix(in srgb, var(--c1) 13%, var(--surface)); transition: background .18s, color .18s; }
.bq-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.bq-nom { font-weight: 800; font-size: 1.08rem; letter-spacing: -.01em; }
.bq-sous { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bq-nb { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: color-mix(in srgb, var(--c2) 70%, var(--text)); font-variant-numeric: tabular-nums; line-height: 1; }
.bq-tuile.is-on { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 16px 34px -18px var(--c2); }
.bq-tuile.is-on .bq-ic { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.bq-tuile.is-on .bq-sous, .bq-tuile.is-on .bq-nb { color: rgba(255, 255, 255, .92); }
.bq-tuile.is-on::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 28px; height: 4px; margin-left: -14px; border-radius: 4px 4px 0 0; background: rgba(255, 255, 255, .85); }
.bq-tuile:focus-visible { outline: 3px solid color-mix(in srgb, var(--c1) 50%, transparent); outline-offset: 2px; }
.bq-live { width: 8px; height: 8px; border-radius: 50%; background: #2fb344; box-shadow: 0 0 0 0 rgba(47, 179, 68, .6); animation: bq-pouls 1.6s infinite; flex: none; }
.bq-tuile.is-on .bq-live { background: #b2f2bb; }
@keyframes bq-pouls { 70% { box-shadow: 0 0 0 7px rgba(47, 179, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 179, 68, 0); } }
.bq-panneau { animation: bq-entree .22s ease; }
@keyframes bq-entree { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.bq-titre-s { margin: 26px 0 10px; font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bq-vide { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 36px 20px; border: 2px dashed var(--border-strong); border-radius: 18px; color: var(--muted); }
.bq-vide h2 { margin: 0; font-size: 1.1rem; color: var(--text); }
.bq-vide p { margin: 0 0 6px; max-width: 460px; }
/* Épreuves */
.bq-epreuves { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.bq-epreuve { position: relative; display: grid; gap: 8px; padding: 16px 44px 14px 16px; height: 100%; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.bq-epreuve:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.bq-epreuve.is-live { border-color: #2fb344; box-shadow: 0 0 0 1px #2fb344; }
.bq-mode { justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px; font-size: .74rem; font-weight: 800; color: #6741d9; background: #f3f0ff; }
.bq-mode.is-chal { color: #d9480f; background: #fff4e6; }
.bq-ep-titre { font-weight: 750; line-height: 1.35; }
.bq-ep-pied { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.bq-classe { font-weight: 800; color: var(--text); padding: 1px 8px; border-radius: 6px; background: var(--neutral-soft); }
.bq-statut { display: inline-flex; align-items: center; gap: 6px; }
.bq-epreuve.is-live .bq-statut { color: #2b8a3e; font-weight: 700; }
.bq-fleche { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); transition: transform .15s, color .15s; }
.bq-epreuve:hover .bq-fleche { color: var(--text); transform: translate(3px, -50%); }
.bq-lignes { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.bq-lignes li + li { border-top: 1px solid var(--border); }
.bq-lignes a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--text); text-decoration: none; font-size: .9rem; }
.bq-lignes a:hover { background: var(--surface-2); text-decoration: none; }
.bq-mode-mini { font-size: .7rem; font-weight: 800; color: #6741d9; min-width: 74px; }
.bq-mode-mini.is-chal { color: #d9480f; }
.bq-lien { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
/* Mes QCM */
.bq-qcm-grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.bq-qcm-carte { --c1: #0ca678; --c2: #087f5b; position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.bq-qcm-carte::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); opacity: .9; }
.bq-qcm-carte:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 16px 30px -20px var(--c2); border-color: color-mix(in srgb, var(--c1) 40%, var(--border)); }
.bq-qcm-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bq-code { display: inline-block; padding: 1px 8px; border-radius: 7px; font-size: .76rem; font-weight: 800; color: #1864ab; background: #e7f5ff; font-variant-numeric: tabular-nums; }
.bq-qcm-nb { margin-left: auto; font-size: .78rem; color: var(--muted); }
.bq-qcm-nb strong { color: var(--c2); font-size: 1rem; }
.bq-qcm-titre { font-weight: 800; line-height: 1.3; font-size: 1rem; }
.bq-qcm-chap { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.bq-qcm-pied { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 800; color: var(--c2); }
.bq-qcm-pied .ic { transition: transform .15s; }
.bq-qcm-carte:hover .bq-qcm-pied .ic { transform: translateX(3px); }
/* Mes QCM : répertoires */
.bq-reps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); margin-bottom: 18px; }
.bq-rep { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.bq-rep:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, #f59f00 45%, var(--border)); box-shadow: 0 16px 30px -22px #e67700; }
.bq-rep-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #e67700; background: color-mix(in srgb, #fcc419 22%, var(--surface)); }
.bq-rep-nom { flex: 1; min-width: 0; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.bq-rep-nb { flex: none; font-size: .76rem; font-weight: 700; color: var(--muted); padding: 1px 8px; border-radius: 99px; background: var(--surface-2); }
.bq-rep-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.bq-fil { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.bq-fil a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); text-decoration: none; }
.bq-fil a:hover { color: var(--primary); }
.bq-fil > span { color: var(--faint); }
.bq-fil h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1.25rem; }
.bq-fil h2 .ic { color: #e67700; }
.bq-rep-actions { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.bq-rep-menu > summary { list-style: none; }
.bq-rep-menu > summary::-webkit-details-marker { display: none; }
.bq-rep-menu[open] > summary { display: none; }
.bq-rep-menu > form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bq-rep-menu input[type=text] { width: min(100%, 16rem); }
.qcm-rep { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: .9rem; }
.qcm-rep label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.qcm-rep label .ic { color: #e67700; }
.qcm-rep select { width: auto; min-width: 12rem; padding-block: 5px; }
.bq-creer { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); margin-top: 18px; align-items: start; }
.bq-creer-carte { border: 1px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.bq-creer-carte > summary, .bq-creer-lien { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.bq-creer-carte > summary::-webkit-details-marker { display: none; }
.bq-creer-carte > summary > span:nth-child(2), .bq-creer-lien > span:nth-child(2) { flex: 1; display: grid; }
.bq-creer-carte small { color: var(--muted); font-size: .78rem; }
.bq-creer-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--primary); box-shadow: inset 0 0 0 1px var(--border); flex: none; }
.bq-creer-carte:hover, .bq-creer-carte[open] { border-style: solid; border-color: var(--primary); text-decoration: none; }
.bq-creer-carte[open] { background: var(--surface); }
.bq-creer-carte > form { padding: 0 16px 16px; }
/* Par matière */
.bq-matieres { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); align-items: start; }
.bq-matiere { border-radius: 18px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.bq-mat-tete { display: grid; gap: 2px; padding: 14px 16px; background: linear-gradient(135deg, color-mix(in srgb, #1c7ed6 9%, var(--surface)), var(--surface)); border-bottom: 1px solid var(--border); }
.bq-mat-tete h2 { margin: 0; font-size: 1.05rem; }
.bq-chapitres { list-style: none; margin: 0; padding: 6px; }
.bq-chapitre { border-radius: 12px; }
.bq-chapitre + .bq-chapitre { margin-top: 2px; }
.bq-chap-lien { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--text); text-decoration: none; }
.bq-chap-lien:hover { background: var(--surface-2); text-decoration: none; }
.bq-chap-titre { flex: 1; min-width: 0; font-size: .9rem; font-weight: 600; line-height: 1.35; }
.bq-chap-nb { font-size: .76rem; font-weight: 700; color: var(--muted); white-space: nowrap; padding: 1px 8px; border-radius: 99px; background: var(--neutral-soft); }
.bq-chapitre.is-vide .bq-chap-titre { color: var(--muted); font-weight: 500; }
.bq-chapitre.is-vide .bq-chap-nb { opacity: .6; }
.bq-chap-qcms { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 10px 50px; }
.bq-matieres + .bq-titre-s + .bq-chap-qcms { padding-left: 0; }
.bq-qcm-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 4px 3px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; text-decoration: none;
  color: #087f5b; background: color-mix(in srgb, #0ca678 11%, var(--surface)); border: 1px solid color-mix(in srgb, #0ca678 30%, transparent); }
.bq-qcm-pill:hover { text-decoration: none; background: color-mix(in srgb, #0ca678 20%, var(--surface)); }
.bq-qcm-pill > span { padding: 0 7px; border-radius: 99px; background: var(--surface); font-size: .7rem; }
.bq-mat-bas { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-top: 16px; }
.bq-ajout-chap { min-width: min(100%, 360px); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bq-mode { background: #2b2440; color: #b197fc; } :root:not([data-theme="light"]) .bq-mode.is-chal { background: #3a2a1a; color: #ffa94d; }
  :root:not([data-theme="light"]) .bq-code { background: #13293d; color: #74c0fc; } :root:not([data-theme="light"]) .bq-qcm-pill { color: #63e6be; } }
:root[data-theme="dark"] .bq-mode { background: #2b2440; color: #b197fc; } :root[data-theme="dark"] .bq-mode.is-chal { background: #3a2a1a; color: #ffa94d; }
:root[data-theme="dark"] .bq-code { background: #13293d; color: #74c0fc; } :root[data-theme="dark"] .bq-qcm-pill { color: #63e6be; }
@media (max-width: 759px) { .bq-tuiles { grid-template-columns: 1fr; gap: 8px; } .bq-tuile { padding: 12px 14px; } .bq-nb { font-size: 1.5rem; } .bq-chap-qcms { padding-left: 10px; } }
@media (prefers-reduced-motion: reduce) { .bq-live, .bq-panneau { animation: none; } .bq-tuile, .bq-epreuve, .bq-qcm-carte { transition: none; } }

/* Élèves et comptes : actions d'un élève sur une seule ligne, colonnes resserrées. */
.eleve-actions { flex-wrap: nowrap; }
.eleve-ligne select { min-width: 118px; }
table.eleves-table th, table.eleves-table td { padding-left: 8px; padding-right: 8px; }

/* Tuile Parcoursup : agenda (dates Parcoursup, salons, portes ouvertes), trois colonnes puis une seule sur téléphone. */
.agenda { margin-bottom: 20px; }
.agenda-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.agenda-tete h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.agenda-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.agenda-col h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; }
.agenda-col h3 .chip { margin-left: auto; }
.agenda-note { margin: 0 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: .85rem; }
.agenda-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 560px; overflow-y: auto; }
.agenda-item { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 8px 6px; border-radius: 10px; }
.agenda-item + .agenda-item { border-top: 1px solid var(--border); }
.agenda-item.is-bientot, .agenda-item.is-en-cours { background: var(--primary-soft); border-top-color: transparent; }
.agenda-date { display: grid; place-items: center; align-content: center; height: 46px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); line-height: 1.05; }
.agenda-date .j { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.agenda-date .m { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.agenda-corps p { margin: 0; }
.agenda-titre { font-weight: 700; font-size: .92rem; }
.agenda-quand { font-size: .8rem; color: var(--muted); }
.agenda-detail { font-size: .82rem; margin-top: 2px !important; }
.agenda-lien { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .8rem; font-weight: 600; }
.agenda-parcoursup .agenda-date { background: var(--violet-soft); border-color: transparent; color: var(--violet); }
.agenda-vide { margin: 0; font-size: .9rem; }
@media (max-width: 980px) { .agenda-grille { grid-template-columns: 1fr; } .agenda-liste { max-height: none; } }

/* Tuile « Choix de l'option » : quatre encarts (RHC, SIG, GF, Mercatique), bandeau fléché coloré comme le support du cours. */
.options-tle { margin-bottom: 20px; }
.options-tle > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.options-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.option-carte { --oc: #495057; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-top: 0; border-radius: 0 0 14px 14px; overflow: hidden; }
.option-rhc { --oc: #b4566c; } .option-sig { --oc: #173a5e; } .option-gf { --oc: #5f8f3a; } .option-merca { --oc: #0b8fd0; }
.option-tete { display: grid; place-items: center; align-content: center; gap: 2px; min-height: 76px; margin: 0; padding: 10px 26px 10px 14px;
  background: var(--oc); color: #fff; text-align: center; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  line-height: 1.25; clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); }
.option-sigle { font-size: 1.25rem; font-weight: 800; letter-spacing: .04em; }
.option-corps { flex: 1; padding: 12px 14px 14px; border-top: 3px solid var(--oc); font-size: .9rem; }
.option-intro { margin: 0 0 6px; font-weight: 700; }
.option-intro + ul + .option-intro { margin-top: 12px; }
.option-corps ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.option-corps li { position: relative; padding-left: 18px; }
.option-debouches li::before { content: "•"; position: absolute; left: 4px; color: var(--oc); font-weight: 800; }
.option-qualites li::before { content: "✓"; position: absolute; left: 0; color: var(--oc); font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .option-sig { --oc: #3d6fa3; } }
:root[data-theme="dark"] .option-sig { --oc: #3d6fa3; }
@media (max-width: 1100px) { .options-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .options-grille { grid-template-columns: 1fr; } }

/* Tuile AP : séances du kit (répertoire repliable, couleurs d'axe de la charte graphique du kit). */
.ap-seances { display: grid; gap: 14px; margin-bottom: 20px; }
.ap-rep { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.ap-rep-tete { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; }
.ap-rep-tete::-webkit-details-marker { display: none; }
.ap-rep-ic { color: #e67700; display: inline-flex; }
.ap-rep-nom { font-size: 1.15rem; font-weight: 800; }
.ap-chevron { margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.ap-rep[open] .ap-chevron { transform: rotate(-135deg); }
.ap-rep-corps { display: grid; gap: 12px; padding: 0 16px 16px; }
.ap-rep-sous { margin: 0; }
.ap-annuels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.ap-annuel { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.ap-annuel:hover { text-decoration: none; border-color: var(--primary); }
.ap-annuel-ic, .ap-annuel-dl { display: inline-flex; color: var(--primary); }
.ap-missions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; }
.ap-mission { --axe: #16324f; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; margin: 0; border-left: 4px solid var(--axe); }
.axe-methode { --axe: #2d6a8e; } .axe-analyse { --axe: #17877a; } .axe-oral { --axe: #e4572e; } .axe-projet { --axe: #6a4c93; }
.ap-mission-num { display: grid; place-items: center; align-content: center; height: 64px; border-radius: 12px; background: var(--axe); color: #fff;
  font-size: 1.5rem; font-weight: 800; line-height: 1; }
.ap-mission-num span { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.ap-mission-corps h3 { margin: 2px 0 4px; font-size: 1.02rem; }
.ap-mission-meta { margin: 0; font-size: .78rem; color: var(--muted); }
.ap-axe { color: var(--axe); font-weight: 700; }
.ap-mission-comp { margin: 0 0 10px; font-size: .88rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .axe-methode .ap-axe { color: #74b3d8; } :root:not([data-theme="light"]) .axe-analyse .ap-axe { color: #4fd1bf; } :root:not([data-theme="light"]) .axe-projet .ap-axe { color: #b39ddb; } }
:root[data-theme="dark"] .axe-methode .ap-axe { color: #74b3d8; } :root[data-theme="dark"] .axe-analyse .ap-axe { color: #4fd1bf; } :root[data-theme="dark"] .axe-projet .ap-axe { color: #b39ddb; }
@media (max-width: 640px) { .ap-missions { grid-template-columns: 1fr; } .ap-mission { grid-template-columns: 48px minmax(0, 1fr); } .ap-mission-num { height: 48px; font-size: 1.2rem; } }

/* Tuile « Sujets et annales » : une section par spécialité, sessions repliables, une ligne par centre d'examen. */
.annales { display: grid; gap: 16px; margin-bottom: 20px; }
.annales-msgn { --sp: #2748c9; } .annales-droit_eco { --sp: #17877a; }
.annales-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.annales-onglet { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: .9rem; }
.annales-onglet::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--sp); }
.annales-onglet:hover { text-decoration: none; border-color: var(--sp); }
.annales-onglet .num { font-weight: 500; color: var(--muted); font-size: .8rem; }
.annales-spe { display: grid; gap: 8px; scroll-margin-top: 90px; }
.annales-spe > h2 { display: flex; align-items: center; gap: 8px; margin: 0; padding-left: 10px; border-left: 4px solid var(--sp); }
.annales-session { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.annales-session > summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; }
.annales-session > summary::-webkit-details-marker { display: none; }
.annales-session[open] .ap-chevron { transform: rotate(-135deg); }
.annales-annee { font-weight: 800; color: var(--sp); }
.annales-liste { list-style: none; margin: 0; padding: 0 14px 10px; display: grid; }
.annales-liste li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.annales-centre { font-weight: 600; color: var(--text); }
.annales-liens { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.annales-sans { display: inline-block; min-width: 92px; text-align: center; }
.annales-autres { --sp: #e8590c; } .annales-lycee { --sp: #6a45cf; }
.annales-lycee-liste { padding: 0 14px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.annales-lycee-liste li:first-child { border-top: 0; }
.annales-prof-note { margin: 0; }
.annales-lieu { color: var(--muted); font-weight: 500; }
/* Annales : pastilles de chapitres (couleur par matière) et tableau des questions repliable. */
.annales-outils { margin: 0; }
.annales-outils select { width: auto; min-height: 32px; font-size: .8125rem; }
.annales-sujet { flex-wrap: wrap; }
.annales-intitule { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-width: 0; flex: 1 1 320px; }
.annales-pastilles { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.annales-pastille { --pc: #495057; display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap;
  color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, transparent); }
.mat-msgn { --pc: #6a45cf; } .mat-gf { --pc: #2f9e44; } .mat-merca { --pc: #d6336c; } .mat-rhc { --pc: #e8590c; } .mat-sig { --pc: #1971c2; }
.mat-sdgn { --pc: #c2410c; } .mat-management { --pc: #0c8599; } .mat-droit { --pc: #364fc7; } .mat-eco { --pc: #a16207; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .annales-pastille { color: color-mix(in srgb, var(--pc) 55%, white); } }
:root[data-theme="dark"] .annales-pastille { color: color-mix(in srgb, var(--pc) 55%, white); }
.annales-q { flex-basis: 100%; margin-top: 2px; }
.annales-q > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .8rem; font-weight: 600; list-style: none;
  padding: 3px 12px 3px 10px; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); }
.annales-q > summary::-webkit-details-marker { display: none; }
.annales-q > summary:hover { border-color: var(--primary); }
.annales-q[open] > summary { background: var(--primary); color: #fff; border-color: var(--primary); }
.annales-q-table { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: .84rem; }
.annales-q-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 6px; }
.annales-q-table td { padding: 5px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.annales-q-table td.num { width: 40px; font-variant-numeric: tabular-nums; color: var(--muted); }
.annales-q-table td:last-child { width: 1%; white-space: nowrap; }
.annales-q-ligne.is-trouve td { background: var(--primary-soft); }
.annales-doute { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font-size: .7rem; font-weight: 800; }
@media (max-width: 640px) { .annales-q-table thead { display: none; } .annales-q-table td { display: block; border-top: 0; padding: 2px 6px; }
  .annales-q-table tr { display: block; border-top: 1px solid var(--border); padding: 4px 0; } .annales-q-table td:last-child { width: auto; } }
