@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC,
    U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2");
  unicode-range:
    U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Valeurs de la passation du 12/09/2026 (design/mvp-2026-09-12/PASSATION.md). */
:root {
  --bg: #f5f2ec;
  --bg-office: #f4f4f3;
  --surface: #fdfcfa;
  --surface-tinted: #efebe4;
  --ink: #1c1815;
  --ink-hover: #2a2520;
  --ink-muted: #6b6460;
  --line: #c9c2b8;
  --yellow: #f0c835;
  --yellow-surface: #faf0c0;
  --rose: #b8455e;
  --rose-surface: #f9e8ec;
  --pending: #985015;
  --certified: #2d7a4a;
  --danger: #c13030;
  --radius: 4px;
  --measure: 65ch;
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --gouttiere: 1rem;
  --feuille: 65dvh;
  color-scheme: light;
}
@media (min-width: 900px) {
  :root {
    --gouttiere: 2rem;
  }
}

@view-transition {
  navigation: auto;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
/* Un élément atteint au clavier ne passe pas sous la feuille basse. */
html:has(.feuille-ouverte) {
  scroll-padding-bottom: var(--feuille);
}
main:focus {
  outline: none;
}
/* Un bouton ou une rangée en flex reste caché quand le script le cache. */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    1rem/1.5 "Atkinson Hyperlegible",
    system-ui,
    sans-serif;
}
body.prof {
  background: var(--bg-office);
}
::selection {
  background: var(--yellow-surface);
  color: var(--ink);
}
:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
h1,
h2,
h3 {
  font-weight: 700;
  margin: 0 0 var(--s3);
  text-wrap: balance;
}
h1 {
  font-size: 1.75rem;
  line-height: 1.15;
}
h2 {
  font-size: 1.375rem;
  line-height: 1.25;
}
h3 {
  font-size: 1.125rem;
  line-height: 1.3;
}
@media (min-width: 900px) {
  h1 {
    font-size: 2rem;
  }
}
p {
  margin: 0 0 var(--s3);
  text-wrap: pretty;
}
small,
.discret {
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.sous-titre {
  color: var(--ink-muted);
  margin: calc(-1 * var(--s2)) 0 var(--s5);
}
.icone {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.evitement {
  position: absolute;
  left: var(--s2);
  top: -4rem;
  z-index: 50;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
}
.evitement:focus {
  top: var(--s2);
}

/* ------------------------------------------------------------ en-tête élève */

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
  min-height: 4rem;
  padding: var(--s2) var(--gouttiere);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.marque {
  overflow-wrap: anywhere;
  margin-right: auto;
  font-size: 1.375rem;
  font-weight: 700;
  text-decoration: none;
}
header.site nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}
header.site nav > a {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: 0 var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}
header.site nav > a:hover {
  border-color: var(--ink);
}
header.site nav > a[aria-current="page"] {
  background: var(--yellow);
  border-color: var(--yellow);
}
.recherche-entete {
  display: flex;
  flex: 0 1 22rem;
}
.recherche-entete input {
  min-width: 0;
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}
.recherche-entete button {
  flex: none;
  width: 44px;
  padding: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.libelle-court {
  display: none;
}
@media (max-width: 640px) {
  .recherche-entete {
    order: 3;
    flex-basis: 100%;
    margin-bottom: var(--s1);
  }
  header.site {
    gap: 0 var(--s2);
    min-height: 3.5rem;
    padding-block: var(--s1);
  }
  header.site .marque {
    font-size: 1.125rem;
  }
  header.site nav {
    gap: var(--s1);
  }
  header.site nav > a {
    padding: 0 var(--s2);
    border-color: transparent;
    background: none;
  }
  header.site nav > a .icone,
  .libelle-long {
    display: none;
  }
  .libelle-court {
    display: inline;
  }
}

.compte {
  position: relative;
}
.compte summary {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  max-width: 10rem;
  padding: 0 var(--s2);
  color: var(--ink-muted);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compte summary::-webkit-details-marker {
  display: none;
}
.compte summary::after {
  content: "";
  flex: none;
  width: 0.4em;
  height: 0.4em;
  margin-top: -0.2em;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg);
}
.compte[open] summary {
  color: var(--ink);
}
.compte form {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
  margin: 0;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 2px 8px rgb(28 24 21 / 0.08);
  white-space: nowrap;
}
.compte form button {
  min-height: 44px;
}
@media (max-width: 640px) {
  .compte summary {
    max-width: 5.5rem;
  }
}

/* ------------------------------------------------------------ rail enseignant */

body.prof {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100dvh;
}
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s5) var(--s4);
  border-right: 1px solid var(--line);
}
.rail .marque {
  margin: 0;
}
.rail-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}
button.rail-bascule {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-color: transparent;
  background: none;
  color: var(--ink-muted);
}
button.rail-bascule:hover {
  border-color: transparent;
  background: var(--surface);
  color: var(--ink);
}

