/* Brief du matin — Chrono 64
   Style « verre liquide » (inspiré de Liquid Glass d'Apple) : panneaux de verre clair,
   reflet lumineux sur les bords, formes très arrondies, commandes en capsules flottantes,
   posés sur le dégradé rouge des supports Chrono 64. */

:root {
  --rouge: #BE0613;            /* rouge du logo (couleur de marque) */
  --rouge-vif: #ff4d57;        /* rouge lisible sur le verre */
  --fond: #2a0003;

  /* Matière « verre » : presque incolore (on doit voir à travers, pas un carton blanc),
     très floue et un peu éclaircie — comme Liquid Glass, c'est surtout le bord qui dessine
     la vitre : un trait net et clair en haut, une lueur douce juste en dessous qui s'éteint
     vite, et une ombre à peine marquée tout en bas, comme l'épaisseur du verre. */
  --verre: rgba(255, 255, 255, 0.03);
  --verre-clair: rgba(255, 255, 255, 0.09);
  --verre-fort: rgba(255, 255, 255, 0.14);
  --verre-bord: rgba(255, 255, 255, 0.48);
  /* Flou plus prononcé + saturation plus haute : la matière « avale » davantage ce qu'il y a
     derrière et le restitue en couleur, au lieu d'un simple flou gris — plus proche d'une
     vraie vitre épaisse que d'un filtre. On pousse la couleur (flou, saturation, lueur, ombre)
     plutôt que le blanc (reflet, sheen) pour épaissir le verre sans le blanchir. */
  --verre-flou: blur(48px) saturate(235%) brightness(1.06);
  --reflet: inset 0 1px 0 rgba(255, 255, 255, 0.58), inset 0 8px 16px -10px rgba(255, 255, 255, 0.24),
            inset 0 -1px 0 rgba(0, 0, 0, 0.36);
  --ombre: 0 22px 54px rgba(10, 0, 2, 0.52);
  --lueur: 0 12px 48px rgba(190, 6, 19, 0.36); /* lueur chaude, comme si le verre filtrait la couleur derrière lui */
  --sheen: radial-gradient(130% 65% at 15% -12%, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0) 55%),
           linear-gradient(160deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0) 68%, rgba(255, 255, 255, 0.03) 100%);

  /* Texte */
  --texte: #ffffff;
  --texte-2: rgba(255, 255, 255, 0.82);
  --texte-3: rgba(255, 255, 255, 0.7);

  --ok: #34c759;
  --orange: #ffb340;
  --rayon-grand: 28px;
  --rayon: 20px;
  --rayon-petit: 14px;
  /* Largeur des pages sur grand écran : on profite de la place plutôt que de rester étriqué au centre.
     Le plafond est volontairement haut (un vrai grand écran doit encore gagner en largeur) ; c'est le
     95vw qui protège les marges sur les tailles plus courantes. */
  --ample: min(2200px, 95vw);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fond);
  color: var(--texte);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 1px 2px rgba(70, 0, 6, 0.28); /* lisibilité sur les zones rouge vif */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; }

/* Fond des supports Chrono 64, fixe pendant le défilement (y compris sur iPhone).
   La photo est adoucie (moins de rouge fluo, un peu assombrie) et une ombre est posée
   sur sa gauche, là où s'affiche le contenu : avec des fenêtres plus transparentes,
   c'est ce qui garde les textes lisibles. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  /* Zoomée et ancrée en haut plutôt que centrée : le bas de la photo (la zone la plus vive,
     presque orange une fois éclaircie par le verre, et où le texte perdait en lisibilité)
     est repoussé hors de l'écran — seul le haut du dégradé, le plus sombre et le plus lisible,
     reste visible, quelle que soit la hauteur de l'écran. */
  background: var(--fond) url("fond.jpg") center top / auto 160% no-repeat;
  /* Garder la saturation proche de l'originale : la baisser fait virer le rouge au
     marron/orange (un rouge désaturé n'est pas gris mais brun). On assombrit plutôt pour
     calmer le fluo — la barre du bas, en verre, sursature déjà ce qui passe derrière elle. */
  filter: saturate(100%) brightness(0.58) contrast(0.98);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, rgba(10, 0, 2, 0.55) 0%, rgba(10, 0, 2, 0.22) 32%, rgba(10, 0, 2, 0) 58%);
}
@media (max-width: 720px) { body::before { background-image: url("fond-mobile.jpg"); background-position: center top; } }

