/* Style de l'appli : esprit « La Caverne » (fond nuit, orange, titres Oswald) par défaut.
   Mode (sombre / clair) et couleur principale se choisissent dans Réglages → Apparence :
   app.js met data-theme sur <html> et les variables --a1 / --a2 / --sur-accent / --halo. */
@font-face { font-family: 'Oswald'; src: url(/polices/oswald.woff2) format('woff2'); font-weight: 200 700; font-display: swap; }
@font-face { font-family: 'Nunito Sans'; src: url(/polices/nunito-sans.woff2) format('woff2'); font-weight: 200 1000; font-display: swap; }

:root, [data-theme=sombre] {
  --fond: #161A26; --carte: #242A3C; --carte2: #1C2130; --texte: #F5F0D8; --texte2: #C9C5B2; --texte3: #8D8A7C;
  --bord: #313950; --ombre: 0 0 0 transparent;
  --a1: #FFB54D; --a2: #E67812; --sur-accent: #1A1206; --halo: rgba(239, 138, 29, 0.22);
  --accent-texte: var(--a1); --vert: #3DD68C; --rouge: #FF6B6B;
  color-scheme: dark;
}
[data-theme=clair] {
  --fond: #F3F5FB; --carte: #FFFFFF; --carte2: #EDF0F7; --texte: #1D2440; --texte2: #4A5375; --texte3: #8A92AD;
  --bord: #E1E5F0; --ombre: 0 1px 2px rgba(29, 36, 64, 0.05), 0 6px 18px rgba(29, 36, 64, 0.06);
  --accent-texte: var(--a2); --vert: #1F9D5A; --rouge: #E5484D;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(90% 38% at 50% -6%, var(--halo), transparent 70%) no-repeat, var(--fond);
  background-attachment: fixed;
  color: var(--texte);
  font: 16px/1.45 'Nunito Sans', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
.cache { display: none !important; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Boutons et champs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--bord); background: var(--carte2); color: var(--texte);
  border-radius: 14px; padding: 10px 16px; min-height: 48px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn:active, .tache:active, .rond:active { transform: scale(0.98); }
.btn.principal {
  background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); border: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 20px var(--halo);
}
.btn.danger { color: var(--rouge); }
.btn.large { width: 100%; }
.btn.petit { min-height: 38px; padding: 6px 12px; font-size: 14px; border-radius: 12px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=time],
input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--bord); border-radius: 14px;
  background: var(--carte2); color: var(--texte); min-height: 48px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--a1); outline-offset: 0; }
textarea { resize: vertical; min-height: 84px; line-height: 1.4; }
label.champ { display: block; font-size: 13px; color: var(--texte3); margin: 14px 0 6px; font-weight: 700; }

/* En-tête de chaque écran */
.entete { padding: calc(env(safe-area-inset-top) + 16px) 18px 4px; max-width: 640px; margin: 0 auto; }
.salut { display: flex; align-items: center; gap: 10px; color: var(--texte2); font-size: 15px; }
.salut .espace { flex: 1; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); font-weight: 800; font-size: 15px;
}
.avatar.petit { width: 22px; height: 22px; font-size: 11px; }
.sur-titre { font: 500 12px/1 'Oswald', sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-texte); margin: 16px 0 6px; }
.grand-titre { font: 600 30px/1.05 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.01em; margin: 0; }
.titre-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.anneau { flex: none; }
.anneau text { font: 800 14px 'Nunito Sans', sans-serif; fill: var(--texte); }

/* Bandeau des jours */
.jours { display: flex; align-items: center; gap: 4px; margin: 14px 0 4px; }
.jours .grille7 { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.bulle {
  border: none; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 0; border-radius: 14px; color: var(--texte3); font-size: 11px; font-weight: 700; cursor: pointer;
}
.bulle b { font-size: 17px; color: var(--texte); font-weight: 800; }
.bulle.auj b { color: var(--accent-texte); }
.bulle.choisi { background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); box-shadow: 0 6px 16px var(--halo); }
.bulle.choisi b { color: var(--sur-accent); }
.rond {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--bord); background: var(--carte2);
  display: grid; place-items: center; color: var(--texte2); cursor: pointer; flex: none; padding: 0;
}
.rond .i { width: 18px; height: 18px; }