/* Rail replié: des icônes seules, le libellé apparaît en bulle au survol et reste lu par les lecteurs d'écran. */
@media (min-width: 901px) {
  body.prof.rail-replie {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }
  .rail-replie .rail {
    align-items: center;
    padding-inline: var(--s2);
  }
  .rail-replie .rail-tete {
    flex-direction: column;
    width: 100%;
  }
  .rail-replie .rail .marque {
    font-size: 1.125rem;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .rail-replie .rail > .discret,
  .rail-replie .rail-pied strong {
    display: none;
  }
  .rail-replie .rail nav a,
  .rail-replie .rail-pied > a,
  .rail-replie .rail-pied button {
    position: relative;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    text-decoration: none;
  }
  .rail-replie .rail nav a > span,
  .rail-replie .rail-pied > a > span,
  .rail-replie .rail-pied button > span {
    position: absolute;
    top: 50%;
    left: calc(100% + var(--s2));
    z-index: 20;
    translate: 0 -50%;
    padding: var(--s1) var(--s2);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--surface);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
  }
  .rail-replie .rail :is(a, button):is(:hover, :focus-visible) > span {
    opacity: 1;
  }
  .rail-replie .rail-pied {
    align-items: center;
  }
}
.rail > .discret {
  margin: 0 0 var(--s4);
}
.rail nav {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}
.rail nav a,
.rail-pied > a {
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 44px;
  padding: 0 var(--s3);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
}
.rail nav a:hover,
.rail-pied > a:hover {
  background: var(--surface);
}
.rail nav a[aria-current="page"] {
  background: var(--yellow);
}
.rail-pied {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  margin-top: auto;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.rail-pied form {
  margin: 0;
}
body.prof main {
  max-width: 90rem;
  margin: 0;
  padding: var(--s5) var(--s6) var(--s7);
}
@media (max-width: 900px) {
  body.prof {
    display: block;
  }
  /* Marque, vue élève et déconnexion sur une ligne, les cinq liens en deux rangées. */
  .rail {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--gouttiere) var(--s3);
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .rail > .discret,
  .rail-pied strong,
  .rail-bascule {
    display: none;
  }
  .rail nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .rail nav a {
    gap: var(--s2);
    padding: 0 var(--s2);
  }
  .rail-pied {
    flex-direction: row;
    align-items: center;
    margin: 0;
    padding: 0;
    border: 0;
  }
  body.prof main {
    padding: var(--s4) var(--gouttiere) var(--s7);
  }
}

@media (max-width: 640px) {
  .rail nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ------------------------------------------------------------ page */

main {
  max-width: 76rem;
  margin: 0 auto;
  padding: var(--s5) var(--gouttiere) var(--s7);
}
.document {
  max-width: 52rem;
}
.document-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3) var(--s5);
  margin-bottom: var(--s5);
}
.document-tete form {
  margin: 0;
}

button,
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 44px;
  padding: var(--s2) var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
button:hover,
.bouton:hover {
  border-color: var(--ink);
}
button:active,
.bouton:active {
  background: var(--surface-tinted);
}
button.principal,
.bouton.principal {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}
button.principal:hover,
.bouton.principal:hover {
  background: var(--ink-hover);
}
button.lien {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
/* Une action qui efface pour de bon. */
button.danger,
button.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}
button.danger:hover {
  background: var(--rose-surface);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.htmx-request button,
button.htmx-request {
  opacity: 0.6;
  cursor: progress;
}
.retour {
  margin-bottom: var(--s4);
}

label {
  display: block;
  margin-bottom: var(--s1);
  font-weight: 700;
}
.champ {
  margin-bottom: var(--s4);
}
.champ .aide,
.reglages .aide {
  margin: 0.15rem 0 0.35rem;
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 400;
}
.champ .erreur {
  margin: var(--s1) 0 0;
  color: var(--danger);
  font-size: 0.9375rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
}
input::placeholder,
textarea::placeholder {
  color: var(--ink-muted);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--ink);
}
textarea {
  min-height: 6rem;
  resize: vertical;
}
fieldset {
  margin: 0 0 var(--s4);
  padding: 0;
  border: 0;
}
fieldset label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: 36px;
  font-weight: 400;
}
.deux {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0 var(--s5);
}
form.etroit {
  max-width: 44rem;
}
/* Le corrigé d'un exercice : les deux colonnes s'empilent sur mobile. */
#corrige .deux {
  row-gap: var(--s4);
}
#corrige > form {
  margin-block-end: var(--s5);
}
/* Réglages : un groupe titré par fieldset, chaque libellé au-dessus de son champ. */
.reglages legend {
  margin-bottom: var(--s2);
  padding: 0;
  font-weight: 700;
}
.reglages > fieldset > legend {
  font-size: 1.125rem;
}
.reglages .champ > label {
  display: block;
  min-height: 0;
  font-weight: 700;
}
.saisie {
  display: flex;
  align-items: stretch;
  gap: var(--s2);
}
.saisie > input,
.saisie > textarea {
  flex: 1;
  min-width: 0;
}
.saisie > button {
  flex: none;
}

