/*
 * Sujets du bac (refonte 2026, phase 10, maquettes sujets/Hub*, Matiere*,
 * Sujet*) : banque (/sujets-bac/), page d'une matiere, page d'un sujet
 * (enonce, corrige, chrono, « Je l'ai fait »), listes par session.
 *
 * Seule feuille de section des pages generees par `npm run build:sujets`,
 * apres les quatre feuilles communes dont elle reprend les jetons. Mobile
 * d'abord.
 */

.site-frame > .exam-shell {
  min-height: 0;
  padding-top: 6px;
  padding-bottom: 0;
}

.exam-page {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: var(--sp-5);
  width: 100%;
  max-width: none;
  margin: 0 auto;
}

/* Fil d'Ariane en pastilles (mobile) : il remplace l'en-tete du site. */
.exam-chips {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.exam-chips .breadcrumb--chips {
  flex: 1;
  min-width: 0;
}

.exam-chips .icon-button[data-theme-toggle] {
  flex-shrink: 0;
  margin-left: auto;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 959.98px) {
  .site-frame:has(.exam-shell--chips) > .site-top { display: none; }
  .site-frame > .exam-shell--chips { padding-top: 14px; }
}

@media (min-width: 960px) {
  .exam-chips { display: none; }
  .site-frame > .exam-shell { padding-top: 14px; padding-bottom: var(--space-6); }
}

/* --- Pastilles communes (autres centres, autres matieres, autres sujets) --- */
.exam-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.exam-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
}

.exam-pill:hover { background: var(--sel-bg); color: var(--sel-text); }
.exam-pill__count { margin-left: 6px; color: var(--muted); }

/* ===== Banque (/sujets-bac/) ================================================ */
.bank { display: flex; flex-direction: column; gap: var(--sp-5); }

.bank-hero {
  display: grid;
  grid-template-areas: "head" "search" "random" "filters";
  gap: var(--sp-5);
}

.bank-hero__head { grid-area: head; display: flex; flex-direction: column; gap: 6px; }

.bank-hero__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.375rem;
  line-height: 1;
}

.bank-hero__title .site-icon { width: 44px; height: 44px; }

.bank-hero__lead { margin: 0; color: var(--muted); font-weight: 700; font-size: 0.9375rem; }

.bank-search { grid-area: search; position: relative; margin: 0; }

.bank-search__icon { position: absolute; top: 17px; left: 16px; pointer-events: none; }

.bank-search__input {
  width: 100%;
  height: 58px;
  padding: 0 var(--sp-4) 0 52px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  font: 800 1.0625rem var(--font-body);
}

.bank-search__input::placeholder { color: var(--muted); }

.bank-hero__random { grid-area: random; gap: 10px; font-size: 1.1875rem; }
.bank-hero__random[hidden] { display: none; }

.bank-filters { grid-area: filters; display: flex; flex-direction: column; gap: var(--sp-2); }
.bank-filters[hidden] { display: none; }

.bank-filters__row { display: flex; flex-wrap: wrap; gap: 6px; }
/* Voies et sessions sur une meme ligne de pastilles, comme la maquette */
.bank-filters__group { display: contents; }

/* Choix segmente : Terminale / Premiere, voies d'une matiere */
.bank-segmented {
  display: flex;
  gap: var(--sp-1);
  padding: var(--sp-1);
  border-radius: 16px;
  background: var(--soft);
}

.bank-segmented .bank-filter {
  flex: 1;
  min-height: 38px;
  padding: 0 var(--sp-2);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: 800 0.875rem/1.15 var(--font-display);
  cursor: pointer;
}

.bank-segmented .bank-filter[aria-pressed="true"] {
  background: var(--flame);
  color: var(--on-flame);
  box-shadow: 0 3px 0 var(--flame-edge);
}

/* Pastilles de voie et de session */
.bank-filters__group .bank-filter {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font: 900 0.875rem var(--font-body);
  cursor: pointer;
}

.bank-filters__group .bank-filter[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-text); }
.bank-filter:disabled { opacity: 0.4; cursor: not-allowed; }

/* Resultats d'une recherche ou d'un filtre */
.bank-results-wrap { display: flex; flex-direction: column; gap: var(--sp-3); }
.bank-results-wrap[hidden] { display: none; }
.bank-count { margin: 0; color: var(--muted); font-size: 0.875rem; }
.bank-count strong { color: var(--text); }

