/* Deuxième cerveau — thème sombre « B + C » (maquette validée le 2026-11-16) :
   fond nuit, police Space Grotesk, barre du bas en pastille, une couleur par type. */

:root {
  --fond: #0E1013;
  --surface: #1A1D23;
  --surface-2: #22262E;
  --ligne: #2A2E36;
  --ligne-forte: #3A3F49;
  --texte: #ECEEF2;
  --texte-2: #9AA1AE;
  --accent: #7CE0B5;        /* vert « maintenant », action principale */
  --sur-accent: #0E1013;    /* texte posé sur l'accent */
  --orange: #FF9F5A;        /* tâches */
  --bleu: #6EA8FF;          /* routines */
  --jaune: #F6C35B;         /* finances, « en cours » */
  --danger: #FF7A7A;
  --ambre: var(--accent);   /* ancien nom, gardé pour les gabarits existants */
  --ambre-fonce: var(--accent);
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

/* Réflexes d'appli : pas de surbrillance au toucher, pas de zoom au double-toucher,
   pas de sélection de texte sur les boutons et la navigation */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; background: var(--fond); }
a, button, input, select, textarea, label { touch-action: manipulation; }
button, .onglet, .action-ligne, .bouton-retour, .rangee { -webkit-user-select: none; user-select: none; }
button { cursor: pointer; }
body {
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--fond); color: var(--texte);
}
::placeholder { color: #7C8391; }

/* Transitions douces entre les écrans (navigateurs récents ; ignoré ailleurs) */
@view-transition { navigation: auto; }

/* Place pour la barre du bas */
body.avec-onglets main { padding-bottom: calc(7rem + var(--bas-sur)); }

/* --- Barre du haut ------------------------------------------------------------- */
.barre-haut {
  position: sticky; top: 0; z-index: 30;
  padding-top: var(--haut-sur);
  background: rgba(14, 16, 19, 0.9);
  -webkit-backdrop-filter: saturate(160%) blur(12px); backdrop-filter: saturate(160%) blur(12px);
}
.barre-ligne {
  max-width: 42rem; margin: 0 auto; height: 52px; padding: 0 6px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
}
.barre-ligne > :last-child { justify-self: end; }
.barre-titre {
  font-weight: 600; font-size: 16px; max-width: 55vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grand-titre {
  max-width: 42rem; margin: 0 auto; padding: 0 20px 10px;
  font-size: 38px; line-height: 1.1; font-weight: 700; letter-spacing: -0.5px;
}
.bouton-retour {
  display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px 0 2px;
  color: var(--accent); font-size: 16px; max-width: 100%;
}
.bouton-icone {
  width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--texte);
}
.bouton-icone:active { background: var(--surface-2); }

/* --- Barre du bas en pastille ---------------------------------------------------- */
.onglets {
  position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(14px + var(--bas-sur));
  max-width: 30rem; margin: 0 auto; height: 64px; border-radius: 32px;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  background: rgba(26, 29, 35, 0.96); border: 1px solid var(--ligne);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.onglet {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: 56px; font-size: 11px; font-weight: 500; color: var(--texte-2);
}
.onglet-actif { color: var(--accent); font-weight: 700; }
.onglet-micro {
  justify-self: center; width: 54px; height: 54px; border-radius: 27px;
  background: var(--accent); color: var(--sur-accent);
  display: flex; align-items: center; justify-content: center;
}
.onglet-micro:active { transform: scale(0.95); }

/* --- Bouton rond « + » ------------------------------------------------------------ */
.bouton-flottant {
  position: fixed; z-index: 31; right: max(20px, calc(50% - 21rem + 20px));
  bottom: calc(92px + var(--bas-sur));
  width: 56px; height: 56px; border-radius: 28px; border: 0;
  background: var(--surface-2); color: var(--accent); display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--ligne-forte); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}
.bouton-flottant:active { transform: scale(0.96); }

/* --- Listes façon appli ---------------------------------------------------------- */
.liste { background: var(--surface); border-radius: 18px; overflow: hidden; }
.liste > * + * { border-top: 1px solid var(--ligne); }
.rangee { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; background: var(--surface); }
a.rangee:active, button.rangee:active { background: var(--surface-2); }
.rangee-titre { font-size: 16px; font-weight: 500; line-height: 1.3; }
.rangee-sous { font-size: 13px; color: var(--texte-2); }
.section-titre { margin: 22px 4px 8px; font-size: 13px; font-weight: 500; color: var(--texte-2); }
.pastille { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; }

/* Bascule « Fiches | Livrets » de l'onglet Savoir */
.bascule { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface); margin-bottom: 14px; }
.bascule a { height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--texte-2); }
.bascule a[aria-current] { background: var(--surface-2); color: var(--texte); font-weight: 700; }