/* --- Matière verre, partagée --- */
.entete, .bandeau, .carte, .mail, .groupe, .prochain, .notifs, .terminees, .erreur, #message-flottant {
  position: relative;
  background: var(--verre);
  border: 1.5px solid var(--verre-bord);
  backdrop-filter: var(--verre-flou); -webkit-backdrop-filter: var(--verre-flou);
  box-shadow: var(--reflet), var(--ombre), var(--lueur);
}
/* Reflet « liquide » : une flaque de lumière en haut à gauche, comme sur une vraie vitre bombée. */
.entete::before, .bandeau::before, .carte::before, .mail::before, .groupe::before, .prochain::before, .notifs::before, .terminees::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--sheen);
}
/* Les éléments intérieurs sont plus légers que leur carte */
.mail, .groupe, .prochain, .notifs, .terminees { background: rgba(255, 255, 255, 0.041); box-shadow: var(--reflet); border-color: rgba(255, 255, 255, 0.2); }

/* --- En-tête : capsule en haut de page, qui défile avec le contenu --- */
.entete {
  z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: calc(100% - 48px); max-width: var(--ample); margin: 12px auto 0;
  padding: 8px 10px 8px 16px;
  border-radius: var(--rayon-grand);
  background: rgba(255, 255, 255, 0.054);
}
.marque { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { height: 64px; width: auto; max-width: 150px; margin: -6px 0; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25)); }
h1 { font: 700 21px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; margin: 0; letter-spacing: -0.2px; }
.date { margin: 2px 0 0; color: var(--texte-2); font-size: 13px; }
.date::first-letter { text-transform: uppercase; }

.entete-boutons { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Bouton Actualiser : capsule de verre */
.actualiser {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--verre-fort); color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4); border-radius: 999px;
  box-shadow: var(--reflet), 0 4px 16px rgba(30, 0, 2, 0.22);
  padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .2s, transform .15s;
}
.actualiser:hover { background: rgba(255, 255, 255, 0.245); }
.actualiser:active { transform: scale(.96); }
.actualiser:disabled { background: rgba(255, 255, 255, 0.109); cursor: progress; }
.actualiser svg { width: 18px; height: 18px; }
.actualiser.tourne svg { animation: tour 1s linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }

/* --- Bandeau d'information --- */
.bandeau {
  max-width: var(--ample); margin: 14px auto 0; width: calc(100% - 48px); padding: 10px 16px;
  border-radius: var(--rayon); color: var(--texte-2); font-size: 13.5px;
  background: rgba(255, 179, 64, 0.16); border-color: rgba(255, 210, 140, 0.4);
}
.bandeau p { margin: 2px 0; }