.bank-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: var(--sp-3); align-items: start; }
.bank-results[hidden] { display: none; }
.bank-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--r-xl); background: var(--surface); }
.bank-card__header { display: flex; align-items: center; gap: var(--sp-3); }
.bank-card__heading { flex: 1; min-width: 0; }
.bank-card__title { margin: 0; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.1; }
.bank-card__title a { color: var(--text); text-decoration: none; }
.bank-card__meta { margin: 0; color: var(--muted); font-size: 0.75rem; }
.bank-card__count { margin: 0; color: var(--muted); font-family: var(--font-display); font-weight: 800; }
.bank-card__label { margin: var(--sp-2) 0 0; color: var(--muted); font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.bank-card__label:first-of-type { color: var(--warm-strong); }
.bank-card__national, .bank-card__others { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }

.bank-pill {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--soft);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 800;
  text-decoration: none;
}

.bank [data-role="empty"] { align-items: center; gap: var(--sp-3); padding: var(--space-6); border: 0; border-radius: var(--r-xl); background: var(--soft); text-align: center; }

/* Sections : sujets nationaux, Premiere, annales */
.bank-section { display: flex; flex-direction: column; gap: 10px; }
.bank-section__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bank-section__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; line-height: 1.05; }

.bank-section__badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 26px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--error);
  color: var(--on-accent);
  font-weight: 900;
  font-size: 0.6875rem;
  text-transform: uppercase;
}

.bank-national { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }

.bank-national__link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-2);
  height: 100%;
  min-height: 120px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--subject-color);
  box-shadow: 0 5px 0 var(--subject-edge);
  color: var(--on-accent);
  text-decoration: none;
}

.bank-national__session { font-weight: 900; font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.9; }
.bank-national__name { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1.05; }

.bank-first { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }

/* Carte-lien a carre d'icone : bloc Premiere de la banque, cours d'une matiere */
.bank-first__link,
.exam-course {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 14px;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.bank-first__link .subject-tile { width: 44px; height: 44px; border-radius: var(--r-sm); box-shadow: 0 4px 0 var(--subject-edge); }
.bank-first__text, .exam-course__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bank-first__text strong, .exam-course__text strong { font-family: var(--font-display); font-weight: 800; font-size: 1.0625rem; line-height: 1.15; }
.bank-first__text span, .exam-course__text span { color: var(--muted); font-weight: 800; font-size: 0.8125rem; }

.bank-browse { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }

.bank-browse__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 60px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  text-decoration: none;
}

.bank-browse__link::before { content: ''; flex-shrink: 0; width: 12px; height: 34px; border-radius: 6px; background: var(--subject-color, var(--violet)); }
.bank-browse__link > span:first-child { flex: 1; min-width: 0; }

.bank-browse__count {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--soft);
  font-family: var(--font-body);
  font-weight: 900;
  font-size: 0.8125rem;
}

@media (min-width: 960px) {
  .exam-page { gap: var(--sp-6); }
  .bank { gap: var(--sp-6); }

  .bank-hero {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "head ." "search ." "filters random";
    column-gap: var(--sp-6);
    row-gap: var(--sp-4);
  }

  .bank-hero__title { font-size: 3.375rem; }
  .bank-hero__title .site-icon { width: 58px; height: 58px; }
  .bank-hero__random { align-self: end; }
  .bank-national { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bank-first, .bank-browse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Page d'une matiere ===================================================== */
.subject-exams { display: grid; gap: var(--sp-5); }
.subject-exams__main { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }

.subject-hero {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 18px;
  border-radius: 30px;
  background: var(--subject-color);
  box-shadow: var(--relief-hi-soft), 0 8px 0 var(--subject-edge);
  color: var(--on-accent);
}

.subject-hero__kicker { margin: 0; line-height: 1.35; font-weight: 900; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.subject-hero__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.25rem; line-height: 1; }
.subject-hero__lead { margin: 0; line-height: 1.35; font-weight: 800; font-size: 0.875rem; }
.subject-collection { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-3); border-radius: var(--r-md); background: var(--count-bg); }
.subject-collection__head { display: flex; justify-content: space-between; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.subject-collection__bar { height: 10px; background: var(--on-violet-line); }
.subject-collection__bar .progress__bar { background: var(--on-accent); }
.subject-collection__invite { display: flex; align-items: center; gap: 6px; margin: 0; line-height: 1.4; font-weight: 800; font-size: 0.8125rem; }
.subject-collection__invite a { color: inherit; }
.subject-collection__invite[hidden] { display: none; }

.subject-tracks .bank-filter { min-height: 42px; font-size: 1rem; }
.subject-tracks[hidden] { display: none; }

.subject-session { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4); border-radius: var(--r-xl); background: var(--surface); }
.subject-session[hidden] { display: none; }
.subject-session__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.625rem; line-height: 1.05; }
.subject-session__title a { color: var(--text); text-decoration: none; }
.subject-session__national, .subject-session__others { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.subject-session__national { flex-direction: column; }
.subject-session__national li[hidden], .subject-session__others li[hidden], .subject-session ul[hidden] { display: none; }
.subject-session__main { gap: 10px; min-height: 64px; border-radius: var(--r-lg); font-size: 1.25rem; letter-spacing: 0.03em; }
.subject-session__others .exam-pill { min-height: 42px; background: var(--soft); font-size: 0.9375rem; }
.subject-exams a[data-done="true"]::after { content: ' ✓'; }

.exam-course__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--cyan-bg);
}

