/* =========================================================
   CRM — PROJET A
   ---------------------------------------------------------
   Squelette repris du CRM de l'agence, que sa mise en page
   rend efficace : barre latérale, briefing en une phrase,
   ligne de tuiles chiffrées, puis listes actionnables.

   Habillage : celui de tout le carnet (modèle « Dossier Reis »).
   Cette feuille n'utilise QUE les jetons de carnet.css
   (--ground, --surface, --band, --citron…) : le sombre suit
   tout seul, sans une ligne de plus.

   Cohabitation avec la barre commune (header.carnet, collante,
   hauteur dans --carnet-h) : la barre latérale du CRM se pose
   DESSOUS, jamais par-dessus, et la page garde un seul
   défilement — celui du document.
   ========================================================= */

body.crm {
  --crm-cote: 232px;
  display: block;
  margin: 0;
  padding: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;            /* écran dense : 16 px, pas 17 */
  line-height: 1.55;
}

/* ---------------------------------------------------------
   La barre latérale — fixe sous la barre commune
   Vert sapin foncé (--band-2), comme la sous-navigation du
   carnet : la barre commune et elle forment un seul cadre.
   --------------------------------------------------------- */

.crm-cote {
  position: fixed;
  top: var(--carnet-h);
  bottom: 0;
  left: 0;
  z-index: 50;                /* sous la barre commune (900) et sous la bulle de chat */
  width: var(--crm-cote);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 14px 24px;
  background: var(--band-2);
  border-right: 1px solid var(--band-line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.crm-marque {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 8px;
  border-radius: 12px;
  color: var(--band-ink);
  font-weight: 600;
  text-decoration: none;
  transition-property: background-color;
  transition-duration: .15s;
}
.crm-marque__pastille {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 7px;
  border-radius: 10px;
  background: transparent;
  color: var(--citron);
  box-shadow: inset 0 0 0 1.5px var(--citron);   /* en contour : l'aplat citron reste réservé à l'entrée active de la barre commune */
  font: 800 15px/1 var(--display);
  letter-spacing: -.01em;
}
.crm-marque b {
  display: block;
  font: 800 17px/1.1 var(--display);
  letter-spacing: -.01em;
  color: var(--band-ink);
}
.crm-marque i {
  display: block;
  margin-top: 4px;
  font: 600 11.5px/1 var(--body);
  font-style: normal;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--band-ink-2);
}
.crm-marque:focus-visible { outline: 2px solid var(--citron); outline-offset: 2px; }

.crm-menu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
}
.crm-menu__item {
  display: flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--band-ink-2);
  font: 600 15px/1.2 var(--body);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition-property: background-color, color, transform;
  transition-duration: .15s;
}
/* L'entrée active : traitée comme la sous-barre du carnet (contour citron),
   pour ne pas faire deux aplats citron à l'écran avec « CRM » dans la barre commune. */
.crm-menu__item.is-actif {
  background: rgba(214, 242, 75, .14);
  border-color: var(--citron);
  color: var(--citron);
  box-shadow: inset 0 0 0 1px var(--citron);
}
.crm-menu__item:active { transform: scale(.97); }
.crm-menu__item:focus-visible { outline: 2px solid var(--citron); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  .crm-marque:hover { background: rgba(255, 255, 255, .06); color: var(--band-ink); }
  .crm-menu__item:not(.is-actif):hover { background: rgba(255, 255, 255, .08); color: var(--band-ink); }
}
/* Au doigt : le retour se lit à l'appui, pas au survol. */
@media (hover: none) {
  .crm-marque:active { background: rgba(255, 255, 255, .06); }
  .crm-menu__item:not(.is-actif):active { background: rgba(255, 255, 255, .1); color: var(--band-ink); }
}

/* ---------------------------------------------------------
   La zone de travail
   Un tableau de bord occupe toute la largeur disponible ; ce
   sont les blocs de TEXTE qui gardent une mesure de lecture.
   --------------------------------------------------------- */

.crm-main {
  margin-left: var(--crm-cote);
  max-width: none;
  min-width: 0;
  padding: 28px clamp(20px, 3.2vw, 48px) 72px;
}

