/* Banque d'exercices — liste horizontale par leçon, filtres (leçon / vu / fait), panneau de lecture.
   Réutilise les classes communes de quiz.css (.subject-tiles, .quiz-back, .quiz-badge, .prog-chip…), chargé sur la même page. */

.exo-toolbar { position: sticky; top: var(--header-height, 64px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin: 0 0 1.2rem; padding: 0.7rem 0.2rem; background: var(--color-bg, #f2ead8); border-bottom: 1px solid var(--color-border); }
/* Sans min-width:0, un <select> dans une rangée flex refuse de rétrécir sous la largeur de son texte
   (le plus long libellé de leçon) et déborde de l'écran sur mobile ; flex-basis 220px lui laisse de la
   place sur grand écran tout en le mettant sur sa propre ligne, pleine largeur, dès que ça manque de place. */
.exo-filter { min-width: 0; flex: 1 1 220px; }
.exo-filter select { width: 100%; box-sizing: border-box; max-width: 100%; padding: 0.55rem 0.9rem; font: inherit; font-size: 0.92rem; border: 1.5px solid var(--color-border-strong, #d8cbae); border-radius: 999px; background: #fff; color: var(--color-text); min-height: 40px; }
.exo-chips-label { font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); margin-right: 0.15rem; align-self: center; }

/* Les deux groupes de puces (Vu / Fait) tiennent sur une seule ligne, y compris sur mobile : le défilement
   horizontal se fait sur ce conteneur commun (une seule barre de défilement, pas une par groupe). */
.exo-status-filters { display: flex; flex-wrap: nowrap; align-items: center; gap: 1.1rem; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.exo-status-filters::-webkit-scrollbar { display: none; }
.exo-status-filters .prog-chips { flex: none; overflow: visible; }
.exo-note { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); }
.exo-note a { font-weight: 700; }
@media (prefers-color-scheme: dark) { .exo-toolbar { background: var(--color-bg); } }

.exo-group { margin: 0 0 2rem; }
.exo-group[hidden] { display: none; }
.exo-lesson-title { font-size: 1.05rem; margin: 0 0 0.6rem; }
.exo-lesson-title small { font-weight: 600; color: var(--color-text-muted); margin-left: 0.4rem; }

/* liste horizontale : défilement tactile, une carte = une largeur fixe */
.exo-row { display: flex; gap: 0.9rem; overflow-x: auto; padding: 0.2rem 0.1rem 0.6rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.exo-row::-webkit-scrollbar { height: 8px; }
.exo-row::-webkit-scrollbar-thumb { background: var(--color-border-strong, #d8cbae); border-radius: 99px; }

.exo-card { flex: none; width: 210px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem; background: #fff; border: 1px solid var(--color-border); border-radius: 14px; }
.exo-card[hidden] { display: none; }
.exo-card-top { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; min-height: 1.2rem; }
.exo-niveau { font-size: 0.85rem; letter-spacing: 0.05em; color: var(--color-primary, #b8872b); }
.exo-card-title { margin: 0; font-size: 0.95rem; line-height: 1.3; flex: 1; }
.exo-card-open { margin-top: auto; padding: 0.5rem 0.9rem; border-radius: 999px; border: 1.5px solid var(--color-primary, #b8872b); background: #fff; color: var(--color-primary, #b8872b); font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer; min-height: 38px; }
.exo-card-open:hover { background: var(--color-primary, #b8872b); color: #fff; }
.exo-card-open:disabled { opacity: 0.5; cursor: not-allowed; }
.exo-card-status { display: flex; align-items: center; gap: 0.4rem; }
.exo-pill { font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.65rem; border-radius: 999px; border: 1.5px solid var(--color-border-strong, #d8cbae); background: #fff; color: var(--color-text-muted); font-family: inherit; cursor: pointer; min-height: 30px; }
.exo-pill-vu { border-color: #1d4ed8; color: #1d4ed8; background: #e6efff; cursor: default; }
.exo-pill-fait.is-on { border-color: #1b5e2f; color: #1b5e2f; background: #e7f5ea; }
.exo-pill-fait:disabled { opacity: 0.5; cursor: not-allowed; }

.exo-empty { text-align: center; padding: 2.5rem 1rem; color: var(--color-text-muted); }
.exo-empty[hidden] { display: none; }

/* panneau de lecture (énoncé / corrigé) */
.exo-panel { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 16, 8, 0.55); }
.exo-panel[hidden] { display: none; }
.exo-panel-box { position: relative; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 18px 18px 0 0; padding: 1.4rem 1.2rem 2rem; }
@media (min-width: 680px) { .exo-panel { align-items: center; } .exo-panel-box { border-radius: 18px; max-height: 80vh; } }
.exo-panel-close { position: sticky; top: 0; float: right; width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--color-bg, #f2ead8); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.exo-panel-body h2 { margin: 0 0.5rem 0.8rem 0; }
.exo-panel-corrige { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px dashed var(--color-border); }
.exo-panel-toggle { margin-top: 0.6rem; padding: 0.5rem 0.9rem; border-radius: 999px; border: 1.5px solid var(--color-border-strong, #d8cbae); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