.subject-others { display: flex; flex-direction: column; gap: var(--sp-2); }
.subject-others__title, .exam-others__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1.05; }

@media (min-width: 960px) {
  .subject-exams {
    grid-template-columns: 380px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: start;
    column-gap: 26px;
    row-gap: var(--sp-4);
  }

  .subject-hero { grid-column: 1; grid-row: 1; padding: 26px; }
  .subject-hero__title { font-size: 3rem; }
  .subject-exams__main { grid-column: 2; grid-row: 1 / span 2; gap: var(--sp-4); }
  /* Le cours sous la carte, les autres matieres sous les sessions. */
  .exam-course { grid-column: 1; grid-row: 2 / span 2; }
  .subject-others { grid-column: 2; grid-row: 3; }
}

/* ===== Listes par session (/sujets-bac/<annee>/…) ============================= */
.exam-list { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }

.exam-link {
  display: grid;
  gap: var(--sp-1);
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.exam-link:hover { background: var(--sel-bg); }
.exam-link__title { font-family: var(--font-display); font-weight: 800; font-size: 1.1875rem; line-height: 1.15; }
.exam-link__meta { color: var(--muted); font-size: 0.9375rem; }
.exam-link__badge { justify-self: start; }

.exam-mesh { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-2); border-top: 2px solid var(--divider); }

.exam-mesh__list { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }

.exam-mesh__list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 960px) {
  .exam-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Page d'un sujet ======================================================== */
.exam { display: grid; gap: var(--sp-5); }

.exam__header { display: flex; flex-direction: column; gap: var(--sp-2); }
.exam__kicker { margin: 0; color: var(--muted); font-weight: 900; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.exam__kicker a { color: inherit; text-decoration: none; }
.exam__kicker a:hover { color: var(--text); text-decoration: underline; }
.exam__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.5rem; line-height: 0.95; }
.exam__year { color: var(--flame); }
.exam__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.exam__chips .chip { min-height: 30px; padding: 0 11px; border: 0; font-weight: 900; }

/* Telecharger, Chrono, Je l'ai fait */
.exam-tools { display: flex; flex-direction: column; gap: var(--sp-2); }
.exam-tools__pdf { gap: 10px; min-height: 60px; border-radius: var(--r-lg); font-size: 1.0625rem; letter-spacing: 0.03em; }
.exam-tools__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--sp-2); }
.exam-tools__row:empty { display: none; }
.exam-tools__row .button { gap: var(--sp-2); min-height: 54px; padding: 0 var(--sp-3); border-radius: var(--r-md); font-size: 1rem; white-space: nowrap; }
.exam-tools__row .button[hidden] { display: none; }
.exam-tools__done { --button-edge-size: 0px; background: var(--soft); color: var(--text); }
.exam-tools__done[aria-pressed="true"] { background: var(--green-bg); color: var(--green-strong); }
.exam-tools__status:empty { display: none; }
.exam-tools__status, .exam-tools__invite { margin: 0; font-size: 0.875rem; font-weight: 700; }

.exam__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Onglets Enonce / Corrige */
.exam-switch { display: flex; gap: var(--sp-1); padding: var(--sp-1); border-radius: var(--r-md); background: var(--soft); }
.exam-switch[hidden] { display: none; }

.exam-switch__button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font: 800 1rem var(--font-display);
  cursor: pointer;
}

.exam-switch__button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 3px 0 var(--border); }

.exam__columns { display: flex; flex-direction: column; gap: 14px; }
.exam__columns[data-view="correction"] > .exam-statement { display: none; }
.exam__columns[data-view="statement"] .exam-exercise:not([data-current="true"]) { display: none; }