/* --- Page d'accueil : bandeau de bienvenue --- */
.accueil-hero {
  position: relative;
  width: calc(100% - 48px); max-width: var(--ample); margin: 16px auto 0;
  padding: 28px 32px 26px; border-radius: var(--rayon-grand);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--verre);
  border: 1.5px solid var(--verre-bord);
  backdrop-filter: var(--verre-flou); -webkit-backdrop-filter: var(--verre-flou);
  box-shadow: var(--reflet), var(--ombre), var(--lueur);
  overflow: hidden;
}
.accueil-hero::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--sheen);
}
.hero-texte { position: relative; min-width: 240px; flex: 1 1 320px; }
.hero-date { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .4px; color: var(--texte-2); text-transform: uppercase; }
.hero-date::first-letter { text-transform: uppercase; }
.hero-titre { margin: 0 0 8px; font: 800 30px/1.25 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; letter-spacing: -.5px; }
.hero-resume { margin: 0; color: var(--texte-2); font-size: 15px; max-width: 54ch; }
.hero-proverbe { margin: 10px 0 0; color: var(--texte-3); font-size: 13px; font-style: italic; max-width: 54ch; }
.hero-proverbe::before { content: "“ "; }
.hero-proverbe::after { content: " ”"; }
.hero-proverbe:empty { display: none; }
.hero-stats { position: relative; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 116px; padding: 14px 8px 12px; border-radius: var(--rayon); text-align: center; text-decoration: none; color: #fff;
  background: rgba(255, 255, 255, 0.061); border: 1.5px solid var(--verre-bord);
  box-shadow: var(--reflet); transition: background .2s, transform .15s;
}
.hero-stat:hover { background: rgba(255, 255, 255, 0.136); transform: translateY(-1px); }
.hero-stat:active { transform: scale(.97); }
.hero-stat-n { font: 800 27px/1 -apple-system, BlinkMacSystemFont, sans-serif; font-variant-numeric: tabular-nums; }
.hero-stat-l { font-size: 11.5px; line-height: 1.25; color: var(--texte-2); }
.hero-stat[data-stat="mails"] .hero-stat-n.actif { color: var(--rouge-vif); }
@media (max-width: 720px) {
  .accueil-hero { width: calc(100% - 24px); padding: 20px 18px 18px; gap: 16px; margin-top: 8px; }
  .hero-titre { font-size: 22px; }
  .hero-stats { width: 100%; justify-content: space-between; }
  .hero-stat { width: auto; flex: 1; padding: 12px 4px; }
}

/* --- Recherche globale (Accueil) --- */
.accueil-outils { width: calc(100% - 48px); max-width: var(--ample); margin: 14px auto 0; display: grid; gap: 10px; }
/* z-index + isolation : sans ça, le panneau de résultats (z-index:20) pouvait finir recouvert
   par les cartes de l'Accueil (Agenda…), qui ont elles aussi position:relative — isolation:isolate
   force ce bloc à former son propre contexte d'empilement, pour que son z-index compte vraiment. */
.accueil-recherche { position: relative; isolation: isolate; z-index: 30; padding: 13px 18px; }
.accueil-recherche input { font-size: 16px; }
.accueil-resultats {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20;
  max-height: min(60vh, 420px); overflow: auto; padding: 8px; display: grid; gap: 2px;
  background: rgba(40, 0, 4, 0.92); border: 1.5px solid var(--verre-bord); border-radius: var(--rayon);
  backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%);
  box-shadow: var(--reflet), var(--ombre);
}
.resultat-vide { padding: 14px; text-align: center; color: var(--texte-2); font-size: 13.5px; }
.resultat {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--rayon-petit);
  background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.resultat:hover, .resultat:focus-visible { background: rgba(255, 255, 255, 0.1); outline: 0; }