main { padding: 6px 18px 200px; max-width: 640px; margin: 0 auto; }
.section { font: 500 13px/1 'Oswald', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--texte3); margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
.section::before { content: ''; width: 7px; height: 7px; transform: rotate(45deg); background: var(--a1); border-radius: 1px; }

/* Cartes de tâches */
.liste { display: flex; flex-direction: column; gap: 9px; }
.tache {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--carte); border: 1px solid var(--bord); border-radius: 18px; padding: 11px 12px; box-shadow: var(--ombre);
}
[data-theme=clair] .tache { border-color: transparent; }
.ico {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--c) 20%, var(--carte)); color: var(--c);
}
.ico .i { width: 22px; height: 22px; }
.tache .corps { flex: 1; min-width: 0; }
.tache .t { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.tache .m { font-size: 13px; color: var(--texte3); white-space: pre-wrap; }
.tache .m .accent { color: var(--accent-texte); font-weight: 700; }
.tache .m .retard { color: var(--rouge); font-weight: 700; }
.tache.fait { opacity: 0.6; }
.tache.fait .t { text-decoration: line-through; color: var(--texte3); }
.tache.ext { background: transparent; border: 1px dashed var(--bord); box-shadow: none; cursor: default; }
.coche {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--bord); background: none; flex: none;
  display: grid; place-items: center; color: transparent; cursor: pointer; padding: 0;
}
.coche .i { width: 18px; height: 18px; stroke-width: 3; }
.coche.oui { background: var(--vert); border-color: var(--vert); color: #fff; }
.maintenant { display: flex; align-items: center; gap: 8px; color: var(--accent-texte); font: 500 11px 'Oswald', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; }
.maintenant::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--a1), transparent); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.puce { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--carte2); color: var(--texte2); border: 1px solid var(--bord);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.puce .i { width: 14px; height: 14px; }
.vide { text-align: center; color: var(--texte3); padding: 36px 16px; }
.vide .grand { font: 600 20px 'Oswald', sans-serif; text-transform: uppercase; color: var(--texte2); display: block; margin-bottom: 6px; }