/* Enonce : une carte par exercice */
.exam-statement, .exam-correction { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.exam-statement[hidden], .exam-correction[hidden] { display: none; }
.exam-summaries { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.exam-summaries[hidden] { display: none; }

.exam-summary { display: flex; flex-direction: column; gap: 10px; padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface); scroll-margin-top: var(--sp-5); }
.exam-summary__head { display: flex; align-items: flex-start; gap: var(--sp-3); }

.exam-summary__number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--subject-color, var(--violet));
  color: var(--on-accent);
  font: 800 1.25rem var(--font-display);
}

.exam-summary__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exam-summary__kicker { margin: 0; color: var(--muted); font-weight: 900; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.exam-summary__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.1875rem; line-height: 1.2; }
.exam-summary__title a { color: var(--text); text-decoration: none; }
.exam-summary__title a:hover { text-decoration: underline; }

.exam-revise { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.exam-revise__label { color: var(--muted); font-weight: 800; font-size: 0.8125rem; }
.exam-revise__link { min-height: 30px; padding: 0 11px; border: 0; font-weight: 900; text-decoration: none; }
.exam-revise__link:not(.chip--cyan) { color: var(--text); }

.exam-source { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); margin: 0; color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.exam-source__open[hidden] { display: none; }

/* Visionneuse PDF (ouverte a la demande et en mode examen) */
.pdf-viewer { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-md); background: var(--soft); }
.pdf-viewer[hidden] { display: none; }
.pdf-viewer__heading { display: flex; align-items: center; gap: 6px; padding: var(--sp-2) 10px; border-bottom: 2px solid var(--divider); background: var(--surface); }
.pdf-viewer__name { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; margin: 0; color: var(--muted); font-weight: 800; font-size: 0.8125rem; }
.pdf-viewer__toolbar { display: flex; align-items: center; gap: 6px; }
.pdf-viewer__toolbar[hidden] { display: none; }
.pdf-viewer__heading .icon-button, .pdf-viewer__pagination .icon-button { border-radius: 12px; }
.pdf-viewer__zoom { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pdf-viewer__paper { padding: 14px; }
.pdf-viewer__canvas { overflow-x: auto; overflow-y: hidden; }
.pdf-viewer__canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.pdf-viewer__canvas canvas { display: block; max-width: none; margin: 0 auto; background: var(--on-accent); }
.pdf-viewer__status { margin: 0; padding: 0 14px var(--sp-3); color: var(--muted); }
.pdf-viewer__status:empty { display: none; }
.pdf-viewer__pagination { display: flex; align-items: center; justify-content: center; gap: 14px; padding: var(--sp-2); border-top: 2px solid var(--divider); background: var(--surface); }
.pdf-viewer__pagination[hidden] { display: none; }
.pdf-viewer__page { margin: 0; font-weight: 800; font-size: 0.875rem; }

/* Corrige : une carte par exercice, une ligne repliee par question */
.exam-correction__list { display: flex; flex-direction: column; gap: 14px; }
.exam-correction__list[hidden], .exam-correction__preview[hidden] { display: none; }
.exam-correction__note { margin: 0; padding: var(--sp-5); border-radius: var(--r-lg); background: var(--surface); line-height: 1.5; }
.exam-correction__note[hidden] { display: none; }
.exam-correction__status:empty { display: none; }

.exam-exercise {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--sp-4);
  border: 2px solid var(--violet);
  border-radius: var(--r-lg);
  background: var(--surface);
  scroll-margin-top: var(--sp-5);
}

.exam-exercise__head { display: flex; align-items: center; gap: 10px; }
.exam-exercise__title { flex: 1; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; line-height: 1.05; }
.exam-exercise__title:focus { outline: none; }
.exam-exercise__free { flex-shrink: 0; min-height: 26px; padding: 0 11px; border: 0; font-weight: 900; font-size: 0.6875rem; text-transform: uppercase; }
.exam-exercise__credit { display: flex; align-items: center; gap: var(--sp-2); margin: 0; color: var(--muted); font-weight: 700; font-size: 0.8125rem; }
.exam-exercise__credit svg { width: 16px; height: 16px; flex-shrink: 0; }

