/* Site des étudiants (0.30) : téléphone d'abord, tableau sur ordinateur. Couleur du cours dans la barre ;
   rubriques d'un chapitre en bandeau pâle de cette couleur ; point orange pour ce qui est nouveau sur l'appareil. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1d2125; background: #f1f4f7; -webkit-text-size-adjust: 100%; }
a { color: #1f5fbf; text-decoration: none; }
button, input { font: inherit; color: inherit; }
.etu { min-height: 100vh; display: flex; flex-direction: column; --c: #1f5fbf; }
.k { color: #5b636b; font-size: 13px; }

/* Barre du haut */
.hd { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 6px 10px; background: var(--c); color: #fff; }
.hd a, .hd button { color: #fff; }
.hd .titre { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 16px; background: none; border: 0; padding: 4px 2px; text-align: left; cursor: pointer; }
.hd .titre span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd .retour { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; flex: none; background: rgba(255,255,255,.2); }
.hd .retour:hover, .hd .retour:active { background: rgba(255,255,255,.32); }
.charge { padding: 24px; color: #5b636b; }
.grp { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 30px; padding: 0 9px 0 11px; border-radius: 15px; background: #fff; color: #1a4c9c !important; font-weight: 600; font-size: 13px; border: 0; cursor: pointer; }
.apercu { background: #fff4d6; color: #6b4e00; font-size: 13px; padding: 6px 12px; border-bottom: 1px solid #ecd48a; }
.apercu a { color: #6b4e00; text-decoration: underline; }

.corps { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 12px 12px 40px; }
.carte { background: #fff; border: 1px solid #e0e5eb; border-radius: 12px; padding: 18px 16px; }
h1 { font-size: 20px; margin: 0 0 6px; }

/* Code et groupe */
.centre { max-width: 420px; margin: 8px auto; }
.code { width: 100%; height: 56px; margin: 16px 0 6px; text-align: center; font: 600 26px/1 ui-monospace, Consolas, monospace; letter-spacing: 4px; text-transform: uppercase;
  border: 1.5px solid #c9d0d8; border-radius: 10px; background: #fff; }
.code:focus { outline: none; border-color: #1f5fbf; box-shadow: 0 0 0 3px #d6e4fa; }
.btn { width: 100%; min-height: 48px; border: 0; border-radius: 10px; background: #1f5fbf; color: #fff; font-weight: 600; font-size: 16px; cursor: pointer; margin-top: 12px; }
.btn[disabled] { opacity: .6; }
.btn2 { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 56px; padding: 10px 14px; margin-top: 10px; border: 1px solid #c9d0d8; border-radius: 10px; background: #fff; cursor: pointer; text-align: left; }
.btn2 b { font-size: 17px; }
.erreur { color: #b3261e; font-size: 14px; margin-top: 8px; }
.note { margin-top: 14px; }

/* Menu du groupe */
.menu { position: fixed; z-index: 20; right: 8px; top: 52px; min-width: 220px; background: #fff; border: 1px solid #d5dde7; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); padding: 6px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 8px 10px; border: 0; background: none; border-radius: 7px; text-align: left; cursor: pointer; }
.menu button:hover, .menu button.on { background: #eef3fb; }
.menu .sep { height: 1px; background: #e6e9ee; margin: 4px 0; }

/* Point orange : nouveau sur cet appareil */
.pt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f08a00; flex: none; }

/* Accueil de la classe */
.cours-carte { display: flex; align-items: stretch; background: #fff; border: 1px solid #e0e5eb; border-radius: 12px; overflow: hidden; margin-bottom: 10px; color: inherit; }
.cours-carte .bd { width: 6px; flex: none; background: var(--cc); }
.cours-carte .ct { flex: 1; display: flex; align-items: center; gap: 8px; padding: 14px 12px; font-weight: 600; font-size: 16px; }

/* Accueil d'un cours : chapitres */
.derniers { display: flex; align-items: center; gap: 6px; width: 100%; padding: 9px 12px; margin-bottom: 10px; background: #fff; border: 1px solid #e0e5eb; border-radius: 10px; color: #1f5fbf; font-size: 14px; cursor: pointer; text-align: left; }
.der-liste { background: #fff; border: 1px solid #e0e5eb; border-radius: 10px; margin: -6px 0 10px; overflow: hidden; }
.der-liste a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid #eef0f3; color: inherit; font-size: 14px; }
.der-liste a:first-child { border-top: 0; }
.der-liste .t { flex: 1; min-width: 0; }
.arbre { background: #fff; border: 1px solid #e0e5eb; border-radius: 12px; overflow: hidden; }
.partie { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 46px; padding: 8px 12px; border: 0; border-top: 1px solid #d5dde7; background: #e4eaf2; color: #1d2b3e; font-weight: 600; font-size: 15px; cursor: pointer; text-align: left; }
.arbre > :first-child { border-top: 0; }
.partie .fl { transition: transform .15s; flex: none; }
.partie.ouverte .fl { transform: rotate(90deg); }
.partie .ext { margin-left: auto; font-weight: 400; font-size: 13px; color: #5b636b; }
.ch { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-top: 1px solid #eef0f3; color: inherit; background: #fff; }
.ch.dans { padding-left: 22px; }
.ch .n { width: 24px; flex: none; text-align: right; color: #5b636b; font-variant-numeric: tabular-nums; }
.ch .t { flex: 1; min-width: 0; }
.ch .tag { font-size: 11px; font-weight: 700; color: #a3245c; background: #fbe7ef; border-radius: 4px; padding: 1px 5px; flex: none; }
.ch.vert .tag { color: #1e6b33; background: #e3f3e7; }
.ch.avenir { color: #8a9199; font-size: 14px; }

/* Grille d'un chapitre */
.fil { color: #5b636b; font-size: 13px; margin: 2px 2px 8px; }
.chap-titre { font-size: 19px; font-weight: 700; margin: 0 2px 10px; }
.sec { background: #fff; border: 1px solid #d5dde7; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.sh { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px; font-weight: 700;
  background: #e8eef8; background: color-mix(in srgb, var(--c) 13%, #fff); color: #173d7a; color: color-mix(in srgb, var(--c) 70%, #000); }
.sec.violet .sh { background: #efe9fb; color: #4d2c91; }
.sh .badge { font-size: 11px; font-weight: 700; color: #1e6b33; background: #e3f3e7; border-radius: 8px; padding: 1px 7px; }
.ent { display: none; }
.lg { padding: 10px 12px; border-top: 1px solid #edf0f4; }
.sh + .lg { border-top: 0; }
.lg .tt { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg .bts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.lg.eclair { animation: eclair 2.2s; }
@keyframes eclair { from { background: #fff1d6; } to { background: transparent; } }
.cell:empty { display: none; }
.b { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 11px; border: 1px solid #c9d3df; border-radius: 7px; background: #fff; color: #1d2125; font-size: 14px; white-space: nowrap; cursor: pointer; }
.b:hover { border-color: #8fa6c4; }
.b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.b .pt { position: absolute; top: 3px; right: 3px; width: 10px; height: 10px; }
.b.pt-la { padding-right: 18px; }
.b.off { color: #737b84; background: #f1f3f5; border-style: dashed; cursor: default; }
.b .dit { display: none; }
.fmt { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 18px; padding: 0 3px; border-radius: 3px; color: #fff; font-size: 10px; font-weight: 800; flex: none; }
.f-pdf { background: #c62828; } .f-ppt { background: #c43e1c; } .f-doc { background: #2b579a; } .f-xls { background: #217346; } .f-vid { background: #b31217; }
.f-web { background: #4a5a6e; } .f-img { background: #6a4fa3; } .f-zip { background: #6b5b3e; } .f-ex { background: #0f7b6c; }
.info { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; background: #fff7d6; border: 1px solid #e6c65a; color: #7a5a00; font: 700 12px/1 Georgia, serif; cursor: pointer; padding: 0; }
.bulle { margin-top: 6px; padding: 7px 10px; border-radius: 6px; background: #fff7d6; border: 1px solid #e6c65a; font-size: 14px; color: #4d3b00; }
.enligne { font-size: 11px; font-weight: 700; color: #0f5e53; background: #dff3ef; border-radius: 8px; padding: 1px 7px; }
.mort { font-size: 12px; color: #8a5a00; }
.voir { margin: 4px 2px; font-size: 14px; }

/* Page d'un document, page d'exercice */
.doc-etat { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: #f3f5f8; }
.cadre-ex { width: 100%; height: calc(100vh - 120px); min-height: 420px; border: 1px solid #d5dde7; border-radius: 10px; background: #fff; }

/* Ordinateur : un tableau croisé par section (colonnes Élève, Corrigé…). */
@media (min-width: 720px) {
  .corps { padding: 18px 20px 40px; }
  .sec .ent, .sec .lg { display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--n), 172px); gap: 8px; align-items: center; }
  .sec .ent { padding: 6px 12px; background: #f4f6f9; font-size: 12px; font-weight: 600; color: #33475f; border-bottom: 1px solid #e4e9ef; }
  .lg .bts { display: contents; }
  .cell:empty { display: block; }
  .b .dit { display: inline; }
  .b .lib { display: none; }
  .lg:nth-child(even) { background: #f9fafc; }
}