[role="alert"],
.alerte {
  margin: 0 0 var(--s4);
  padding: 0.6rem 0.9rem;
  border-left: 1px solid var(--danger);
  background: var(--rose-surface);
}
[role="status"],
.note {
  margin: 0 0 var(--s4);
  padding: 0.6rem 0.9rem;
  border-left: 1px solid var(--certified);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
th,
td {
  padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--ink-muted);
  font-size: 0.875rem;
  font-weight: 700;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}

.statut {
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
}
.statut.a_relire,
.statut.unreviewed,
.statut.en-cours {
  color: var(--pending);
}
.statut.certifiee,
.statut.certified {
  color: var(--certified);
}
.statut.rejetee,
.statut.rejected,
.statut.failed {
  color: var(--danger);
}
.statut.nouvelle {
  color: var(--ink);
}

/* Liste des fichiers d'un lot : le titre prend la place, le statut passe à la ligne. */
table.lot {
  margin-bottom: var(--s2);
}
table.lot td:nth-child(2) {
  width: 40%;
}
table.lot input[type="text"] {
  min-width: 10rem;
}
table.lot .statut {
  white-space: normal;
}
.resultats {
  padding-left: 0;
  list-style: none;
}
.resultats li {
  margin-bottom: var(--s1);
}
@media (max-width: 640px) {
  table.lot thead {
    display: none;
  }
  table.lot tr,
  table.lot td {
    display: block;
  }
  table.lot td {
    padding: var(--s1) var(--s3);
    border: 0;
  }
  table.lot td:nth-child(2) {
    width: auto;
  }
  table.lot input[type="text"] {
    width: 100%;
  }
  table.lot tr {
    padding: var(--s2) 0;
    border-bottom: 1px solid var(--line);
  }
}

.barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin: 0 0 var(--s4);
}
.barre .espace {
  margin-left: auto;
}
.barre input[type="text"],
.barre > select {
  flex: 1 1 18rem;
  width: auto;
  max-width: 24rem;
}

kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 0.3em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  text-align: center;
}

/* ------------------------------------------------------------ documents */