/* --- Boutons et champs -------------------------------------------------------------- */
.bouton-principal {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 24px;
  background: var(--accent); color: var(--sur-accent); font-size: 16px; font-weight: 700;
}
.bouton-principal:active { filter: brightness(0.92); }
.bouton-secondaire {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 24px;
  border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font-size: 16px; font-weight: 600;
}
.bouton-discret {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border-radius: 20px; border: 1px solid var(--ligne-forte); background: transparent; color: var(--texte); font-size: 14px;
}
.champ {
  width: 100%; min-height: 48px; box-sizing: border-box; border: 1px solid var(--ligne-forte); border-radius: 14px;
  padding: 10px 14px; font-size: 16px; background: var(--surface); color: var(--texte);
}
.champ:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 224, 181, 0.2); }
textarea.champ { line-height: 1.5; }
.champ-recherche { padding-left: 40px; }
.etiquette-champ { display: block; font-size: 13px; font-weight: 600; color: var(--texte-2); margin-bottom: 6px; }
.carte { background: var(--surface); border-radius: 18px; padding: 16px; }

/* --- Feuilles d'actions (panneau qui monte du bas) ------------------------------------- */
.feuille { position: fixed; inset: 0; z-index: 50; }
.feuille[hidden] { display: none; }
.feuille-voile { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); animation: apparaitre 0.18s ease-out; }
.feuille-panneau {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
  max-width: 42rem; margin: 0 auto;
  background: var(--surface); border-radius: 24px 24px 0 0; border-top: 1px solid var(--ligne);
  padding: 8px 12px calc(16px + var(--bas-sur));
  animation: monter 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.feuille-poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--ligne-forte); margin: 2px auto 10px; }
