/* Entre Nous : une porte de frigo. Des notes, des aimants, la couleur dit le type de liste. */
@font-face { font-family: "Entre Nous Texte"; font-weight: 400; font-display: swap; src: url("polices/texte-400.woff") format("woff"); }
@font-face { font-family: "Entre Nous Texte"; font-weight: 600; font-display: swap; src: url("polices/texte-600.woff") format("woff"); }
@font-face { font-family: "Entre Nous Texte"; font-weight: 700; font-display: swap; src: url("polices/texte-700.woff") format("woff"); }
@font-face { font-family: "Entre Nous Titre"; font-weight: 800; font-display: swap; src: url("polices/titre-800.woff") format("woff"); }
:root {
  /* Valeurs de repli : les couleurs viennent de palettes.css, fabriqué par outils/generer_palettes.py. */
  --fond: #ffffff;
  --surface: #eef3f0;
  --champ: #ffffff;
  --encre: #212e53;
  --doux: #4a5472;
  --trait: #d3ddd8;
  --vif: #212e53;
  --vif-texte: #ffffff;
  --danger: #a8434a;
  --etoile: #ce6a6b;
  --ombre: 0 1px 2px rgba(33, 46, 83, .12);
  /* Les notes gardent leur couleur, sur le tableau comme ouvertes. L'encre reste foncée dessus. */
  --encre-note: #212e53;
  --doux-note: #212e53;
  --citron: #dd8f8d;  --citron-papier: #dd8f8d;
  --menthe: #bed3c3;  --menthe-papier: #bed3c3;
  --ciel: #7fb6bf;    --ciel-papier: #7fb6bf;
  --rose: #ebaca2;    --rose-papier: #ebaca2;
  --lilas: #a9d0d5;   --lilas-papier: #a9d0d5;
  --peche: #f5d6ce;   --peche-papier: #f5d6ce;
  --gris: #dfe6e2;    --gris-papier: #dfe6e2;
  --aimant: #212e53;
  --bandeau: #4a919e;
  --logo-fond: #ebaca2;
  --logo-punaise: #ce6a6b;
  --haut-entete: 48px;
  --trait-papier: rgba(33, 46, 83, .22);
  --encre-papier: #212e53;
  --doux-papier: #212e53;
  --titre: "Entre Nous Titre", "Entre Nous Texte", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #171f3a;
    --surface: #212e53;
    --champ: #212e53;
    --encre: #eef3f0;
    --doux: #bed3c3;
    --trait: #3b4a73;
    --vif: #ebaca2;
    --vif-texte: #212e53;
    --danger: #f2a6a6;
    --etoile: #ebaca2;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4);
    --citron-papier: #5c3338;
    --menthe-papier: #2e4a40;
    --ciel-papier: #1f4a54;
    --rose-papier: #5c3f3f;
    --lilas-papier: #25505a;
    --peche-papier: #53403d;
    --gris-papier: #2b3654;
    --aimant: #ce6a6b;
    --trait-papier: rgba(255, 255, 255, .2);
    --encre-papier: #eef3f0;
    --doux-papier: #bed3c3;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Écran serré : 14 px pour le texte, 12 px pour le secondaire, jamais moins. */
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 14px/1.35 "Entre Nous Texte", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[hidden] { display: none !important; }
a { color: var(--vif); }
p { margin: .4rem 0; }
h1, h2, .note-titre, .nom-feuille, .type-carte strong, .fete {
  font-family: var(--titre);
}
h2 { font-size: .95rem; font-weight: 800; margin: .8rem 0 .25rem; }

.entete {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: .15rem;
  min-height: var(--haut-entete);
  /* Sur un grand écran, le titre, le pseudo et le réglage restent alignés sur le contenu. */
  padding: max(.15rem, env(safe-area-inset-top)) max(12px, calc((100% - 696px) / 2)) .15rem;
  background: var(--fond);
}
.entete h1 { flex: 1; min-width: 0; margin: 0; font-size: 1rem; font-weight: 800; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.retour, .reglages-lien { flex: none; display: flex; align-items: center; justify-content: center; min-width: 34px; min-height: 38px; padding: 0; color: var(--vif); background: none; border: 0; cursor: pointer; font: inherit; font-size: 1.5rem; line-height: 1; text-decoration: none; }
.reglages-lien { font-size: 1.1rem; }

main { max-width: 720px; margin: 0 auto; padding: 2px 12px calc(60px + env(safe-area-inset-bottom)); outline: none; }
.intro { color: var(--doux); margin: 0 0 .5rem; }
.texte-long { padding-top: 12px; padding-bottom: 32px; }
.texte-long h1 { font-size: 1.25rem; font-weight: 800; }

.bandeau { margin: 0; padding: .25rem 12px; background: var(--citron); color: var(--encre-note); font-size: 12px; text-align: center; }
.message {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10;
  max-width: 696px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .8rem; border-radius: 12px;
  background: var(--encre); color: var(--fond); font-size: 13px;
}
.message button { flex: none; background: none; border: 0; color: inherit; text-decoration: underline; font: inherit; font-weight: 700; padding: .2rem; cursor: pointer; }

/* ------- le tableau de notes ------- */
.tableau { list-style: none; margin: 0 0 .5rem; padding: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 14px 8px; }
.tableau > li { min-width: 0; display: flex; }
.note {
  position: relative; display: block; width: 100%;
  padding: .7rem .55rem .5rem;
  color: var(--encre-note); text-decoration: none; text-align: left; font: inherit;
  border: 0; border-radius: 5px; box-shadow: var(--ombre);
  overflow-wrap: anywhere;
}
.tableau > li:nth-child(4n+1) > .note { transform: rotate(-.9deg); }
.tableau > li:nth-child(4n+2) > .note { transform: rotate(.7deg); }
.tableau > li:nth-child(4n+3) > .note { transform: rotate(.5deg); }
.tableau > li:nth-child(4n+4) > .note { transform: rotate(-.6deg); }
a.note:active, button.note:active { transform: scale(.98); }
.note-citron, .type-carte.note-citron { background: var(--citron); }
.note-menthe, .type-carte.note-menthe { background: var(--menthe); }
.note-ciel, .type-carte.note-ciel { background: var(--ciel); }
.note-rose { background: var(--rose); }
.note-lilas { background: var(--lilas); }
.note-peche { background: var(--peche); }
.note-gris { background: var(--gris); }
.type-carte.note-rose { background: var(--rose); }
.type-carte.note-lilas { background: var(--lilas); }
.type-carte.note-peche { background: var(--peche); }
.type-carte.note-gris { background: var(--gris); }
.aimant {
  position: absolute; top: -6px; left: 50%; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%;
  background: var(--aimant);
}
.note-titre { display: block; font-size: 13.5px; font-weight: 800; line-height: 1.2; }
/* Sur le tableau, l'icône se pose dans le coin : un long nom ne la laisse plus seule sur sa ligne. */
.tableau .note:not(.note-nouvelle) { padding-top: 1rem; }
.tableau .note-titre > span { position: absolute; top: 2px; left: 6px; font-size: 13px; }
.note small { display: block; margin-top: .1rem; color: var(--doux-note); font-size: 12px; font-weight: 600; }
.note p { margin: .25rem 0; }
.apercu { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: .2rem; color: var(--doux-note); font-size: 12px; line-height: 1.25; }
.note-nouvelle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 62px; text-align: center; cursor: pointer; font-size: 13px;
  color: var(--vif); background: transparent; border: 2px dashed var(--vif); box-shadow: none;
}
.plus { font-size: 1.25rem; line-height: 1; font-weight: 300; }
.etape-note { margin: 12px 0 10px; }

.choix-types { margin: 0 0 .6rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
.type-carte {
  display: flex; align-items: center; gap: .4rem; width: 100%; padding: .35rem .5rem;
  color: var(--encre-note); font: inherit; text-align: left; cursor: pointer;
  border: 0; border-radius: 5px; box-shadow: var(--ombre);
}
.type-emoji { font-size: 1.25rem; line-height: 1; }
.type-carte strong { display: block; font-size: 13.5px; font-weight: 800; }
.type-carte small { display: block; color: var(--doux-note); font-size: 12px; }

/* ------- membres ------- */
.membres { margin-bottom: .1rem; }
.rang-membres { display: flex; align-items: center; justify-content: space-between; gap: .4rem; min-height: 36px; }
.rang-membres .bouton { flex: none; }
.avatars { display: flex; align-items: center; min-height: 36px; padding: 0; background: none; border: 0; cursor: pointer; }
.avatar {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 30px; height: 30px; margin-right: -6px;
  color: var(--encre-note); background: var(--lilas); border: 2px solid var(--fond); border-radius: 50%;
  font-size: 11.5px; font-weight: 800;
}
.avatar:nth-child(3n+2) { background: var(--rose); }
.avatar:nth-child(3n+3) { background: var(--menthe); }
.detail-membres { margin-top: .35rem; }
.panneau-qr { margin: .4rem 0; padding: .6rem; background: var(--surface); border-radius: 12px; box-shadow: var(--ombre); }
.carte-liste { list-style: none; margin: 0 0 .4rem; padding: 0; background: var(--surface); border-radius: 12px; overflow: hidden; }
.carte-liste li + li { border-top: 1px solid var(--trait); }
.rangee-membre { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .65rem; flex-wrap: wrap; }
.rangee-membre .actions { display: flex; gap: .3rem; flex-wrap: wrap; }
.discret { color: var(--doux); font-size: 12px; margin: .15rem 0 .25rem; }

/* ------- formulaires ------- */
label { display: block; font-weight: 700; font-size: 13px; margin: .5rem 0 .15rem; }
textarea { width: 100%; padding: .35rem .65rem; font: inherit; color: var(--encre); background: var(--champ); border: 1.5px solid var(--trait); border-radius: 10px; resize: vertical; }
input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="time"], input[type="number"], select {
  width: 100%; min-height: 38px; padding: .3rem .65rem;
  font: inherit; color: var(--encre);
  background: var(--champ); border: 1.5px solid var(--trait); border-radius: 10px;
}
/* Sur iPhone, Safari agrandit toute la page si un champ fait moins de 16 px. */
@supports (-webkit-touch-callout: none) {
  input[type="text"], input[type="password"], input[type="email"], input[type="date"], input[type="time"], input[type="number"], select, textarea { font-size: 16px; }
}
input:focus-visible, select:focus-visible, textarea:focus-visible, label:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--vif); outline-offset: 1px; }
.champ-mdp { position: relative; }
.champ-mdp input { padding-right: 4.6rem; }
.voir { position: absolute; top: 2px; right: 2px; bottom: 2px; padding: 0 .6rem; color: var(--vif); background: none; border: 0; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.sous-champ { margin: .2rem 0 .45rem; text-align: right; font-size: 13px; }
.rangee-bouton { margin: .4rem 0; }
.bouton {
  display: inline-block; min-height: 38px; padding: .4rem .9rem;
  font: inherit; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none;
  color: var(--vif-texte); background: var(--vif); border: 1.5px solid var(--vif); border-radius: 999px;
}
.bouton.second { color: var(--vif); background: transparent; }
.bouton.petit { min-height: 30px; padding: .15rem .7rem; font-size: 13px; }
.bouton.danger { color: var(--danger); background: transparent; border-color: var(--danger); }
.bouton.large { display: block; width: 100%; }
.espace { margin-top: .5rem; }
.note .bouton.second { color: var(--encre-note); border-color: var(--encre-note); }
.note .bouton:not(.second) { color: #fff; background: var(--encre-note); border-color: var(--encre-note); }
.lien-danger { padding: .25rem 0; color: var(--danger); background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.pile > * + * { margin-top: .35rem; }
.lien-copie { word-break: break-all; font-size: 12px; color: var(--doux); margin: .2rem 0 0; }
.erreur { color: var(--danger); font-weight: 700; font-size: 13px; margin: .35rem 0; }
.repli { margin: .6rem 0; }
.repli summary, .bloc > summary { cursor: pointer; font-weight: 700; color: var(--vif); min-height: 34px; padding-top: .4rem; }
details.bloc { border-top: 1px solid var(--trait); }
.contenu-repli { padding-bottom: .6rem; }
section.bloc { margin-bottom: .5rem; }
.rang-boutons { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }

/* ------- l'accueil ------- */
.accueil .entete { position: static; padding-top: max(.5rem, env(safe-area-inset-top)); }
.grand-titre { margin: .2rem 0 .5rem; font-size: min(42px, 10.8vw); font-weight: 800; line-height: .98; letter-spacing: -.03em; }
/* Tout le groupe suit la largeur : --u vaut 1 px sur un écran de 382 px et plus, moins sur un petit téléphone. */
.objets { --u: calc(min(100vw - 24px, 358px) / 358); position: relative; width: calc(358 * var(--u)); height: calc(234 * var(--u)); margin: 0 auto; color: var(--encre-note); }
.objets > div { position: absolute; }
.objets h3 { margin: 0; font-family: var(--titre); font-weight: 800; line-height: 1.04; }
.objet-liste { left: 0; top: calc(14 * var(--u)); width: calc(172 * var(--u)); height: calc(148 * var(--u)); padding: calc(16 * var(--u)) calc(12 * var(--u)); background: var(--citron); border-radius: 6px; transform: rotate(-3deg); }
.objet-liste h3 { font-size: calc(23 * var(--u)); }
.objet-liste ul { list-style: none; margin: calc(6 * var(--u)) 0 0; padding: 0; font-size: calc(13.5 * var(--u)); font-weight: 600; line-height: 1.4; }
.objet-calendrier { right: 0; top: 0; width: calc(172 * var(--u)); height: calc(150 * var(--u)); overflow: hidden; background: #fff; border: 2px solid var(--encre-note); border-radius: 12px; transform: rotate(2.5deg); }
.objet-calendrier h3 { padding: calc(6 * var(--u)) calc(10 * var(--u)); color: #fff; background: var(--bandeau); font-size: calc(18 * var(--u)); }
.objet-calendrier p { margin: 0; padding: calc(6 * var(--u)) calc(10 * var(--u)); font-size: calc(12.5 * var(--u)); font-weight: 600; line-height: 1.3; }
.objet-pense-bete { left: calc(106 * var(--u)); top: calc(156 * var(--u)); width: calc(172 * var(--u)); height: calc(72 * var(--u)); padding: calc(12 * var(--u)) calc(10 * var(--u)) calc(6 * var(--u)); text-align: center; background: var(--menthe); border-radius: 6px; transform: rotate(-1.5deg); }
.objet-pense-bete h3 { font-size: calc(22 * var(--u)); }
.phrase-privee { margin: .5rem 0 .6rem; font-size: min(12px, 3vw); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; text-align: center; white-space: nowrap; }
.accueil main { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.accueil .pied { margin-top: .5rem; }
.accueil .repli { margin: .25rem 0; }

/* ------- une liste ouverte : la note devient la page ------- */
.feuille { position: relative; margin-top: 8px; padding: .55rem .65rem .5rem; color: var(--encre-papier); border-radius: 6px; box-shadow: var(--ombre); }
.feuille a { color: inherit; }
.feuille { background: var(--papier); border-top: 6px solid var(--bord); }
.feuille-citron { --papier: var(--citron-papier); --bord: var(--citron); }
.feuille-menthe { --papier: var(--menthe-papier); --bord: var(--menthe); }
.feuille-ciel { --papier: var(--ciel-papier); --bord: var(--ciel); }
.feuille-rose { --papier: var(--rose-papier); --bord: var(--rose); }
.feuille-lilas { --papier: var(--lilas-papier); --bord: var(--lilas); }
.feuille-peche { --papier: var(--peche-papier); --bord: var(--peche); }
.feuille-gris { --papier: var(--gris-papier); --bord: var(--gris); }
.feuille > .aimant { top: -10px; }
.tete-feuille { display: flex; align-items: center; gap: .3rem; margin-bottom: .25rem; }
.emoji-feuille { flex: none; font-size: 1.15rem; line-height: 1; }
input.nom-feuille[type="text"] { flex: 1; min-width: 0; min-height: 32px; padding: 0 .2rem; color: inherit; background: transparent; border: 1.5px solid transparent; border-radius: 6px; font-size: 18px; font-weight: 800; }
input.nom-feuille[type="text"]:focus { border-color: var(--trait-papier); }
.saisie { position: sticky; top: var(--haut-entete); z-index: 4; margin-bottom: .1rem; padding: 2px 0 4px; background: inherit; }
.saisie form { display: flex; gap: .35rem; }
.saisie input { flex: 1; min-width: 0; }
.bouton.ajouter { flex: none; width: 38px; padding: 0; font-size: 1.3rem; line-height: 1; }
.suggestions { list-style: none; margin: .25rem 0 0; padding: 0; color: var(--encre); background: var(--surface); border-radius: 10px; overflow: hidden; box-shadow: 0 8px 20px rgba(33, 46, 83, .28); }
.suggestions li + li { border-top: 1px solid var(--trait); }
.suggestion { display: block; width: 100%; min-height: 38px; padding: .3rem .65rem; font: inherit; color: inherit; text-align: left; background: none; border: 0; cursor: pointer; }
.suggestion strong { display: block; font-weight: 700; }
.suggestion span { display: block; color: var(--doux); font-size: 12px; }
.suggestion[aria-selected="true"], .suggestion:hover { background: var(--fond); }
.suggestion.alerte span { color: var(--danger); font-weight: 600; }

.lignes { list-style: none; margin: 0; padding: 0; }
.feuille[data-type="discussion"] .saisie { top: auto; bottom: 0; margin: .4rem 0 0; padding: 4px 0 2px; }
.fil { display: flex; flex-direction: column; gap: .35rem; }
.bulle { max-width: 85%; align-self: flex-start; }
.bulle.mien { align-self: flex-end; }
.bulle .ligne-corps { display: block; width: auto; min-height: 0; padding: .35rem .6rem; color: var(--encre-note); text-align: left; background: #fff; border: 0; border-radius: 12px 12px 12px 3px; overflow-wrap: anywhere; font: inherit; }
.bulle.mien .ligne-corps { background: var(--citron); border-radius: 12px 12px 3px 12px; }
.bulle .ligne-corps > * { display: block; }
.bulle .auteur-message { font-size: 12px; font-weight: 700; }
/* Plus précis que « .ligne-corps small », qui donne une encre claire en mode sombre et coupe les textes longs. */
.bulle .ligne-corps small { max-width: none; margin-top: .1rem; color: var(--encre-note); font-size: 11px; white-space: normal; }
.bulle .rang-boutons, .bulle .edition { margin-top: .25rem; }
.ligne { display: flex; align-items: center; gap: .1rem; min-height: 34px; border-bottom: 1px solid var(--trait-papier); }
.lignes li:last-child > .ligne { border-bottom: 0; }
.coche { flex: none; width: 30px; height: 34px; padding: 0; background: none; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: flex-start; color: inherit; }
.coche i { display: block; width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 50%; }
.ligne.finie .coche i { background: currentColor; box-shadow: inset 0 0 0 3px var(--papier); }
.coche.pop i { animation: pop .32s ease-out; }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
.ligne-corps { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; padding: .25rem 0; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.ligne-corps small { flex: none; max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--doux-papier); font-size: 12px; }
.ligne.finie .ligne-texte { text-decoration: line-through; color: var(--doux-papier); }
.en-attente small::after { content: " (en attente)"; }
.edition { padding: .25rem 0 .5rem; }
.titre-finies { margin-top: .6rem; color: var(--doux-papier); }
.vide { padding: .4rem .1rem; color: inherit; margin: 0; }
.fete { margin: .2rem 0; padding: .4rem .1rem; font-size: 1.05rem; font-weight: 800; }
.fete-animee span { display: inline-block; animation: pop .5s ease-out; }

.lieu { align-items: flex-start; padding: .15rem 0; }
.lieu .ligne-corps { display: block; padding: .15rem 0; }
.lieu .ligne-texte { font-weight: 700; }
.lieu .adresse { display: block; max-width: none; white-space: normal; line-height: 1.2; }
.lieu .remarque { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; max-width: none; margin-top: .2rem; white-space: pre-line; line-height: 1.25; font-style: italic; color: var(--doux-papier); }
.note-lieu { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.note-lieu small { color: var(--doux-papier); font-size: 12px; white-space: nowrap; }
.y-aller { margin-left: .4rem; font-weight: 700; }
.etoiles { display: inline-flex; }
.etoile { width: 23px; height: 26px; padding: 0; color: var(--etoile); background: none; border: 0; font-size: 1.15rem; line-height: 1; cursor: pointer; }

/* ------- dates et rappels ------- */
.dates { display: grid; grid-template-columns: 1.25fr 1fr 1.25fr; gap: .3rem; margin-top: .15rem; }
.dates > div { min-width: 0; }
.dates label { margin: 0; font-size: 12px; font-weight: 600; }
.dates input { min-height: 34px; padding: .1rem .3rem; }
.evenement { flex-wrap: wrap; padding: .15rem 0; }
.evenement .ligne-corps { flex: 1 0 100%; display: block; padding: .15rem 0 0; }
.evenement .ligne-texte { font-weight: 700; }
.evenement .quand { display: block; max-width: none; white-space: normal; }
.evenement.passe { opacity: .6; }
.rappels { display: flex; align-items: center; gap: .25rem; padding: .1rem 0 .2rem; font-size: 12px; }
.rappel { min-height: 26px; padding: 0 .5rem; color: inherit; background: transparent; border: 1px solid var(--trait-papier); border-radius: 999px; font: inherit; font-size: 12px; cursor: pointer; }
.rappel.choisi { color: #fff; background: var(--encre-note); border-color: var(--encre-note); font-weight: 700; }
.rappel:disabled { opacity: .4; cursor: default; }

/* ------- champs selon le type de liste ------- */
.extras { display: grid; gap: .3rem; margin-top: .3rem; }
.extras.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fichier { position: absolute; width: 1px; height: 1px; opacity: 0; }
.bouton-fichier { margin: 0; cursor: pointer; }
.fichier:focus-visible + * { outline: 2px solid var(--vif); }
.sourdine { flex: none; width: 34px; height: 32px; padding: 0; background: none; border: 0; font-size: 1rem; cursor: pointer; }
.qui { display: inline !important; max-width: none !important; white-space: normal !important; }
.montant { flex: none; font-weight: 800; }
.soldes { margin: .2rem 0 .4rem; padding: .35rem .5rem; background: rgba(255, 255, 255, .45); border-radius: 8px; }
.solde { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .15rem 0; }
.fete.petite { margin: 0; padding: .1rem 0; font-size: .95rem; }
.sondage, .annonce { flex-wrap: wrap; padding: .15rem 0; }
.sondage .ligne-corps, .annonce .ligne-corps { flex: 1 0 100%; }
.options { flex: 1 0 100%; display: grid; gap: .2rem; }
.option { display: flex; justify-content: space-between; gap: .5rem; min-height: 32px; align-items: center; padding: .15rem .55rem; color: inherit; background: transparent; border: 1px solid var(--trait-papier); border-radius: 8px; font: inherit; text-align: left; cursor: pointer; }
.option small { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.option.en-tete { font-weight: 700; border-color: currentColor; }
.option.votee { color: #fff; background: var(--encre-note); border-color: var(--encre-note); }
.ajout-choix { flex: 1 0 100%; display: flex; gap: .3rem; margin-top: .25rem; }
.ajout-choix input { min-height: 32px; }
.mon-tour .ligne-texte { font-weight: 800; }
.sens { padding: 0 .35rem; border: 1px solid currentColor; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.detail-annonce { flex: 1 0 100%; margin: .1rem 0 .2rem; white-space: pre-wrap; font-size: 13px; }
.annonce .rang-boutons { margin: 0 0 .25rem; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .4rem; }
.photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--trait-papier); }
.album .ligne-corps { padding: .1rem 0; }
.interrupteur { display: flex; align-items: flex-start; gap: .5rem; padding: .25rem 0; }
.interrupteur input { flex: none; width: 20px; height: 20px; margin: .1rem 0 0; accent-color: var(--vif); }
.interrupteur label { margin: 0; font-size: 13.5px; }
.interrupteur small { display: block; font-weight: 400; font-size: 12px; color: var(--doux); }

/* ------- un thème a changé : une cloche sur son carré jusqu'à ce qu'on y entre ------- */
.pastille-nouveau { position: absolute; top: -7px; right: -5px; z-index: 1; display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: #fff; background: var(--aimant); border: 2px solid var(--fond); border-radius: 50%; }
.lecteur-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.pseudo-entete { flex: 0 1 auto; max-width: 36%; overflow: hidden; font-size: 12.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.noms-membres { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: .1rem .7rem; margin: 0; padding: 0; list-style: none; font-size: 13px; }

/* ------- console d'administration et demandes ------- */
.bloc-console { margin-bottom: .9rem; }
.bloc-console h2 { margin: 0 0 .3rem; }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; margin: 0; }
.chiffres > div { padding: .35rem .45rem; background: var(--surface); border-radius: 8px; }
.chiffres dd { margin: 0; font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.chiffres dt { font-size: 11.5px; color: var(--doux); }
.barres { display: block; width: 100%; height: auto; margin-top: .5rem; }
.barre { fill: var(--vif); }
.barre-zone:hover .barre { opacity: .75; }
.barres-axe { stroke: var(--trait); stroke-width: 1; }
.barres-texte { fill: var(--doux); font-size: 9px; }
.lecture-barres { margin-top: .1rem; }
.demandes { list-style: none; margin: .4rem 0; padding: 0; }
.demande { margin-bottom: .45rem; padding: .5rem .6rem; background: var(--surface); border-radius: 10px; }
.demande-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.etiquette { flex: none; padding: .05rem .4rem; font-size: 11px; font-weight: 700; color: var(--vif); border: 1px solid currentColor; border-radius: 999px; }
.demande[data-statut="preparee"], .demande[data-statut="analysee"] { outline: 2px solid var(--vif); outline-offset: -2px; }
.analyse { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--trait); font-size: 13px; }
.analyse p { margin: .15rem 0; }
.champs-demande { margin: .2rem 0; font-size: 13px; }
.champs-demande dt { font-weight: 700; }
.champs-demande dd { margin: 0 0 .25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.rangee-demande { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .6rem; font-size: 13px; }
.rangee-demande small { flex: none; color: var(--doux); }

/* ------- partage d'un thème ------- */
.bandeau-partage { display: flex; align-items: center; gap: .4rem; width: 100%; min-height: 32px; margin-bottom: .25rem; padding: .1rem 0; color: inherit; background: none; border: 0; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.avatars-petits { display: flex; flex: none; }
.petit-avatar { width: 22px; height: 22px; margin-right: -5px; font-size: 9.5px; border-color: var(--trait-papier); }
.avatars-petits:not(:empty) { margin-right: 6px; }
.partage-texte { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bandeau-partage strong { flex: none; text-decoration: underline; }
.panneau-partage { margin-bottom: .5rem; padding-bottom: .4rem; border-bottom: 1px solid var(--trait-papier); }
.panneau-partage .panneau-qr { margin-top: 0; color: var(--encre); }
.personnes { list-style: none; margin: .35rem 0 0; padding: 0; font-size: 13px; }
.personnes li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 32px; }
.personnes small { font-size: 12px; color: var(--doux-papier); }
.partage-note { color: var(--doux-note); }
.partage-prive { margin: 0 0 .25rem; font-size: 12.5px; }

.etapes { padding-left: 1.2rem; margin: .3rem 0; }
.etapes li + li { margin-top: .25rem; }
.pied { margin-top: .8rem; font-size: 12px; color: var(--doux); }

/* QR code : toujours sur fond blanc, largeur limitée au téléphone */
.bloc-qr { margin: 0; text-align: center; }
.qr { display: inline-block; width: min(200px, 100%); height: auto; border-radius: 6px; image-rendering: pixelated; }

@media (prefers-reduced-motion: reduce) {
  .coche.pop i, .fete-animee span { animation: none; }
}

/* ------- design A : logo, tableau aimanté, thème ouvert ------- */
.entete h1 { font-size: 18px; letter-spacing: -.01em; }
.logo-mini { position: relative; flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 6px; color: var(--encre-note); background: var(--logo-fond); border-radius: 4px; font-family: var(--titre); font-size: 17px; font-weight: 800; letter-spacing: -.04em; transform: rotate(-5deg); }
.logo-mini i { position: absolute; top: -3px; left: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--aimant); }
/* Même nombre de notes à l'écran qu'avant : tout le tableau tient sans défiler sur un téléphone. */
.tableau .note:not(.note-nouvelle) { padding: 12px 8px 6px; border-radius: 6px; }
.tableau .note-titre { font-size: 15px; line-height: 1.08; letter-spacing: -.01em; }
.tableau .note-titre > span { display: none; }
.tableau .note small { margin-top: 2px; font-size: 12px; font-weight: 700; }
.note-nouvelle { font-weight: 700; border-radius: 6px; }
.note-nouvelle strong { font-family: inherit; }
.feuille { margin-top: 12px; padding: 22px 14px 14px; border-radius: 8px; border-top: 0; box-shadow: none; }
.feuille > .aimant { top: -8px; width: 16px; height: 16px; margin-left: -8px; }
.emoji-feuille { display: none; }
input.nom-feuille[type="text"] { min-height: 40px; padding: 0; font-family: var(--titre); font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.feuille input[type="text"]:not(.nom-feuille), .feuille input[type="email"], .feuille input[type="date"], .feuille input[type="time"], .feuille select, .feuille textarea { min-height: 46px; background: var(--champ); border: 2px solid currentColor; border-radius: 10px; }
.bouton.ajouter { width: 46px; min-height: 46px; border-radius: 10px; }
.saisie { padding-bottom: 6px; }
.ligne { min-height: 44px; gap: .35rem; font-size: 15px; }
.ligne-corps { font-weight: 600; }
.ligne.finie .ligne-corps { font-weight: 400; }
.coche { height: 44px; }
.coche i { width: 22px; height: 22px; border-width: 2px; }
.titre-finies { color: inherit; font-size: 17px; }
@media (prefers-color-scheme: dark) {
  .feuille { border-top: 6px solid var(--bord); }
}

/* ------- tirer vers le bas pour actualiser ------- */
.tirer { position: fixed; top: calc(var(--haut-entete) + env(safe-area-inset-top)); left: 50%; z-index: 9; margin: 0; padding: .3rem .8rem; color: var(--fond); background: var(--encre); border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; transform: translateX(-50%); }

/* ------- avertissement avant de supprimer un cercle ------- */
.avertissement { margin: .8rem 0; padding: .7rem .8rem; border: 2px solid var(--danger); border-radius: 10px; }
.avertissement h2 { margin-top: 0; color: var(--danger); }
.avertissement ul { margin: .3rem 0; padding-left: 1.1rem; }
.avertissement li + li { margin-top: .2rem; }
.bouton-grave { color: #fff; background: #a8434a; border-color: #a8434a; }
.actions-cercle { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.lien-simple { padding: .25rem 0; color: var(--vif); background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; }
.annuler-liens { padding: .25rem 0; color: inherit; background: none; border: 0; font: inherit; text-decoration: underline; cursor: pointer; } /* lisible sur toutes les couleurs de notes */

/* ------- la version et ses nouveautés, sur « Mes cercles » ------- */

/* ------- le bouton vers l'écran d'accueil ------- */
.lien-icone { margin: .4rem 0 .5rem; }
.lien-icone .bouton { display: inline-flex; align-items: center; gap: .25rem; }
.accueil .lien-icone { margin: .2rem 0; }

/* À venir : les prochains rendez-vous sur l'écran des cercles */
.a-venir { margin-top: 1rem; }
.a-venir ul { list-style: none; margin: 0; padding: 0; }
.a-venir a { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: .35rem 0; border-bottom: 1px solid var(--trait); color: var(--encre); text-decoration: none; }
.a-venir strong { font-weight: 700; overflow-wrap: anywhere; }
.a-venir small { color: var(--doux); font-size: 13px; }
.grand-trait { border: 0; border-top: 2px solid var(--encre); margin: 1rem 0 0; }
.grand-trait + .a-venir { margin-top: .6rem; }

/* Pense-bête protégé */
.code-secours { margin: .4rem 0 .6rem; padding: .8rem; border-radius: 10px; background: var(--surface); font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; user-select: all; }
.avertissement { margin: .7rem 0; padding: .7rem .8rem; border-left: 4px solid var(--danger); background: var(--surface); }

/* Le vrai post-it : carré, punaisé, coin bas droit qui se soulève, ombre portée sur le tableau */
.tableau > li { position: relative; }
.tableau > li > .note:not(.note-nouvelle), .tableau > li > .note-nouvelle { aspect-ratio: 1 / 1; z-index: 1; }
.tableau > li > .note:not(.note-nouvelle) {
  border-radius: 2px 2px 34px 2px / 2px 2px 7px 2px;
  box-shadow: 0 1px 1px rgba(33, 46, 83, .16), 2px 4px 7px rgba(33, 46, 83, .2);
}
.tableau > li > .note:not(.note-nouvelle)::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(322deg, rgba(33, 46, 83, .13), rgba(33, 46, 83, 0) 24%);
}
.tableau > li:has(> .note:not(.note-nouvelle))::after {
  content: ""; position: absolute; right: 5px; bottom: 5px; width: 46%; height: 18px; z-index: 0;
  box-shadow: 5px 9px 9px rgba(33, 46, 83, .38); transform: rotate(3.5deg); pointer-events: none;
}
.note .aimant, .objets .aimant, .feuille > .aimant {
  top: -7px; width: 15px; height: 15px; margin-left: -7.5px; z-index: 2;
  background: radial-gradient(circle at 36% 30%, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, 0) 46%, rgba(0, 0, 0, .38) 100%), var(--aimant);
  box-shadow: 2px 3px 3px rgba(33, 46, 83, .4);
}
.note .aimant::after, .objets .aimant::after, .feuille > .aimant::after {
  content: ""; position: absolute; left: 6px; top: 12px; width: 3px; height: 6px; border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .5)), var(--aimant); box-shadow: 2px 2px 2px rgba(33, 46, 83, .3);
}
.objet-liste, .objet-pense-bete { border-radius: 2px 2px 30px 2px / 2px 2px 7px 2px; box-shadow: 0 1px 1px rgba(33, 46, 83, .16), 3px 5px 9px rgba(33, 46, 83, .26); }
.logo-mini { width: 46px; height: 34px; margin-right: 8px; padding-top: 4px; font-size: 8.6px; letter-spacing: -.01em; border-radius: 1px 1px 12px 1px / 1px 1px 3px 1px; box-shadow: 1px 2px 3px rgba(33, 46, 83, .35); }
.logo-mini i { top: -3px; left: 19px; background: radial-gradient(circle at 36% 30%, rgba(255, 255, 255, .5) 0, rgba(255, 255, 255, 0) 46%, rgba(0, 0, 0, .3) 100%), var(--logo-punaise); box-shadow: 1px 1px 1px rgba(33, 46, 83, .4); }

/* La flèche et le réglage : une zone de 44 px sous le doigt, sans déplacer le titre */
.entete .retour, .entete .reglages-lien { min-width: 44px; min-height: 44px; touch-action: manipulation; }
@media (max-width: 760px) { .entete .retour { margin-left: -8px; } .entete .reglages-lien { margin-right: -8px; } }


/* Choisir ses couleurs */
.nuances { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; }
.nuance { display: block; width: 100%; padding: .4rem; color: var(--encre); text-align: left; font: inherit; font-weight: 600; background: var(--champ); border: 2px solid var(--trait); border-radius: 10px; cursor: pointer; }
.nuance[aria-pressed="true"] { border-color: var(--vif); box-shadow: inset 0 0 0 1px var(--vif); }
.nuance .bande { display: flex; height: 26px; margin-bottom: .3rem; overflow: hidden; border-radius: 6px; }
.nuance .bande i { flex: 1; }

/* Choisir le style des carrés */
.choix-carre { display: block; width: 100%; padding: .55rem .45rem .35rem; color: var(--encre); font: inherit; font-weight: 600; text-align: center; background: var(--champ); border: 2px solid var(--trait); border-radius: 10px; cursor: pointer; }
.choix-carre[aria-pressed="true"] { border-color: var(--vif); box-shadow: inset 0 0 0 1px var(--vif); }
.exemple-carre { aspect-ratio: 1 / 1; margin-bottom: .35rem; text-align: left; }
.exemple-carre.carre-postit { border-radius: 2px 2px 34px 2px / 2px 2px 7px 2px; box-shadow: 0 1px 1px rgba(33, 46, 83, .16), 2px 4px 7px rgba(33, 46, 83, .2); }
.nom-carre { display: block; }
.carres-choix .note-titre { font-size: 15px; }

/* Écran d'un cercle : ronds et pseudos en haut, droits de chacun tout en bas */
.personnes-cercle { flex: 1; min-width: 0; display: flex; align-items: center; font-size: 13px; }
.personnes-cercle .partage-texte { white-space: normal; overflow-wrap: anywhere; }
.grand-trait + .noms-membres { margin-top: .6rem; }

/* Les fêtes : par-dessus l'écran, jamais sous le doigt */
/* clip-path et non overflow : la scène ne doit jamais être une zone qui défile et capter le doigt sur iPhone. */
#animation-fete { position: fixed; inset: 0; z-index: 9; clip-path: inset(0); pointer-events: none; }
.volant { position: absolute; left: 0; pointer-events: none; user-select: none; will-change: transform, opacity; }
.bouge-droite { animation: vol-droite 9s linear both; }
.bouge-gauche { animation: vol-gauche 11s linear both; }
.bouge-saut { animation: vol-saut 8s linear both; }
.bouge-tombe { top: -130px; animation: chute 8s linear both; }
.bouge-monte { top: 100%; animation: montee 7s ease-out both; }
.bouge-eclat { animation: eclat 2.2s ease-out both; }
.case-animations { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 400; }
.case-animations input { flex: none; width: 22px; height: 22px; margin: 0; }
@keyframes vol-droite {
  0% { transform: translate(-260px, 0) rotate(-4deg); }
  25% { transform: translate(25vw, -26px) rotate(3deg); }
  50% { transform: translate(50vw, 14px) rotate(-5deg); }
  75% { transform: translate(75vw, -18px) rotate(4deg); }
  100% { transform: translate(calc(100vw + 260px), 6px) rotate(-3deg); }
}
@keyframes vol-gauche {
  0% { transform: translate(calc(100vw + 120px), 0) rotate(8deg); }
  25% { transform: translate(75vw, 22px) rotate(-8deg); }
  50% { transform: translate(50vw, -18px) rotate(8deg); }
  75% { transform: translate(25vw, 20px) rotate(-8deg); }
  100% { transform: translate(-160px, -6px) rotate(6deg); }
}
@keyframes vol-saut {
  0% { transform: translate(-130px, 0) rotate(0); }
  12.5% { transform: translate(5vw, -90px) rotate(180deg); }
  25% { transform: translate(25vw, 0) rotate(360deg); }
  37.5% { transform: translate(40vw, -90px) rotate(540deg); }
  50% { transform: translate(50vw, 0) rotate(720deg); }
  62.5% { transform: translate(65vw, -90px) rotate(900deg); }
  75% { transform: translate(75vw, 0) rotate(1080deg); }
  87.5% { transform: translate(90vw, -90px) rotate(1260deg); }
  100% { transform: translate(calc(100vw + 130px), 0) rotate(1440deg); }
}
@keyframes chute {
  0% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(24px, 28vh) rotate(90deg); }
  50% { transform: translate(-18px, 56vh) rotate(180deg); }
  75% { transform: translate(20px, 84vh) rotate(270deg); }
  100% { transform: translate(-6px, calc(100vh + 160px)) rotate(360deg); }
}
@keyframes montee {
  0% { transform: translate(0, 40px) scale(.7); opacity: 0; }
  12% { opacity: 1; }
  40% { transform: translate(20px, -40vh) scale(1); }
  70% { transform: translate(-20px, -72vh) scale(1.05); opacity: 1; }
  100% { transform: translate(14px, calc(-100vh - 120px)) scale(1.1); opacity: 0; }
}
@keyframes eclat {
  0% { transform: scale(.1); opacity: 0; }
  20% { transform: scale(.7); opacity: 1; }
  70% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { #animation-fete { display: none; } }

/* ------- alertes météo (D-92) ------- */
.saisie-alerte { margin-bottom: .4rem; }
.saisie-alerte label:first-child { margin-top: .1rem; }
.champ-lieu { position: relative; }
.champ-lieu .suggestions { position: absolute; left: 0; right: 0; z-index: 6; }
.proposition-alerte { margin-top: .5rem; padding: .55rem .65rem; color: var(--encre); background: var(--surface); border-radius: 10px; }
.proposition-alerte p { margin: .2rem 0; }
.proposition-titre { font-weight: 800; }
.conditions-alerte { list-style: none; margin: .3rem 0; padding: 0; }
.condition-alerte { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .25rem 0; border-top: 1px solid var(--trait); }
.condition-alerte:first-child { border-top: 0; }
.condition-nom { flex: 1 1 100%; font-weight: 700; font-size: 13px; }
.condition-alerte input { flex: none; width: 5.5rem; min-height: 36px; }
.condition-alerte .lien-danger { margin-left: auto; }
.horizon-alerte { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-weight: 400; font-size: 14px; }
.horizon-alerte select { flex: 1; width: auto; min-width: 10rem; }
.accord-ia { margin-top: .5rem; padding: .45rem .55rem; border: 1.5px dashed var(--trait); border-radius: 10px; }
.ligne.alerte { align-items: flex-start; gap: .5rem; padding: .45rem 0; }
.alerte-icone { flex: none; width: 1.6rem; font-size: 20px; line-height: 1.4; text-align: center; }
.alerte-corps { flex: 1; min-width: 0; }
.alerte-corps .ligne-texte { margin: 0; font-weight: 700; line-height: 1.3; }
.alerte-etat { margin: .2rem 0 0; font-weight: 700; }
.alerte-prevu { margin: .1rem 0 .2rem; padding-left: 1.1rem; }
.alerte-pause .alerte-corps { opacity: .75; }
.pied-alertes { margin-top: .6rem; padding-top: .35rem; border-top: 1px solid var(--trait-papier); }
.pied-alertes .discret { color: var(--doux-papier); }