.document {
  counter-reset: figure;
}
.document p {
  max-width: var(--measure);
  font-size: 1.125rem;
  line-height: 1.65;
}
/* Une liste extraite garde une entrée par ligne. */
.document p.lignes {
  white-space: pre-line;
}
.document pre {
  margin: var(--s4) 0;
  padding: var(--s4) var(--s5);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font:
    0.875rem/1.6 ui-monospace,
    "SF Mono",
    Menlo,
    Consolas,
    monospace;
  tab-size: 2;
}
.document pre code {
  font: inherit;
}
/* Le bouton « Copier » reste en haut à droite pendant que le code défile en largeur. */
.bloc-code {
  position: relative;
  margin: var(--s4) 0;
}
.bloc-code pre {
  margin: 0;
}
.bloc-code .copier {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  min-height: 28px;
  padding: 0 var(--s2);
  font-size: 0.8125rem;
  font-weight: 400;
}
.document h3 {
  margin-top: var(--s5);
  font-size: 1.125rem;
}
.document .intertitre {
  margin-top: var(--s6);
  scroll-margin-top: var(--s5);
}
.document .cadre-tableau {
  margin: var(--s4) 0 var(--s5);
}
.document table {
  background: none;
  font-size: 1rem;
  line-height: 1.5;
}
/* La première colonne s'aligne sur le texte. */
.document :is(th, td) {
  padding: var(--s2) var(--s4) var(--s2) 0;
}
/* Un schéma Mermaid en figure : le dessin, sa légende numérotée, puis son code replié. */
.figure-schema {
  margin: var(--s5) 0;
  padding: var(--s4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.figure-schema > pre {
  margin-top: 0;
}
.figure-schema .schema {
  margin: 0;
}
.figure-schema .schema svg {
  margin-inline: auto;
}
.figure-schema figcaption {
  max-width: none;
  margin-top: var(--s3);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  counter-increment: figure;
}
.figure-schema figcaption::before {
  content: "Fig. " counter(figure);
  margin-right: var(--s2);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
}
.figure-schema figcaption strong {
  color: var(--ink);
}
.code-schema {
  margin-top: var(--s3);
}
.code-schema summary {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  cursor: pointer;
}
.code-schema pre {
  margin-bottom: 0;
}
/* Le sommaire suit la lecture à droite du texte, sur un écran assez large pour deux colonnes. */
/* `minmax(0, …)` : un tableau ou un bloc de code défile dans son cadre sans élargir la page. */
.lecture-colonnes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.sommaire {
  display: none;
}
@media (min-width: 75rem) {
  .lecture-colonnes {
    grid-template-columns: minmax(0, 52rem) minmax(12rem, 16rem);
    gap: var(--s7);
  }
  .sommaire {
    display: block;
    position: sticky;
    top: var(--s5);
    align-self: start;
    max-height: calc(100dvh - 2 * var(--s5));
    overflow-y: auto;
  }
}
.sommaire h2 {
  margin-bottom: var(--s2);
  font-size: 1rem;
}
.sommaire ol {
  margin: 0;
  padding: 0 0 0 var(--s3);
  border-left: 1px solid var(--line);
  list-style: none;
}
.sommaire a {
  display: block;
  padding: var(--s1) 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}
.sommaire a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.fichier {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
}
.fichier label {
  margin: 0;
}
.fichier input:focus-visible + label {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .question-rapide .saisie {
    flex-wrap: wrap;
  }
  .question-rapide .saisie > input {
    flex-basis: 100%;
  }
}
.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
mark {
  background: var(--yellow-surface);
  box-shadow: inset 0 -2px 0 var(--yellow);
  color: inherit;
}
figure {
  margin: 0 0 var(--s5);
}
figure img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  border: 1px solid var(--line);
}
figcaption {
  max-width: var(--measure);
  margin-top: var(--s2);
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
figcaption .credit {
  display: block;
}

/* Une œuvre se montre entière sur un passe-partout, jamais recadrée. */
.passe-partout {
  display: block;
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  padding: var(--s2);
  background: var(--surface-tinted);
}
.passe-partout img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sans-image {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--ink-muted);
}
.sans-image .icone {
  width: 2.5rem;
  height: 2.5rem;
}

/* ------------------------------------------------------------ accueil élève */

.question-rapide {
  max-width: 44rem;
  margin-bottom: var(--s6);
}
.accueil-grille {
  display: grid;
  gap: var(--s6);
}
@media (min-width: 900px) {
  .accueil-grille {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    align-items: start;
  }
}
.chapitres {
  margin: 0;
  padding: 0;
  list-style: none;
}
.chapitre {
  display: grid;
  gap: var(--s3);
  padding: var(--s5) 0;
  border-top: 1px solid var(--line);
}
.chapitre:last-child {
  border-bottom: 1px solid var(--line);
}
.chapitre-tete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s1) var(--s3);
}
.chapitre-tete h3 {
  margin: 0;
  font-size: 1.25rem;
}
.chapitre-tete a {
  text-decoration: none;
}
.chapitre-tete a:hover {
  text-decoration: underline;
}
.chapitre .idees {
  margin: 0;
}
.chapitre > .bouton {
  justify-self: start;
}
.apercu-oeuvres {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s2);
  max-width: 32rem;
}
.saviez-vous {
  padding: var(--s4);
  border: 1px solid var(--line);
  background: var(--surface);
}
.saviez-vous h2 {
  font-size: 1.125rem;
}
.saviez-vous .passe-partout {
  margin-bottom: var(--s3);
}
.saviez-vous blockquote {
  margin: 0 0 var(--s2);
  padding: var(--s3);
  background: var(--yellow-surface);
  font-size: 1.125rem;
}

.idees {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
  margin: 0 0 var(--s4);
}
.idee-form {
  margin: 0;
}
button.idee {
  font-size: 0.9375rem;
  font-weight: 400;
}
button.idee .icone {
  color: var(--ink-muted);
}

/* ------------------------------------------------------------ chapitre: mur et lecteur */