/* Cartes génériques (réglages, alertes) */
.bloc { background: var(--carte); border: 1px solid var(--bord); border-radius: 20px; padding: 16px; margin: 12px 0; box-shadow: var(--ombre); }
[data-theme=clair] .bloc { border-color: transparent; }
.bloc h3 { font: 600 17px 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.bloc h3 .i { color: var(--accent-texte); }
.bloc p { margin: 6px 0; }
.discret { color: var(--texte3); font-size: 14px; }
.ligne-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--bord); }
.ligne-item:first-of-type { border-top: none; }
.ligne-item .corps { flex: 1; min-width: 0; }
.rangee { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.rangee > * { flex: 1; }

/* Apparence : segments et pastilles de couleur */
.segments { display: flex; background: var(--carte2); border: 1px solid var(--bord); border-radius: 14px; padding: 4px; gap: 4px; margin: 10px 0; }
.segments button { flex: 1; border: none; background: none; border-radius: 10px; padding: 9px 4px; font-weight: 700; color: var(--texte2); display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.segments button.oui { background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); }
.segments .i { width: 18px; height: 18px; }
.pastilles { display: flex; justify-content: space-between; margin: 12px 4px 4px; }
.pastilles button { width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer; padding: 0; outline-offset: 3px; }
.pastilles button.oui { outline: 3px solid var(--texte); }

/* Courses */
.article { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--bord); }
.article:first-child { border-top: none; }
.article img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; flex: none; }
.article .corps { flex: 1; min-width: 0; }
.article .t { font-weight: 700; }
.article .m { font-size: 13px; color: var(--texte3); }
.article.oui .t { text-decoration: line-through; color: var(--texte3); }
.ns { display: inline-block; font-weight: 800; font-size: 11px; padding: 0 6px; border-radius: 5px; color: #fff; }
.ns-A { background: #038141; } .ns-B { background: #85bb2f; } .ns-C { background: #f5c300; color: #333; } .ns-D { background: #ef8200; } .ns-E { background: #e63e11; }
.ajout { display: flex; gap: 8px; }
.ajout input { flex: 1; }

/* Semaine */
.jour-carte { width: 100%; text-align: left; cursor: pointer; background: var(--carte); border: 1px solid var(--bord); border-radius: 20px; padding: 14px; margin: 10px 0; display: block; color: var(--texte); box-shadow: var(--ombre); }
[data-theme=clair] .jour-carte { border-color: transparent; }
.jour-carte h3 { margin: 0 0 8px; font: 600 16px 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; display: flex; justify-content: space-between; }
.jour-carte h3 span { color: var(--texte3); font-size: 13px; }
.jour-carte.auj h3 { color: var(--accent-texte); }
.mini { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; }
.mini .ico { width: 26px; height: 26px; border-radius: 8px; }
.mini .ico .i { width: 15px; height: 15px; }
.mini b { width: 42px; font-weight: 700; color: var(--texte3); font-variant-numeric: tabular-nums; flex: none; }

/* Bas d'écran : saisie + onglets */
.bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: color-mix(in srgb, var(--fond) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom);
}
.saisie { display: flex; gap: 8px; align-items: center; padding: 10px 14px 6px; max-width: 640px; margin: 0 auto; }
.saisie input { flex: 1; border-radius: 26px; padding-left: 18px; background: var(--carte); }
.micro {
  width: 50px; height: 50px; border-radius: 50%; border: none; flex: none; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px var(--halo);
}
.micro .i { width: 24px; height: 24px; }
.micro.ecoute { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--a1) 25%, transparent); } }
nav { display: flex; max-width: 640px; margin: 0 auto; }
nav button {
  flex: 1; border: none; background: none; padding: 4px 2px 8px; font-size: 11px; font-weight: 700; color: var(--texte3);
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
}
nav button.actif { color: var(--accent-texte); }

/* Feuille qui monte du bas */
.voile { position: fixed; inset: 0; background: rgba(5, 7, 12, 0.55); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.feuille {
  background: var(--carte); width: 100%; max-width: 640px; border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 18px); max-height: 90vh; overflow-y: auto;
  border-top: 1px solid var(--bord);
}
.feuille::before { content: ''; display: block; width: 42px; height: 5px; border-radius: 3px; background: var(--bord); margin: 0 auto 14px; }
.feuille .tete { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.feuille h2 { margin: 0; font: 600 22px/1.1 'Oswald', sans-serif; text-transform: uppercase; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 10px; }
.grille2 .btn { min-height: 58px; flex-direction: column; gap: 2px; font-size: 15px; }
.interrupteur { display: flex; align-items: center; gap: 12px; margin: 12px 0; font-weight: 700; }
.interrupteur input { width: 24px; height: 24px; accent-color: var(--a2); }

/* Message en bas */
#toast {
  position: fixed; left: 14px; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 136px); z-index: 30;
  max-width: 612px; margin: 0 auto; background: var(--texte); color: var(--fond); font-weight: 700;
  border-radius: 16px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
#toast span { flex: 1; }
#toast button { background: none; border: 1px solid var(--fond); color: var(--fond); border-radius: 10px; padding: 6px 10px; font-weight: 800; }

#scanner video { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 4/3; object-fit: cover; margin-top: 10px; }

