/* SIGE Élèves — feuille de style de l'application des élèves (PWA, v0.67 ; refonte « calme et net », v0.82).
   Autonome (aucune police ni ressource externe), pensée pour le téléphone : 320 px de large sans défilement
   horizontal, zones tactiles de 44 px, contrastes WCAG AA, thème sombre automatique.
   Principes : fond neutre, listes GROUPÉES (un cadre, des lignes séparées par un trait fin) plutôt que des cartes
   empilées, aucune ombre hors des éléments flottants, le vert réservé aux actions et à l'état « maintenant »,
   casse normale partout (pas de petites capitales espacées). Toute couleur vient d'une variable de :root. */
:root {
  --fond: #f1f3f2;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --remplissage: rgba(118, 118, 128, .12);
  --encre: #101413;
  --discret: #6b706e;
  --tres-discret: #9a9f9c;
  --ligne: rgba(60, 60, 67, .14);
  --vert: #0e7a52;
  --vert-fonce: #0a5c3d;
  --vert-clair: #e5f3ec;
  --sur-vert: #ffffff;
  --sur-vert-discret: rgba(255, 255, 255, .78);
  --fort: #0e7a52;
  --fort-profond: #08503a;
  --fort-reflet: rgba(255, 255, 255, .2);
  --fort-ombre: 0 14px 32px rgba(10, 92, 62, .28), 0 2px 6px rgba(10, 92, 62, .18);
  --sur-fort: #ffffff;
  --sur-fort-discret: rgba(255, 255, 255, .78);
  /* Identité SIGE : le vert profond du logo et son étincelle dorée */
  --or: #f2b431;
  --or-halo: rgba(242, 180, 49, .35);
  --vert-haut: #149a64;
  --bouton-reflet: rgba(255, 255, 255, .28);
  --bouton-ombre: 0 6px 16px rgba(14, 122, 82, .28);
  /* Relief des cartes : une ombre très douce en clair, un liseré de lumière en haut en sombre */
  --carte-reflet: rgba(255, 255, 255, 0);
  --carte-ombre: 0 1px 2px rgba(16, 40, 28, .05), 0 6px 18px rgba(16, 40, 28, .06);
  --ambre: #9a5b00;
  --ambre-clair: #fff4dc;
  --rouge: #c0261a;
  --rouge-clair: #fde8e6;
  --bleu: #1a64c4;
  --bleu-clair: #e6effc;
  --flottant: 0 8px 30px rgba(0, 0, 0, .14);
  /* Verre (esprit « Liquid Glass » d'iOS 26) : réservé à ce qui FLOTTE au-dessus du contenu */
  --verre: rgba(255, 255, 255, .56);
  --verre-actif: rgba(118, 118, 128, .16);
  --verre-bord: rgba(255, 255, 255, .75);
  --verre-reflet: rgba(255, 255, 255, .95);
  --verre-creux: rgba(0, 0, 0, .05);
  --verre-ombre: 0 10px 30px rgba(15, 30, 22, .13), 0 1px 3px rgba(0, 0, 0, .06);
  --verre-flou: blur(22px) saturate(190%);
  --ambiance-1: rgba(14, 122, 82, .13);
  --ambiance-2: rgba(47, 125, 209, .09);
  --voile-haut: rgba(242, 242, 244, .9);
  --pouce: #ffffff;
  --pouce-ombre: 0 1px 3px rgba(0, 0, 0, .18), 0 3px 8px rgba(0, 0, 0, .08);
  --t-vert: #1f9d68; --t-bleu: #2f7dd1; --t-lilas: #8a63d2; --t-ambre: #d08a0c; --t-corail: #e0644f; --t-sarcelle: #12908e;
  --rayon: 20px;
  --rayon-sm: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #070908;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --remplissage: rgba(118, 118, 128, .24);
    --encre: #f4f5f4;
    --discret: #a0a5a2;
    --tres-discret: #6f7471;
    --ligne: rgba(84, 84, 88, .55);
    --vert: #34c77f;
    --vert-fonce: #6fdcab;
    --vert-clair: #12301f;
    --sur-vert: #04140c;
    --sur-vert-discret: rgba(4, 20, 12, .7);
    --fort: #13643f;
    --fort-profond: #0a3523;
    --fort-reflet: rgba(140, 240, 190, .16);
    --fort-ombre: 0 14px 32px rgba(0, 0, 0, .55);
    --sur-fort: #f2fbf6;
    --sur-fort-discret: rgba(242, 251, 246, .72);
    --or: #ffc94d;
    --or-halo: rgba(255, 201, 77, .3);
    --vert-haut: #5be0a1;
    --bouton-reflet: rgba(255, 255, 255, .3);
    --bouton-ombre: 0 6px 16px rgba(0, 0, 0, .45);
    --carte-reflet: rgba(255, 255, 255, .07);
    --carte-ombre: 0 1px 2px rgba(0, 0, 0, .4);
    --ambre: #ffc24d;
    --ambre-clair: #2e2410;
    --rouge: #ff7b6e;
    --rouge-clair: #351816;
    --bleu: #7fb3ff;
    --bleu-clair: #14243b;
    --flottant: 0 8px 30px rgba(0, 0, 0, .6);
    --verre: rgba(44, 44, 48, .5);
    --verre-actif: rgba(255, 255, 255, .12);
    --verre-bord: rgba(255, 255, 255, .14);
    --verre-reflet: rgba(255, 255, 255, .2);
    --verre-creux: rgba(0, 0, 0, .35);
    --verre-ombre: 0 10px 30px rgba(0, 0, 0, .55);
    --ambiance-1: rgba(52, 199, 127, .16);
    --ambiance-2: rgba(127, 179, 255, .1);
    --voile-haut: rgba(0, 0, 0, .85);
    --pouce: #ffffff;
    --pouce-ombre: 0 1px 3px rgba(0, 0, 0, .4);
  }
}