.feuille-titre { margin: 0 8px 8px; font-size: 13px; color: var(--texte-2); }
.action-ligne {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 14px; padding: 0 10px;
  border: 0; border-radius: 12px; background: transparent; color: var(--texte); font-size: 16px; text-align: left;
}
.action-ligne svg { color: var(--texte-2); }
.action-ligne:active { background: var(--surface-2); }
.action-danger, .action-danger svg { color: var(--danger); font-weight: 600; }
.feuille hr { border: 0; border-top: 1px solid var(--ligne); margin: 4px 8px; }
@keyframes monter { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes apparaitre { from { opacity: 0; } to { opacity: 1; } }

/* --- Bulles de message -------------------------------------------------------------------- */
.bulles {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: calc(92px + var(--bas-sur));
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.bulle {
  pointer-events: auto; max-width: 30rem; padding: 12px 18px; border-radius: 16px;
  background: var(--texte); color: var(--fond); font-size: 14px; font-weight: 500; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); animation: apparaitre 0.2s ease-out;
  transition: opacity 0.3s, transform 0.3s;
}
.bulle-erreur { background: var(--danger); color: var(--fond); }
.bulle-partie { opacity: 0; transform: translateY(8px); }

/* --- Écran Jour ---------------------------------------------------------------------------- */
.jour-date { margin: 0; font-size: 13px; color: var(--texte-2); }
.jour-titre { margin: 2px 0 0; font-size: 40px; line-height: 44px; font-weight: 700; letter-spacing: -0.5px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--texte-2); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.fil { position: relative; display: flex; flex-direction: column; gap: 4px; padding-left: 64px; }
.fil::before { content: ""; position: absolute; left: 50px; top: 10px; bottom: 10px; width: 2px; background: var(--ligne); }
.fil-ligne { position: relative; min-height: 52px; display: flex; align-items: center; gap: 10px; }
.fil-heure { position: absolute; left: -64px; width: 44px; font-size: 13px; color: var(--texte-2); }
.fil-point { position: absolute; left: -19px; width: 10px; height: 10px; border-radius: 5px; }
.fil-texte { flex: 1; min-width: 0; font-size: 16px; }
.fil-detail { font-size: 12px; color: var(--texte-2); text-align: right; }
.fil-maintenant { position: relative; height: 22px; display: flex; align-items: center; }
.fil-maintenant::after { content: ""; position: absolute; left: -18px; right: 0; height: 2px; background: var(--accent); }
.fil-maintenant .fil-heure { color: var(--accent); font-weight: 700; font-size: 12px; }
.bloc-maintenant {
  position: relative; background: var(--accent); color: var(--sur-accent);
  border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.bloc-maintenant .etiquette { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.bloc-maintenant .titre { font-size: 23px; line-height: 27px; font-weight: 700; }
.bloc-maintenant a.agir {
  align-self: flex-start; height: 44px; padding: 0 20px; border-radius: 22px;
  background: var(--sur-accent); color: var(--accent); font-size: 15px; font-weight: 700;
  display: inline-flex; align-items: center;
}
.compteurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.compteur { border: 1px solid var(--ligne); border-radius: 16px; padding: 12px; display: block; }
.compteur b { display: block; font-size: 26px; line-height: 30px; color: var(--jaune); }
.compteur span { font-size: 12px; color: var(--texte-2); }

/* --- Impression : seulement le contenu, en clair ---------------------------------------------- */
@media print {
  .barre-haut, .onglets, .bouton-flottant, .bulles, .feuille, .pas-imprime { display: none !important; }
  body.avec-onglets main { padding-bottom: 0; }
  html, body { background: #fff !important; color: #111 !important; }
  .livret, .livret * { color: #111 !important; background: transparent !important; border-color: #ccc !important; }
}

/* --- Fiches ---------------------------------------------------------------------------- */
.puce {
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px;
  border-radius: 16px; border: 1px solid var(--ligne-forte); background: transparent; color: var(--texte); font-size: 13px; font-weight: 500;
}
.puce-active { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.puce-etiquette { background: var(--surface-2); border-color: transparent; }
.puce-livret { background: rgba(246, 195, 91, 0.12); border-color: rgba(246, 195, 91, 0.45); color: var(--jaune); }

.bloc { scroll-margin-top: 70px; }
.bloc-enfant { margin-top: 14px; margin-left: 4px; padding-left: 12px; border-left: 2px solid var(--ligne); }
.bloc-titre { cursor: text; font-weight: 600; color: var(--texte); padding: 6px 0 2px; line-height: 1.3; }
.bloc-niveau-0 { font-size: 19px; }
.bloc-niveau-1 { font-size: 16px; }
.bloc-niveau-2 { font-size: 15px; }
.bloc-contenu { cursor: text; font-size: 15.5px; line-height: 1.6; color: #C9CDD6; min-height: 1.4em; border-radius: 6px; }
.bloc-vide { min-height: 0.6em; }
.bouton-bloc {
  width: 36px; height: 36px; flex-shrink: 0; border: 0; border-radius: 18px; background: transparent;
  color: var(--texte-2); display: inline-flex; align-items: center; justify-content: center;
}
.bouton-bloc:active { background: var(--surface-2); color: var(--texte); }

.contenu-md p { margin: 0 0 0.6em; }
.contenu-md p:last-child { margin-bottom: 0; }
.contenu-md ul { margin: 0 0 0.6em; padding-left: 1.25em; list-style: disc; }
.contenu-md ol { margin: 0 0 0.6em; padding-left: 1.25em; list-style: decimal; }
.contenu-md li { margin: 0.2em 0; }
.contenu-md li.li-case { list-style: none; margin-left: -1.25em; }
.contenu-md li::marker { color: var(--texte-2); }
.contenu-md blockquote { border-left: 3px solid var(--ligne-forte); padding-left: 0.75em; color: var(--texte-2); margin: 0.5em 0; }
.contenu-md a { text-decoration: underline; color: var(--accent); }
.contenu-md strong { color: var(--texte); }
.case-interactive { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: -3px; margin-right: 4px; }
.ref-personne { background: rgba(196, 160, 255, 0.16); color: #D4BBFF; border-radius: 4px; padding: 0 4px; text-decoration: none !important; }
.ref-date { background: rgba(110, 168, 255, 0.16); color: var(--bleu); border-radius: 4px; padding: 0 4px; }
.ref-lien { background: rgba(124, 224, 181, 0.14); color: var(--accent); border-radius: 4px; padding: 0 4px; text-decoration: none !important; }
.ref-lien-inconnu { background: var(--surface-2); color: var(--texte-2); border-radius: 4px; padding: 0 4px; }
.video-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin: 0.5em 0; border-radius: 14px; background: var(--surface-2); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.image-bloc { max-width: 100%; max-height: 320px; border-radius: 12px; display: block; margin: 0.5em 0; object-fit: cover; }
.moodboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 0.5em 0; }
.moodboard .image-bloc { margin: 0; width: 100%; height: 120px; }

/* Suggestions (@, [[, recherche) */
.tiroir-suggestions {
  position: fixed; z-index: 70; max-height: 15rem; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--ligne-forte); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); padding: 4px;
}
.tiroir-suggestions[hidden] { display: none; }
.tiroir-statique { position: absolute; left: 0; right: 0; top: calc(100% + 4px); }
.suggestion {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 15px; color: var(--texte);
}
.suggestion:hover, .suggestion-active { background: var(--ligne); }

/* --- Foyer : tâches à cocher ------------------------------------------------------------------ */
.tache { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 52px; }
.case-ronde {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 15px; border: 2px solid var(--teinte, var(--bleu));
  background: transparent; color: var(--sur-accent); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.tache-faite .case-ronde { background: var(--teinte, var(--bleu)); }
.tache-passee .case-ronde { border-style: dashed; color: var(--texte-2); }
.tache-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  border: 0; background: transparent; color: inherit; text-align: left; padding: 6px 0; }
.tache-titre { font-size: 16px; line-height: 1.3; }
.tache-etat { font-size: 13px; color: var(--jaune); }
.tache-faite .tache-titre, .tache-passee .tache-titre { color: var(--texte-2); text-decoration: line-through; }
.tache-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--texte-2); }
.tache-detail .pastille { margin-right: -5px; }
.avatar { width: 26px; height: 26px; flex-shrink: 0; border-radius: 13px; color: #fff; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.case-carree { width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; border: 2px solid var(--ligne-forte);
  display: inline-flex; align-items: center; justify-content: center; color: var(--sur-accent); }
.case-carree-ok { background: var(--accent); border-color: var(--accent); }
.liste-taches { background: var(--surface); border-radius: 18px; padding: 2px 14px; }
.liste-taches > * + * { border-top: 1px solid var(--ligne); }
.groupe-moment { margin: 18px 4px 6px; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.fil .fil-heure.fil-moment { font-size: 12px; line-height: 1.2; top: 18px; }
.fil-ligne > .tache { margin-left: 0; }

/* Choix de la personne (moi / foyer / un membre) */
.puces { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puces .puce { flex-shrink: 0; }
/* Planning : roues qu'on fait défiler au doigt (jours, semaines, mois) */
.bascule-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.roue { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; margin: 0 -16px 12px; padding: 2px 0; }
.roue::-webkit-scrollbar { display: none; }
.roue-libelle { margin: 0 4px 4px; font-size: 13px; font-weight: 600; color: var(--texte-2); }
.roue-jour { flex: 0 0 calc(100% / 7); scroll-snap-align: center; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 0; border-radius: 14px; font-size: 12px; color: var(--texte-2); }
.roue-jour b { font-size: 17px; color: var(--texte); font-weight: 600; }
.roue-jour.lundi:not([aria-current]) { box-shadow: -1px 0 0 var(--ligne); }
.roue-jour.aujourdhui:not([aria-current]) b { color: var(--accent); }
.roue-point { width: 5px; height: 5px; border-radius: 3px; }
.roue-point.a { background: var(--bleu); }
.roue-point.ok { background: var(--accent); }
.roue-bloc { flex: 0 0 27%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px;
  margin: 0 3px; padding: 8px 4px; border-radius: 14px; background: var(--surface); font-size: 12px; color: var(--texte-2); }
.roue-bloc b { font-size: 15px; color: var(--texte); font-weight: 600; }
.roue-bloc.aujourdhui:not([aria-current]) b { color: var(--accent); }
.roue-jour[aria-current], .roue-bloc[aria-current] { background: var(--accent); color: var(--sur-accent); }
.roue-jour[aria-current] b, .roue-bloc[aria-current] b { color: var(--sur-accent); }
.roue-jour[aria-current] .roue-point.a, .roue-jour[aria-current] .roue-point.ok { background: var(--sur-accent); }
.semaine-bloc.aujourdhui { box-shadow: inset 0 0 0 1px var(--accent); }
.mois-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mois-tete { text-align: center; font-size: 11px; color: var(--texte-2); padding-bottom: 2px; }
.mois-case { min-height: 54px; display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 10px;
  background: var(--surface); font-size: 13px; color: var(--texte); }
.mois-case.autre { opacity: .35; }
.mois-case.chargee { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--jaune); }
.mois-case.aujourdhui .mois-num { color: var(--accent); font-weight: 700; }
.mois-case[aria-current] { box-shadow: inset 0 0 0 2px var(--accent); }
.mois-points { display: flex; flex-wrap: wrap; gap: 2px; }
.mois-points i { width: 6px; height: 6px; border-radius: 3px; background: var(--c); }
.mois-points i.ok { opacity: .3; }
.barre-progres { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.barre-progres span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bloc-maintenant button.agir {
  align-self: flex-start; height: 44px; padding: 0 20px; border-radius: 22px; border: 0;
  background: var(--sur-accent); color: var(--accent); font-size: 15px; font-weight: 700;
}
.bandeau-enfant { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px;
  padding: 10px 14px; border-radius: 16px; background: rgba(110, 168, 255, 0.12); color: var(--bleu); font-size: 14px; }

/* Suivi d'une routine ou d'une habitude : 12 semaines, une ligne par semaine */
.suivi { display: grid; grid-template-columns: 3rem repeat(7, minmax(0, 1fr)) 3rem; gap: 5px; align-items: center; }
.suivi-tete { text-align: center; font-size: 11px; color: var(--texte-2); }
.suivi-date { font-size: 11px; color: var(--texte-2); }
.suivi-case { display: block; aspect-ratio: 1; max-height: 28px; width: 100%; border-radius: 7px; background: var(--surface); }
p .suivi-case { width: 12px; height: 12px; }
.suivi-case.fait { background: var(--accent); }
.suivi-case.manque { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--danger); }
.suivi-case.futur { opacity: .4; }
.suivi-case.aujourdhui { outline: 2px solid var(--texte-2); outline-offset: 1px; }
.suivi-compte { font-size: 12px; text-align: right; color: var(--texte-2); }
.suivi-compte.reussie { color: var(--accent); font-weight: 700; }

/* --- Bulle de dictée (suit la navigation) ----------------------------------------------- */
.dictee {
  position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(88px + var(--bas-sur));
  max-width: 30rem; margin: 0 auto; padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 8px;
  background: rgba(26, 29, 35, 0.98); border: 1px solid var(--ligne-forte); border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: apparaitre 0.18s ease-out;
}
.dictee[hidden], .dictee-pastille[hidden], .dictee-morceaux[hidden] { display: none; }
.dictee-tete { display: flex; align-items: center; gap: 4px; }
.dictee-nom { flex: 1; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }
.dictee-morceaux {
  max-height: 28vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
  margin: 0; padding: 0; list-style: none;
}
.dictee-morceaux li {
  position: relative; padding: 6px 30px 6px 10px; border-radius: 12px; background: var(--surface-2);
  font-size: 14px; line-height: 1.35; display: flex; flex-direction: column; gap: 2px; white-space: pre-line;
}
.dictee-lieu { font-size: 11px; color: var(--texte-2); }
.dictee-retirer {
  position: absolute; top: 2px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 13px;
  background: transparent; color: var(--texte-2); font-size: 18px; line-height: 1;
}
.dictee-champ { min-height: 3.5rem; max-height: 30vh; resize: vertical; }
.dictee-envoyer { width: 100%; }
.dictee-pastille {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: calc(88px + var(--bas-sur));
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--surface-2); color: var(--accent); border: 1px solid var(--ligne-forte);
  font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
body.avec-dictee main { padding-bottom: calc(22rem + var(--bas-sur)); }
body.avec-dictee .bouton-flottant { display: none; }
@media print { .dictee, .dictee-pastille { display: none !important; } }

/* --- Agenda ------------------------------------------------------------------------------ */
.rdv-heure { flex-shrink: 0; min-width: 3.2rem; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--texte-2); }

/* --- Finances (repris de myBudget) ------------------------------------------------------- */
.bascule-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bascule-4 a { font-size: 13px; }
.montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.grand-montant { font-size: 36px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.choix { cursor: pointer; display: inline-block; }
.choix span { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px; border-radius: 18px;
  border: 1px solid var(--ligne-forte); color: var(--texte-2); font-size: 14px; }
.choix small { color: var(--texte-2); opacity: 0.8; font-size: 12px; }
.choix input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); font-weight: 600; }
.choix input:checked + span small { color: var(--sur-accent); }
.choix input:focus-visible + span { box-shadow: 0 0 0 3px rgba(124, 224, 181, 0.35); }
.choix-groupe { display: flex; flex-wrap: wrap; gap: 6px; }
.encart { border-radius: 14px; padding: 10px 14px; font-size: 14px; border: 1px solid; }
.encart-ok { background: rgba(124, 224, 181, 0.08); border-color: rgba(124, 224, 181, 0.35); color: #BDF0D8; }
.encart-info { background: rgba(110, 168, 255, 0.08); border-color: rgba(110, 168, 255, 0.35); color: #BFD6FF; }
.encart-alerte { background: rgba(246, 195, 91, 0.08); border-color: rgba(246, 195, 91, 0.4); color: #F8DCA0; }
.encart-danger { background: rgba(255, 122, 122, 0.08); border-color: rgba(255, 122, 122, 0.4); color: #FFC2C2; }
.lignes-chiffres > * + * { border-top: 1px solid var(--ligne); }
.lignes-chiffres > * { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 9px 0; }
.repartition-barre { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }

/* Blocs d'un projet (étapes, listes, décisions, notes, liens) */
.bloc-projet { background: var(--surface); border-radius: 16px; padding: 8px 4px 8px 14px; scroll-margin-top: 80px; }
.bloc-projet:target { box-shadow: 0 0 0 1px var(--ligne-forte); }
.bloc-type { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.bloc-ajouter { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 16px;
  border: 1.5px dashed var(--ligne-forte); color: var(--texte); font-weight: 600; background: transparent; cursor: pointer; }
.bloc-ajouter:active { background: var(--surface); }
.bloc-choix { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 56px;
  padding: 8px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--ligne); text-align: left; cursor: pointer; }
.case-carree { width: 26px; height: 26px; margin: 9px 0; border-radius: 7px; border: 2px solid var(--ligne-forte);
  display: flex; align-items: center; justify-content: center; color: var(--sur-accent); cursor: pointer; }
.case-carree.cochee { background: var(--orange); border-color: var(--orange); }

/* Écran Jour : barre de dictée et tuiles des projets en cours */
.barre-dictee { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 7px 0 18px; margin-bottom: 14px;
  border-radius: 29px; background: var(--surface); border: 1px solid var(--ligne-forte); color: var(--texte-2); font-size: 15px; }
.barre-dictee > span:first-child { flex: 1; min-width: 0; }
.barre-dictee-micro { width: 44px; height: 44px; border-radius: 22px; background: var(--accent); color: var(--sur-accent);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tuiles-en-cours { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tuile-en-cours { background: var(--surface); border-radius: 16px; padding: 12px; min-height: 118px; display: flex; flex-direction: column; gap: 6px; }
.tuile-titre { font-size: 14px; line-height: 18px; font-weight: 700; overflow-wrap: anywhere; }
.tuile-pas { font-size: 12px; line-height: 16px; color: var(--texte-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tuile-pied { margin-top: auto; font-size: 12px; line-height: 16px; color: var(--jaune); font-weight: 600; }

/* Photos et documents des projets */
.galerie { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.galerie img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.galerie-retirer button { position: relative; width: 100%; display: block; text-align: left; }
.galerie-croix { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
  background: rgba(0, 0, 0, .65); color: #fff; }
.document-ligne { display: flex; align-items: center; gap: 12px; padding: 8px 0; min-height: 52px; }
.document-icone { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 10px; font-weight: 700;
  letter-spacing: .02em; background: var(--surface-2); color: var(--orange); border: 1px solid var(--ligne); overflow: hidden; }
.document-miniature { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.photo-en-grand { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 12px; cursor: zoom-out; }
.photo-en-grand img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

/* Idées pour une personne, Proposer avec Claude */
.etat-idees { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--texte-2);
  text-transform: none; letter-spacing: 0; }
.etat-idees.etat-trouve { background: var(--accent); color: var(--sur-accent); }
.etat-idees.etat-a-trouver { color: var(--orange); }
.idee { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 8px 8px 8px 12px; }
.pastille-idee { min-height: 32px; padding: 0 12px; border-radius: 16px; font-size: 12px; font-weight: 700; background: var(--surface);
  color: var(--texte); border: 1px solid var(--ligne-forte); }
.pastille-idee.pastille-achete { background: var(--accent); color: var(--sur-accent); border-color: var(--accent); }
.bouton-claude { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 22px;
  font-weight: 600; color: var(--accent); border: 1px dashed var(--accent); background: transparent; width: 100%; }
.bouton-claude:disabled { opacity: .7; }
.proposition { display: flex; gap: 10px; align-items: flex-start; }
.proposition textarea:disabled { opacity: .45; text-decoration: line-through; }

/* Fil du jour rangé au doigt : repères fixes, poignée pour faire glisser, to-do « à caser » */
.fil-trier { display: flex; flex-direction: column; gap: 4px; }
.fil-repere { position: relative; min-height: 26px; border-top: 1px dashed var(--ligne); margin-top: 6px; }
.fil-repere .fil-heure.fil-moment { top: 6px; font-weight: 600; }
.fil-repere-debut { min-height: 0; border: 0; margin: 0; }
.poignee { flex-shrink: 0; width: 36px; height: 44px; display: flex; align-items: center; justify-content: center;
  color: var(--texte-2); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.fil-ligne > .tache { flex: 1; min-width: 0; }
.fil-fantome { opacity: 0.35; }
.fil-choisi { background: var(--surface-2); border-radius: 12px; }
.a-caser-liste { display: flex; flex-direction: column; gap: 2px; min-height: 8px; }
.a-caser-el { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 4px 0 12px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 12px; }
.fil-point-caser { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; }
.a-caser-ajouter { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
/* Un élément de la to-do posé dans le fil le temps de l'enregistrer */
.fil-trier .a-caser-el { margin-left: 0; }

/* Écran de vérification de la dictée : un nouveau projet, et ce qui va dedans juste en dessous */
.tri-projet { border-left: 3px solid var(--accent); }
.tri-dans-projet { margin-left: 1rem; border-left: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); }