.mur-lecteur {
  display: grid;
  gap: var(--s6);
}
/* La colonne du lecteur s'étire sur toute la hauteur du mur pour que le lecteur y reste collé. */
@media (min-width: 1180px) {
  .mur-lecteur {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }
}
.seance {
  margin-bottom: var(--s6);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.seance h2 {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  font-size: 1.125rem;
}
.seance h2 .discret {
  font-weight: 400;
}
.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: var(--s4) var(--s3);
}
.tuile {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  font-size: 0.9375rem;
  line-height: 1.3;
  text-decoration: none;
}
.tuile:hover .passe-partout {
  background: var(--line);
}
.tuile:hover .tuile-titre {
  text-decoration: underline;
}
.tuile[aria-current="true"] .passe-partout {
  background: var(--yellow-surface);
  box-shadow: inset 0 0 0 3px var(--yellow);
}
.tuile[aria-current="true"] .tuile-titre {
  font-weight: 700;
}
.resultats {
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 40vw), 1fr));
}
.tuile-extrait {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.tuile-titre {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.quiz {
  max-width: 32rem;
  margin: var(--s7) 0 0;
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}
#quiz-resultat:empty {
  display: none;
}
.quiz img {
  display: block;
  max-width: 100%;
  max-height: 18rem;
  margin-bottom: var(--s3);
  object-fit: contain;
}

/* ------------------------------------------------------------ feuilles: source et lecteur */

.feuille {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.feuille-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}
.feuille h2 {
  margin: 0;
  font-size: 1.25rem;
}
#source > .feuille-tete h2,
#source > h2 {
  font-size: 1.5rem;
}
.feuille h3 {
  margin: 0 0 var(--s1);
}
.feuille [tabindex="-1"]:focus {
  outline: none;
}
.feuille-pied {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
.feuille-pied form {
  margin: 0;
}
.source-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}
.passage {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.0625rem;
  line-height: 1.55;
}
.oeuvre-grande {
  margin: 0 0 var(--s4);
  padding: var(--s3);
  background: var(--surface-tinted);
}
.oeuvre-grande img {
  display: block;
  max-width: 100%;
  max-height: 50dvh;
  margin: 0 auto;
  border: 0;
  object-fit: contain;
}
.cartel {
  display: grid;
  align-content: start;
  grid-template-columns: auto 1fr;
  gap: var(--s1) var(--s4);
  margin: 0 0 var(--s4);
  font-size: 0.9375rem;
}
.cartel dt {
  color: var(--ink-muted);
}
.cartel dd {
  margin: 0;
}
.extrait {
  margin: 0;
}

@media (min-width: 1180px) {
  .fermer-feuille {
    display: none;
  }
  .defile {
    overflow-y: auto;
    min-height: 0;
  }
  /* Tient dans le premier écran avant défilement: l'œuvre, son cartel et « Lire le document ». */
  #lecteur {
    position: sticky;
    top: var(--s4);
    max-height: calc(100dvh - 6rem);
    padding: var(--s5);
    border: 1px solid var(--line);
    background: var(--surface);
  }
  #lecteur .oeuvre-grande img {
    max-height: min(22rem, 38dvh);
  }
  .colonne-source {
    border-left: 1px solid var(--line);
    background: var(--surface);
  }
  #source {
    position: sticky;
    top: 0;
    max-height: 100dvh;
    padding: var(--s5);
  }
}

/* Sous 1180 px, la feuille s'ouvre au toucher et laisse visible ce qui l'a ouverte. */
@media (max-width: 1179.98px) {
  .feuille {
    display: none;
  }
  .feuille-ouverte {
    padding-bottom: var(--feuille);
  }
  .feuille-ouverte .feuille {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    display: flex;
    max-height: var(--feuille);
    overflow: hidden;
    padding: var(--s4) var(--gouttiere) calc(var(--s4) + env(safe-area-inset-bottom));
    border-top: 4px solid var(--yellow);
    background: var(--surface);
    box-shadow: 0 -2px 8px rgb(28 24 21 / 0.08);
  }
  /* Dans la feuille, le passage ou l'œuvre reste l'élément le plus grand. */
  .feuille-ouverte .feuille h2,
  .feuille-ouverte #source > .feuille-tete h2 {
    font-size: 1.125rem;
  }
  .feuille-ouverte .feuille h3 {
    font-size: 1rem;
  }
  /* Le passage suit directement le titre: la navigation entre sources passe dessous. */
  .feuille-ouverte #source .source-nav {
    order: 1;
  }
  .feuille-ouverte #source .feuille-pied {
    order: 2;
  }
  .feuille-ouverte .defile {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .oeuvre-grande img {
    max-height: 28dvh;
  }
}

/* ------------------------------------------------------------ chat */