/* Repli OPAQUE : réglage « réduire la transparence » du téléphone, ou navigateur sans flou d'arrière-plan
   (anciens Android) — le verre devient une surface pleine, lisible. Variables seulement. */
@media (prefers-reduced-transparency: reduce) {
  :root { --verre: var(--surface); --verre-flou: none; --ambiance-1: transparent; --ambiance-2: transparent; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --verre: var(--surface); --verre-flou: none; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overflow-x: clip; }   /* jamais de défilement horizontal de la page */
body {
  margin: 0; min-height: 100vh; background: var(--fond); color: var(--encre);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
  overflow-x: clip;            /* doublé sur body : Safari iOS n'applique pas toujours celui de html */
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 45% at 100% 0%, var(--ambiance-1), transparent 70%),
              radial-gradient(55% 40% at 0% 100%, var(--ambiance-2), transparent 70%);
}
.carte, .carte-ecole, .a-savoir, .carte-bulletin, .statut-bulletins, .onglets-jours, .colonne-jour, .liste-classes,
.resultat-ecole.choisie, .bandeau-installation, .statut-notif, .bouton-contour {
  box-shadow: inset 0 1px 0 var(--carte-reflet), var(--carte-ombre);
}
.verre, .marque, .barre-actions, .navigation-bas, .semaine button, .tirer-actualiser, .bulle-info {
  background: var(--verre); border: .5px solid var(--verre-bord);
  backdrop-filter: var(--verre-flou); -webkit-backdrop-filter: var(--verre-flou);
  box-shadow: inset 0 1px 0 var(--verre-reflet), inset 0 -1px 0 var(--verre-creux), var(--verre-ombre);
}
a { color: var(--vert); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
button:active, a:active { opacity: .7; }
:focus-visible { outline: 3px solid var(--vert); outline-offset: 2px; border-radius: 10px; }
.icone { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.22em; }
.evitement { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .6rem 1rem; z-index: 50; }
.evitement:focus { left: .5rem; top: .5rem; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- barre du haut */
.barre {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: calc(.5rem + env(safe-area-inset-top)) max(16px, calc((100% - 640px) / 2)) .9rem;
  background: linear-gradient(to bottom, var(--voile-haut) 55%, transparent);
}
.marque { display: inline-flex; align-items: center; gap: .5rem; color: var(--encre); text-decoration: none; min-height: 44px; padding: 0 .9rem 0 .4rem; border-radius: 999px;
  flex: 0 1 auto; min-width: 0; overflow: hidden; }
.marque img { width: 30px; height: 30px; border-radius: 50%; }
.marque > span { display: flex; align-items: baseline; gap: .3rem; min-width: 0; white-space: nowrap; }
.marque strong { font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; }
.marque small { font-size: 1.05rem; font-weight: 500; color: var(--discret); }
.barre-actions { display: flex; align-items: center; gap: 0; padding: 2px 3px; border-radius: 999px; min-height: 44px; flex: none; }
/* Pastille « Hors ligne » / « Erreur serveur » affichée : elle prend la place du mot « Élèves » (sur téléphone, l'en-tête
   dépassait l'écran et toute la page glissait vers la gauche, laissant un vide à droite — constaté par Ali le 29/10/2026). */
.barre:has(.reseau.hors-ligne, .reseau.erreur) .marque small { display: none; }
/* Paliers nets plutôt qu'un mot rogné : sous 375 px, « SIGE » seul ; sous 360 px avec la pastille, le logo seul. */
@media (max-width: 374px) { .marque small { display: none; } }
@media (max-width: 359px) { .barre:has(.reseau.hors-ligne, .reseau.erreur) .marque > span { display: none; }
  .barre:has(.reseau.hors-ligne, .reseau.erreur) .marque { padding: 0 .4rem; } }
/* État du réseau : un simple point quand tout va bien (le texte reste lu par les lecteurs d'écran), une pastille
   lisible seulement s'il y a quelque chose à savoir. */
.reseau { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; color: var(--discret); white-space: nowrap; margin: 0 .2rem 0 .4rem; }
.reseau i { width: 7px; height: 7px; border-radius: 50%; background: var(--vert); }
.reseau.en-ligne span, .reseau.en-cours span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.reseau.hors-ligne, .reseau.erreur { padding: .25rem .55rem; border-radius: 999px; background: var(--remplissage); }
.reseau.hors-ligne { color: var(--ambre); background: var(--ambre-clair); }
.reseau.hors-ligne i { background: var(--ambre); }
.reseau.erreur { color: var(--rouge); background: var(--rouge-clair); }
.reseau.erreur i { background: var(--rouge); }
.reseau.en-cours i { animation: pulsation 1s ease-in-out infinite; }
@keyframes pulsation { 50% { opacity: .25; } }
.bouton-rond {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0;
  background: transparent; color: var(--encre); text-decoration: none;
}
.bouton-rond .icone { width: 22px; height: 22px; stroke-width: 1.8; }
.bouton-rond:hover, .bouton-rond:active { background: var(--verre-actif); }

/* « Tirer pour actualiser » (application installée) : la pastille sort de sous la barre et suit le doigt (--tirage,
   posée par le script). Cachée au repos ; elle reste visible pendant la mise à jour. */
.tirer-actualiser {
  position: fixed; z-index: 19; left: 50%; top: calc(env(safe-area-inset-top) + 62px);
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px;
  color: var(--discret); font-size: .82rem; font-weight: 600; white-space: nowrap; pointer-events: none;
  transform: translate(-50%, calc(var(--tirage, 0px) - 100%)); opacity: 0;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s ease;
}
.tirer-actualiser.tire { opacity: 1; transition: none; }
.tirer-actualiser.pret, .tirer-actualiser.actualise { opacity: 1; color: var(--vert); }
.tirer-actualiser .fleche { display: inline-block; font-size: 1rem; line-height: 1; transition: transform .2s ease; }
.tirer-actualiser.pret .fleche { transform: rotate(180deg); }
.tirer-actualiser.actualise .fleche { animation: tourner .9s linear infinite; }
@keyframes tourner { to { transform: rotate(360deg); } }
/* Bouton « Actualiser » : l'icône tourne pendant la mise à jour, puis une bulle annonce le résultat. */
.bouton-rond.tourne .icone { animation: tourner .8s linear infinite; }
.bulle-info {
  position: fixed; z-index: 25; left: 50%; top: calc(env(safe-area-inset-top) + 64px); max-width: calc(100% - 32px);
  padding: .55rem 1rem; border-radius: 999px; font-size: .88rem; font-weight: 600; color: var(--encre); text-align: center;
  opacity: 0; transform: translate(-50%, -8px) scale(.96); pointer-events: none;
  transition: opacity .2s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.bulle-info.visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
.bulle-info.alerte { color: var(--ambre); }
.bulle-info.erreur { color: var(--rouge); }

/* ---------------------------------------------------------------- contenu et typographie */
main { max-width: 640px; margin: 0 auto; padding: .6rem 16px 1.5rem; outline: none; }
.vue > :first-child { margin-top: .4rem; }
.vue > * + * { margin-top: .85rem; }
.vue { animation: apparition .22s ease-out; }
@keyframes apparition { from { opacity: .5; transform: translateY(4px); } }
h1 { margin: .2rem 0 0; font-size: 2.05rem; line-height: 1.1; font-weight: 750; letter-spacing: -.025em; outline: none; }
h2 { margin: 0; font-size: 1.2rem; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.sous-titre { margin: .3rem 0 0; color: var(--discret); font-size: .98rem; }
.chapeau { margin: .35rem 0 0; color: var(--discret); font-size: .95rem; }
.legende { margin: 1.6rem 0 -.35rem !important; padding: 0 .25rem; font-size: .84rem; font-weight: 600; color: var(--discret); }
.titre-section { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-top: 1.6rem !important; padding: 0 .1rem; }
.lien-texte { font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .15rem; min-height: 32px; }
.lien-texte .icone { width: 1em; height: 1em; }

/* Cadre groupé : le conteneur de toutes les listes */
.carte { background: var(--surface); border-radius: var(--rayon); padding: .25rem 1rem; }
.alerte-carte { background: var(--ambre-clair); color: var(--ambre); padding: 1rem; }

/* boutons */
.bouton-principal {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 50px; padding: 0 1.4rem;
  border-radius: 14px; background: linear-gradient(180deg, var(--vert-haut), var(--vert)); color: var(--sur-vert);
  font-weight: 650; font-size: 1.02rem; text-decoration: none; border: 0;
  box-shadow: inset 0 1px 0 var(--bouton-reflet), var(--bouton-ombre);
}
.bouton-principal.large { width: 100%; }
.bouton-contour {
  display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 50px;
  border-radius: 14px; border: 0; background: var(--surface); font-weight: 600; color: var(--vert);
}
.bouton-contour.danger, .bouton-discret.danger { color: var(--rouge); }
.bouton-discret {
  min-height: 34px; min-width: 34px; padding: 0 .8rem; border-radius: 999px; border: 0; background: var(--remplissage);
  font-weight: 600; font-size: .85rem; display: inline-grid; place-items: center; color: var(--vert);
}
.bouton-discret .icone { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- accueil */
.salut h1 { font-size: 2.2rem; }
.accueil-vide { text-align: center; padding: 2.2rem 1.4rem 1.8rem; }
.accueil-vide img { border-radius: 16px; }
.accueil-vide h2 { margin-top: 1rem; font-size: 1.3rem; }
.accueil-vide p { color: var(--discret); margin: .5rem auto 1.4rem; max-width: 26rem; }
/* Classe affichée : une ligne sobre, qui mène au choix des classes */
.carte-ecole {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: var(--rayon);
  text-decoration: none; color: inherit; background: var(--surface);
}
.ecole-texte { flex: 1; display: grid; min-width: 0; }
.ecole-texte strong { font-size: 1.05rem; font-weight: 650; }
.ecole-texte span { color: var(--discret); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.changer { display: inline-flex; align-items: center; gap: .1rem; color: var(--tres-discret); font-size: .9rem; }
.puces-classes { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .1rem; scrollbar-width: none; }
.puces-classes::-webkit-scrollbar { display: none; }
.puce { flex: none; min-height: 36px; padding: 0 1rem; border-radius: 999px; border: 0; background: var(--remplissage); font-weight: 600; font-size: .9rem; }
.puce.active { background: linear-gradient(180deg, var(--vert-haut), var(--vert)); color: var(--sur-vert); box-shadow: inset 0 1px 0 var(--bouton-reflet); }

/* Maintenant / ensuite : le cours en cours (ou le prochain) en grand, l'information la plus utile de la journée */
.maintenant {
  position: relative; overflow: hidden; border-radius: 26px; padding: 1.2rem 1.25rem 1.15rem; color: var(--sur-fort);
  background: radial-gradient(90% 80% at 100% 0%, var(--fort-reflet), transparent 60%),
              linear-gradient(155deg, var(--fort) 0%, var(--fort-profond) 100%);
  box-shadow: inset 0 1px 0 var(--fort-reflet), var(--fort-ombre);
}
.maintenant .quand { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .9rem; font-weight: 600; color: var(--sur-fort-discret); }
.maintenant .quand span { display: inline-flex; align-items: center; gap: .45rem; }
.maintenant .quand span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--or); box-shadow: 0 0 0 4px var(--or-halo); }
.maintenant.en-direct .quand span::before { animation: battement 2s ease-in-out infinite; }
@keyframes battement { 50% { box-shadow: 0 0 0 7px transparent; } }
.maintenant .quand b { color: var(--sur-fort); font-weight: 650; }
.maintenant h2 { margin-top: .45rem; font-size: 1.7rem; line-height: 1.12; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.maintenant .details { margin: .3rem 0 0; color: var(--sur-fort-discret); font-size: .95rem; }
.maintenant .details.alerte { color: var(--sur-fort); font-weight: 650; }
.avancement { height: 5px; margin-top: 1rem; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--sur-fort) 28%, transparent); }
.avancement > span { display: block; height: 100%; width: var(--avancement, 0%); border-radius: 999px; background: linear-gradient(90deg, var(--sur-fort), var(--or)); }
.ensuite { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 0; padding-top: .85rem; border-top: 1px solid var(--sur-fort-discret); font-size: .93rem; }
.ensuite span:first-child { color: var(--sur-fort-discret); }
.ensuite strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.ensuite b { font-variant-numeric: tabular-nums; font-weight: 650; }

/* ---------------------------------------------------------------- journée et cours (lignes d'une liste groupée) */
.journee { display: grid; }
.cours {
  display: grid; grid-template-columns: 3.3rem 4px 1fr auto; align-items: center; column-gap: .8rem;
  padding: .8rem 0; border-top: .5px solid var(--ligne);
}
.journee > :first-child { border-top: 0; }
.cours .heure { font-weight: 650; font-variant-numeric: tabular-nums; display: grid; line-height: 1.2; font-size: .95rem; }
.cours .heure small { font-weight: 400; color: var(--discret); font-size: .85rem; }
.cours .trait { align-self: stretch; border-radius: 4px; background: var(--teinte, var(--vert)); }
.cours .matiere { display: grid; min-width: 0; }
.cours .matiere strong { font-weight: 600; overflow-wrap: anywhere; }
.cours .matiere small { color: var(--discret); font-size: .86rem; }
.cours .etiquette { font-size: .75rem; font-weight: 650; color: var(--vert); background: var(--vert-clair); padding: .25rem .55rem; border-radius: 999px; white-space: nowrap; }
.cours.actuel .heure, .cours.actuel .matiere strong { color: var(--vert); }
.cours.passe { opacity: .45; }
.cours.change .detail-change { color: var(--ambre); font-weight: 600; }
.cours .etiquette.alerte { color: var(--ambre); background: var(--ambre-clair); }
.cours.change-annule .matiere strong { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--discret); }
.cours.change-annule .detail-change, .cours.change-annule .etiquette.alerte { color: var(--rouge); }
.cours.change-annule .etiquette.alerte { background: var(--rouge-clair); }
.pause-ligne { display: flex; align-items: center; gap: .6rem; color: var(--discret); font-size: .82rem; padding: .55rem 0; border-top: .5px solid var(--ligne); }
.pause-ligne > span { flex: 1; height: 0; border-top: 1px dashed var(--ligne); }
.pause-ligne b { font-weight: 600; }
.pause-ligne small { font-variant-numeric: tabular-nums; font-size: .82rem; }
.teinte-vert { --teinte: var(--t-vert); } .teinte-bleu { --teinte: var(--t-bleu); } .teinte-lilas { --teinte: var(--t-lilas); }
.teinte-ambre { --teinte: var(--t-ambre); } .teinte-corail { --teinte: var(--t-corail); } .teinte-sarcelle { --teinte: var(--t-sarcelle); }
.evenement { display: flex; align-items: center; gap: .55rem; margin: .7rem 0 .2rem; padding: .6rem .75rem; border-radius: var(--rayon-sm); background: var(--bleu-clair); color: var(--bleu); font-weight: 600; font-size: .9rem; }
.sans-cours { display: flex; align-items: center; gap: .75rem; padding: 1rem 0; color: var(--ambre); }
.sans-cours span { display: grid; }
.sans-cours small { color: var(--discret); }
.etat-vide { display: grid; justify-items: center; text-align: center; gap: .3rem; padding: 1.6rem .5rem; }
.etat-vide strong { font-weight: 650; }
.etat-vide p { margin: 0; color: var(--discret); font-size: .92rem; max-width: 26rem; }
.etat-vide .bouton-principal { margin-top: .9rem; }
.etat-vide .pastille { background: transparent; color: var(--tres-discret); width: auto; height: auto; margin-bottom: .2rem; }
.etat-vide .pastille .icone { width: 34px; height: 34px; stroke-width: 1.5; }
.pastille { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--vert-clair); color: var(--vert); flex: none; }
.fraicheur { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: 1.2rem 0 0; font-size: .8rem; color: var(--tres-discret); text-align: center; }
.fraicheur .icone { width: 14px; height: 14px; }
.fraicheur.alerte { color: var(--ambre); }
.fraicheur.erreur { color: var(--rouge); justify-content: flex-start; text-align: left; font-size: .88rem; }

/* À savoir : les changements à venir, sans rien rater */
.a-savoir { border-radius: var(--rayon); padding: .9rem 1rem .5rem; background: var(--surface); }
.a-savoir .titre-a-savoir { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 700; font-size: 1rem; color: var(--ambre); }
.a-savoir ul { list-style: none; margin: .5rem 0 .1rem; padding: 0; }
.a-savoir li { display: flex; gap: .55rem; align-items: baseline; font-size: .93rem; padding: .45rem 0; border-top: .5px solid var(--ligne); }
.a-savoir li:first-child { border-top: 0; }
.a-savoir li::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ambre); transform: translateY(-.1em); }
.a-savoir li.grave::before { background: var(--rouge); }
.a-savoir li .icone { display: none; }
.a-savoir .lien-texte { min-height: 40px; }

