/* Mon calendrier (ex « Mon planning »). Posée par organiser.js (comme choix-ia.css). Le gros du dessin vit dans app.css (.pl-…) ;
   ici, les ajouts du 11/10 (le sélecteur de vue, les cibles de 44 px) et la refonte du 13/10 (Lisa) : le bloc à deux pilules (les classes
   .iv2-bloc et .iv2-portes d'Idées virales, idees.css), ses deux contenus, les états façon Idées virales, les cartes à ouvrir, le mois en points.
   Préfixe des ajouts du 13/10 : .cal-. À ranger dans app.css à la prochaine passe. */

/* ---------- Les états : Script, Planifié, Créé, Publié. Les pastilles sont celles d'Idées virales (.iv2-etat, idees.css), avec un point
   devant ; le même point sert seul dans les cases du mois. ---------- */
.cal-bloc, .cal-legende, #pl-vue { --e-script: #B5AEA2; --e-planifie: #A8CBBD; --e-cree: #5E9C8A; --e-publie: #1F5B52; }
.cal-etat { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; line-height: 1.4; white-space: nowrap; border-radius: 999px; padding: 4px 11px 4px 9px; color: var(--encre2); background: var(--surface); }
.cal-etat::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--e-script); }
.cal-etat.e-planifie { background: #E7F0EC; color: var(--bx2); } .cal-etat.e-planifie::before { background: var(--e-planifie); }
.cal-etat.e-cree { background: #D5E5DE; color: var(--bx); } .cal-etat.e-cree::before { background: var(--e-cree); }
.cal-etat.e-publie { background: var(--bx2); color: #fff; } .cal-etat.e-publie::before { background: #fff; }
.cal-legende { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }

/* ---------- Le bloc à deux pilules ---------- */
.cal-bloc { margin: 0 0 4px; }
.cal-bloc.ouvert #cal-panneau { margin-top: 20px; padding: 0 6px 6px; }
.cal-bloc .champ:last-child { margin-bottom: 0; }
.cal-bloc .actions { margin-top: 4px; }
.cal-bloc .choix button { min-height: 44px; }
.cal-bloc .choix.pl-ronds button { min-width: 44px; padding-left: 0; padding-right: 0; text-align: center; }
.cal-bloc .cia { margin-top: 0; }
.pl-sous-champ { margin: 8px 0 0; font-size: 14px; }
.pl-sous-champ:empty { display: none; }
#p-go:disabled { opacity: .45; cursor: not-allowed; }
/* Un petit titre doré, quand ce n'est pas le libellé d'un champ (même dessin que .iv2-bloc .champ > label). */
.cal-titre { display: block; margin: 0 0 10px; font-size: 14px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--or-texte); }
.cal-piliers { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-lien { display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 500; color: var(--bx2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cal-lien:focus-visible, .cal-idee-b:focus-visible, .cal-post-tete:focus-visible, .cal-autre input:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }
.cal-vide { margin: 0; font-size: 14.5px; color: var(--encre2); }
#cal-source:empty, #cal-note:empty { display: none; }
#cal-note { margin-top: 14px; }
#cal-note .erreur { margin: 0; }
.cal-ok { margin: 0; font-size: 15px; font-weight: 500; color: var(--bx2); }

/* Je crée mon planning : la liste d'une source, une idée par ligne ; l'idée choisie ouvre le choix du jour. */
.cal-liste { display: flex; flex-direction: column; border-top: 1px solid var(--ligne); }
.cal-idee { border-bottom: 1px solid var(--ligne); }
.cal-idee-b { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; width: 100%; min-height: 60px; padding: 10px 2px; border: 0; background: none; font: inherit; color: var(--bx); text-align: left; cursor: pointer; }
.cal-idee-b .pl-sugg-txt { flex: 1 1 170px; }
.cal-idee-b:hover .pl-sugg-txt b { text-decoration: underline; text-underline-offset: 3px; }
.cal-idee.ouvert { background: var(--fond); border-radius: 16px; border-bottom-color: transparent; padding: 0 12px 14px; margin: 6px 0; }
.cal-suite { margin-top: 14px; min-height: 44px; }
.cal-jours { margin-top: 6px; }
.cal-libre .cal-jours { margin-top: 18px; }
.cal-jours .pl-cibles button { position: relative; }
.cal-jours .pl-cibles button.pris::after { content: ''; position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--or); }
.cal-autre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; font-size: 14.5px; color: var(--encre2); }
.cal-autre input { min-height: 44px; padding: 8px 12px; border: 1px solid rgba(27,33,31,.18); border-radius: 12px; background: #fff; color: var(--bx); font: inherit; font-size: 16px; }

/* ---------- Le sélecteur de vue (11/10) : un bloc arrondi, trois parts égales, la vue montrée remplie en vert. ---------- */
.pl-vues { display: inline-flex; gap: 0; max-width: 100%; margin: 22px 0 0; padding: 4px; border-radius: 999px; background: var(--surface, #ECE7DE); }
.pl-vue-b { flex: 1 1 0; min-width: 104px; min-height: 44px; padding: 8px 20px; border: 0; border-radius: 999px; background: none; color: var(--bx, #17463F); font: inherit; font-size: 15px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background .2s, color .2s; }
.pl-vue-b:hover:not(.on) { background: rgba(31,91,82,.08); }
.pl-vue-b.on { background: var(--bx2, #1F5B52); color: #fff; font-weight: 600; }
.pl-vue-b:focus-visible { outline: 2px solid var(--or, #C9A24A); outline-offset: 2px; }
#pl-vue .pl-bloc { margin-top: 20px; }

/* ---------- Un post dans une vue : une carte à ouvrir (lire, changer l'état). Rien ne s'ajoute depuis les vues. ---------- */
.pl-post.cal-post { cursor: default; padding: 0; gap: 0; }
.pl-post.cal-post.e-publie { background: #F1F7F5; }
.cal-post-tete { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 100%; min-height: 44px; padding: 12px; border: 0; border-radius: 16px; background: none; font: inherit; color: var(--bx); text-align: left; cursor: pointer; }
.cal-post-tete .pl-post-haut { flex-wrap: wrap; }
.cal-post-tete .cal-etat { margin-left: auto; }
.cal-post-tete:hover .pl-sujet { text-decoration: underline; text-underline-offset: 3px; }
.cal-detail { display: flex; flex-direction: column; gap: 10px; margin: 0 12px; padding: 12px 0; border-top: 1px solid var(--ligne); }
.cal-detail p { margin: 0; }
.cal-detail .cal-titre { margin: 4px 0 0; }
.cal-hook { font-size: 14.5px; line-height: 1.45; color: var(--encre2); }
.cal-texte { font-size: 14.5px; line-height: 1.45; color: var(--bx); overflow-wrap: anywhere; }
.cal-deroule { margin: 0; padding-left: 22px; font-size: 14.5px; line-height: 1.45; color: var(--bx); }
.cal-deroule li + li { margin-top: 4px; }
.cal-etats button { min-height: 44px; }
.cal-detail .pl-menu-actions { margin-top: 2px; gap: 6px 10px; }
.cal-detail .pl-menu-actions .btn { min-height: 44px; }
.pl-jour-seul { margin-top: 0; }
.pl-jour-seul .pl-detail-posts { margin-bottom: 0; }
.pl-detail .pl-detail-posts:last-child { margin-bottom: 0; }

/* ---------- Le mois (refait le 13/10) : le numéro du jour, puis un point par état (et son nombre s'il y en a plusieurs). ---------- */
.cal-mois .pl-case { min-height: 78px; align-items: center; justify-content: flex-start; gap: 6px; padding: 8px 2px; }
.cal-mois .pl-num { align-self: center; font-size: 15px; }
.cal-pts { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 7px; min-width: 0; }
.cal-pt { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 500; line-height: 1; color: var(--bx); }
.cal-pt i { flex: none; width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.cal-pt i.e-script { background: var(--e-script); } .cal-pt i.e-planifie { background: var(--e-planifie); } .cal-pt i.e-cree { background: var(--e-cree); } .cal-pt i.e-publie { background: var(--e-publie); }
.pl-case.choisi .cal-pt { color: #fff; }
.pl-case.choisi .cal-pt i { box-shadow: 0 0 0 1.5px #fff; }

@media (max-width: 640px) {
  .pl-vues { display: flex; width: 100%; }
  .pl-vue-b { min-width: 0; padding: 8px 6px; }
  .cal-bloc.ouvert #cal-panneau { padding: 0 4px 4px; }
  .cal-bloc .actions .btn { min-height: 44px; }
  .cal-sources button { flex: 1 1 auto; text-align: center; }
  .cal-idee.ouvert { padding: 0 8px 12px; }
  .cal-mois .pl-case { min-height: 66px; padding: 6px 0; gap: 5px; }
  .cal-pts { gap: 3px 5px; }
  /* Au doigt : chaque bouton du calendrier fait au moins 44 px de haut. */
  #pl-vue .btn.petit { min-height: 44px; display: inline-flex; align-items: center; }
  #pl-vue .sn-fleche { min-width: 44px; min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .pl-vue-b { transition: none; } }