.resultat-type {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  font-size: 13px; background: rgba(255, 255, 255, 0.14);
}
.resultat-corps { min-width: 0; flex: 1; }
.resultat-titre { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resultat-detail { display: block; font-size: 12px; color: var(--texte-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 720px) {
  .accueil-outils { width: calc(100% - 24px); }
}

/* --- Cartes repliables --- */
main { max-width: var(--ample); margin: 0 auto; padding: 16px 24px 8px; display: grid; gap: 18px; grid-template-columns: 1fr; }
/* Grand écran : l'agenda et les autres mails restent en pleine largeur, les deux listes
   (mails prioritaires, tâches) se mettent côte à côte pour profiter de la place. */
@media (min-width: 1000px) {
  main { grid-template-columns: 1fr 1fr; }
  main .carte[data-bloc="agenda"] { grid-column: 1 / -1; order: 1; }
  main .carte[data-bloc="prioritaires"] { order: 2; }
  main .carte[data-bloc="taches"] { order: 3; }
  main .carte[data-bloc="autres"] { grid-column: 1 / -1; order: 4; }
}
.carte { border-radius: var(--rayon-grand); overflow: hidden; }
.carte[data-bloc="prioritaires"] { background: rgba(255, 70, 80, 0.1); border-color: rgba(255, 200, 204, 0.5); }
.carte-titre {
  position: relative; z-index: 1;
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.carte-titre h2 { font: 700 18px/1.25 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; letter-spacing: -0.2px; margin: 0; flex: 1; }
.puce { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.476); flex-shrink: 0; box-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }
.puce.rouge { background: var(--rouge-vif); box-shadow: 0 0 12px var(--rouge-vif); }
.compteur { color: var(--texte); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.109); border: 1.5px solid rgba(255, 255, 255, 0.22); border-radius: 999px; padding: 1px 10px; }
.compteur:empty { display: none; }
.chevron { width: 9px; height: 9px; border-right: 2px solid var(--texte-2); border-bottom: 2px solid var(--texte-2); transform: rotate(45deg); transition: transform .25s; margin: 0 6px 4px; }
.carte.repliee .chevron { transform: rotate(-45deg); margin-bottom: 0; }
.carte.repliee .carte-corps { display: none; }
.carte-corps { position: relative; z-index: 1; padding: 0 20px 20px; display: grid; gap: 10px; }

/* --- Mails --- */
.mail { border-radius: var(--rayon); padding: 14px 16px; display: grid; gap: 6px; }
.mail.prio { background: rgba(255, 255, 255, 0.061); border-color: rgba(255, 255, 255, 0.3); }
.mail > * { position: relative; }
.mail-tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mail-de { font-weight: 700; font-size: 15.5px; }
.mail-quand { color: var(--texte-3); font-size: 12.5px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mail-objet { color: var(--texte-2); font-size: 14px; }
.mail-recap { margin: 2px 0; }
.mail-pied { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.etiquette {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  color: var(--texte-2); background: rgba(255, 255, 255, 0.068); border: 1.5px solid rgba(255, 255, 255, 0.18);
}
.etiquette.rouge { color: #fff; background: rgba(255, 59, 70, 0.38); border-color: rgba(255, 170, 176, 0.55); font-weight: 600; }
.etiquette.attendue { color: #fff; background: rgba(255, 179, 64, 0.32); border-color: rgba(255, 214, 150, 0.55); }
.etiquette.info { color: var(--texte-3); }
.etiquette.cle { color: #fff; background: rgba(255, 255, 255, 0.163); border-color: rgba(255, 255, 255, 0.4); font-weight: 600; }
.action { font-size: 13.5px; color: #fff; }
.action::before { content: "→ "; color: var(--rouge-vif); font-weight: 700; }
.lien-mail {
  margin-left: auto; font-size: 13px; color: #fff; text-decoration: none; font-weight: 600; white-space: nowrap;
  background: rgba(255, 255, 255, 0.136); border: 1.5px solid rgba(255, 255, 255, 0.35); border-radius: 999px; padding: 4px 12px;
  box-shadow: var(--reflet);
}
.non-lu .mail-de::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--rouge-vif); box-shadow: 0 0 8px var(--rouge-vif); margin-right: 8px; vertical-align: 2px; }

.categorie h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--texte-2); margin: 10px 4px 8px; display: flex; gap: 8px; }
.categorie h3 span { color: var(--texte-3); }
.categorie .liste { display: grid; gap: 8px; }
.compact { padding: 12px 14px; }
.compact .mail-recap { font-size: 14px; }
.notifs { color: var(--texte-2); font-size: 14px; padding: 12px 16px; border-radius: var(--rayon); }
.notifs strong { color: #fff; }

/* Carte entière cliquable : le bouton « Ouvrir dans Outlook » couvre toute la carte. */
.mail.cliquable { cursor: pointer; transition: background-color .2s, border-color .2s, transform .15s; }
.mail.cliquable .lien-mail::after { content: ""; position: absolute; inset: -400px -2000px; }
.mail.cliquable { overflow: hidden; }
button.lien-mail { font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mail.cliquable:hover { background: rgba(255, 255, 255, 0.136); border-color: rgba(255, 255, 255, 0.45); transform: translateY(-1px); box-shadow: var(--reflet), 0 8px 20px rgba(0,0,0,.25); }
.mail.cliquable:active { transform: scale(.995); }
.mail.ouvert { opacity: .6; }
.mail.ouvert .mail-pied::after { content: "Ouvert dans Outlook : disparaîtra une fois répondu"; font-size: 12px; color: var(--texte-3); width: 100%; }

#message-flottant {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); max-width: min(560px, calc(100% - 32px));
  background: rgba(40, 0, 4, 0.42); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 50;
}
#message-flottant.visible { opacity: 1; transform: translate(-50%, 0); }

/* --- Agenda : carrousel de jours --- */
.nav-jours { display: flex; align-items: center; gap: 8px; }
/* Le titre et le bouton « Aujourd'hui » forment un seul groupe centré entre les deux flèches
   (plutôt que le titre seul en flex:1, qui se retrouvait décentré par le bouton à sa droite). */
.nav-centre { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.nav-titre { min-width: 0; font-weight: 700; font-size: 15px; text-align: center; }
.nav-titre small { display: block; font-weight: 400; font-size: 12.5px; color: var(--texte-2); }
.nav-fleche, .nav-auj {
  background: rgba(255, 255, 255, 0.109); color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.32); border-radius: 999px;
  box-shadow: var(--reflet); font: inherit; cursor: pointer; transition: background .2s, transform .15s, opacity .2s;
}
.nav-fleche { width: 36px; height: 36px; font-size: 22px; line-height: 1; padding: 0 0 3px; }
.nav-auj { height: 36px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.nav-fleche:hover, .nav-auj:hover { background: rgba(255, 255, 255, 0.19); }
.nav-fleche:active, .nav-auj:active { transform: scale(.94); }
.nav-auj:disabled { opacity: .45; cursor: default; }

.defile-jours {
  position: relative;
  /* « stretch » (pas « start ») : la colonne la moins remplie (ex. un jour calme) s'étire sur
     toute la hauteur de la ligne au lieu de s'arrêter net — les deux jours finissent alignés
     en bas plutôt que de laisser un vide sous la colonne la plus courte. */
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 14px) / 2); gap: 14px; align-items: stretch;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;          /* le glissement ne déclenche pas « page précédente » */
  scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  transition: height .25s ease;
}
.defile-jours::-webkit-scrollbar { display: none; }
.defile-jours:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 4px; border-radius: var(--rayon); }
.jour {
  scroll-snap-align: start; min-width: 0;
  background: rgba(255, 255, 255, 0.041); border: 1.5px solid rgba(255, 255, 255, 0.2); border-radius: var(--rayon);
  box-shadow: var(--reflet); padding: 10px 14px 8px;
}
.jour.jour-auj { background: rgba(255, 255, 255, 0.082); border-color: rgba(255, 255, 255, 0.45); }
.jour.jour-passe { opacity: .55; }
.jour.jour-weekend h3 { color: var(--texte-3); }
.jour h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--texte-2); margin: 2px 0 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.jour-rel { color: #fff; font-weight: 800; }
.jour-sem { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.122); border: 1.5px solid rgba(255, 255, 255, 0.3); border-radius: 999px; padding: 0 8px; }
.evt { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 9px 10px; margin: 0 -10px; border-top: 1.5px solid rgba(255, 255, 255, 0.12); text-decoration: none; border-radius: var(--rayon-petit); }
.evt:first-of-type { border-top: 0; }
.evt-heure { font-variant-numeric: tabular-nums; color: #fff; font-weight: 700; font-size: 14.5px; }
.evt-heure small { display: block; color: var(--texte-3); font-weight: 400; font-size: 12.5px; }
.evt-titre { font-weight: 600; }
.evt-meta { color: var(--texte-3); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pastille { width: 9px; height: 9px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.55); }
.evt[href] { cursor: pointer; transition: background-color .2s; }
.evt[href]:hover { background: rgba(255, 255, 255, 0.095); border-top-color: transparent; }
.evt[href]:hover + .evt { border-top-color: transparent; }
.evt.passe { opacity: .5; }
.evt.encours { background: rgba(255, 70, 80, 0.22); border-top-color: transparent; }
.evt.encours .evt-heure { color: #fff; }

/* Prochain rendez-vous et chevauchements */
.prochain { border-radius: var(--rayon); padding: 10px 16px; font-size: 14px; display: grid; gap: 4px; background: rgba(255, 255, 255, 0.068); }
.prochain strong { color: #fff; }
.etat-encours, .etat-prochain { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; padding: 2px 9px; border-radius: 999px; margin-right: 8px; vertical-align: 1px; }
.etat-encours { background: var(--rouge-vif); color: #fff; box-shadow: 0 0 10px rgba(255, 77, 87, 0.6); }
.etat-prochain { background: rgba(255, 255, 255, 0.15); border: 1.5px solid rgba(255, 255, 255, 0.4); color: #fff; }
.conflit { color: #ffd38a; font-size: 12.5px; margin-top: 2px; font-weight: 600; }
.evt.en-conflit .evt-heure { color: #ffd38a; }

/* --- Tâches --- */
.groupes { columns: 2 320px; column-gap: 14px; }
.groupe { break-inside: avoid; border-radius: var(--rayon); padding: 12px 16px; margin-bottom: 14px; }
.groupe > * { position: relative; }
.groupe h3 { margin: 0 0 6px; font-size: 14.5px; display: flex; justify-content: space-between; }
.groupe h3 span { color: var(--texte-3); font-weight: 500; }
.groupe.retard { background: rgba(255, 70, 80, 0.15); border-color: rgba(255, 190, 195, 0.5); }
.tache { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-top: 1.5px solid rgba(255, 255, 255, 0.1); font-size: 14px; transition: opacity .25s, transform .25s; }
.tache:first-of-type { border-top: 0; }
.tache.sous { padding-left: 16px; }
.tache-lien {
  flex: 1; display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: inherit; border-radius: 10px;
  padding: 1px 8px; margin: 0 -8px; min-width: 0;
  /* Certaines tâches sont des <button> (pour ouvrir leur fiche) plutôt que des <a> : on efface
     l'apparence par défaut du bouton (fond et bordure gris) pour garder le look liquid glass. */
  background: none; border: 0; font: inherit; text-align: left; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.tache-lien:hover { background: rgba(255, 255, 255, 0.095); }
.tache-titre { flex: 1; }
.tache.faite .tache-titre { text-decoration: line-through; color: var(--texte-3); }
.tache.sortie { opacity: 0; transform: translateX(12px); }
.tache-erreur { color: #ffd0d3; font-size: 12.5px; padding: 2px 0 4px 28px; }
.terminees { margin-top: 4px; border-radius: var(--rayon); padding: 10px 16px; border-style: dashed; }
.terminees h3 { margin: 0 0 4px; font-size: 12.5px; color: var(--texte-2); text-transform: uppercase; letter-spacing: .9px; }
.tache-faite { display: flex; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; color: var(--texte-3); }
.tache-faite .tache-titre { text-decoration: line-through; }
.coche { color: var(--ok); font-weight: 700; width: 18px; text-align: center; }
.annuler { background: rgba(255, 255, 255, 0.122); border: 1.5px solid rgba(255, 255, 255, 0.35); color: #fff; border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: var(--reflet); }
.annuler:hover { background: rgba(255, 255, 255, 0.19); }
.annuler:disabled { opacity: .5; cursor: progress; }
.tache-liste { font-size: 11.5px; color: var(--texte-2); background: rgba(255, 255, 255, 0.082); border: 1.5px solid rgba(255, 255, 255, 0.2); border-radius: 999px; padding: 0 8px; margin-left: 4px; white-space: nowrap; }
.tache-date { font-size: 12px; color: var(--texte-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tache-date.retard { color: #fff; font-weight: 700; background: rgba(255, 59, 70, 0.45); border-radius: 999px; padding: 0 8px; }
.tache-date.jour { color: #ffd38a; font-weight: 700; }

/* Case à cocher ronde, comme dans Rappels */
.case { width: 20px; height: 20px; border: 1.5px solid rgba(255, 255, 255, 0.7); border-radius: 50%; flex-shrink: 0; transform: translateY(4px);
  background: rgba(255, 255, 255, 0.054); padding: 0; cursor: pointer; position: relative; transition: border-color .15s, background-color .15s, transform .15s; }
button.case:hover { border-color: #fff; background: rgba(255, 255, 255, 0.136); }
button.case:active { transform: translateY(4px) scale(.9); }
button.case:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.case.inactive { cursor: default; opacity: .45; }
.tache.faite .case { background: var(--ok); border-color: var(--ok); }
.tache.faite .case::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }
@media (max-width: 720px) { .case { width: 22px; height: 22px; } .tache { padding: 8px 0; } }

/* --- États --- */
.vide { color: var(--texte-2); font-size: 14px; padding: 4px 2px; }
.erreur { color: #fff; font-size: 14px; background: rgba(255, 59, 70, 0.3); border-color: rgba(255, 190, 195, 0.5); border-radius: var(--rayon); padding: 12px 16px; }
.squelette { height: 66px; border-radius: var(--rayon); background: linear-gradient(90deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .2), rgba(255, 255, 255, .08)); background-size: 200% 100%; animation: brille 1.4s infinite; }
@keyframes brille { to { background-position: -200% 0; } }

/* Navigateurs sans flou d'arrière-plan : verre plus opaque pour rester lisible */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .entete, .carte { background: rgba(60, 4, 10, 0.82); }
}

/* --- Téléphone --- */
@media (max-width: 720px) {
  /* Plus de marge avant la barre de statut (translucide sur iPhone) : il faut un peu défiler
     avant que l'en-tête l'atteigne et se retrouve flouté par cet effet natif d'iOS. */
  .entete { width: calc(100% - 24px); margin-top: 22px; padding: 6px 8px 6px 12px; border-radius: 22px; }
  .logo { height: 46px; max-width: 100px; margin: -4px 0; }
  h1 { font-size: 17px; }
  .date { font-size: 12px; }
  .actualiser span { display: none; }
  .actualiser { padding: 10px; }
  .bandeau { width: calc(100% - 24px); }
  main { padding: 12px 12px 8px; gap: 14px; }
  .carte { border-radius: 24px; }
  .carte-titre { padding: 14px 16px; }
  .carte-corps { padding: 0 12px 14px; }
  .defile-jours { grid-auto-columns: 88%; gap: 10px; }
  .nav-titre { font-size: 14px; }
  /* Cibles tactiles plus grandes (proches des 44px recommandés) pour les flèches jour précédent/suivant. */
  .nav-fleche { width: 44px; height: 44px; font-size: 24px; }
  .nav-auj { height: 38px; }
  .evt { grid-template-columns: 70px 1fr; }
  .mail-quand { margin-left: 0; }
  .lien-mail { margin-left: 0; }
}