/* « En bref » : l'enjeu de l'exercice (la case Problematique de la maquette) */
.exam-brief { padding: var(--sp-3) 14px; border-left: 5px solid var(--flame); border-radius: var(--r-sm); background: var(--warm-bg); }
.exam-brief__label { margin: 0; color: var(--flame); font-weight: 900; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.exam-brief__text { margin: 2px 0 0; font-weight: 700; font-size: 0.875rem; line-height: 1.4; }

.exam-question { border-radius: var(--r-sm); background: var(--soft); }
.exam-question__summary { display: block; padding: 10px; cursor: pointer; list-style: none; }
.exam-question__summary::-webkit-details-marker { display: none; }
.exam-question__title { display: flex; gap: 10px; margin: 0; font-family: var(--font-body); font-weight: 800; font-size: 0.875rem; line-height: 1.35; }
.exam-question__mark { flex-shrink: 0; color: var(--violet-light); font-family: var(--font-display); font-size: 0.9375rem; }
.exam-question__body { display: flex; flex-direction: column; gap: var(--sp-2); padding: 0 10px 10px; }

.exam-block { display: flex; flex-direction: column; gap: 6px; padding: 10px var(--sp-3); border-radius: 12px; }
.exam-block--method { background: var(--surface); color: var(--muted); }
.exam-block--answer { background: var(--surface); }
.exam-block__label { margin: 0; color: var(--accent-text); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.exam-block--answer .exam-block__label { color: var(--green-strong); }

.exam-html { display: flex; flex-direction: column; gap: var(--sp-2); font-size: 0.9375rem; line-height: 1.55; overflow-wrap: anywhere; }
.exam-html > * { margin: 0; }
.exam-html ul, .exam-html ol { padding-left: 1.25rem; }
.exam-html math { font-size: 1.1em; }
.exam-html math[display="block"] { display: block math; max-width: 100%; overflow-x: auto; margin: var(--sp-1) 0; }

/* Actions d'un eleve connecte : notions a ajouter a ses cartes */
.exam__actions { display: flex; flex-direction: column; gap: var(--sp-3); }
.exam__actions[hidden] { display: none; }
.exam-reader__cards { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.exam-reader__cards:empty, .exam__status:empty { display: none; }

/* Mode examen et bilan */
.exam-mode,
.exam-report {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 2px solid var(--warm-border);
  border-radius: var(--r-xl);
  background: var(--warm-bg);
  color: var(--warm-text);
}

.exam-mode[hidden], .exam-report[hidden] { display: none; }
.exam-report { border-color: var(--border); background: var(--surface); color: var(--text); }
.exam-report:focus { outline: none; }
.exam-mode__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; }
.exam-mode__timer { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 2.5rem; line-height: 1; font-variant-numeric: tabular-nums; color: var(--warm-strong); }
.exam-report__duration { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; }
.exam-report__list { display: grid; gap: var(--sp-2); width: 100%; margin: 0; padding: 0; list-style: none; }
.exam-report__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 10px 14px; border-radius: var(--r-md); background: var(--soft); }
.exam-report__title { font-weight: 800; }

/* Defie un ami, autres sujets */
.exam-challenge { display: flex; flex-direction: column; gap: 10px; padding: var(--sp-4); border-radius: 24px; background: var(--sel-bg); }
.exam-challenge__head { display: flex; align-items: center; gap: var(--sp-3); }
.exam-challenge__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.0625rem; line-height: 1.2; }
.exam-challenge__text { margin: 0; color: var(--sel-text); font-weight: 700; font-size: 0.8125rem; }
.exam-challenge__actions { display: flex; gap: var(--sp-2); }
.exam-challenge__actions .button { flex: 1; min-height: 46px; padding: 0 var(--sp-3); border-radius: var(--r-md); }
.exam-others { display: flex; flex-direction: column; gap: var(--sp-2); }

/* Pendant l'epreuve : l'enonce seul */
.exam[data-phase="exam"] .exam-tools,
.exam[data-phase="exam"] .exam-challenge,
.exam[data-phase="exam"] .exam-others { display: none; }

@media (min-width: 960px) {
  .exam {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto auto auto auto 1fr;
    align-items: start;
    column-gap: 26px;
    row-gap: 14px;
  }

  .exam__header { grid-column: 1 / -1; margin-bottom: 14px; }
  .exam__title { font-size: 3.5rem; }
  .exam__main { grid-column: 1; grid-row: 2 / span 4; }
  .exam-tools { grid-column: 2; grid-row: 2; }
  .exam-challenge { grid-column: 2; grid-row: 3; }
  .exam-others { grid-column: 2; grid-row: 4; margin-top: 10px; }
  .exam[data-phase="exam"] .exam__main { grid-column: 1 / -1; }
  .pdf-viewer__paper { padding: var(--sp-5); }
  .exam__actions { flex-direction: row; justify-content: flex-end; align-items: center; }
}