/* Bulletins (ligne de l'accueil) */
.carte-bulletin { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; border-radius: var(--rayon); background: var(--surface); text-decoration: none; color: inherit; }
.carte-bulletin .texte { flex: 1; display: grid; min-width: 0; }
.carte-bulletin strong { font-weight: 600; }
.carte-bulletin small { color: var(--discret); font-size: .86rem; }
.carte-bulletin > .icone { color: var(--tres-discret); }
.etat-prets .pastille { background: var(--vert-clair); color: var(--vert); }
.etat-bulletins_en_preparation .pastille, .etat-resultats_en_preparation .pastille { background: var(--ambre-clair); color: var(--ambre); }
.etat-a_venir .pastille, .etat-indisponible .pastille { background: var(--remplissage); color: var(--discret); }

/* ---------------------------------------------------------------- planning */
/* Semaine : flèches et période sur une ligne, puis les jours comme dans un calendrier */
.semaine { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .1rem; }
.semaine strong { font-size: 1rem; font-weight: 650; }
.semaine button { width: 42px; height: 42px; border-radius: 50%; font-size: 1.35rem; line-height: 1; color: var(--vert); }
/* Contrôle segmenté (modes, périodes) */
.modes, .onglets-periodes { display: flex; gap: 2px; background: var(--remplissage); border-radius: 10px; padding: 2px; }
.modes button, .onglets-periodes button { flex: 1; min-height: 34px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: .88rem; color: var(--encre); white-space: nowrap; padding: 0 .4rem; }
.modes button.active, .onglets-periodes button.active { background: var(--pouce); color: var(--encre); box-shadow: var(--pouce-ombre); }
@media (prefers-color-scheme: dark) { .modes button.active, .onglets-periodes button.active { background: var(--surface-2); } }
.onglets-jours { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .2rem; background: var(--surface); border-radius: var(--rayon); padding: .55rem .4rem; }
.onglets-jours button { display: grid; justify-items: center; gap: .3rem; min-height: 60px; border: 0; background: transparent; font-size: .76rem; font-weight: 500; color: var(--discret); padding: 0; }
.onglets-jours button b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-size: 1.05rem; font-weight: 600; color: var(--encre); font-variant-numeric: tabular-nums; }
.onglets-jours button.aujourdhui b { color: var(--vert); }
.onglets-jours button.active b { background: linear-gradient(180deg, var(--vert-haut), var(--vert)); color: var(--sur-vert); box-shadow: inset 0 1px 0 var(--bouton-reflet), var(--bouton-ombre); }
.bandeau-date { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; margin-top: 1.4rem !important; padding: 0 .1rem; }
.bandeau-date strong { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; }
.bandeau-date small { color: var(--discret); font-size: .9rem; }
.grille-semaine { display: grid; gap: .75rem; }
.colonne-jour { background: var(--surface); border-radius: var(--rayon); padding: .8rem 1rem .3rem; }
.colonne-jour h2 { font-size: 1rem; margin: 0 0 .2rem; }
.colonne-jour.aujourdhui h2 { color: var(--vert); }
.journee.compacte .cours { padding: .6rem 0; }
.journee.compacte .etat-vide { padding: .6rem 0 .9rem; justify-items: start; text-align: left; }
.journee.compacte .etat-vide .pastille { display: none; }
.liste-semaine { padding-bottom: .4rem; }
.jour-liste { font-size: 1rem; margin: 1.1rem 0 .1rem !important; }
.jour-liste:first-child { margin-top: .6rem !important; }
.jour-liste.aujourdhui { color: var(--vert); }
@media (min-width: 720px) {
  .grille-semaine { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ---------------------------------------------------------------- bulletins (page) */
.statut-bulletins { padding: 1.2rem 1.2rem 1rem; background: var(--surface); border-radius: 24px; }
.statut-bulletins h2 { font-size: 1.45rem; margin-top: .7rem; letter-spacing: -.02em; }
.statut-bulletins > p { color: var(--discret); margin: .4rem 0 0; }
.badge-etat { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 650; background: var(--remplissage); color: var(--discret); }
.badge-etat .icone { width: 15px; height: 15px; }
.etat-prets .badge-etat { background: var(--vert-clair); color: var(--vert); }
.etat-bulletins_en_preparation .badge-etat, .etat-resultats_en_preparation .badge-etat { background: var(--ambre-clair); color: var(--ambre); }
.suivi { list-style: none; margin: 1.1rem 0 0; padding: 0; }
.suivi li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-top: .5px solid var(--ligne); color: var(--discret); }
.suivi li > span:nth-child(2) { flex: 1; }
.suivi .rond { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--ligne); flex: none; }
.suivi .rond .icone { width: 14px; height: 14px; stroke-width: 3; }
.suivi li.faite { color: var(--encre); }
.suivi li.faite .rond { background: var(--vert); border-color: var(--vert); color: var(--sur-vert); }
.suivi small { font-size: .85rem; color: var(--discret); }
.mis-a-jour { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--tres-discret); margin-top: .5rem; }
.mis-a-jour .icone { width: 14px; height: 14px; }
.note-discrete { display: flex; gap: .55rem; align-items: flex-start; margin: 1.2rem 0 0 !important; padding: 0 .3rem; color: var(--discret); font-size: .85rem; }
.note-discrete .icone { color: var(--tres-discret); margin-top: .05rem; }
.note-discrete strong { color: var(--encre); font-weight: 600; }