/* Connexion */
.connexion { max-width: 380px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 12vh) 22px 40px; }
.logo { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); box-shadow: 0 12px 34px var(--halo); }
.logo .i { width: 40px; height: 40px; stroke-width: 2.5; }
.connexion .grand-titre { font-size: 36px; }
.connexion form { margin-top: 18px; }

/* ===== Étape 2 ===== */
.haut { margin-top: 14px; }
.tache > .i:last-child { width: 18px; height: 18px; color: var(--texte3); }
img.ico { object-fit: cover; background: var(--carte2); }

.carte-liste:active, .vignette:active { transform: scale(0.97); }

/* Plus : « La maison en un coup d'œil ». Des blocs vivants de tailles différentes, avec de vraies données
   (gros chiffres, courbe, prochaine échéance, dernier message, photos), pas une grille de boutons. */
.titre-doux { display: block; color: var(--texte3); font-size: 0.62em; letter-spacing: 0.04em; margin-top: 2px; }
.maison { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.duo.large-etroit { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.bloc-vivant {
  position: relative; overflow: hidden; cursor: pointer; color: var(--texte);
  background: var(--carte); border: 1px solid var(--bord); border-radius: 26px; padding: 15px; box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 2px; min-height: 158px;
  animation: monte 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
[data-theme=clair] .bloc-vivant { border-color: transparent; }
.bloc-vivant:active { transform: scale(0.985); }
.bloc-vivant:focus-visible, .lien-vivant:focus-visible { outline: 2px solid var(--a1); outline-offset: 2px; }
.bloc-vivant.sante {
  min-height: 0; padding-bottom: 13px;
  background: radial-gradient(110% 85% at 100% 0%, color-mix(in srgb, var(--a1) 17%, transparent), transparent 58%), var(--carte);
}
.bloc-vivant.entretiens { background: radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--a2) 10%, transparent), transparent 65%), var(--carte); }
.etiquette-vivant { font: 500 11px/1 'Oswald', sans-serif; letter-spacing: 0.15em; text-transform: uppercase; color: var(--texte3); display: flex; align-items: center; gap: 6px; }
.etiquette-vivant .i { width: 13px; height: 13px; }
.ligne-chiffre { display: flex; align-items: baseline; gap: 7px; margin-top: 6px; }
.gros-chiffre { font: 600 56px/0.92 'Oswald', sans-serif; letter-spacing: -0.01em; margin-top: 6px; }
.ligne-chiffre .gros-chiffre { margin-top: 0; }
.gros-chiffre.doux { color: var(--texte3); }
.unite { color: var(--texte3); font-weight: 800; }
.pastille-evo { margin-left: auto; align-self: flex-start; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 99px; background: var(--carte2); color: var(--texte2); white-space: nowrap; }
.pastille-evo.baisse { background: color-mix(in srgb, var(--vert) 18%, transparent); color: var(--vert); }
.courbe-vivante { display: block; width: calc(100% + 30px); height: 78px; margin: 8px -15px 0; }
.pied-vivant { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; color: var(--texte3); margin-top: auto; padding-top: 10px; }
.pied-vivant.debut { justify-content: flex-start; }
.pied-vivant.colonne { flex-direction: column; align-items: flex-start; gap: 1px; }
.pied-vivant b { color: var(--texte); font-weight: 800; font-size: 15px; }
.pied-vivant .accent { color: var(--accent-texte); font-weight: 800; }
.sante .pied-vivant { border-top: 1px solid var(--bord); margin-top: 0; }
.barre { height: 5px; border-radius: 3px; background: var(--carte2); overflow: hidden; margin-top: 7px; }
.barre span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--a2), var(--a1)); }
.titre-vivant { font-weight: 800; font-size: 16px; line-height: 1.25; margin-top: 8px; }
.moyen-chiffre { font: 600 34px/1 'Oswald', sans-serif; color: var(--accent-texte); text-transform: uppercase; margin-top: 4px; }
.aide-vivant { font-size: 13px; color: var(--texte3); margin: 8px 0 0; line-height: 1.35; }
.retard-vivant { margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 800; color: var(--rouge); display: flex; gap: 6px; align-items: flex-start; }
.retard-vivant .i { width: 16px; height: 16px; margin-top: 1px; }
.bulle-vivante {
  background: var(--carte2); border: 1px solid var(--bord); border-radius: 16px 16px 16px 4px; padding: 9px 11px; font-size: 14px; margin-top: 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.mosaique { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 4px; margin-top: 10px; border-radius: 14px; overflow: hidden; aspect-ratio: 1.35; }
.mosaique img { width: 100%; height: 100%; object-fit: cover; background: var(--carte2); display: block; }
.mosaique.n1 { grid-template-columns: 1fr; }
.mosaique.n3 img:first-child { grid-row: span 2; }
.lignes-vivantes { margin-top: 6px; }
.lignes-vivantes div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--bord); font-size: 14px; }
.lignes-vivantes div:last-child { border-bottom: none; }
.lignes-vivantes span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lignes-vivantes b { font: 600 19px/1 'Oswald', sans-serif; color: var(--accent-texte); }
.liens-vivants { display: flex; gap: 8px; animation: monte 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.lien-vivant {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 6px 12px;
  border-radius: 99px; background: var(--carte); border: 1px solid var(--bord); color: var(--texte); font-weight: 800; font-size: 14px; cursor: pointer;
  box-shadow: var(--ombre); white-space: nowrap;
}
[data-theme=clair] .lien-vivant { border-color: transparent; }
.lien-vivant.seul { flex: none; width: 46px; padding: 0; }
.lien-vivant .i { width: 18px; height: 18px; color: var(--texte3); }
.lien-vivant:active { transform: scale(0.97); }
.pile { display: flex; }
.pile .avatar { border: 2px solid var(--carte); margin-left: -8px; }
.pile .avatar:first-child { margin-left: 0; }
/* Importer dans l'agenda : une liste de choix (pas une grille), puis l'aperçu à cocher */
.choix-imports { display: flex; flex-direction: column; margin: 12px 0 4px; border-top: 1px solid var(--bord); }
.choix-import {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; border-bottom: 1px solid var(--bord); padding: 13px 2px; color: var(--texte);
}
.choix-import .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choix-import b { font-weight: 800; font-size: 16px; }
.choix-import .corps span { font-size: 13px; color: var(--texte3); line-height: 1.35; }
.choix-import > .i { width: 18px; height: 18px; color: var(--texte3); }
.choix-import:active { background: var(--carte2); }
.lignes-import { display: flex; flex-direction: column; }
.ligne-import { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bord); cursor: pointer; }
.ligne-import input { width: 22px; height: 22px; accent-color: var(--a2); margin-top: 1px; flex: none; }
.ligne-import .corps { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ligne-import b { font-weight: 800; }
.ligne-import .corps span { font-size: 13px; color: var(--texte3); }
.lien-doux { margin-left: auto; background: none; border: none; color: var(--accent-texte); font: 700 12px 'Nunito Sans', sans-serif; letter-spacing: 0; text-transform: none; cursor: pointer; padding: 4px; }
.tache.ext.ouvrable { cursor: pointer; }
button.puce { cursor: pointer; }

/* Étape 3 — la famille en couleurs : filtre par personne, barre de couleur sur les cartes */
.filtres { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtre {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 99px; cursor: pointer;
  background: var(--carte2); border: 1px solid var(--bord); color: var(--texte2); font-weight: 800; font-size: 13px; white-space: nowrap;
}
.filtre.oui { background: var(--p, var(--a1)); border-color: var(--p, var(--a1)); color: #14110c; }
.filtre.oui .point-p { background: #14110c; }
.point-p { width: 9px; height: 9px; border-radius: 50%; background: var(--p); flex: none; display: inline-block; }
.point-p.grand { width: 16px; height: 16px; }
.pour-qui { color: var(--p); font-weight: 800; }
.tache.avec-p { box-shadow: inset 4px 0 0 var(--p), var(--ombre); }
.tache.ext.avec-p { box-shadow: inset 4px 0 0 var(--p); }
.mini.avec-p { box-shadow: inset 3px 0 0 var(--p); padding-left: 8px; border-radius: 0; }
.mini.ferie, .puce.ferie { color: var(--accent-texte); font-weight: 800; }
.mini.ferie .i, .puce.ferie .i { width: 14px; height: 14px; }
.bloc-contact { background: var(--carte2); border: 1px solid var(--bord); border-radius: 16px; padding: 12px; margin: 10px 0 4px; }
.bloc-contact .t { font-weight: 800; display: flex; align-items: center; gap: 8px; }
.bloc-contact .m { font-size: 14px; color: var(--texte2); display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; }
.bloc-contact .i { width: 17px; height: 17px; color: var(--accent-texte); flex: none; }
.bloc-contact .rangee { margin: 10px 0 0; }
.bloc-contact .btn .i { color: inherit; }
.jours-choix { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.jours-choix button { min-height: 42px; border-radius: 12px; border: 1px solid var(--bord); background: var(--carte2); color: var(--texte2); font-weight: 800; cursor: pointer; }
.jours-choix button.oui { background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); border-color: transparent; }
.pastilles.petites { justify-content: flex-start; gap: 8px; margin: 8px 0 2px; flex-wrap: wrap; }
.pastilles.petites button { width: 26px; height: 26px; }
.ligne-item.colonne { flex-direction: column; align-items: stretch; }
.ligne-haut { display: flex; align-items: center; gap: 10px; }
.ligne-personne { width: 100%; background: none; border: none; border-top: 1px solid var(--bord); color: var(--texte); text-align: left; cursor: pointer; }
.ligne-personne > .i { width: 18px; height: 18px; color: var(--texte3); }
.groupe-pour { border: 1px solid var(--bord); border-radius: 16px; padding: 4px 12px 2px; margin: 4px 0 12px; background: var(--carte2); }
.titre-pour { font: 500 12px/1.2 'Oswald', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-texte);
  display: flex; align-items: center; gap: 6px; padding: 10px 0 4px; }
.titre-pour .i { width: 15px; height: 15px; }
.titre-pour.doux { color: var(--texte3); }
.groupe-pour .article:first-of-type { border-top: none; }
a.lien-info { text-decoration: none; color: inherit; }

@keyframes monte { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .bloc-vivant, .liens-vivants { animation: none; } }

/* Choix d'une icône (catégories, listes) */
.choix-icones { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 2px 0 4px; }
.choix-icones button {
  border: 2px solid transparent; background: var(--carte2); border-radius: 16px; padding: 7px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; line-height: 1.1; color: var(--texte2);
}
.choix-icones .ico { width: 40px; height: 40px; border-radius: 12px; }
.choix-icones button.oui { border-color: var(--a1); background: color-mix(in srgb, var(--a1) 14%, var(--carte2)); color: var(--texte); }

/* Fiche : infos, notes, photos et fichiers */
.tete-bloc { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.tete-bloc .corps { flex: 1; min-width: 0; }
.tete-bloc .t { font: 600 16px 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.03em; }
.info { display: flex; align-items: center; gap: 12px; padding: 10px 0 2px; margin-top: 8px; border-top: 1px solid var(--bord); }
.info > .i { color: var(--accent-texte); }
.info .corps { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.info b { display: block; font-size: 12px; font-weight: 700; color: var(--texte3); }
.info .retard { color: var(--rouge); font-weight: 700; }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--carte2); border-radius: 14px; padding: 10px 12px; margin: 12px 0 0 !important; }
.feuille .notes { margin-top: 14px !important; }
.vignettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 4px; }
.vignette {
  aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--bord); background: var(--carte2); padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--texte2); min-width: 0;
}
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette.doc { padding: 8px; }
.vignette.doc .i { width: 32px; height: 32px; color: var(--accent-texte); }
.vignette.doc span {
  font-size: 11px; font-weight: 700; text-align: center; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.apercu { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 16px; background: var(--carte2); }
.feuille h2.coupe { overflow-wrap: anywhere; font-size: 19px; }
label.btn { cursor: pointer; position: relative; overflow: hidden; }
.fichier-cache { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Listes perso */
.grille-listes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.carte-liste {
  text-align: left; background: var(--carte); border: 1px solid var(--bord); border-radius: 20px; padding: 14px; box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 3px; cursor: pointer; color: var(--texte); min-width: 0;
}
[data-theme=clair] .carte-liste { border-color: transparent; }
.carte-liste .ico { margin-bottom: 8px; }
.carte-liste .t { font: 600 17px/1.15 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.carte-liste .m { font-size: 13px; color: var(--texte3); }

/* Santé */
.bloc h3 .espace { flex: 1; }
.chiffres { margin: 10px 0 2px; }
.grand-chiffre { font: 600 40px/1 'Oswald', sans-serif; letter-spacing: 0.01em; }
.grand-chiffre small { font: 800 15px 'Nunito Sans', sans-serif; color: var(--texte3); }
.evos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.courbe { display: block; width: 100%; height: auto; margin: 12px 0 4px; }
.courbe .grille { stroke: var(--bord); stroke-width: 1; stroke-dasharray: 3 4; }
.courbe stop { stop-color: var(--a1); }
.courbe .ligne { fill: none; stroke: var(--a1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.courbe circle { fill: var(--carte); stroke: var(--a1); stroke-width: 2; }
.courbe circle.dernier { fill: var(--a1); stroke: var(--carte); }
.courbe text { font: 700 10px 'Nunito Sans', sans-serif; fill: var(--texte3); }
.segments.petits { margin: 6px 0 0; }
.segments.petits button { padding: 6px 4px; font-size: 13px; }
.barre { height: 12px; border-radius: 99px; background: var(--carte2); border: 1px solid var(--bord); overflow: hidden; margin: 12px 0 6px; }
.barre > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--a2), var(--a1)); transition: width 0.4s; }
.barre.depasse > div { background: linear-gradient(90deg, var(--a2), var(--rouge)); }
.jour-nav { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 0; }
.jour-nav b { font: 600 15px 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.06em; }
.sous-titre {
  display: flex; justify-content: space-between; margin: 16px 0 2px;
  font: 500 12px 'Oswald', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--texte3);
}
.ligne-repas { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--bord); }
.sous-titre + .ligne-repas, .feuille .ligne-repas:first-child { border-top: none; }
.ligne-repas .corps { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.ligne-repas .kcal { color: var(--texte2); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.repas-ajout { display: grid; grid-template-columns: 1fr 88px; gap: 8px; margin-top: 14px; }
.repas-ajout select { grid-column: 1; }
.repas-ajout .btn { grid-column: 2; grid-row: 2; }

/* Messages */
.fil { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.jour-fil {
  align-self: center; margin: 14px 0 6px; padding: 4px 12px; border-radius: 99px; background: var(--carte2); border: 1px solid var(--bord);
  font: 500 11px 'Oswald', sans-serif; letter-spacing: 0.12em; text-transform: uppercase; color: var(--texte3);
}
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 84%; }
.msg.moi { align-self: flex-end; align-items: flex-end; }
.msg .auteur { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px 4px; font-size: 12px; font-weight: 800; color: var(--texte2); }
.bulle-msg {
  background: var(--carte); border: 1px solid var(--bord); border-radius: 20px 20px 20px 6px; padding: 8px 13px 6px; box-shadow: var(--ombre);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
[data-theme=clair] .bulle-msg { border-color: transparent; }
.msg.moi .bulle-msg { background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); border: none; border-radius: 20px 20px 6px 20px; }
.bulle-msg time { display: block; margin-top: 2px; text-align: right; font-size: 11px; font-weight: 700; opacity: 0.65; }

/* Contacts */
.recherche { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-left: 12px; background: var(--carte2); border: 1px solid var(--bord); border-radius: 14px; color: var(--texte3); }
.recherche:focus-within { outline: 2px solid var(--a1); }
.recherche input { border: none; background: none; }
.recherche input:focus { outline: none; }
a.rond { text-decoration: none; }
.rond.grand { width: 42px; height: 42px; }
.rond.grand .i { width: 20px; height: 20px; }
.rond.accent { background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent); border: none; box-shadow: 0 6px 16px var(--halo); }

/* Saisie à la main : bouton +, participants, bande de couleurs quand ils sont plusieurs */
.ajouter {
  position: absolute; right: 16px; bottom: calc(100% + 12px); width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  display: grid; place-items: center; background: linear-gradient(var(--a1), var(--a2)); color: var(--sur-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 22px var(--halo);
}
.ajouter .i { width: 28px; height: 28px; stroke-width: 2.4; }
@media (min-width: 700px) { .ajouter { right: calc(50% - 304px); } }
.filtres.participants { flex-wrap: wrap; overflow: visible; padding-top: 2px; }
.tache.plusieurs, .mini.plusieurs, .puce.plusieurs { position: relative; overflow: hidden; }
.tache.plusieurs::before, .mini.plusieurs::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bande); }
.mini.plusieurs::before { width: 3px; }
.puce.avec-p { box-shadow: inset 4px 0 0 var(--p); padding-left: 12px; }
.puce.plusieurs::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bande); }
.jour-carte h3 { align-items: center; justify-content: flex-start; gap: 8px; }
.jour-carte h3 .espace { flex: 1; }
.rond.petit { width: 30px; height: 30px; }
.rond.petit .i { width: 16px; height: 16px; }