.crm-main a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.crm-main :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.crm-main code {
  font-family: var(--mono);
  font-size: .84em;
  color: inherit;
  background: var(--surface-2);
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

/* Le bandeau « Maquette » : il doit rester impossible à rater. */
.crm-fictif {
  max-width: 120ch;
  margin: 0 0 26px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--negatif) 45%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--negatif) 9%, var(--ground));
  color: var(--negatif);
  font-size: 15px;
  line-height: 1.5;
}
.crm-fictif strong { color: var(--negatif); font-weight: 700; }

/* L'en-tête de chaque vue */
.crm-tete {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: 0 0 22px;
}
.crm-tete h1 {
  margin: 0;
  font: 800 clamp(30px, 3.4vw, 40px)/1.05 var(--display);
  letter-spacing: -.02em;
  color: var(--ink);
  text-wrap: balance;
}
.crm-tete__date {
  max-width: 90ch;
  margin: 8px 0 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
}
.crm-jour {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--citron);
  color: var(--on-citron);
  font: 700 13px/1.1 var(--body);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* « Aujourd'hui » : le briefing en une phrase, sur le vert sapin. */
.crm-resume {
  margin: 0 0 22px;
  padding: 20px 24px;
  border: 1px solid var(--band-line);
  border-radius: 12px;
  background: var(--band);
  color: var(--band-ink);
}
.crm-resume__lab {
  margin: 0 0 10px;
  font: 600 12px/1.2 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--citron);
}
.crm-resume p:last-child {
  max-width: 95ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--band-ink);
}
.crm-resume b { color: var(--citron); font-weight: 600; }
.crm-resume__action {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--band-line);
  color: var(--band-ink);
  font-weight: 600;
}