/* ---------------------------------------------------------------- aide */
.liste-aide { padding: .2rem 1rem; }
.bloc-aide { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 0; border-top: .5px solid var(--ligne); }
.bloc-aide:first-child { border-top: 0; }
.bloc-aide > .icone { color: var(--vert); width: 22px; height: 22px; margin-top: .1rem; }
.bloc-aide h2 { font-size: 1rem; font-weight: 650; }
.bloc-aide p { margin: .2rem 0 0; color: var(--discret); font-size: .92rem; }

/* ---------------------------------------------------------------- classes */
.recherche { display: flex; align-items: center; gap: .5rem; background: var(--remplissage); border-radius: var(--rayon-sm); padding: 0 .3rem 0 .75rem; }
.recherche > .icone { color: var(--discret); }
.recherche input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; outline: none; font-size: 1rem; }
.recherche input::placeholder { color: var(--discret); }
.recherche input::-webkit-search-cancel-button { display: none; }
.recherche button { min-height: 34px; padding: 0 .8rem; border-radius: 9px; border: 0; background: transparent; color: var(--vert); font-weight: 650; }
.liste-classes { background: var(--surface); border-radius: var(--rayon); padding: 0 0 0 1rem; overflow: hidden; }
.ligne-classe, .resultat-ecole {
  display: flex; align-items: center; gap: .75rem; width: 100%; text-align: left; min-height: 60px; padding: .55rem 1rem .55rem 0;
  border: 0; border-top: .5px solid var(--ligne); background: transparent; color: inherit;
}
.liste-classes > :first-child { border-top: 0; }
.ligne-classe .texte, .resultat-ecole > span { flex: 1; display: grid; min-width: 0; }
.ligne-classe strong, .resultat-ecole strong { font-weight: 600; }
.ligne-classe small, .resultat-ecole small { color: var(--discret); font-size: .86rem; }
.resultat-ecole img { width: 36px; height: 36px; border-radius: 9px; }
.resultat-ecole > .icone { color: var(--tres-discret); }
.resultat-ecole.choisie { background: var(--surface); border-radius: var(--rayon); padding-left: 1rem; border-top: 0; }
.ligne-classe .action { color: var(--vert); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--vert-clair); }
.ligne-classe .action .icone { width: 18px; height: 18px; stroke-width: 2.4; }
.ligne-classe.favori .action { background: linear-gradient(180deg, var(--vert-haut), var(--vert)); color: var(--sur-vert); }
.ligne-classe .badge { font-size: .78rem; font-weight: 600; color: var(--vert); padding: .25rem .1rem; }
.retour { border: 0; background: none; color: var(--vert); font-weight: 600; min-height: 40px; padding: 0 .1rem; display: inline-flex; align-items: center; gap: .1rem; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  color: var(--teinte, var(--vert)); flex: none;
  background: linear-gradient(150deg, color-mix(in srgb, var(--teinte, var(--vert)) 24%, transparent),
                                      color-mix(in srgb, var(--teinte, var(--vert)) 10%, transparent));
  box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--teinte, var(--vert)) 30%, transparent);
}
.chargement { color: var(--discret); text-align: center; font-size: .92rem; }