/* Tunas : bons plans d'anti-crise.fr (Préparer, Panier, Démarches) */
a.tache { color: inherit; text-decoration: none; }
.tunas-ligne { align-items: flex-start; cursor: default; }
.tunas-ligne .t { white-space: normal; }
.tunas-ligne .puces { margin-top: 6px; }
.prix-tunas { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; padding-top: 2px; }
.prix-tunas s { font-size: 12px; color: var(--texte3); }
.prix-tunas b { font: 600 19px/1 'Oswald', sans-serif; }
.prix-tunas b.gagne { color: var(--vert); }
.puce.zone-grise { background: color-mix(in srgb, #F5A524 20%, var(--carte)); color: #E39B1B; border-color: color-mix(in srgb, #F5A524 45%, transparent); }
.tunas-total .gros-chiffre { font-size: 48px; }
.tunas-total .unite { font-size: 17px; }
.budget-tunas { align-items: center; }
.budget-tunas input { flex: 1; font: 600 22px 'Oswald', sans-serif; }
.budget-tunas .euro { flex: none; font: 600 22px 'Oswald', sans-serif; color: var(--texte2); }
.etat-demarche { flex: none; border-radius: 99px; padding: 7px 12px; font-weight: 800; font-size: 13px; cursor: pointer;
  border: 1px solid var(--bord); background: var(--carte2); color: var(--texte2); }
.etat-demarche.envoye { color: var(--accent-texte); border-color: color-mix(in srgb, var(--a1) 45%, transparent); }
.etat-demarche.rembourse { color: var(--vert); border-color: color-mix(in srgb, var(--vert) 45%, transparent); }
.demarche { align-items: center; cursor: default; }
.demarche .t { white-space: normal; }
.champ-euro { display: flex; align-items: center; gap: 6px; width: 130px; font-weight: 800; color: var(--texte2); }