main.page-chat {
  max-width: none;
  padding: 0;
}
/* Un refus d'envoi reste visible au bas d'une longue conversation. */
main.page-chat #erreur-reseau {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
}
/* Une colonne qui ne s'élargit pas : un tableau de réponse défile dans son cadre. */
.chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1180px) {
  .chat {
    grid-template-columns: minmax(0, 1fr) minmax(26rem, 40%);
  }
}
.chat-principal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 48rem;
  min-height: calc(100dvh - 4rem);
  margin: 0 auto;
  padding: var(--s5) var(--gouttiere) 0;
}
#conversation {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--s5);
}
.question {
  margin: 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--radius);
  background: var(--surface-tinted);
  font-weight: 700;
}
.reponse {
  max-width: var(--measure);
}
.reponse-note {
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.texte-reponse {
  margin: 0 0 var(--s3);
  font-size: 1.125rem;
  line-height: 1.75;
}
.texte-reponse h2 {
  margin: var(--s4) 0 var(--s1);
  font-size: 1.125rem;
}
.texte-reponse :is(ul, ol) {
  margin: 0 0 var(--s3);
  padding-left: 1.5em;
}
/* Un tableau ou un schéma défile dans son cadre plutôt que d'écraser son contenu sur un
   téléphone. La liste d'un schéma le suit. */
:is(.tableau-reponse, .schema-reponse) {
  margin: 0 0 var(--s3);
}
.cadre-tableau,
.schema {
  overflow-x: auto;
}
.tableau-reponse table {
  font-size: 1rem;
  line-height: 1.5;
}
:is(.tableau-reponse, .schema-reponse) figcaption {
  max-width: none;
  margin: 0 0 var(--s2);
  color: inherit;
  font-size: 1rem;
  font-weight: 700;
}
.tableau-reponse tbody td {
  min-width: 14rem;
}
.schema {
  margin: var(--s4) 0 var(--s2);
}
.schema svg {
  display: block;
}
/* Une longue formule défile dans sa ligne au lieu d'élargir la réponse. */
.formule-bloc {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
}
/* L'espace et la marque ne se séparent pas : le dernier mot de la phrase les suit à la ligne. */
.marque {
  white-space: nowrap;
}
/* Marque de citation dans la phrase: petite à l'œil, 44 px au toucher. */
.citation {
  position: relative;
  gap: 0.2em;
  min-height: 0;
  padding: 0.05em 0.4em;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  vertical-align: 0.1em;
}
.citation .icone {
  width: 1em;
  height: 1em;
}
.citation::after {
  content: "";
  position: absolute;
  inset: -11px -4px;
}
.citation[aria-pressed="true"] {
  border-color: var(--yellow);
  background: var(--yellow-surface);
}
.image-reponse {
  display: block;
  max-width: min(100%, 18rem);
  max-height: 13rem;
  margin: var(--s2) 0;
  object-fit: contain;
}
.provenance {
  margin: var(--s3) 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.avis {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}
.avis button {
  font-size: 0.875rem;
  font-weight: 400;
}
.avis button[aria-pressed="true"] {
  border-color: var(--yellow);
  background: var(--yellow-surface);
  font-weight: 700;
}
.idees-reponse {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s2);
  margin-top: var(--s4);
}
/* Hors cours et panne restent calmes: pas de couleur de statut côté élève. */
.reponse.hors-corpus,
.reponse.panne {
  padding: var(--s4);
  border: 1px solid var(--line);
  background: var(--surface);
}
/* « Arrêter » prend la ligne de l'étape quand elle tient. */
.reponse[sse-connect] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--s4);
}
.reponse[sse-connect] .lien {
  min-height: 44px;
}
.reponse .etape {
  margin: 0;
  color: var(--ink-muted);
}
.reponse .etape[role="status"] {
  padding: 0;
  border: 0;
  background: none;
}
.reponse .etape::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: var(--s2);
  background: var(--yellow);
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reponse .etape::before {
    animation: none;
  }
}
/* Un champ qui prend le focus ne se cache pas sous le composeur collé. */
:root:has(.page-chat) {
  scroll-padding-bottom: 7rem;
}
/* Seul le composeur reste collé en bas : le périmètre et la mention défilent avec la conversation. */
.pied-chat {
  display: contents;
}
.pied-chat > :first-child {
  margin: var(--s5) 0 var(--s2);
}
.composeur:has(*:not([hidden])) {
  position: sticky;
  bottom: 0;
  padding: var(--s2) 0;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.composeur > [data-aller-reponse] {
  margin-bottom: var(--s2);
}
.pied-chat > :is(small, p) {
  margin: var(--s2) 0 var(--s4);
}
.pied-chat .idees {
  margin: var(--s4) 0 var(--s4);
}
form.question-form label {
  margin-bottom: 0;
}
form.question-form textarea {
  max-height: 8rem;
  min-height: 3rem;
  field-sizing: content;
}
.question-rapide small {
  display: block;
  margin-top: var(--s2);
}

/* ------------------------------------------------------------ conversations */

/* La liste vit dans sa colonne à partir de 1400 px, sur sa propre page en dessous. */
.liste-conversations {
  display: none;
}
.liens-conversations {
  display: flex;
  gap: var(--s4);
}
@media (min-width: 1400px) {
  .chat {
    grid-template-columns: 16rem minmax(0, 1fr) minmax(24rem, 34%);
  }
  .liste-conversations {
    display: block;
    border-right: 1px solid var(--line);
    background: var(--surface);
  }
  .liste-conversations > div {
    position: sticky;
    top: 0;
    max-height: 100dvh;
    overflow-y: auto;
    padding: var(--s5) var(--s3);
  }
  .liens-conversations {
    display: none;
  }
}
.recherche-conversations {
  margin-top: var(--s4);
}
.conversations {
  margin: var(--s4) 0;
  padding: 0;
  list-style: none;
}
/* Le repère jaune se pose dans la gouttière : le texte reste aligné sur le titre. */
.conversations a {
  display: flex;
  flex-direction: column;
  margin-left: calc(-1 * (var(--s2) + 4px));
  padding: var(--s2);
  border-left: 4px solid transparent;
  text-decoration: none;
}
.conversations a:hover {
  background: var(--surface-tinted);
}
.conversations a[aria-current="page"] {
  border-left-color: var(--yellow);
}
.conversation-titre {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.conversations .discret {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-conversations {
  max-width: 44rem;
}
.tete-conversation {
  margin-bottom: var(--s5);
}
#titre-chat {
  overflow-wrap: anywhere;
}
#titre-chat:focus {
  outline: none;
}
.actions-conversation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
}
.actions-conversation form,
.renommer {
  margin: 0;
}
.changement-perimetre {
  margin: 0;
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.perimetre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s3);
  margin-bottom: var(--s2);
  font-size: 0.875rem;
}
#perimetre {
  margin: 0;
  overflow-wrap: anywhere;
}
.perimetre summary {
  min-height: 32px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.perimetre details[open] {
  flex-basis: 100%;
}
.perimetre form {
  display: grid;
  gap: var(--s2) var(--s3);
  padding-bottom: var(--s3);
}
.perimetre form button {
  justify-self: start;
}
/* Comparer : une case par matière, à la suite, sous les trois listes. */
.perimetre fieldset {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 0 var(--s4);
  margin: 0;
}
.perimetre legend {
  margin-bottom: var(--s1);
  padding: 0;
  font-weight: 700;
}
@media (min-width: 900px) {
  .perimetre form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .perimetre form button {
    grid-column: 1 / -1;
  }
}

/* ------------------------------------------------------------ enseignant */

/* File des légendes en bande de vignettes, puis l'image et sa proposition côte à côte. */
.relecture {
  display: grid;
  gap: var(--s4);
}
.file {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-width: 0;
}
.file p {
  flex: none;
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.file p strong {
  color: var(--ink);
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}
.file ol {
  display: flex;
  gap: var(--s2);
  min-width: 0;
  margin: 0;
  padding: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.file a {
  display: block;
  width: 3.5rem;
  aspect-ratio: 1;
  padding: 2px;
  background: var(--surface-tinted);
}
.file img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.7;
}
.file a:hover img {
  opacity: 1;
}
.file a[aria-current="true"] {
  box-shadow: 0 0 0 2px var(--ink);
}
.file a[aria-current="true"] img {
  opacity: 1;
}

.relecture-plan {
  display: grid;
  gap: var(--s5);
  align-items: start;
}
@media (min-width: 1000px) {
  .relecture-plan {
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
    gap: var(--s6);
  }
  .relecture-proposition {
    position: sticky;
    top: var(--s5);
  }
}
.relecture-image {
  height: max(24rem, calc(100dvh - 14rem));
  margin: 0;
  padding: var(--s5);
  background: var(--surface-tinted);
}
.relecture-image img {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}
@media (max-width: 999px) {
  .relecture-image {
    height: 60dvh;
    padding: var(--s3);
  }
}
.relecture-proposition > .discret {
  margin: 0;
}
.relecture-proposition h2 {
  margin-bottom: var(--s5);
  font-size: 1.125rem;
}
.relecture-proposition .aide {
  margin: 0 0 var(--s2);
  color: var(--ink-muted);
  font-size: 0.875rem;
}
.relecture-proposition textarea {
  min-height: 10rem;
  field-sizing: content;
}
.relecture-proposition .barre {
  margin: var(--s3) 0 var(--s4);
}
.relecture-proposition button kbd {
  min-width: 1.4em;
  border-color: currentColor;
  background: none;
  color: inherit;
  font-size: 0.8125rem;
  opacity: 0.7;
}
.raccourcis {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s4);
}
.raccourcis kbd {
  font-size: 0.8125rem;
}
.edition-source {
  margin: var(--s5) 0;
  padding: var(--s3) 0;
  border-block: 1px solid var(--line);
}
.suppression-source {
  margin-top: var(--s6);
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}
.questions-prof {
  margin: var(--s6) 0;
  overflow-x: auto;
}
/* Sur téléphone, le tableau défile dans sa section plutôt que d'écraser la question. */
.questions-prof table {
  min-width: 36rem;
}
.questions-prof td:last-child {
  white-space: nowrap;
}
/* Mêmes colonnes d'un chapitre à l'autre, là où la largeur le permet. */
@media (min-width: 900px) {
  .questions-prof table {
    table-layout: fixed;
  }
  .questions-prof th:not(:first-child) {
    width: 9rem;
  }
  .questions-prof th:last-child {
    width: 11rem;
  }
}
.feuilles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: var(--s4);
}
.identifiants {
  padding: var(--s4);
  border: 1px solid var(--line);
  background: var(--surface);
  break-inside: avoid;
}
.identifiants p {
  margin: 0.4rem 0;
}