/* ---------------------------------------------------------------- installation et invitations */
.bandeau-installation {
  display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; padding: .85rem 1rem; border-radius: var(--rayon);
  border: 0; background: var(--surface); color: inherit; text-decoration: none;
}
.bandeau-installation > span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.bandeau-installation strong { font-weight: 600; }
.bandeau-installation small { color: var(--discret); font-size: .86rem; }
.bandeau-installation > .icone { color: var(--tres-discret); }
.bandeau-installation.statique { cursor: default; }

/* ---------------------------------------------------------------- notifications */
.choix-notif { display: grid; gap: .7rem; text-align: center; padding: 1.5rem 1.2rem; }
.choix-notif h2 { font-size: 1.15rem; }
.choix-notif .aide-notif { margin: 0; color: var(--discret); font-size: .88rem; }
.choix-secondaires { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.statut-notif { display: flex; align-items: center; gap: .55rem; margin: 0; padding: .85rem 1rem; border-radius: var(--rayon); background: var(--surface); font-weight: 600; color: var(--discret); }
.statut-notif.actif { color: var(--vert); }
.reglages-notif { display: grid; padding: .2rem 1rem; }
.reglages-notif .legende { margin: .7rem 0 .1rem !important; padding: 0; }
.classe-notif { display: grid; padding: .7rem 0 .2rem; border-top: .5px solid var(--ligne); }
.classe-notif:first-of-type { border-top: 0; }
.classe-notif strong { font-weight: 650; }
.classe-notif small { color: var(--discret); font-size: .85rem; margin-bottom: .2rem; }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 50px; cursor: pointer; font-size: .95rem; }
.interrupteur + .interrupteur { border-top: .5px solid var(--ligne); }
.interrupteur input { appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 999px; background: var(--remplissage); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: var(--pouce); box-shadow: var(--pouce-ombre); transition: left .2s cubic-bezier(.2, .8, .2, 1); }
.interrupteur input:checked { background: var(--vert); }
.interrupteur input:checked::after { left: 22px; }
.plage-silence { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; color: var(--discret); padding-bottom: .7rem; }
.plage-silence input { min-height: 40px; border: 0; border-radius: 10px; padding: 0 .7rem; background: var(--remplissage); }
.message-notif { margin: 0; padding: .8rem 1rem; border-radius: 14px; background: var(--bleu-clair); color: var(--bleu); font-weight: 600; font-size: .92rem; }
.securite-alerte { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--rayon); background: var(--rouge-clair); color: var(--rouge); font-size: .9rem; }