/* Les tuiles chiffrées — plus l'écran est large, plus il y en a par ligne */
.crm-tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}
.crm-tuiles--4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.crm-tuile {
  margin: 0;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.crm-tuile__lab {
  margin: 0 0 8px;
  font: 600 12px/1.25 var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.crm-tuile__n {
  margin: 0;
  font: 800 34px/1 var(--display);
  letter-spacing: -.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.crm-tuile__sur { font-size: 20px; font-weight: 700; color: var(--ink-3); }
.crm-tuile__d {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
}

/* La tuile qui compte : fond sapin, chiffre citron. */
.crm-tuile--fort { background: var(--band); border-color: var(--band-line); }
.crm-tuile--fort .crm-tuile__lab,
.crm-tuile--fort .crm-tuile__d { color: var(--band-ink-2); }
.crm-tuile--fort .crm-tuile__n { color: var(--citron); }

.crm-hausse { color: var(--positif); font-weight: 600; }
.crm-baisse { color: var(--negatif); font-weight: 600; }
.crm-tuile--fort .crm-hausse { color: var(--citron); }

/* ---------------------------------------------------------
   Blocs et colonnes
   --------------------------------------------------------- */

/* `min(420px, 100%)` : la colonne descend à la largeur de l'écran
   quand il n'y a plus la place, au lieu de déborder. */
.crm-colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 16px;
}

.crm-bloc {
  min-width: 0;
  margin: 0 0 16px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.crm-bloc__t {
  margin: 0 0 16px;
  font: 700 22px/1.2 var(--display);
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
}
/* La pastille citron devant chaque titre, comme sur le dossier Reis. */
.crm-bloc__t::before {
  content: "";
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 11px;
  border-radius: 3px;
  background: var(--citron);
  box-shadow: 0 0 0 2px var(--band);
  vertical-align: .08em;
}
.crm-bloc__t .crm-tag { margin-left: 8px; vertical-align: .2em; }

.crm-bloc__st {
  display: block;
  margin: 30px 0 4px;
  font: 600 18px/1.3 var(--body);
  letter-spacing: 0;
  color: var(--ink);
  text-wrap: balance;
}

.crm-bloc__i {
  max-width: 90ch;
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
.crm-bloc__note {
  /* Le texte garde une mesure de lecture (~80 caractères) mais son
     filet court sur toute la largeur du bloc. */
  max-width: none;
  margin: 18px 0 0;
  padding-top: 14px;
  padding-right: max(0px, calc(100% - 80ch));
  border-top: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}
/* Directement sous un titre, la note n'a pas besoin de filet. */
.crm-bloc__t + .crm-bloc__note,
.crm-bloc__st + .crm-bloc__note {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Le gras dans la prose : surligné citron, comme sur Reis. */
.crm-bloc__note strong,
.crm-bloc__i strong {
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(transparent 56%, var(--surligne) 56%);
  padding: 0 2px;
  border-radius: 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Le bloc des VRAIES données, au milieu d'une maquette : il se
   distingue sans crier — un liseré et un fond à peine teinté. */
.crm-bloc--vrai {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: color-mix(in srgb, var(--citron) 7%, var(--surface));
}

/* ---------------------------------------------------------
   Les tableaux
   --------------------------------------------------------- */

.crm-bloc .table-scroll {
  margin: 0;
  background: transparent;    /* le tableau prend le fond de son bloc */
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.crm-bloc__note + .table-scroll,
.crm-bloc__i + .table-scroll { margin-top: 14px; }

.crm-bloc table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.crm-bloc th {
  position: static;
  padding: 10px 12px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font: 600 12px/1.3 var(--body);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  vertical-align: bottom;
  white-space: nowrap;
}
.crm-bloc td {
  padding: 12px;
  background: transparent;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  text-align: left;
  vertical-align: middle;
}
.crm-bloc td strong { color: var(--ink); font-weight: 600; }
.crm-bloc tbody tr:last-child td { border-bottom: 0; }
.crm-bloc tbody tr:hover td { background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .crm-bloc tbody tr:hover td { background: var(--surface-2); }
}

/* La première colonne porte des libellés longs : sans largeur
   minimale, ils se cassent en trois lignes. */
.crm-bloc th:first-child,
.crm-bloc td:first-child { min-width: 230px; }
.crm-bloc th:last-child,
.crm-bloc td:last-child { white-space: nowrap; }

/* Les chiffres ne se coupent jamais (« 13 840 » sur deux lignes est
   illisible) — seulement là où ces colonnes SONT des chiffres : dans
   les idées, la deuxième colonne est un paragraphe. */
.crm-bloc td.crm-hausse,
.crm-bloc td.crm-baisse,
[data-vue="veille"] .crm-bloc td:nth-child(2),
[data-vue="veille"] .crm-bloc td:nth-child(3) { white-space: nowrap; }

/* Les rangées longues des idées se lisent depuis le haut. */
[data-vue="idees"] .crm-bloc td { vertical-align: top; }

/* Sur écran étroit, les tableaux défilent dans leur cadre. */
@media (max-width: 1100px) {
  .crm-bloc table { min-width: 720px; }
}

/* La « semaine type » n'a que deux colonnes courtes. */
[data-vue="planning"] .crm-bloc table { min-width: 0; }
[data-vue="planning"] .crm-bloc th:first-child,
[data-vue="planning"] .crm-bloc td:first-child { min-width: 130px; }
[data-vue="planning"] .crm-bloc th:last-child,
[data-vue="planning"] .crm-bloc td:last-child { white-space: normal; }
[data-vue="planning"] .crm-bloc em { font-style: normal; color: var(--ink-3); }

/* ---------------------------------------------------------
   Listes actionnables
   --------------------------------------------------------- */

.crm-liste { list-style: none; max-width: none; margin: 0; padding: 0; }
.crm-liste li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}
/* Une ligne de texte libre (liens de la veille) reste une phrase. */
.crm-liste li:not(:has(.crm-liste__t)) { display: block; color: var(--ink-2); }
.crm-liste li:last-child { border-bottom: 0; }
.crm-liste__t { flex: 1; min-width: 0; color: var(--ink); }
.crm-liste__d {
  flex: none;
  font: 600 12px/1.2 var(--body);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}

.crm-pt { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.crm-pt--rouge  { background: var(--negatif); }
.crm-pt--orange { background: var(--attention); }

/* Étiquettes de statut */
.crm-tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: 600 11.5px/1.3 var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.crm-tag--ok {
  color: var(--positif);
  border-color: color-mix(in srgb, var(--positif) 55%, transparent);
  background: color-mix(in srgb, var(--positif) 10%, transparent);
}
.crm-tag--chaud {
  color: var(--negatif);
  border-color: color-mix(in srgb, var(--negatif) 55%, transparent);
  background: color-mix(in srgb, var(--negatif) 9%, transparent);
}
.crm-tag--stop { color: var(--negatif); border-color: var(--negatif); }
.crm-retard { color: var(--negatif); font-weight: 600; }

.crm-pied {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font: 600 12px/1.5 var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.crm-vue[hidden] { display: none; }

/* =========================================================
   LE PLANNING — la page d'accueil du CRM
   ---------------------------------------------------------
   Une grille de mois, une vue semaine, un code couleur par
   type, pensé pour un rythme éditorial (une publication par
   jour). Chaque type a sa couleur de jeton : même vu de loin,
   on lit la nature d'une journée sans lire le texte.
   ========================================================= */

.pl-bloc { padding: 0; overflow: hidden; }

.pl-barre {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.pl-vues {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.pl-vue {
  min-height: 40px;
  padding: 6px 18px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font: 600 14px/1.1 var(--body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition-property: background-color, color, transform;
  transition-duration: .15s;
}
.pl-vue.is-actif { background: var(--ink); color: var(--ground); }   /* inversé : net en clair comme en sombre */
.pl-vue:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .pl-vue:not(.is-actif):hover { color: var(--ink); background: var(--surface-2); }
}
@media (hover: none) {
  .pl-vue:not(.is-actif):active { color: var(--ink); background: var(--surface-2); }
}

.pl-periode {
  margin: 0;
  font: 700 20px/1.2 var(--display);
  letter-spacing: -.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.pl-legende {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  max-width: none;
  margin: 0 0 0 auto;
  padding: 0;
}
.pl-legende li {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
}
.pl-pt { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.pl-pt--publi    { background: var(--accent); }
.pl-pt--tournage { background: var(--attention); }
.pl-pt--direct   { background: var(--band); box-shadow: inset 0 0 0 2px var(--citron); }
.pl-pt--lettre   { background: var(--positif); }
.pl-pt--rdv      { background: var(--ink); }

/* --- La grille du mois --------------------------------------------- */

.pl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pl-scroll[hidden] { display: none; }

/* Sous ~1180 px, sept colonnes deviennent des rubans où « Tournage
   groupé ×4 » tient sur quatre lignes : le calendrier défile
   latéralement dans son cadre plutôt que de s'écraser. */
.pl-grille {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 1060px;
}
.pl-grille > *:nth-child(7n) { border-right: 0; }

.pl-jn {
  padding: 10px 12px;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font: 600 12px/1.2 var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.pl-case {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 134px;
  padding: 9px 10px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pl-case--hors { background: var(--ground); }
.pl-case--we   { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.pl-case--auj  {
  background: color-mix(in srgb, var(--citron) 16%, var(--surface));
  box-shadow: inset 0 0 0 2px var(--accent);
}

.pl-tete { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; }
.pl-num {
  font: 700 15px/1 var(--display);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pl-case--auj .pl-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--citron);
  color: var(--on-citron);
}
.pl-auj {
  font: 600 11.5px/1 var(--body);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.pl-evs { display: flex; flex-direction: column; gap: 4px; }

/* Une pastille par événement ; le filet de gauche porte la couleur
   du type. Un intitulé tronqué par « … » se lit comme un bug : dans
   une case de calendrier, mieux vaut deux lignes qu'une phrase coupée. */
.pl-ev {
  display: block;
  padding: 4px 8px;
  border-left: 3px solid;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: break-word;
}
.pl-ev b { font-weight: 700; }

.pl-ev--publi    { color: var(--ink);       background: color-mix(in srgb, var(--citron) 30%, var(--surface));    border-left-color: var(--accent); }
.pl-ev--tournage { color: var(--attention); background: color-mix(in srgb, var(--attention) 9%, var(--surface)); border-left-color: var(--attention); }
.pl-ev--direct   { color: var(--citron);    background: var(--band);                                              border-left-color: var(--citron); }
.pl-ev--lettre   { color: var(--positif);   background: color-mix(in srgb, var(--positif) 8%, var(--surface));   border-left-color: var(--positif); }
.pl-ev--rdv      { color: var(--ink);       background: var(--surface-2);                                         border-left-color: var(--ink); }
.pl-ev--tache    { color: var(--ink-2);     background: var(--ground);                                            border-left-color: var(--ink-3); }

/* Le passé reste lisible mais ne réclame plus l'attention. */
.pl-ev--fait { opacity: 1; color: var(--ink-3); background: var(--surface-2); border-left-color: var(--line); text-decoration: line-through; text-decoration-thickness: 1px; }

/* --- La vue semaine -------------------------------------------------- */

.pl-sem {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 1060px;
}
.pl-col {
  display: flex;
  flex-direction: column;
  min-height: 430px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.pl-col:last-child { border-right: 0; }
.pl-col--auj { background: color-mix(in srgb, var(--citron) 14%, var(--surface)); }

.pl-col__tete {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.pl-col__j {
  display: block;
  font: 600 12px/1.2 var(--body);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.pl-col__n {
  display: block;
  margin-top: 3px;
  font: 800 24px/1.1 var(--display);
  letter-spacing: -.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pl-col--auj .pl-col__n { color: var(--accent); }
.pl-col__corps { display: flex; flex-direction: column; gap: 5px; padding: 9px; }

/* Le bloc du calendrier n'a pas de marge intérieure : sa note en
   récupère une, et garde une mesure de lecture sans raccourcir son filet. */
.pl-bloc .crm-bloc__note {
  max-width: none;
  margin: 0;
  padding: 16px max(20px, calc(100% - 90ch)) 16px 20px;
  border-top: 1px solid var(--line);
}

/* =========================================================
   ÉCRANS ÉTROITS
   ---------------------------------------------------------
   Sous 900 px, la barre latérale passe en haut de la page,
   sous la barre commune : la marque, puis les huit entrées
   en pastilles qui passent à la ligne. Elle défile avec la
   page — chaque changement de vue remonte en haut.
   ========================================================= */

@media (max-width: 1240px) {
  .pl-legende { margin-left: 0; width: 100%; }
}

@media (max-width: 900px) {
  .crm-cote {
    position: static;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 16px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--band-line);
    overflow: visible;
  }
  .crm-menu { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .crm-menu__item { padding: 8px 14px; }

  .crm-main { margin-left: 0; padding: 22px 16px 64px; }

  .pl-barre { padding: 16px; }
  .pl-grille { min-width: 880px; }
  /* La semaine s'empile : sept cartes à la suite. */
  .pl-sem { grid-template-columns: 1fr; min-width: 0; }
  .pl-col { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .pl-col__tete { display: flex; align-items: baseline; gap: 9px; text-align: left; }
  .pl-col__n { margin-top: 0; }
  .pl-bloc .crm-bloc__note { padding: 16px; }
}

@media (max-width: 640px) {
  .crm-marque i { display: none; }
  .crm-menu__item { min-height: 40px; padding: 8px 13px; font-size: 14.5px; }
  .crm-bloc { padding: 18px 16px; }
  .crm-resume { padding: 18px; }
  .crm-resume p:last-child { font-size: 16px; }
  /* Deux tuiles par ligne : quatre tuiles empilées mangeaient l'écran. */
  .crm-tuiles,
  .crm-tuiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .crm-tuile { padding: 14px; }
  .crm-tuile__n { font-size: 30px; }
  /* Sur téléphone, la première colonne cède de la place au texte. */
  .crm-bloc th:first-child,
  .crm-bloc td:first-child { min-width: 150px; }
  .crm-bloc table { min-width: 640px; }
  [data-vue="planning"] .crm-bloc table { min-width: 0; }
  [data-vue="planning"] .crm-bloc th:first-child,
  [data-vue="planning"] .crm-bloc td:first-child { min-width: 104px; }
}

@media (prefers-reduced-motion: reduce) {
  .crm-marque, .crm-menu__item, .pl-vue { transition: none; }
}

@media print {
  .crm-cote { display: none; }
  .crm-main { margin-left: 0; }
}