details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-muted);
  cursor: pointer;
}
/* Les membres d'un cours se lisent sous sa ligne, pas avant le cours suivant. */
.barre + details {
  margin: calc(-1 * var(--s3)) 0 var(--s5);
}
details:not(.compte) > summary {
  gap: var(--s2);
}
details:not(.compte) > summary::after {
  content: "";
  width: 0.4em;
  height: 0.4em;
  margin-top: -0.2em;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg);
}
details:not(.compte)[open] > summary::after {
  margin-top: 0.2em;
  transform: rotate(-135deg);
}
details table,
table.eleves {
  margin-bottom: var(--s3);
}
details td,
table.eleves td {
  vertical-align: middle;
}
details td:last-child,
table.eleves td:last-child {
  width: 1%;
}
table.eleves .barre {
  flex-wrap: nowrap;
  margin: 0;
}
table.eleves button {
  white-space: nowrap;
}
/* Sur téléphone, les boutons passent à la ligne plutôt que de sortir de l'écran. */
@media (max-width: 640px) {
  table.eleves .barre {
    flex-wrap: wrap;
  }
  table.eleves button {
    white-space: normal;
  }
}

@media print {
  header.site,
  .rail,
  .evitement,
  .sans-impression {
    display: none !important;
  }
  body,
  body.prof {
    display: block;
    background: white;
  }
  main,
  body.prof main {
    max-width: none;
    padding: 0;
  }
  .feuilles {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ------------------------------------------------------------ bibliothèque */

/* La séquence choisit le corpus, le statut et l'affichage le filtrent: deux niveaux, deux formes. */
.onglets {
  display: flex;
  gap: var(--s5);
  margin: 0 0 var(--s4);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.onglets a {
  display: inline-flex;
  align-items: baseline;
  gap: var(--s2);
  flex: none;
  padding: var(--s2) 0 var(--s3);
  color: var(--ink-muted);
  font-weight: 700;
  text-decoration: none;
}
.onglets a:hover {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--line);
}
.onglets a[aria-current="true"],
.onglets a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--ink);
}
.nombre {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.biblio-outils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s4);
  margin-bottom: var(--s4);
}
.segments {
  display: inline-flex;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
  scrollbar-width: none;
}
.segments a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-width: 36px;
  min-height: 36px;
  padding: 0 var(--s3);
  border-radius: 2px;
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}
.segments a:has(.icone) {
  padding: 0 var(--s2);
}
.segments a:hover {
  background: var(--surface-tinted);
}
.segments a.vide {
  color: var(--ink-muted);
}
.segments a[aria-current="true"] {
  background: var(--ink);
  color: var(--surface);
}
.segments a[aria-current="true"] .nombre {
  color: var(--line);
}