/* ---------------------------------------------------------------- navigation du bas */
.navigation-bas {
  position: fixed; left: 16px; right: 16px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 20; margin: 0 auto; max-width: 440px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 5px; border-radius: 999px;
}
.navigation-bas a { display: grid; justify-items: center; align-content: center; gap: .1rem; min-height: 54px; border-radius: 999px; text-decoration: none; color: var(--encre); font-size: .66rem; font-weight: 600; transition: background .2s ease, color .2s ease; }
.navigation-bas a .icone { width: 24px; height: 24px; stroke-width: 1.8; }
.navigation-bas a[aria-current="page"] { color: var(--vert); background: var(--verre-actif); }
.navigation-bas a[aria-current="page"] .icone { stroke-width: 2.3; }
.annonce-mise-a-jour {
  position: fixed; left: 16px; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 30; margin: 0 auto; max-width: 520px;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem .6rem .6rem 1rem;
  border-radius: 16px; background: var(--encre); color: var(--fond); box-shadow: var(--flottant); font-size: .92rem;
}
.annonce-mise-a-jour button { min-height: 38px; border: 0; border-radius: 10px; padding: 0 .9rem; background: var(--vert); color: var(--sur-vert); font-weight: 650; white-space: nowrap; }

@media (max-width: 360px) {
  h1 { font-size: 1.75rem; }
  .marque small { display: none; }
  .bouton-rond { width: 38px; height: 38px; }
  .maintenant h2 { font-size: 1.45rem; }
  .cours { grid-template-columns: 3rem 4px 1fr; }
  .cours .etiquette { grid-column: 3; justify-self: start; margin-top: .3rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .barre, .navigation-bas, .annonce-mise-a-jour, .bandeau-installation, .modes, .semaine, .puces-classes { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
}
