/* Mon cartable — interface. Mobile d'abord (photos depuis le téléphone), confortable sur ordinateur. */
:root {
  --violet: #5b4fcf; --violet-fonce: #4338a8; --violet-clair: #ecebfa; --corail: #ff7a59; --corail-clair: #ffece6;
  --vert: #2e9e76; --vert-clair: #e3f6ee; --rouge: #d9534f; --rouge-clair: #fdecec; --orange: #e08a00; --orange-clair: #fff4d6;
  --fond: #f5f4fb; --carte: #fff; --texte: #23223a; --gris: #7b7a94; --gris-clair: #f0eff7; --bord: #e4e2f0;
  --police: "Nunito", system-ui, -apple-system, sans-serif;
  --rayon: 14px; --ombre: 0 2px 10px rgba(60, 50, 130, .08);
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1.2; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
a { color: var(--violet); text-decoration: none; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; border: 1.5px solid var(--bord); border-radius: 10px; padding: 10px 12px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-clair); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0 5px; color: var(--gris); }
.aide { color: var(--gris); font-size: 13.5px; }
.erreur { color: var(--rouge); font-size: 13.5px; min-height: 1em; }
.vide { color: var(--gris); text-align: center; padding: 36px 16px; }
.vide strong { display: block; font-size: 16px; color: var(--texte); margin-bottom: 4px; }
[hidden] { display: none !important; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px solid var(--bord); background: #fff; color: var(--violet-fonce); padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: var(--violet); background: var(--violet-clair); }
.btn.principal { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn.principal:hover { background: var(--violet-fonce); border-color: var(--violet-fonce); }
.btn.corail { background: var(--corail); border-color: var(--corail); color: #fff; }
.btn.corail:hover { filter: brightness(.95); }
.btn.large { width: 100%; padding: 13px; font-size: 16px; }
.btn.petit { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.lien { border: 0; background: transparent; padding: 4px 6px; }
.btn.danger { color: var(--rouge); }
.btn.danger:hover { background: var(--rouge-clair); border-color: var(--rouge); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--violet-fonce); }
.logo-icone { width: 34px; height: 34px; border-radius: 10px; background: var(--violet); position: relative; flex: none; }
.logo-icone::before { content: ""; position: absolute; inset: 9px 8px 8px; background: #fff; border-radius: 3px; }
.logo-icone::after { content: ""; position: absolute; left: 8px; right: 8px; top: 9px; height: 5px; background: var(--corail); border-radius: 3px 3px 0 0; }
.logo.grand { justify-content: center; margin-bottom: 8px; }
.logo.grand .logo-icone { width: 56px; height: 56px; border-radius: 16px; }
.logo.grand .logo-icone::before { inset: 15px 13px 13px; } .logo.grand .logo-icone::after { left: 13px; right: 13px; top: 15px; height: 8px; }

/* Connexion */
#connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.carte-connexion { background: var(--carte); border-radius: 20px; box-shadow: var(--ombre); padding: 32px 26px; width: min(380px, 100%); text-align: center; }
.carte-connexion h1 { margin-bottom: 4px; }
.carte-connexion input { margin: 16px 0 10px; text-align: center; font-size: 18px; letter-spacing: .1em; }

/* Structure */
#app { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.nav { background: var(--carte); border-right: 1px solid var(--bord); padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.nav nav { display: flex; flex-direction: column; gap: 4px; }
.nav nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--gris); font-weight: 700; }
.nav nav a:hover { background: var(--gris-clair); color: var(--texte); }
.nav nav a.actif { background: var(--violet-clair); color: var(--violet-fonce); }
.deconnexion { margin-top: auto; color: var(--gris); font-size: 13px; }
main { padding: 26px 28px 60px; max-width: 1080px; width: 100%; min-width: 0; }
.entete-vue { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.entete-vue .sous { color: var(--gris); font-size: 14px; }

/* Icônes (traits) */
.ico { width: 20px; height: 20px; display: inline-block; flex: none; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ico-maison { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8v9a2 2 0 0 1-2 2h-4v-7H9v7H5a2 2 0 0 1-2-2z'/%3E%3C/svg%3E"); }
.ico-livre { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20V3H6.5A2.5 2.5 0 0 0 4 5.5z'/%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 0 6.5 22H20v-5'/%3E%3C/svg%3E"); }
.ico-coche { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='4'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E"); }
.ico-eclair { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2L4 14h7l-1 8 9-12h-7z'/%3E%3C/svg%3E"); }
.ico-bulle { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-8 8H8l-5 3 1.5-4.5A8 8 0 1 1 21 12z'/%3E%3C/svg%3E"); }
.ico-plus { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.ico-photo { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.ico-trombone { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5l-8.5 8.5a5 5 0 0 1-7-7l9-9a3.5 3.5 0 0 1 5 5l-9 9a2 2 0 0 1-3-3l8-8'/%3E%3C/svg%3E"); }
.ico-envoyer { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2L11 13M22 2l-7 20-4-9-9-4z'/%3E%3C/svg%3E"); }
.ico-retour { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 5l-7 7 7 7'/%3E%3C/svg%3E"); }
.ico-petit { width: 16px; height: 16px; }

/* Cartes et listes */
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 18px; }
.carte + .carte { margin-top: 14px; }
.carte h2 { margin-bottom: 10px; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grille-2 { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.liste { display: flex; flex-direction: column; gap: 8px; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--carte); border: 1px solid var(--bord); }
.ligne:hover { border-color: #cfcbe8; }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .titre { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .detail { color: var(--gris); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne.cliquable { cursor: pointer; }
.pastille { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; flex: none; }
.pastille.petite { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--gris-clair); color: var(--gris); white-space: nowrap; }
.chip .point { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.retard { background: var(--rouge-clair); color: var(--rouge); }
.chip.aujourdhui { background: var(--corail-clair); color: #c75a3a; }
.chip.bientot { background: var(--orange-clair); color: #9a6000; }
.chip.fait { background: var(--vert-clair); color: var(--vert); }
.chip.type { background: var(--violet-clair); color: var(--violet-fonce); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .choix { cursor: pointer; border: 1.5px solid var(--bord); background: #fff; padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.chips .choix.actif { border-color: var(--c, var(--violet)); background: color-mix(in srgb, var(--c, var(--violet)) 12%, #fff); color: var(--c, var(--violet-fonce)); }
.chips .choix .point { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--violet)); }

/* Accueil */
.bonjour { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.bonjour h1 { font-size: 26px; }
.raccourcis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.raccourci { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--texte); border: 1.5px solid transparent; }
.raccourci:hover { border-color: var(--violet); }
.raccourci .ico { width: 26px; height: 26px; color: var(--violet); }
.raccourci strong { font-size: 15px; }
.raccourci span { color: var(--gris); font-size: 13px; }
.matiere-carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 16px; display: flex; align-items: center; gap: 12px; color: var(--texte); border-left: 6px solid var(--c); cursor: pointer; }
.matiere-carte:hover { transform: translateY(-1px); }
.matiere-carte strong { display: block; font-size: 15px; }
.matiere-carte span { color: var(--gris); font-size: 13px; }

/* Sections dépliables de chapitres */
.chapitre { margin-bottom: 16px; }
.chapitre h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--violet-fonce); }
.chapitre h3 .compte { color: var(--gris); font-weight: 600; font-size: 13px; }

/* Devoirs */
.devoir { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; }
.devoir input[type=checkbox] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--vert); flex: none; }
.devoir .corps { flex: 1; min-width: 0; }
.devoir .titre { font-weight: 800; }
.devoir.fait .titre { text-decoration: line-through; color: var(--gris); }
.devoir .consigne { color: var(--gris); font-size: 13.5px; white-space: pre-wrap; }
.devoir .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 8px; }
.devoir .pieces { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.devoir .pieces .chip { cursor: pointer; }
.section-devoirs h2 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--gris); }

/* Fenêtre modale */
.voile { position: fixed; inset: 0; background: rgba(35, 34, 58, .45); display: grid; place-items: end center; z-index: 50; padding: 0; }
.fenetre { background: var(--carte); width: min(640px, 100%); max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 20px 28px; box-shadow: 0 -4px 30px rgba(0,0,0,.2); }
.fenetre h2 { margin-bottom: 4px; }
.fenetre .pied { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.fenetre.visionneuse { width: min(1000px, 100%); height: 92vh; display: flex; flex-direction: column; padding: 14px; }
.visionneuse .cadre { flex: 1; min-height: 0; border-radius: 10px; overflow: auto; background: var(--gris-clair); display: grid; place-items: center; }
.visionneuse iframe { width: 100%; height: 100%; border: 0; }
.visionneuse img { max-width: 100%; max-height: 100%; object-fit: contain; }
.visionneuse pre { white-space: pre-wrap; padding: 16px; align-self: start; justify-self: start; }
@media (min-width: 720px) { .voile { place-items: center; padding: 20px; } .fenetre { border-radius: 20px; } }

/* Dépôt de fichiers */
.sources { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.sources .btn { padding: 12px 10px; white-space: normal; }
.sources .btn:nth-child(3) { grid-column: 1 / -1; }
.zone-depot { border: 2px dashed var(--bord); border-radius: 14px; padding: 14px; text-align: center; color: var(--gris); background: var(--fond); cursor: pointer; font-size: 13px; }
@media (max-width: 719px) { .zone-depot { display: none; } }
.zone-depot.survol { border-color: var(--violet); background: var(--violet-clair); }
.zone-depot strong { color: var(--violet-fonce); }
.fichiers-en-cours { margin-top: 12px; }
.fichier-statut { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--gris-clair); margin-bottom: 6px; font-size: 13.5px; }
.fichier-statut .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.fichier-statut.ok { background: var(--vert-clair); } .fichier-statut.ko { background: var(--rouge-clair); }
.selection-docs { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; border: 1.5px solid var(--bord); border-radius: 10px; padding: 8px; }
.selection-docs label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 8px; border-radius: 8px; font-weight: 600; color: var(--texte); cursor: pointer; font-size: 14px; }
.selection-docs label:hover { background: var(--gris-clair); }
.selection-docs input { width: 18px; height: 18px; accent-color: var(--violet); }
.selection-docs .groupe { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--gris); font-weight: 800; padding: 6px 8px 0; }

/* Réviser */
.etape { margin-bottom: 18px; }
.etape h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.etape h2 .num { width: 28px; height: 28px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; font-size: 14px; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mode { border: 1.5px solid var(--bord); border-radius: 12px; padding: 14px; background: #fff; cursor: pointer; text-align: left; }
.mode:hover { border-color: var(--violet); }
.mode strong { display: block; margin-bottom: 4px; }
.mode span { color: var(--gris); font-size: 13px; }
.progression { display: flex; align-items: center; gap: 10px; color: var(--gris); font-size: 14px; padding: 8px 0; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--violet-clair); border-top-color: var(--violet); border-radius: 50%; animation: tourne .8s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Contenu Markdown */
.md { line-height: 1.6; }
.md h1 { font-size: 22px; margin: 0 0 12px; color: var(--violet-fonce); }
.md h2 { font-size: 17px; margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--violet-clair); color: var(--violet-fonce); }
.md h3 { font-size: 15px; margin: 14px 0 6px; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin-bottom: 4px; }
.md strong { color: var(--violet-fonce); }
.md blockquote { margin: 10px 0; padding: 10px 14px; border-left: 4px solid var(--corail); background: var(--corail-clair); border-radius: 0 8px 8px 0; }
.md table { border-collapse: collapse; margin: 10px 0; width: 100%; }
.md th, .md td { border: 1px solid var(--bord); padding: 6px 10px; text-align: left; }
.md code { background: var(--gris-clair); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.md pre { background: var(--gris-clair); padding: 12px; border-radius: 8px; overflow: auto; }
.md .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }

/* Quiz */
.quiz-question { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.quiz-choix { display: flex; flex-direction: column; gap: 8px; }
.quiz-choix button { text-align: left; border: 1.5px solid var(--bord); background: #fff; padding: 12px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.quiz-choix button:hover:not(:disabled) { border-color: var(--violet); }
.quiz-choix button.bonne { border-color: var(--vert); background: var(--vert-clair); }
.quiz-choix button.mauvaise { border-color: var(--rouge); background: var(--rouge-clair); }
.quiz-explication { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--violet-clair); }
.quiz-score { text-align: center; padding: 20px; }
.quiz-score .gros { font-size: 42px; font-weight: 800; color: var(--violet); }
.barre-prog { height: 6px; background: var(--gris-clair); border-radius: 3px; margin-bottom: 16px; overflow: hidden; }
.barre-prog div { height: 100%; background: var(--violet); border-radius: 3px; transition: width .3s; }

/* Flashcards */
.flash { perspective: 1200px; height: 260px; cursor: pointer; margin-bottom: 14px; }
.flash .interieur { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.flash.retournee .interieur { transform: rotateY(180deg); }
.flash .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 18px; font-weight: 700; box-shadow: var(--ombre); overflow: auto; }
.flash .recto { background: var(--carte); border: 2px solid var(--violet-clair); }
.flash .verso { background: var(--violet); color: #fff; transform: rotateY(180deg); font-weight: 600; }
.flash .face small { position: absolute; top: 10px; left: 14px; font-size: 11px; opacity: .6; text-transform: uppercase; letter-spacing: .08em; }

/* Aide (chat) */
.aide-vue { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.conversations { display: flex; flex-direction: column; gap: 6px; }
.conversations .ligne { padding: 8px 10px; }
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
.chat .messages { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 4px 0 16px; }
.bulle { max-width: 88%; padding: 12px 14px; border-radius: 16px; line-height: 1.5; }
.bulle.moi { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bulle.prof { align-self: flex-start; background: var(--carte); box-shadow: var(--ombre); border-bottom-left-radius: 4px; }
.bulle.prof .md p:last-child { margin-bottom: 0; }
.bulle.systeme { align-self: center; background: transparent; color: var(--gris); font-size: 13px; text-align: center; }
.chat .saisie { position: sticky; bottom: calc(var(--nav-h) + 8px); background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.chat .saisie textarea { min-height: 44px; max-height: 160px; border: 0; padding: 8px 6px; background: transparent; }
.chat .saisie textarea:focus { box-shadow: none; }
.chat .saisie .barre { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chat .saisie .barre .btn.principal { margin-left: auto; }
.contexte-chat { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--gris); margin-bottom: 10px; }
.contexte-chat .chip { cursor: pointer; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); background: var(--texte); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: 0 4px 20px rgba(0,0,0,.25); max-width: 90vw; }
#toast.erreur { background: var(--rouge); }

/* Mobile */
@media (max-width: 719px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  html, body { overflow-x: hidden; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: var(--nav-h); border-right: 0; border-top: 1px solid var(--bord); padding: 0 6px env(safe-area-inset-bottom); flex-direction: row; z-index: 40; }
  .nav .logo, .nav .deconnexion { display: none; }
  .nav nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav nav a { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 11px; flex: 1; align-items: center; }
  .nav nav a.actif { background: transparent; }
  main { padding: 16px 16px calc(var(--nav-h) + 24px); }
  .raccourcis { grid-template-columns: 1fr; }
  .grille-2 { grid-template-columns: 1fr; }
  .aide-vue { grid-template-columns: 1fr; }
  .aide-vue .conversations.masque-mobile { display: none; }
  .chat { min-height: calc(100vh - var(--nav-h) - 100px); }
  .bulle { max-width: 94%; }
  .bonjour h1 { font-size: 22px; }
}
@media (min-width: 720px) { .chat .saisie { bottom: 12px; } #toast { bottom: 24px; } .retour-mobile { display: none; } }

/* Aujourd'hui, plan de révision, à revoir */
.carte.aujourdhui { border-left: 6px solid var(--corail); margin-bottom: 18px; }
.tache { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.tache + .tache { border-top: 1px solid var(--bord); }
.tache .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tache .corps span { color: var(--gris); font-size: 13px; }
.tache .pastille { font-size: 15px; }
.ensuite { margin: 10px 0 0; }
.plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin-bottom: 10px; }
.plan .etape { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1.5px solid var(--bord); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font-size: 13px; font-weight: 700; color: var(--texte); margin: 0; }
.plan .etape small { margin-left: auto; color: var(--gris); font-weight: 600; white-space: nowrap; }
.plan .etape .coche { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bord); flex: none; }
.plan .etape.due { border-color: var(--corail); background: var(--corail-clair); }
.plan .etape.due small { color: #c75a3a; }
.plan .etape.faite { opacity: .7; }
.plan .etape.faite .coche { background: var(--vert); border-color: var(--vert); position: relative; }
.plan .etape.faite .coche::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.bandeau-plan { display: flex; align-items: center; gap: 12px; background: var(--corail-clair); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.bandeau-plan .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bandeau-plan .corps span { color: #8a4a34; font-size: 13px; }
@media (max-width: 719px) { .tache { flex-wrap: wrap; } .tache .btn { width: 100%; } .plan { grid-template-columns: 1fr; } }