.biblio td {
  vertical-align: middle;
}
.ligne-doc {
  display: flex;
  align-items: center;
  gap: var(--s3);
}
.ligne-doc .passe-partout {
  width: 3rem;
  flex: none;
  padding: 2px;
}
.ligne-doc small {
  display: block;
}

.grille-sources {
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.carte {
  position: relative;
}
/* La case reste discrète tant que rien n'est choisi, puis s'affiche partout. */
.carte-case {
  position: absolute;
  top: var(--s2);
  left: var(--s2);
  z-index: 1;
  margin: 0;
  opacity: 0;
}
.carte:hover .carte-case,
.carte-case:focus-visible,
form:has(.carte-case:checked) .carte-case {
  opacity: 1;
}
@media (hover: none) {
  .carte-case {
    opacity: 1;
  }
}
.carte:has(.carte-case:checked) .passe-partout {
  box-shadow: inset 0 0 0 3px var(--ink);
}
.carte.rejetee img {
  opacity: 0.4;
  filter: grayscale(1);
}
.carte-etat {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s2);
  margin: var(--s1) 0 0;
}

/* Barre d'actions de la sélection: elle n'existe que si une case est cochée et suit le défilement. */
.selection {
  position: sticky;
  bottom: var(--s4);
  z-index: 5;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
  margin-top: var(--s5);
  padding: var(--s2) var(--s2) var(--s2) var(--s4);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--surface);
}
form:has([name="ids"]:checked) .selection {
  display: flex;
}
.selection output {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.selection button.lien {
  color: var(--surface);
}
.selection .espace {
  margin-left: auto;
}
.selection button:not(.lien) {
  min-height: 40px;
  border-color: var(--ink-muted);
  background: transparent;
  color: var(--surface);
}
.selection button:not(.lien):hover {
  border-color: var(--surface);
}
.selection select {
  width: auto;
  min-height: 40px;
  color: var(--ink);
}
.selection button.principal {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--ink);
}
#lignes > .seance:first-child {
  padding-top: 0;
  border-top: 0;
}
