/* ============================================================
   Base de programmation TV : style commun.
   v2 : les jetons de couleur (clair et sombre) sont définis dans
   assets/theme.css, chargé après cette feuille par le gabarit.
   ============================================================ */

* { box-sizing: border-box; }

/* L'attribut hidden doit toujours l'emporter sur les display explicites
   (dialogue de collage, presse-papiers), sans quoi ils s'affichent au chargement. */
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--papier);
    color: var(--texte);
    font-family: 'Archivo', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

/* ---------- Bandeau supérieur ---------- */
.bandeau {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    background: var(--bandeau);
    color: var(--blanc);
    padding: 10px 22px;
}
.bandeau nav { display: flex; gap: 4px; flex: 1; align-items: center; }
.bandeau nav a {
    color: #C9CCD1;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
}
.recherche-menu {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.recherche-menu input[type="search"] {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 13px;
    padding: 6px 10px;
    width: 150px;
}
.recherche-menu input[type="search"]::placeholder { color: #C9CCD1; }
.recherche-menu input[type="search"]:focus {
    outline: none;
    border-color: var(--antenne);
    background: rgba(255, 255, 255, 0.18);
}
.recherche-menu button.secondaire {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    border-radius: 4px;
    font-size: 12px;
    padding: 6px 10px;
    cursor: pointer;
}
.recherche-menu button.secondaire:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: var(--antenne);
}
.bandeau nav a:hover { background: #2A2D34; color: var(--blanc); }
.bandeau nav a.actif { background: var(--antenne); color: var(--blanc); }

.bandeau-voir-comme {
    background: #7A3FA3;
    color: #FFFFFF;
    font-size: 13px;
    padding: 8px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.lien-retour-voir-comme {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.4);
    color: #FFFFFF;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 12px;
    cursor: pointer;
}
.lien-retour-voir-comme:hover { background: rgba(255,255,255,0.3); }

.voir-comme {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.libelle-voir-comme { color: #C9CCD1; font-size: 13px; }
.voir-comme select {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    border-radius: 4px;
    font-size: 13px;
    padding: 5px 8px;
}
.voir-comme select option { color: var(--encre); }
.badge-demandes {
    display: inline-block;
    background: var(--antenne);
    color: #FFFFFF;
    font-size: 10.5px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 6px;
    margin-left: 5px;
}

/* ---------- Page Prog ---------- */
table.prog { margin-bottom: 4px; }
.gouttiere-sepm { width: 62px; font-size: 10px; }
.case-prog { font-size: 12px; padding: 6px 8px; vertical-align: top; }
.case-prog-vide { text-align: center; font-style: italic; color: var(--texte-2); }
.date-case { font-size: 9.5px; color: var(--texte-2); margin-bottom: 2px; }
/* Une modification récente se signale désormais par la couleur du
   texte, jamais par le fond de la case, pour ne pas troubler les
   trois fonds déjà attribués : blanc, rouge pâle, violet pâle. */
.case-modifiee, .case-modifiee .date-case { color: var(--antenne) !important; font-weight: 600; }

tr.semaine-actuelle { background: #FBE9EC; }
.jour-passe { opacity: 0.45; }

.case-non-definitif { background: #EFE7FB; border: 1px dashed #8B6FC9; }

/* Repère de la date du jour : un liséré qui ressort sur les trois
   fonds possibles, sans en ajouter un quatrième. */
/* Jour d'aujourd'hui dans la grille : fond rouge plein sur toute la
   case, y compris l'en-tête de date, avec tous les textes en blanc
   pour rester lisibles. Les fonds clairs propres à certains éléments
   internes sont assombris pour garder ce contraste. Classe distincte
   de .case-aujourdhui, utilisée par Prog avec un simple liséré. */
.case-aujourdhui-grille { background: var(--antenne) !important; }
.case-aujourdhui-grille .entete-jour { background: var(--antenne) !important; }
.case-aujourdhui-grille, .case-aujourdhui-grille * { color: #FFFFFF !important; }
.case-aujourdhui-grille .pile li { background: rgba(255, 255, 255, 0.18); }
.case-aujourdhui-grille .episodes-pile { background: rgba(255, 255, 255, 0.28); }
.case-aujourdhui-grille .badge-signal,
.case-aujourdhui-grille .pastille-inedit { background: var(--bandeau); }
.case-aujourdhui-grille .ligne-access { background: rgba(0, 0, 0, 0.2) !important; }

/* Badge du numéro de semaine, pour la seule semaine en cours. */
.badge-semaine-actuelle {
    display: inline-block;
    background: var(--antenne);
    color: #FFFFFF;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 7px;
}
.prime-manuel-prog {
    min-height: 18px;
    outline: none;
    border: 1px dashed transparent;
    border-radius: 3px;
    padding: 1px 3px;
    margin: -1px -3px;
}
.prime-manuel-prog:hover, .prime-manuel-prog:focus {
    border-color: var(--texte-2);
    background: rgba(255,255,255,0.6);
}
.legende-prog {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--texte-2);
    margin: 0 0 14px;
}
.pastille-legende {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
}
.pastille-non-definitif { background: #EFE7FB; border: 1px dashed #8B6FC9; }
.pastille-modifie { background: var(--attention-fond); border: 1px solid var(--attention-bord); }
.exemple-legende-modifie { color: var(--antenne); font-weight: 600; }
.exemple-legende-aujourdhui {
    display: inline-block;
    width: 14px;
    height: 14px;
    box-shadow: inset 0 0 0 2px var(--antenne);
    border-radius: 2px;
}

/* Accès direct aux trois grilles : logos officiels sur fond blanc */
.groupe-grilles {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--surface);
    border-radius: 6px;
    padding: 3px 5px 3px 12px;
    margin: 0 6px;
}
.libelle-grilles {
    color: #4A4D53;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    margin-right: 6px;
}
.bandeau nav a.lien-grille {
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
}
.bandeau nav a.lien-grille img {
    height: 17px;
    width: auto;
    display: block;
}
.bandeau nav a.lien-grille:hover { background: #ECEDEF; }
.bandeau nav a.lien-grille.decouverte.actif {
    background: #DFE8FF;
    box-shadow: inset 0 0 0 2px var(--decouverte);
}
.bandeau nav a.lien-grille.story.actif {
    background: #FFE6DC;
    box-shadow: inset 0 0 0 2px var(--story);
}
.bandeau nav a.lien-grille.life.actif {
    background: #FBDCEF;
    box-shadow: inset 0 0 0 2px var(--life);
}
.session { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #C9CCD1; }
.session a { color: var(--blanc); }

/* ---------- Contenu ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 26px 22px 60px; }
main.pleine-largeur { max-width: none; padding-left: 32px; padding-right: 32px; }
/* LA GAMME (6 septembre 2026). Les titres sont en Unbounded, comme sur
   l'accueil en mosaïque : le h1 ne sert plus que hors connexion (le
   titre vit dans la barre, voir coquille.css), le h2 titre les blocs,
   les cartes et les fenêtres de toutes les pages, à une seule taille.
   Le h3 est un sous-titre : Archivo en capitales, gris, comme les
   en-têtes de colonne et les libellés de champ. Les jetons --t-* sont
   déclarés dans coquille.css. */
h1 {
    font-family: var(--police-affiche, 'Unbounded', 'Archivo', sans-serif);
    font-stretch: 100%;
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.01em;
    line-height: var(--interligne-titre, 1.15);
    margin: 0 0 18px;
    text-wrap: balance;
}
h2 {
    font-family: var(--police-affiche, 'Unbounded', 'Archivo', sans-serif);
    font-stretch: 100%;
    font-weight: 800;
    font-size: var(--t-titre-bloc, 17px);
    letter-spacing: -0.005em;
    line-height: var(--interligne-titre, 1.15);
    margin: 28px 0 12px;
    text-wrap: balance;
}
/* Seuls les h3 nus (sans classe ni id) prennent le sous-titre par
   défaut, et à la spécificité d'un simple élément (:where) : ceux que
   les grilles, les modales et les tiroirs habillent eux-mêmes gardent
   leur règle. */
h3:where(:not([class]):not([id])) {
    font-size: var(--t-sous-titre, 11px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--texte-2);
    margin: 18px 0 8px;
}

/* ---------- Tableau de bord ---------- */
.compteurs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 22px;
}
.compteur {
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-left: 4px solid var(--antenne);
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 2px 6px rgba(27, 29, 34, 0.04);
}
.compteur .valeur {
    font-family: var(--police-chiffres, 'IBM Plex Mono', monospace);
    font-size: var(--t-compteur, 28px);
    font-weight: 700;
    line-height: 1.1;
    color: var(--texte);
}
.compteur .valeur-texte {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--texte);
}
.compteur .libelle { font-size: 12px; color: var(--texte-2); margin-top: 4px; }
.compteur-etat { border-left-color: var(--acier); }

.actions-accueil { margin-top: 22px; }

footer {
    text-align: center;
    color: var(--texte-2);
    font-size: 12px;
    padding: 20px;
}

/* ---------- Messages ---------- */
.message {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 18px;
    font-weight: 600;
}
.message.ok { background: var(--ok-fond); color: var(--ok); border: 1px solid var(--ok-fond); }
.message.erreur { background: var(--erreur-fond); color: var(--erreur); border: 1px solid var(--erreur-bord); }

/* ---------- Formulaires ---------- */
form.fiche {
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: 6px;
    padding: 22px;
}
.grille-champs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px 20px;
}
.champ { display: flex; flex-direction: column; gap: 5px; }
.champ.large { grid-column: 1 / -1; }
.champ label { font-size: var(--t-sous-titre, 11px); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-2); }
.champ .obligatoire { color: var(--antenne); }
.champ input[type=text],
.champ input[type=number],
.champ input[type=date],
.champ input[type=password],
.champ select,
.champ textarea {
    padding: 8px 10px;
    border: 1px solid var(--ligne-forte);
    border-radius: 4px;
    font: inherit;
    background: var(--surface);
    resize: vertical;
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
    outline: 2px solid var(--acier);
    outline-offset: 1px;
}
.indication { font-size: 12px; color: var(--texte-2); }

.cases-quotas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 6px 18px;
    padding: 12px;
    background: var(--papier);
    border-radius: 4px;
}
.cases-quotas label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
}

.ligne-case { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

.actions { margin-top: 22px; display: flex; gap: 12px; }
button, .bouton {
    font: inherit;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
button.principal, .bouton.principal { background: var(--antenne); color: var(--blanc); }
button.principal:hover { background: #A80D26; }
button.secondaire, .bouton.secondaire { background: var(--surface); color: var(--texte); border: 1px solid var(--ligne-forte); }

/* ---------- Tableaux ---------- */
table.liste {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--ligne);
    font-size: var(--t-tableau, 13px);
}
table.liste th {
    text-align: left;
    background: var(--bandeau);
    color: var(--blanc);
    padding: 8px 10px;
    font-size: var(--t-sous-titre, 11px);
    font-stretch: 100%;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
table.liste td { padding: 7px 10px; border-top: 1px solid var(--ligne); vertical-align: top; }
table.liste tr:hover td { background: var(--surface-2); }
td.mono, .mono { font-family: var(--police-chiffres, 'IBM Plex Mono', monospace); font-size: var(--t-tableau, 13px); font-variant-numeric: tabular-nums; white-space: nowrap; }
td.droite { text-align: right; }
.etiquette {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 8px;
    border-radius: 10px;
    margin: 1px 2px 1px 0;
    background: #EDEFF2;
    color: var(--acier);
}
.etiquette.prod { background: #E4EDF5; color: var(--acier); }
.etiquette.acqu { background: #F5E9E4; color: #8A4B2D; }
.etiquette.chaine-decouverte { background: var(--decouverte); color: #FFFFFF; }
.etiquette.chaine-story { background: linear-gradient(120deg, #FF7A3C, #FF2E63); color: #FFFFFF; }
.etiquette.chaine-life { background: var(--life); color: #FFFFFF; }
.illimite { color: var(--ok); font-weight: 600; }

/* ---------- Infobulle de note sur les titres ---------- */
.a-une-note {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--texte-2);
}
.a-une-note .bulle-note {
    display: none;
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 220px;
    max-width: 340px;
    background: var(--bandeau);
    color: var(--blanc);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 9px 12px;
    border-radius: 5px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    white-space: normal;
}
.a-une-note:hover .bulle-note,
.a-une-note:focus .bulle-note {
    display: block;
}
a.lien-titre {
    color: inherit;
    text-decoration: none;
}
a.lien-titre:hover strong {
    color: var(--antenne);
}

/* ---------- Grille annuelle ---------- */
.grille-defilement { overflow-x: auto; overflow-y: auto; max-height: 78vh; }
.zone-suite-grille { text-align: center; padding: 14px 0 26px; }
table.grille {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 1050px;
    background: var(--surface);
    table-layout: fixed;
}
table.grille th {
    background: var(--bandeau);
    color: var(--blanc);
    padding: 7px 6px;
    font-stretch: 80%;
    letter-spacing: 0.06em;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 5;
    border-style: solid;
    border-color: var(--ligne);
    border-width: 1px 1px 1px 0;
}
table.grille th.col-semaine { border-left-width: 1px; }
td.cellule {
    border-style: solid;
    border-color: var(--ligne);
    border-width: 0 1px 1px 0;
    vertical-align: top;
    padding: 0;
    min-height: 64px;
    position: relative;
}
td.cellule.hors-annee { background: #EFEFEC; opacity: 0.55; }
.entete-jour {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 6px 3px;
    border-bottom: 1px solid var(--ligne);
    font-size: 12px;
    min-height: 24px;
}

/* Semaines passées masquées par défaut dans la grille */
table.grille tr.semaine-passee { display: none; }
table.grille.voir-passees tr.semaine-passee { display: table-row; }

/* Affichage : semaines passées, access et primes, chacun indépendant */
.afficher-options {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--texte-2);
}
.afficher-options label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
table.grille.masquer-access .ligne-access { display: none !important; }
table.grille.masquer-primes .pile,
table.grille.masquer-primes .ajouter-pile,
table.grille.masquer-primes .recherche-pile,
table.grille.masquer-primes .liste-manuels { display: none !important; }

/* Zones en vacances de la semaine, dans la case du numéro de
   semaine : un petit rond par zone concernée, la lettre de la zone à
   l'intérieur, puis le pourcentage d'élèves scolarisés concernés. */
.ronds-zones-semaine {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 6px;
}
.rond-zone {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
}
.rond-zone-a { background: #3E7FC1; }
.rond-zone-b { background: #4E9350; }
.rond-zone-c { background: #D98A2B; }
.pct-zones-semaine {
    display: block;
    font-size: 9.5px;
    font-weight: 500;
    color: var(--texte-2);
    margin-top: 1px;
}

.badge-ferie {
    display: inline-block;
    background: var(--antenne);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 3px;
    padding: 1px 5px;
}
.entete-jour .date-jour { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.entete-jour.ferie .date-jour { color: var(--antenne); }
.entete-jour .emoji-jour { font-size: 14px; }
.bouton-jour {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 0 3px;
    color: var(--texte-2);
    opacity: 0;
}
td.cellule:hover .bouton-jour { opacity: 1; }
.pile {
    list-style: none;
    margin: 0;
    padding: 2px 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 20px;
}
.pile li {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 12px;
    line-height: 1.3;
    padding: 2px 4px;
    background: #F4F4F0;
    border-radius: 3px;
}
.pile li.hors-droits { background: #E85D5D; color: #FFFFFF; }
.pile li.hors-droits a.lien-titre, .pile li.hors-droits .a-une-note { color: #FFFFFF; }
.pile li.hors-droits .outils-pile button { color: #FFD9D9; }
.pile li.hors-droits .outils-pile button:hover { color: #FFFFFF; }

/* Programmation qui déroge à une règle éditoriale (jour interdit,
   zone en vacances, Cinéma un samedi) : même traitement visuel que le
   hors droits, la bulle au survol permettant de distinguer les deux
   situations l'une de l'autre. */
.pile li.regle-douteuse { background: #E85D5D; color: #FFFFFF; }
.pile li.regle-douteuse a.lien-titre, .pile li.regle-douteuse .a-une-note { color: #FFFFFF; }
.pile li.regle-douteuse .outils-pile button { color: #FFD9D9; }
.pile li.regle-douteuse .outils-pile button:hover { color: #FFFFFF; }

/* Programme dont la livraison est annoncée après la date de diffusion :
   il n'existera pas ce jour-là. Même traitement visuel que le hors
   droits, l'infobulle du marqueur distinguant les deux situations. */
.pile li.livraison-absente { background: #E85D5D; color: #FFFFFF; }
.pile li.livraison-absente a.lien-titre, .pile li.livraison-absente .a-une-note { color: #FFFFFF; }
.pile li.livraison-absente .outils-pile button { color: #FFD9D9; }
.pile li.livraison-absente .outils-pile button:hover { color: #FFFFFF; }

.liste-manuels { padding: 2px 6px 4px; }
.prime-manuel-item {
    display: flex;
    align-items: flex-start;
    gap: 4px;
}
.prime-manuel-grille-texte {
    flex: 1;
    font-size: 12px;
    outline: none;
    border-radius: 3px;
    padding: 1px 3px;
    margin: -1px -3px;
}
.prime-manuel-grille-texte[contenteditable]:hover,
.prime-manuel-grille-texte[contenteditable]:focus {
    background: #F0F0EC;
}
.retirer-manuel-grille {
    background: none;
    border: none;
    color: var(--texte-2);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 2px;
}
.retirer-manuel-grille:hover { color: var(--antenne); }
.ajouter-manuel-grille {
    background: none;
    border: none;
    color: var(--texte-2);
    font-size: 11px;
    font-style: italic;
    cursor: pointer;
    padding: 1px 3px;
}
.ajouter-manuel-grille:hover { color: var(--antenne); }

.avertissement-regle {
    position: relative;
    cursor: help;
    font-weight: 800;
    margin-left: 2px;
}
.avertissement-regle .bulle-avertissement {
    display: none;
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 220px;
    max-width: 320px;
    background: var(--bandeau);
    color: var(--blanc);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 9px 12px;
    border-radius: 5px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    white-space: normal;
}
.avertissement-regle:hover .bulle-avertissement,
.avertissement-regle:focus .bulle-avertissement {
    display: block;
}

/* Alerte de livraison : la date annoncée par le responsable tombe trop
   tard au regard de la case posée. Le pictogramme dit la nature du
   problème, la pastille de fond en dit la gravité.

   Un emoji ne se colore pas : la gravité passe donc par le fond, non
   par la couleur du signe. Ambre pour l'annonce au SPMI, orange pour la
   marge trop courte, rouge pour la livraison postérieure à la
   diffusion. */
.marque-livraison {
    display: inline-block;
    padding: 0 3px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.5;
    vertical-align: middle;
}
.marque-livraison.liv-n1 { background: #FCE3B4; }
.marque-livraison.liv-n2 { background: #F0A02A; }
.marque-livraison.liv-n3 { background: var(--erreur); }

/* Date de diffusion hors de la fenêtre de droits (vue Recherche) */
.date-hors-droits {
    background: #E85D5D;
    color: #FFFFFF;
    padding: 0 5px;
    border-radius: 3px;
    cursor: help;
}
.titre-pile { flex: 1; word-break: break-word; }
.saison-pile {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10.5px;
    color: var(--acier);
    font-weight: 600;
}
.episodes-pile {
    font-size: 10.5px;
    color: var(--texte);
    background: #E4E9F0;
    border-radius: 3px;
    padding: 1px 5px;
    white-space: nowrap;
    cursor: pointer;
}
.episodes-pile.vide {
    color: var(--texte-2);
    background: transparent;
    opacity: 0;
}
.pile li:hover .episodes-pile.vide { opacity: 1; }
/* Deuxième partie de soirée : même ergonomie que le prime. La pastille
   « + épisodes » vide est masquée au repos (règle ci-dessus, opacity 0)
   et doit réapparaître au survol de l'élément. Au prime, l'élément est
   un li de la pile ; en deuxième partie, c'est un div .soiree2-item.
   Sans cette règle, la pastille restait invisible en permanence. */
.soiree2-item:hover .episodes-pile.vide { opacity: 1; }
.episodes-pile:hover { background: var(--acier); color: #FFFFFF; }
.outils-pile { display: none; white-space: nowrap; }
.pile li:hover .outils-pile { display: inline; }
.outils-pile button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    font-size: 12px;
    color: var(--texte-2);
}
.outils-pile button.bascule-inedit { font-weight: 800; }
.outils-pile button.bascule-inedit.actif { color: var(--antenne); }
.outils-pile button:hover { color: var(--antenne); }
.ajouter-pile {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #9A9DA3;
    font-size: 11px;
    text-align: left;
    padding: 2px 6px 4px;
    cursor: pointer;
    opacity: 0;
}
td.cellule:hover .ajouter-pile { opacity: 1; }
.ajouter-pile:hover { color: var(--acier); }
.recherche-pile { position: relative; padding: 2px 4px 4px; }
.recherche-pile input {
    width: 100%;
    font: inherit;
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid var(--acier);
    border-radius: 3px;
}
.resultats-pile {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    z-index: 30;
    left: 4px;
    right: 4px;
    background: var(--surface);
    border: 1px solid var(--ligne);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    max-height: 240px;
    overflow-y: auto;
}
.resultats-pile li {
    padding: 5px 8px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #F0F0EC;
}
.resultats-pile li:hover { background: #F4F6F9; }
.temoin.dispo { color: var(--ok); }

/* ---------- Ligne Access ---------- */
.ligne-access {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 6px;
    background: #F7F3E8;
    border-bottom: 1px solid var(--ligne);
    font-size: 12px;
    min-height: 20px;
}
.access-item {
    display: flex;
    align-items: center;
    gap: 3px;
}
.access-titre { font-weight: 600; word-break: break-word; }
.monter-access, .descendre-access {
    background: none;
    border: none;
    color: var(--texte-2);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 2px;
}
.monter-access:hover, .descendre-access:hover { color: var(--acier); }
.retirer-access {
    background: none;
    border: none;
    color: var(--texte-2);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 2px;
}
.retirer-access:hover { color: var(--antenne); }
.poignee-access {
    width: 10px;
    height: 10px;
    cursor: ew-resize;
    flex-shrink: 0;
}
.ajouter-access {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: #9A9DA3;
    font-size: 11px;
    text-align: left;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}
.ligne-access:hover .ajouter-access, td.cellule:hover .ajouter-access { opacity: 1; }
.ajouter-access:hover { color: var(--acier); }
.recherche-access { position: relative; padding: 2px 0 0; }
.recherche-access input {
    width: 100%;
    font: inherit;
    font-size: 12px;
    padding: 3px 5px;
    border: 1px solid var(--acier);
    border-radius: 3px;
}
.resultats-access {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--ligne);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    max-height: 220px;
    overflow-y: auto;
}
.resultats-access li { padding: 5px 8px; font-size: 12px; cursor: pointer; border-bottom: 1px solid #F0F0EC; }
.resultats-access li:hover { background: #F4F6F9; }
.cellule.cible-extension-access { outline: 2px solid #C7A947; outline-offset: -2px; }

/* Sélection d'un prime ou d'un access pour le copier ailleurs */
.selection-copie {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid var(--texte-2);
    cursor: pointer;
    flex-shrink: 0;
}
.selection-copie:hover { border-color: var(--acier); }
.selection-copie.actif { background: var(--acier); border-color: var(--acier); }
.cellule.cible-collage { outline: 2px solid var(--acier); outline-offset: -2px; background: #EAF0F6; }

.barre-collage {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bandeau);
    color: #FFFFFF;
    padding: 10px 16px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    font-size: 13px;
}
.barre-collage .indication { color: #C9CCD1; }
.aide-programmation {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.25);
}
.aide-programmation input[type="date"],
.aide-programmation select {
    font: inherit;
    font-size: 12px;
    padding: 3px 5px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
}
.aide-programmation select option { color: var(--encre); }
.barre-collage button.principal {
    background: var(--antenne);
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
}
.barre-collage button.principal:disabled { opacity: 0.5; cursor: default; }
.barre-collage button.secondaire {
    background: rgba(255,255,255,0.12);
    color: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 5px 12px;
    font-size: 13px;
    cursor: pointer;
}

.temoin.indispo { color: var(--erreur); }
.badge-signal {
    display: inline-block;
    background: var(--bandeau);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    vertical-align: middle;
    cursor: help;
}

/* Colonne du numéro de semaine */
table.grille th.col-semaine { width: 66px; }
td.num-semaine {
    border-style: solid;
    border-color: var(--ligne);
    border-width: 0 1px 1px 1px;
    background: #EDEEF0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--acier);
    text-align: center;
    vertical-align: middle;
    width: 66px;
}
.numero-semaine-grand { display: block; font-size: 14px; }
.date-sepm-grille { display: block; font-size: 10px; font-weight: 500; color: var(--texte-2); margin-top: 1px; }

/* Glisser-déposer */
.pile li[draggable="true"] { cursor: grab; }
.prime-manuel-grille-texte[draggable="true"] { cursor: grab; }
.pile li.en-deplacement, .prime-manuel-grille-texte.en-deplacement { opacity: 0.45; }
td.cellule.survol-depot { outline: 2px solid var(--acier); outline-offset: -2px; }

/* ---------- Panneau flottant d'une date ---------- */
.panneau-jour {
    position: absolute;
    z-index: 40;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.25);
    padding: 12px 14px;
    width: 340px;
}
.titre-panneau { font-weight: 700; margin-bottom: 8px; font-stretch: 85%; }
.ligne-panneau {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}
.pastilles { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.pastille {
    width: 22px; height: 22px;
    border: 1px solid #B9B8B2;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    font-size: 11px;
}
.raccourci-emoji {
    background: #F4F4F0;
    border: 1px solid var(--ligne);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    padding: 1px 5px;
}
.actions-panneau button { padding: 5px 12px; font-size: 13px; }

/* ---------- Presse-papiers ---------- */
.presse-papiers {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 50;
    background: var(--bandeau);
    color: var(--blanc);
    padding: 9px 14px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.presse-papiers button {
    background: none;
    border: none;
    color: var(--blanc);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

/* ---------- Dialogue de collage ---------- */
.dialogue {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(20, 22, 26, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}
.boite-dialogue {
    background: var(--surface);
    border-radius: 8px;
    padding: 22px 26px;
    max-width: 420px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}

/* ---------- Bulletin de programme ---------- */
.barre-bulletin {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.feuille-bulletin {
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: 8px;
    padding: 16px;
}
.entete-feuille {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.coin-semaine {
    background: #141519;
    color: #FFFFFF;
    border-radius: 6px;
    padding: 8px 16px;
    text-align: center;
    line-height: 1;
}
.coin-semaine .grand-numero { display: block; font-size: 30px; font-weight: 800; font-stretch: 80%; }
.coin-semaine .annee-coin { font-size: 11px; color: #B9BCC2; }
.nom-feuille { font-size: 19px; font-weight: 700; font-stretch: 82%; }
.sous-titre-feuille { font-size: 12px; color: var(--texte-2); }
.pastille-remise {
    margin-left: auto;
    background: var(--papier);
    border: 1px solid var(--ligne);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 12px;
}
.pastille-remise .valeur-remise { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.pastille-remise.remise-exception { background: var(--antenne); border-color: var(--antenne); color: #FFFFFF; }
.pastille-remise.remise-exception .alerte-remise { font-weight: 700; margin-left: 6px; }

table.bulletin {
    border-collapse: collapse;
    width: 100%;
    table-layout: fixed;
    font-size: 12px;
}
table.bulletin th, table.bulletin td { border: 1px solid #EAE9E2; }
table.bulletin th.jour-bulletin,
table.bulletin th.jour-n1,
table.bulletin td.bandeau-chaine {
    border-color: transparent;
}
table.bulletin .gouttiere {
    width: 58px;
    background: #F7F7F4;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--texte-2);
    text-align: center;
    vertical-align: middle;
}
th.jour-bulletin {
    background: #141519;
    color: #FFFFFF;
    padding: 7px 3px;
    font-size: 13px;
    font-weight: 700;
    font-stretch: 85%;
}
th.jour-bulletin.jour-ferie { color: #F09595; cursor: help; }
.pastille-ferie {
    background: #FF0000;
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 6px;
    letter-spacing: 0.05em;
}
.pastille-zones {
    background: #FFE94D;
    color: #5F5000;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 6px;
    letter-spacing: 0.03em;
}
.pastille-inedit {
    background: #FF0000;
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    padding: 1px 5px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.sigle-moins12 {
    height: 15px;
    width: auto;
    vertical-align: middle;
    cursor: help;
}
.case-prime a.lien-titre { color: inherit; }
.case-prime a.lien-titre:hover { text-decoration: underline; }
.separateur-bloc td { border: none; height: 26px; background: var(--surface); }

.bandeau-chaine { padding: 6px 10px; }
.bandeau-chaine.bloc-decouverte { background: var(--decouverte); }
.bandeau-chaine.bloc-story { background: linear-gradient(90deg, var(--story), #F01060); }
.bandeau-chaine.bloc-life { background: var(--life); }
.puce-logo {
    display: inline-block;
    background: var(--surface);
    border-radius: 4px;
    padding: 2px 8px;
    line-height: 0;
}
.puce-logo img { height: 16px; width: auto; display: inline-block; vertical-align: middle; }
.logo-replie { color: var(--texte); font-weight: 700; font-size: 11px; padding: 0 4px; }

.case-bulletin { padding: 7px 9px; vertical-align: top; word-break: break-word; }
.bascule-avant {
    display: inline-block;
    font-size: 9px;
    color: var(--ligne-forte);
    cursor: pointer;
    vertical-align: middle;
}
.bascule-avant:hover { color: var(--acier); }
.bascule-avant.actif { color: #FF0000; }
.case-bulletin[contenteditable]:focus {
    outline: 2px solid var(--acier);
    outline-offset: -2px;
}
.case-access { font-size: 10px; text-align: center; }
.case-prime { font-size: 14px; font-weight: 600; text-align: center; height: 56px; vertical-align: middle; }
.case-soiree2 { font-size: 10px; text-align: center; }
.case-commentaire { font-size: 11px; font-style: italic; height: 24px; }

.bloc-decouverte .case-prime { background: #E1EAFE; color: #071E7A; }
.bloc-decouverte .case-access, .bloc-decouverte .case-soiree2 { background: #F2F6FF; color: #0A2CA8; }
.bloc-story .case-prime { background: #FEE4DC; color: #84140B; }
.bloc-story .case-access, .bloc-story .case-soiree2 { background: #FFF3F0; color: #9E1E10; }
.bloc-life .case-prime { background: #FBE2F1; color: #75004E; }
.bloc-life .case-access, .bloc-life .case-soiree2 { background: #FCF1F8; color: #8F0060; }

/* Veille concurrentielle intégrée au bulletin (TF1, M6, Autres) */
tr.source-tf1 .gouttiere { background: #4A4A48; color: #FFFFFF; }
tr.source-tf1 .case-veille-ligne { background: #F2F2F0; color: #3A3A38; }
tr.source-m6 .gouttiere { background: var(--texte-2); color: #FFFFFF; }
tr.source-m6 .case-veille-ligne { background: #F5F5F4; color: #4A4A48; }
tr.source-autres .gouttiere { background: var(--texte-2); color: #FFFFFF; }
tr.source-autres .case-veille-ligne { background: #F7F7F5; color: var(--texte-2); }
/* LA LIGNE SPORT (9 septembre). Elle ferme le bloc de veille et se
   distingue des trois autres par un fond légèrement plus clair : ce
   n'est pas une chaîne concurrente, c'est ce qui se joue ailleurs. Elle
   ne se saisit pas — le contenu vient des rencontres cochées dans
   veille.php. */
tr.source-sport .gouttiere { background: #2F4B52; color: #FFFFFF; }
tr.source-sport .case-veille-ligne { background: #F2F7F8; color: #2B3A3E; }
.bl-sport-ligne { display: block; }
.bl-sport-ligne + .bl-sport-ligne { margin-top: 2px; }
/* LE SEUL ROUGE DE LA LIGNE SPORT (24 août, demande du client) :
   l'équipe de France masculine de football et le XV de France, EN
   PRIME. Rien d'autre. Le rouge marquait auparavant tous les rangs 1,
   soit des dizaines de lignes par saison — et un rouge qui paraît
   partout ne marque plus rien. */
.bl-sport-france { color: #B3261E; font-weight: 700; }
.case-veille-ligne { font-size: 12px; text-align: center; padding: 7px 8px; }

/* La même semaine l'année dernière */
.separateur-section { height: 30px; }
table.annee-derniere { margin-top: 4px; table-layout: fixed; }
.titre-section-n1 {
    background: #E9E7DE;
    color: var(--texte);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid #B9B8B2;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}
th.jour-n1 { font-size: 11px; font-weight: 500; }
.case-n1 { font-size: 12px; text-align: center; padding: 7px 8px; }
tr.ligne-n1-decouverte .case-n1 { background: #E1EAFE; color: #071E7A; }
tr.ligne-n1-story .case-n1 { background: #FEE4DC; color: #84140B; }
tr.ligne-n1-life .case-n1 { background: #FBE2F1; color: #75004E; }
tr.ligne-n1-concurrence .gouttiere { font-style: italic; font-size: 10.5px; }
table.bulletin .gouttiere-n1 { width: 78px; padding: 4px 3px; text-align: center; }
.gouttiere-n1 img { max-width: 34px; max-height: 26px; width: auto; height: auto; display: block; margin: 0 auto; }
.gouttiere-veille img {
    max-width: 40px;
    max-height: 22px;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 2px;
}
tr.ligne-n1-concurrence .gouttiere-n1 { font-size: 10px; line-height: 1.2; white-space: nowrap; }
.case-n1-concurrence {
    background: var(--surface);
    font-style: italic;
    font-size: 10.5px;
    text-align: left;
    padding: 6px 10px;
}

.outil-gras {
    position: absolute;
    z-index: 45;
    display: flex;
    gap: 6px;
}
.outil-gras button {
    background: var(--bandeau);
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.outil-gras button:hover { background: var(--antenne); }

/* ---------- Sélection multiple, presse papiers et historique du bulletin ---------- */
td.case-bulletin.case-selectionnee {
    outline: 2px solid var(--acier);
    outline-offset: -2px;
    box-shadow: inset 0 0 0 999px rgba(46, 74, 98, 0.12);
}
.barre-selection {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 50;
    background: var(--acier);
    color: #FFFFFF;
    padding: 9px 14px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.barre-selection button {
    padding: 5px 10px;
    font-size: 12px;
    background: var(--surface);
    color: var(--acier);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.barre-selection button:hover { background: #E4E9F0; }

#presse-papiers-bulletin {
    bottom: 70px;
    background: var(--bandeau);
}
#presse-papiers-bulletin button {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    font-size: 13px;
    padding: 3px 8px;
    border-radius: 4px;
}
#presse-papiers-bulletin button:hover { background: rgba(255,255,255,0.15); }
#presse-papiers-bulletin #bulletin-coller { background: var(--antenne); font-weight: 600; }
#presse-papiers-bulletin #bulletin-coller:hover { background: #A80D26; }

/* Le texte de ces indicateurs ne doit jamais pouvoir être sélectionné
   à la souris : une sélection accidentelle suivie d'un Cmd+C / Ctrl+C
   placerait ce texte dans le presse papiers du système, sans rapport
   avec le presse papiers propre au bulletin. */
#barre-selection-bulletin, #presse-papiers-bulletin {
    -webkit-user-select: none;
    user-select: none;
}

/* ---------- Veille concurrentielle ---------- */
.onglets-jours { display: flex; gap: 2px; }
.onglets-jours a {
    padding: 7px 14px;
    border-radius: 5px 5px 0 0;
    background: var(--papier);
    color: var(--texte);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--ligne);
    border-bottom: none;
}
.onglets-jours a.actif { background: var(--acier); color: #FFFFFF; border-color: var(--acier); }
.onglets-jours a:hover:not(.actif) { background: #E9ECF1; }

table.veille-liste { table-layout: fixed; }
table.veille-liste .col-date { width: 170px; font-weight: 700; font-size: 12px; }
table.veille-liste th { background: var(--bandeau); color: #FFFFFF; padding: 8px; font-size: 13px; }
table.veille-liste th.col-date { text-align: left; padding-left: 12px; }
tr.ligne-veille td.col-date { background: var(--surface-2); border-right: 2px solid var(--ligne); }
tr.ligne-veille.ligne-aujourdhui td.col-date { background: var(--bandeau); color: #FFFFFF; }
tr.ligne-veille:nth-child(even) .case-veille {
    background: var(--surface-2);
}
.case-veille {
    position: relative;
    padding: 0;
}
.texte-veille {
    font-size: 12px;
    padding: 8px 14px 8px 10px;
    min-height: 20px;
}
.poignee-remplissage {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 8px;
    height: 8px;
    background: var(--acier);
    border: 1px solid #FFFFFF;
    cursor: crosshair;
    opacity: 0;
}
.case-veille:hover .poignee-remplissage,
.texte-veille:focus ~ .poignee-remplissage {
    opacity: 1;
}

/* ---------- Export PDF (deux bulletins) ---------- */
/* Ce bloc contient la copie de la semaine suivante le temps de l'export.
   Il doit rester réellement affiché (et non masqué par display:none) pour
   que la bibliothèque de capture puisse le photographier, mais il est
   positionné hors du champ visible pour ne rien perturber à l'écran. */
#export-pdf-conteneur {
    position: absolute;
    left: -10000px;
    top: 0;
}

/* Police standard, sans variation de graisse, appliquée uniquement aux
   copies capturées pour l'export PDF : la police variable du site n'est
   pas mesurée correctement par la bibliothèque de capture, ce qui écrase
   les espaces dans le texte du fichier obtenu. */
.export-pdf-police-sure,
.export-pdf-police-sure * {
    font-family: Arial, Helvetica, sans-serif !important;
    font-stretch: normal !important;
}

/* Réglages d'impression généraux, utiles à toute page imprimée
   manuellement par le navigateur (menus et boutons masqués, format
   A4 paysage). Le bulletin lui même n'utilise plus ce mécanisme,
   remplacé par l'export PDF, mais les autres pages en dépendent
   encore pour une impression occasionnelle. */
@media print {
    @page { size: A4 landscape; margin: 8mm; }
    .bandeau, footer, .non-imprimable, .outil-gras, .bascule-avant { display: none !important; }
    main { max-width: none; padding: 0; }
    h1 { display: none; }
    body { background: var(--surface); }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 700px) {
    .bandeau { gap: 10px; }
    main { padding: 18px 12px 50px; }
    main.pleine-largeur { padding-left: 12px; padding-right: 12px; }
}

/* ---------- Neutralisation du gras et de l'italique dans les cases
   du bulletin, de la programmation et des textes manuels de la
   grille : quel que soit l'HTML enregistré en base ou généré par
   l'éditeur du navigateur (b, strong, i, em, ou styles inline
   font-weight, font-style), aucun effet visuel n'est appliqué. Tous
   les titres apparaissent du même poids et sans italique dans chaque
   fichier, quelle que soit leur origine. L'héritage laisse la case
   parente imposer son propre poids : un gras dans une case-prime
   (600) reste 600, dans une case-access (par défaut) reste 400. ---- */
.case-bulletin b, .case-bulletin strong, .case-bulletin i, .case-bulletin em,
.case-bulletin [style*="font-weight"], .case-bulletin [style*="font-style"],
.case-prog b, .case-prog strong, .case-prog i, .case-prog em,
.case-prog [style*="font-weight"], .case-prog [style*="font-style"],
.prime-manuel-grille-texte b, .prime-manuel-grille-texte strong,
.prime-manuel-grille-texte i, .prime-manuel-grille-texte em,
.prime-manuel-grille-texte [style*="font-weight"], .prime-manuel-grille-texte [style*="font-style"],
.prime-manuel-prog b, .prime-manuel-prog strong,
.prime-manuel-prog i, .prime-manuel-prog em,
.prime-manuel-prog [style*="font-weight"], .prime-manuel-prog [style*="font-style"] {
    font-weight: inherit !important;
    font-style: inherit !important;
    color: inherit !important;
}

/* ==========================================================
   Pages de connexion, inscription et confirmation
   ==========================================================
   Fond en dégradé RMC Cube pleine page, boîte blanche
   flottante centrée verticalement et horizontalement, logo
   RMC Cube posé sur un petit carré coloré arrondi en tête
   de la boîte. Le bandeau et la barre de navigation sont
   absents sur ces pages puisque la personne n'est pas encore
   connectée ou est en train d'agir sur son compte.
   ========================================================== */
body.page-connexion {
    background: linear-gradient(135deg, #1E5EE8 0%, #8B3ECC 30%, #E63985 60%, #F97316 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}
body.page-connexion main {
    width: 100%;
    max-width: 420px;
    padding: 0;
}
body.page-connexion main > h1,
body.page-connexion header.bandeau,
body.page-connexion .bandeau-voir-comme,
body.page-connexion footer { display: none; }

body.page-connexion .boite-connexion {
    background: var(--surface);
    border-radius: 20px;
    padding: 32px 34px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
body.page-connexion .boite-connexion .logo-cube {
    display: flex;
    justify-content: center;
    margin: 0 auto 20px;
}
body.page-connexion .boite-connexion .logo-cube img {
    width: 84px;
    height: 84px;
    display: block;
    border-radius: 18px;
    box-shadow: 0 4px 14px rgba(139, 62, 204, 0.28);
}
body.page-connexion .boite-connexion h1 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--encre, var(--encre));
    padding: 0;
    border: none;
}
body.page-connexion .boite-connexion .indication {
    text-align: center;
    font-size: 13px;
    color: var(--texte-2);
    margin: 0 0 22px;
}
body.page-connexion .boite-connexion .champ { margin-bottom: 14px; }
body.page-connexion .boite-connexion .champ label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--encre, var(--encre));
    margin-bottom: 6px;
}
body.page-connexion .boite-connexion input[type="text"],
body.page-connexion .boite-connexion input[type="email"],
body.page-connexion .boite-connexion input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    border: 1.5px solid var(--ligne);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--encre, var(--encre));
    transition: border-color 120ms, background 120ms;
}
body.page-connexion .boite-connexion input:focus {
    outline: none;
    border-color: #8B3ECC;
    background: var(--surface);
}
body.page-connexion .boite-connexion button.principal,
body.page-connexion .boite-connexion .bouton.principal {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, #1E5EE8 0%, #8B3ECC 40%, #E63985 75%, #F97316 100%);
    background-color: #8B3ECC;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 62, 204, 0.3);
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 120ms, box-shadow 120ms;
}
body.page-connexion .boite-connexion button.principal:hover,
body.page-connexion .boite-connexion .bouton.principal:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 62, 204, 0.38);
}
body.page-connexion .boite-connexion .bouton.secondaire {
    display: block;
    text-align: center;
    padding: 12px;
    background: transparent;
    color: var(--encre, var(--encre));
    border: 1.5px solid var(--ligne);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 8px;
}
body.page-connexion .boite-connexion a {
    color: #8B3ECC;
    font-weight: 600;
    text-decoration: none;
}
body.page-connexion .boite-connexion a:hover { text-decoration: underline; }
body.page-connexion .boite-connexion .obligatoire { color: #E63985; }
body.page-connexion .boite-connexion .message {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    text-align: left;
}
body.page-connexion .boite-connexion .message.erreur {
    background: rgba(230, 57, 133, 0.08);
    color: #A32458;
    border: 1px solid rgba(230, 57, 133, 0.25);
}
body.page-connexion .boite-connexion .message.ok {
    background: rgba(30, 94, 232, 0.06);
    color: #0F3D96;
    border: 1px solid rgba(30, 94, 232, 0.2);
}
body.page-connexion .boite-connexion p { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--texte-2); }

/* ==========================================================
   Refresh visuel RMC Cube
   ==========================================================
   Superposition de nouveaux styles sur les règles existantes.
   Deux périmètres distincts :
   - Le bandeau prend le dégradé RMC Cube sur toutes les pages
     internes (utilisateur connecté), y compris la grille et le
     bulletin, pour une cohérence globale d'identité.
   - Le corps de page reçoit un fond légèrement rosé, cartes
     arrondies, boutons principaux en dégradé et tableaux
     modernisés UNIQUEMENT sur les pages « standard ». Les pages
     denses (grille et bulletin, ciblées par main.pleine-largeur)
     et les pages de connexion sont épargnées.
   ========================================================== */

/* ---------- Bandeau : fond dégradé, logo, liens blancs ---------- */
body:not(.page-connexion) .bandeau {
    background: linear-gradient(135deg, #1E5EE8 0%, #8B3ECC 35%, #E63985 65%, #F97316 100%);
    background-color: #E63985;
    padding: 12px 24px;
    gap: 22px;
}
.logo-cube-bandeau {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-cube-bandeau img {
    width: 36px;
    height: 36px;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: transform 150ms;
}
.logo-cube-bandeau:hover img { transform: scale(1.05); }

body:not(.page-connexion) .bandeau nav a {
    color: rgba(255, 255, 255, 0.82);
    border-radius: 8px;
    padding: 7px 13px;
    font-weight: 500;
    transition: background 150ms, color 150ms;
}
body:not(.page-connexion) .bandeau nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}
body:not(.page-connexion) .bandeau nav a.actif {
    background: var(--surface);
    color: var(--encre);
    font-weight: 700;
}

body:not(.page-connexion) .bandeau .badge-demandes {
    background: var(--surface);
    color: #E63985;
    font-weight: 800;
}
body:not(.page-connexion) .bandeau nav a.actif .badge-demandes {
    background: #E63985;
    color: #FFFFFF;
}

body:not(.page-connexion) .bandeau .session {
    color: rgba(255, 255, 255, 0.9);
}
body:not(.page-connexion) .bandeau .session a {
    color: #FFFFFF;
    text-decoration: none;
    padding: 5px 11px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    font-weight: 500;
}
body:not(.page-connexion) .bandeau .session a:hover { background: rgba(255, 255, 255, 0.24); }

body:not(.page-connexion) .bandeau .recherche-menu input[type="search"] {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
}
body:not(.page-connexion) .bandeau .recherche-menu input[type="search"]::placeholder { color: rgba(255, 255, 255, 0.72); }
body:not(.page-connexion) .bandeau .recherche-menu input[type="search"]:focus {
    background: rgba(255, 255, 255, 0.24);
    border-color: #FFFFFF;
}
body:not(.page-connexion) .bandeau .recherche-menu button.secondaire {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    color: #FFFFFF;
}
body:not(.page-connexion) .bandeau .recherche-menu button.secondaire:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: #FFFFFF;
}

body:not(.page-connexion) .bandeau .libelle-voir-comme {
    color: rgba(255, 255, 255, 0.82);
}
body:not(.page-connexion) .bandeau .voir-comme select {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #FFFFFF;
    border-radius: 8px;
    padding: 5px 8px;
}

body:not(.page-connexion) .bandeau .libelle-grilles { color: rgba(255, 255, 255, 0.9); }

/* Le mini bandeau super-admin « Vous visualisez comme… » garde son
   fond violet propre pour rester très visible, indépendamment du
   bandeau nav coloré juste en dessous. */

/* ---------- Corps des pages « standard » ---------- */
/* Fond très légèrement rosé, cartes arrondies, boutons dégradé,
   tableaux modernisés. La sélection main:not(.pleine-largeur)
   exclut automatiquement grille et bulletin qui gardent leur mise
   en page dense actuelle. */
body:not(.page-connexion):has(main:not(.pleine-largeur)) {
    background: var(--fond-standard);
}
body:not(.page-connexion) main:not(.pleine-largeur) {
    background: transparent;
}
body:not(.page-connexion) main:not(.pleine-largeur) h1 {
    font-weight: 800;
    letter-spacing: -0.4px;
    margin-bottom: 20px;
}

/* Boutons principaux : dégradé RMC Cube au lieu du rouge antenne. */
body:not(.page-connexion) main:not(.pleine-largeur) button.principal,
body:not(.page-connexion) main:not(.pleine-largeur) .bouton.principal {
    background: linear-gradient(135deg, #1E5EE8 0%, #8B3ECC 40%, #E63985 75%, #F97316 100%);
    background-color: #8B3ECC;
    color: #FFFFFF;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(139, 62, 204, 0.28);
    transition: transform 120ms, box-shadow 120ms;
}
body:not(.page-connexion) main:not(.pleine-largeur) button.principal:hover,
body:not(.page-connexion) main:not(.pleine-largeur) .bouton.principal:hover {
    background: linear-gradient(135deg, #1E5EE8 0%, #8B3ECC 40%, #E63985 75%, #F97316 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 62, 204, 0.38);
}

body:not(.page-connexion) main:not(.pleine-largeur) button.secondaire,
body:not(.page-connexion) main:not(.pleine-largeur) .bouton.secondaire {
    background: var(--surface);
    color: var(--encre);
    border: 1.5px solid var(--ligne);
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 600;
}
body:not(.page-connexion) main:not(.pleine-largeur) button.secondaire:hover,
body:not(.page-connexion) main:not(.pleine-largeur) .bouton.secondaire:hover {
    background: var(--surface-2);
    border-color: #8B3ECC;
}

/* Cartes / fiches avec ombre douce et angles arrondis. */
body:not(.page-connexion) main:not(.pleine-largeur) .fiche {
    background: var(--surface);
    padding: 22px 26px;
    border-radius: 14px;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    margin-bottom: 22px;
}
body:not(.page-connexion) main:not(.pleine-largeur) .fiche input[type="text"],
body:not(.page-connexion) main:not(.pleine-largeur) .fiche input[type="number"],
body:not(.page-connexion) main:not(.pleine-largeur) .fiche input[type="date"],
body:not(.page-connexion) main:not(.pleine-largeur) .fiche input[type="password"],
body:not(.page-connexion) main:not(.pleine-largeur) .fiche input[type="search"],
body:not(.page-connexion) main:not(.pleine-largeur) .fiche select,
body:not(.page-connexion) main:not(.pleine-largeur) .fiche textarea {
    border-radius: 8px;
    border: 1.5px solid var(--ligne);
    background: var(--surface-2);
    transition: border-color 120ms, background 120ms;
}
body:not(.page-connexion) main:not(.pleine-largeur) .fiche input:focus,
body:not(.page-connexion) main:not(.pleine-largeur) .fiche select:focus,
body:not(.page-connexion) main:not(.pleine-largeur) .fiche textarea:focus {
    outline: none;
    border-color: #8B3ECC;
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(139, 62, 204, 0.12);
}

/* Tableaux .liste : angles arrondis, ombre douce, en-tête
   dégradé RMC Cube ténu, séparateurs plus doux. */
body:not(.page-connexion) main:not(.pleine-largeur) table.liste {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    background: var(--surface);
}
body:not(.page-connexion) main:not(.pleine-largeur) table.liste th {
    background: var(--surface-2);
    color: var(--encre);
    font-weight: 700;
    border-bottom: 1px solid var(--ligne);
    padding: 12px 14px;
    font-stretch: normal;
    letter-spacing: 0.06em;
    font-size: var(--t-sous-titre, 11px);
    text-transform: uppercase;
    color: var(--texte-2);
}
body:not(.page-connexion) main:not(.pleine-largeur) table.liste td {
    padding: 12px 14px;
    border-top: 1px solid #F3F0EA;
}
body:not(.page-connexion) main:not(.pleine-largeur) table.liste tr:hover td { background: #FDF6F7; }

/* Message d'information (succès, erreur) plus contemporain. */
body:not(.page-connexion) main:not(.pleine-largeur) .message {
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid transparent;
    font-size: 14px;
}
body:not(.page-connexion) main:not(.pleine-largeur) .message.ok {
    background: var(--ok-fond);
    color: var(--ok);
    border-color: var(--ok-fond);
}
body:not(.page-connexion) main:not(.pleine-largeur) .message.erreur {
    background: var(--erreur-fond);
    color: var(--erreur);
    border-color: var(--erreur-bord);
}

/* Étiquettes (badges de rôle, quota, chaîne) : angles plus arrondis. */
body:not(.page-connexion) main:not(.pleine-largeur) .etiquette {
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Correction sur la pastille du groupe grilles : le fond 100% blanc
   masquait le libellé « Grilles » gris foncé sur le dégradé du
   bandeau. On passe à un blanc 85% qui laisse transparaître le
   dégradé, et on assombrit le libellé pour qu'il reste net. */
body:not(.page-connexion) .bandeau .groupe-grilles {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
}
body:not(.page-connexion) .bandeau .libelle-grilles {
    color: var(--encre);
    font-weight: 800;
}

/* Le bandeau ne doit jamais passer sur deux lignes. On force le
   nowrap, on masque le débordement éventuel, et on donne à la nav
   la priorité de se rétracter (flex-shrink 1) tandis que le logo
   RMC Cube et le menu compte gardent leur place fixe. */
body:not(.page-connexion) .bandeau {
    flex-wrap: nowrap;
    overflow: visible;
    min-width: 0;
}
body:not(.page-connexion) .bandeau nav {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    flex-wrap: nowrap;
}

/* ---------- Menu compte déroulant ---------- */
/* Regroupe le nom du compte, le rôle, le sélecteur « voir comme »
   (super-admin uniquement) et le bouton de déconnexion sous un
   unique bouton dans le bandeau. Libère beaucoup de place pour la
   navigation principale et évite tout risque de retour à la ligne. */
.menu-compte {
    position: relative;
    flex-shrink: 0;
    margin-left: 6px;
}
.menu-compte-bouton {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #FFFFFF;
    padding: 5px 10px 5px 5px;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: background 150ms, border-color 150ms;
}
.menu-compte-bouton:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.55);
}
.initiale-compte {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface);
    color: #8B3ECC;
    font-weight: 800;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    flex-shrink: 0;
}
.nom-court-compte {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fleche-compte { font-size: 11px; opacity: 0.85; }

.menu-compte-panneau {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    padding: 6px;
    z-index: 100;
    display: none;
    color: var(--encre);
    font-size: 14px;
}
.menu-compte.ouvert .menu-compte-panneau { display: block; }
/* LE PANNEAU DE LA BARRE DU HAUT SE POSE EN POSITION FIXE (le client,
   28 août : « la fenêtre s'ouvre mais on ne la voit pas »). La barre
   porte overflow-x: auto pour défiler sur écran étroit, ce qui force
   overflow-y à hidden : un panneau plus haut qu'elle y était rogné.
   En position fixe il quitte le cadre du rogneur. coquille.js pose la
   classe et calcule top/left ; sans JavaScript, rien ne change. */
.menu-compte-panneau.menu-compte-echappe {
    position: fixed;
    top: 0; left: 0; right: auto;
    z-index: 500;
}

.menu-compte-entete {
    padding: 12px 14px 10px;
    border-bottom: 1px solid #F3F0EA;
    margin-bottom: 6px;
}
.menu-compte-nom {
    font-weight: 700;
    color: var(--encre);
    font-size: 14px;
}
.menu-compte-role {
    color: var(--texte-2);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.menu-compte-panneau .voir-comme {
    display: block;
    padding: 8px 12px 12px;
    margin: 0;
    border-bottom: 1px solid #F3F0EA;
    margin-bottom: 6px;
}
.menu-compte-panneau .libelle-voir-comme {
    display: block;
    color: var(--texte-2);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.menu-compte-panneau .voir-comme select {
    width: 100%;
    padding: 8px 10px;
    background: var(--surface-2);
    color: var(--encre);
    border: 1.5px solid var(--ligne);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}
.menu-compte-panneau .voir-comme select:focus {
    outline: none;
    border-color: #8B3ECC;
    background: var(--surface);
}

.menu-compte-deconnexion {
    display: block;
    padding: 10px 14px;
    color: #A32458 !important;
    background: transparent !important;
    text-decoration: none;
    font-weight: 600;
    border-radius: 8px;
    font-size: 14px;
}
.menu-compte-deconnexion:hover {
    background: rgba(230, 57, 133, 0.08) !important;
    color: #A32458 !important;
}

/* Correction : les règles précédentes qui stylisaient « voir comme »
   pour le bandeau (texte blanc, fond semi-transparent) s'appliquaient
   aussi dans le panneau du menu compte puisque celui-ci est un
   descendant du bandeau. Le sélecteur devenait invisible (blanc sur
   blanc). On surcharge ici pour restaurer les couleurs sombres sur
   fond clair du panneau. Petit signal visuel : point actif à côté du
   logo RMC Cube quand on est sur l'accueil. */
body:not(.page-connexion) .menu-compte-panneau .libelle-voir-comme {
    color: var(--texte-2);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
body:not(.page-connexion) .menu-compte-panneau .voir-comme select {
    background: var(--surface-2);
    border: 1.5px solid var(--ligne);
    color: var(--encre);
}
body:not(.page-connexion) .menu-compte-panneau .voir-comme select:focus {
    background: var(--surface);
    border-color: #8B3ECC;
}

.logo-cube-bandeau.actif img {
    box-shadow: 0 0 0 2px #FFFFFF, 0 2px 6px rgba(0, 0, 0, 0.18);
}

/* ============================================================
   Revue de stock : une ligne par fiche

   Le tableau redevient un tableau : sept colonnes, une ligne, on
   balaie du regard. Le regroupement ne se lit plus dans la
   structure mais dans une étiquette devant le titre, et tout le
   détail s'ouvre en surimpression au clic.
   ============================================================ */

.stock-bilan {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--texte-2);
}
.stock-bilan strong { color: var(--encre, var(--encre)); }

.liste-stock { width: 100%; border-collapse: collapse; }
.liste-stock thead th {
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.liste-stock thead th.droite { text-align: right; }
.liste-stock tbody td {
    padding: 9px 12px;
    font-size: 13px;
    border-bottom: 1px solid #F2F0EA;
    white-space: nowrap;
}
.liste-stock tbody tr:last-child td { border-bottom: 0; }
.liste-stock tbody tr:hover td { background: var(--surface-2); }
.liste-stock .gris { color: var(--texte-2); }

/* Le titre du programme laisse la place aux autres colonnes : c'est
   la seule qui peut se couper, les autres tiennent sur une ligne. */
.stock-prog { white-space: normal !important; max-width: 460px; }
.stock-titre {
    font-weight: 700;
    color: var(--encre, var(--encre));
    text-decoration: none;
    border-bottom: 1px solid transparent;
    cursor: pointer;
}
.stock-titre:hover {
    color: var(--acier, #2E4A62);
    border-bottom-color: var(--acier, #2E4A62);
}
.stock-vo {
    display: block;
    font-size: 11px;
    color: var(--texte-2);
    font-style: italic;
}

/* Première diffusion : la date, puis la chaîne qui l'a portée. La
   chaîne passe sous la date plutôt qu'à côté, pour que les dates
   restent alignées d'une ligne à l'autre. */
.stock-pd .mono {
    display: block;
    font-size: 12px;
    color: var(--texte-2);
}
.stock-pd-ch {
    display: block;
    font-size: 11px;
    color: var(--texte-2);
}

/* Étiquette d'appartenance : la marque du magazine, ou le mot
   « Série ». Rien pour un unitaire, qui ne se rattache à rien. */
.appart {
    display: inline-block;
    margin-right: 7px;
    padding: 1px 7px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.a-mag { background: #EDE4F7; color: #6A2E96; }
.a-ser { background: #DCE6EF; color: #28506F; }

/* ============================================================
   Fenêtre de détail d'une fiche

   Ouverte au clic sur un titre, elle porte ce qui ne tenait pas
   dans la liste : droits, quotas, épisodes et leurs passages,
   saisons voisines. La liste reste en place derrière.
   ============================================================ */

.voile-detail {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(20, 20, 22, 0.55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 26px 20px;
    overflow-y: auto;
}
.cadre-detail {
    position: relative;
    background: var(--blanc, #FFFFFF);
    border-radius: 9px;
    width: min(960px, 96vw);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.detail-fermer {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: var(--texte-2);
    cursor: pointer;
    z-index: 1;
}
.detail-corps { padding: 0 0 20px; }
.detail-attente {
    padding: 40px 20px;
    text-align: center;
    color: var(--texte-2);
    font-size: 14px;
}

.detail-tete {
    /* Même réserve que la barre : la croix occupe ce coin, et un titre
       long y passait dessous. */
    padding: 15px 52px 14px 20px;
    border-bottom: 1px solid var(--ligne, var(--ligne));
    background: var(--surface-2);
    border-radius: 9px 9px 0 0;
}
.detail-tete h2 { margin: 4px 0 0; font-size: 19px; }
.detail-meta {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--texte-2);
    line-height: 1.5;
}

/* Blocs de synthèse : les valeurs qui tiennent en un mot, côte à
   côte, avant les tableaux détaillés. */
.detail-blocs {
    display: flex;
    gap: 26px;
    flex-wrap: wrap;
    padding: 16px 20px 4px;
}
.detail-bloc { flex: 1 1 180px; min-width: 170px; }
.detail-bloc h4 {
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--texte-2);
}
.detail-val { font-size: 13px; line-height: 1.5; }
.detail-l { display: block; }
.detail-diff { margin-left: 6px; font-size: 11px; color: var(--texte-2); }

.detail-corps h3 {
    margin: 18px 20px 8px;
    padding-top: 14px;
    border-top: 1px solid #EFEDE6;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--texte-2);
}

.detail-table {
    width: calc(100% - 40px);
    margin: 0 20px;
    border-collapse: collapse;
}
.detail-table th {
    text-align: left;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--texte-2);
    border-bottom: 1px solid var(--ligne, var(--ligne));
}
.detail-table th.droite, .detail-table td.droite { text-align: right; }
.detail-table th.num, .detail-table td.num {
    width: 34px;
    text-align: right;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--texte-2);
}
.detail-table td {
    padding: 5px 8px;
    font-size: 12px;
    border-bottom: 1px solid #F4F2EC;
}
.detail-table tr:last-child td { border-bottom: 0; }
.detail-pass {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--texte-2);
}
.detail-m12 {
    padding: 0 5px;
    border-radius: 3px;
    background: var(--erreur-fond);
    color: #A8382B;
    font-size: 9.5px;
    font-weight: 700;
}
.detail-suivi {
    margin-left: 6px;
    font-size: 11px;
    color: var(--texte-2);
    font-style: italic;
}

.detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 20px 0;
    padding-top: 15px;
    border-top: 1px solid #EFEDE6;
}

/* ---------- Mode modification, dans la même fenêtre ---------- */

/* Barre de retour : on est entré dans le formulaire, on doit pouvoir
   en sortir sans fermer la fenêtre et perdre sa place dans la liste. */
.detail-barre {
    display: flex;
    align-items: center;
    gap: 14px;
    /* La croix de fermeture est posée en surimpression dans le coin
       haut droit du cadre, à 12 pixels du bord et sur 24 de large : la
       barre lui réserve la place, sans quoi « Ouvrir en pleine page »
       passait dessous. */
    padding: 11px 52px 11px 18px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--ligne, var(--ligne));
    border-radius: 9px 9px 0 0;
}
.detail-retour {
    border: 1px solid var(--ligne-forte);
    border-radius: 6px;
    background: var(--blanc, #FFFFFF);
    padding: 6px 13px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--encre, var(--encre));
    cursor: pointer;
}
.detail-retour:hover { background: #F2F2EC; }
.detail-plein { margin-left: auto; font-size: 12px; }

/* Le formulaire est chargé tel quel : sa hauteur est généreuse, faute
   de quoi on passerait son temps à faire défiler un cadre étroit. */
.detail-cadre {
    display: block;
    width: 100%;
    height: 78vh;
    min-height: 480px;
    border: 0;
    border-radius: 0 0 9px 9px;
    background: var(--blanc, #FFFFFF);
}


/* ==================================================================
   ACCUEIL
   ==================================================================
   Ces règles ne servent qu'à index.php. Elles vivaient dans la page
   même, ce qui empêchait le navigateur de les mettre en cache et
   obligeait à rouvrir un fichier de deux mille lignes pour changer une
   couleur.
   ================================================================== */

/* Aucun titre sur cette page : le h1 sortirait vide, avec son liseré,
   et laisserait une barre orpheline en tête. La règle ne vaut que pour
   l'accueil, le titre étant utile partout ailleurs. */
main > h1 { display: none; }

/* ---- Widgets ----
   Tous de même facture : fond blanc, liseré, coins arrondis, un titre,
   un sous-titre qui dit à quoi ça sert, un contenu, un lien d'action.
   C'est cette répétition qui fait la cohérence de la page. */
.widget {
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

/* ==================================================================
   Accueil : une page de tableau de bord.

   Les classes sont préfixées ac- et n'existent que sur cette page :
   refondre .widget toucherait les onze autres écrans du site, dont ce
   n'est pas le sujet.

   Trois principes. La couleur ne sert qu'à distinguer une chaîne ou à
   signaler un écart, jamais à décorer. Les chiffres sont en chasse
   fixe, pour se comparer d'une ligne à l'autre. Et rien ne clignote :
   une page consultée dix fois par jour doit se laisser oublier.
   ================================================================== */

/* Le corps de page s'élargit : deux colonnes ne tiennent pas dans la
   largeur d'un texte courant. */
body:not(.page-connexion) main:not(.pleine-largeur):has(.ac-grille) {
    max-width: 1560px;
}

/* ---------- Échéance : un bandeau, pas un bloc ---------- */
.ac-echeance {
    display: flex; align-items: center; gap: 14px;
    background: #15171C; color: #fff;
    border-radius: 16px; padding: 15px 20px; margin-bottom: 18px;
}
.ac-echeance.ac-urgent { background: #7A1D14; }
.ac-echeance-mot {
    font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    background: rgba(255,255,255,.16); padding: 5px 10px; border-radius: 6px; white-space: nowrap;
}
.ac-echeance-texte { flex: 1; font-size: 15.5px; }
.ac-echeance-texte b { font-weight: 700; }
.ac-echeance-reste {
    font-family: 'IBM Plex Mono', monospace; font-size: 13px; opacity: .75; white-space: nowrap;
}
.ac-echeance-lien {
    color: #fff; font-size: 13px; font-weight: 700; text-decoration: none;
    border: 1px solid rgba(255,255,255,.3); padding: 6px 13px; border-radius: 9px;
    white-space: nowrap;
}
.ac-echeance-lien:hover { background: rgba(255,255,255,.12); }

/* La seconde échéance tient sur la même ligne, derrière un filet
   vertical et dans un ton plus sourd : elle informe, elle ne réclame
   pas. Un second bandeau aurait donné deux alertes pour une seule
   obligation. */
.ac-echeance-puis {
    font-size: 13px; color: rgba(255,255,255,.62);
    padding-left: 14px; border-left: 1px solid rgba(255,255,255,.22);
    white-space: nowrap;
}
.ac-echeance-puis b { font-weight: 700; color: rgba(255,255,255,.86); }
.ac-echeance-j2 { font-family: 'IBM Plex Mono', monospace; font-size: 12px; opacity: .8; }

/* ---------- Grille ---------- */
.ac-grille {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    align-items: stretch; margin-bottom: 20px;
}
/* Sans cette marge, les blocs de la grille collaient aux widgets
   pleine largeur qui les suivent. */
.ac-grille > .ac-bloc { margin-bottom: 0; }
.ac-pleine { grid-column: 1 / -1; }
@media (max-width: 1100px) { .ac-grille { grid-template-columns: 1fr; } }

.ac-bloc {
    background: var(--surface); border: 1px solid var(--ligne);
    border-radius: 14px; overflow: hidden;
    /* Les blocs voisins se calent sur la même hauteur : une grille dont
       les cartes flottent à des niveaux différents ne ressemble pas à
       un tableau de bord, mais à une pile de billets. */
    height: 100%;
    display: flex; flex-direction: column;
}
/* Le contenu prend la place, le pied reste en bas. */

/* Tout ce qui vit dans un bloc garde ses marges : sans cette règle,
   le contenu posé directement sous la tête collait aux bords, et les
   phrases longues semblaient sortir du cadre. */
/* Le rembourrage vit sur .ac-corps, jamais sur un sélecteur
   universel : « .ac-bloc > * » compte pour une seule classe, si bien
   que la moindre règle de classe déclarée plus loin l'écrasait, et le
   contenu se retrouvait collé aux bords. */
.ac-corps { padding: 12px 16px 14px; flex: 1 1 auto; }
/* Un lien en pied doit occuper sa ligne : inline, sa marge basse
   n'aurait aucun effet. */
.ac-bloc > .widget-lien, .ac-bloc > .ac-lien {
    display: block; margin-top: auto;
    padding: 11px 16px 13px;
    border-top: 1px solid var(--surface-2); font-size: 12.5px;
}
.ac-tete {
    display: flex; align-items: baseline; gap: 12px;
    padding: 13px 16px 0;
    border-bottom: 1px solid var(--surface-2); padding-bottom: 11px;
}
.ac-tete h2 {
    font-size: 14px; font-weight: 800; font-stretch: 84%; margin: 0;
    letter-spacing: .01em;
    display: flex; align-items: center; gap: 8px;
}
.ac-tete .ac-sous {
    font-size: 10.5px; color: var(--texte-2); margin-left: auto; text-align: right;
    text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.ac-corps { padding: 13px 18px 16px; }
.ac-pied { padding: 0 18px 15px; }
/* Les soirées portent leur propre grille : la règle générale leur
   donnerait une marge en trop. */
.ac-bloc > .ac-soirees { padding: 13px 18px 16px; }
.ac-lien { font-size: 13px; color: #2E4A62; font-weight: 600; text-decoration: none; }
.ac-lien:hover { text-decoration: underline; }
.ac-vide { margin: 0; font-size: 13.5px; color: var(--texte-2); font-style: italic; }

/* ---------- Prime du soir ---------- */
/* Une carte par chaîne, le bandeau à sa couleur. Le contenu reste sur
   fond clair : du texte sur aplat coloré se lit mal. */
.ac-soirees { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; padding: 13px 18px 16px; }
@media (max-width: 820px) { .ac-soirees { grid-template-columns: 1fr; } }
.ac-soiree { border: 1px solid var(--ligne); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.ac-soiree-tete {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 13px; color: #fff;
    font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
}
/* Le logo se pose sur une pastille blanche : les logos des chaînes
   sont eux-mêmes bleus, rouges ou roses, et disparaissaient sur un
   aplat de leur propre couleur. */
.ac-soiree-tete img {
    width: 26px; height: 18px; object-fit: contain;
    background: var(--surface); border-radius: 4px; padding: 2px 3px;
    flex: 0 0 auto;
}
/* Les classes viennent de $config_prime : « decouverte », « story »,
   « life ». Viser ac-dec et consorts laissait le bandeau blanc, donc
   le nom de la chaîne illisible sur fond clair. */
.ac-soiree.decouverte .ac-soiree-tete { background: var(--decouverte); }
.ac-soiree.story .ac-soiree-tete { background: var(--story); }
.ac-soiree.life .ac-soiree-tete { background: var(--life); }
/* Par défaut, un fond sombre plutôt qu'un fond clair : si une chaîne
   nouvelle apparaissait, son nom resterait lisible. */
.ac-soiree-tete { background: var(--texte-2); }
.ac-soiree-corps { padding: 12px 13px; }
.ac-prog { padding: 9px 0; border-top: 1px solid #EEEDE6; }
.ac-prog:first-child { border-top: 0; padding-top: 0; }
.ac-prog-titre { font-weight: 700; font-size: 15px; line-height: 1.3; }
.ac-prog-detail { font-size: 12.5px; color: var(--texte-2); margin-top: 3px; }
.ac-prog-prod { font-size: 11.5px; color: var(--texte-2); margin-top: 2px; }
.ac-inedit {
    display: inline-block; background: #A32B1E; color: #fff;
    font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
    padding: 2px 6px; border-radius: 4px; vertical-align: 2px; margin-left: 5px;
}
.ac-m12 { width: 15px; height: 15px; vertical-align: -2px; margin-left: 4px; }

/* ---------- Audiences ---------- */
.ac-aud-cartes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; padding: 13px 18px 16px; }
@media (max-width: 1400px) { .ac-aud-cartes { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .ac-aud-cartes { grid-template-columns: repeat(2, 1fr); } }
.ac-aud-c { border: 1px solid var(--ligne); border-radius: 14px; padding: 13px; background: var(--surface-2); }
.ac-aud-c.ac-dec { border-color: #B9D2FF; background: #F5F9FF; }
.ac-aud-c.ac-sto { border-color: #FFC6C9; background: #FFF7F7; }
.ac-aud-c.ac-lif { border-color: #EFBCDE; background: #FFF6FC; }
.ac-aud-tete { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-height: 28px; }
.ac-aud-logo { width: 26px; height: 26px; object-fit: contain; }
.ac-aud-nom { font-size: 12.5px; font-weight: 700; line-height: 1.15; }
.ac-aud-score { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.ac-aud-pda { font-size: 28px; font-weight: 800; font-stretch: 84%; line-height: 1; }
.ac-dec .ac-aud-pda { color: var(--decouverte); }
.ac-sto .ac-aud-pda { color: var(--story); }
.ac-lif .ac-aud-pda { color: var(--life); }
.ac-aud-cible { font-size: 11px; color: var(--texte-2); }
.ac-aud-record {
    font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    background: #F5E9C8; color: #8A6C24; padding: 2px 6px; border-radius: 4px;
}
/* La jauge dit l'écart à la moyenne du même jour de la semaine. Le
   repère central marque cette moyenne : à sa hauteur, journée
   ordinaire. */
.ac-jauge { position: relative; height: 7px; border-radius: 999px; background: #E9E7E0; margin: 11px 0 6px; }
.ac-jauge-b { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.ac-jauge-b.haut { background: var(--ok); left: 50%; }
.ac-jauge-b.bas { background: #A32B1E; right: 50%; }
.ac-jauge-b.egal { background: var(--texte-2); left: 49%; width: 2%; }
.ac-jauge-r { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 2px; background: #15171C; opacity: .4; }
.ac-aud-moy { font-size: 11px; color: var(--texte-2); line-height: 1.3; }
.ac-aud-mouv { background: var(--surface); }
.ac-mouv-tete {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .04em; margin-bottom: 10px;
}
.ac-fl.haut { color: var(--ok); } .ac-fl.bas { color: #A32B1E; }
.ac-mouv-l {
    display: grid; grid-template-columns: 1fr auto auto; gap: 7px;
    align-items: baseline; padding: 6px 0; font-size: 12.5px;
}
.ac-mouv-l + .ac-mouv-l { border-top: 1px solid var(--surface-2); }
.ac-mouv-ch { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-mouv-pda { font-family: 'IBM Plex Mono', monospace; font-weight: 700; }
.ac-pt {
    font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 700;
    padding: 1px 6px; border-radius: 999px;
}
.ac-pt.haut { background: #EDF5ED; color: var(--ok); }
.ac-pt.bas { background: #FDF1EF; color: #A32B1E; }
.ac-pt.egal { background: var(--surface-2); color: var(--texte-2); }

/* ---------- Tableau des prime times ---------- */
.ac-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ac-tbl th {
    text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--ligne);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--texte-2); white-space: nowrap;
}
.ac-tbl td { padding: 9px 11px; border-bottom: 1px solid var(--surface-2); }
.ac-tbl tr:last-child td { border-bottom: 0; }
.ac-c-rang { width: 36px; color: var(--texte-2); font-family: 'IBM Plex Mono', monospace; }
.ac-c-num { text-align: right; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.ac-c-fort { font-weight: 700; }
.ac-tbl .ac-l-rmc { background: #FAF9F5; }
.ac-tbl .ac-l-rmc td:nth-child(2) { font-weight: 700; }
.ac-deplier { margin-top: 13px; }
.ac-deplier summary {
    font-size: 13px; color: var(--texte-2); cursor: pointer; padding: 8px 0; list-style: none;
}
.ac-deplier summary::-webkit-details-marker { display: none; }
.ac-deplier summary::before { content: '▸ '; }
.ac-deplier[open] summary::before { content: '▾ '; }
.ac-titre-ed {
    border-bottom: 1px dashed var(--texte-2); cursor: text; outline: none;
}
.ac-titre-ed:focus { border-bottom-style: solid; background: #FFFCF0; }
.ac-titre-eps { color: var(--texte-2); font-size: 12px; }
.widget-tete { margin-bottom: 12px; }
/* Le titre du widget est le premier niveau visible de l'accueil : le
   h1 y est masqué, et des titres de quinze pixels, dimensionnés pour
   vivre sous lui, laissaient la page sans repères. À onze widgets, ce
   sont eux qui portent le parcours.
   La condensation est celle des h2 du site, non celle qu'imposait cette
   page : l'accueil n'a pas de raison de parler autrement. */
.widget h2 {
    font-size: var(--t-titre-bloc, 17px);
    font-weight: 800;
    font-stretch: 100%;
    margin: 0 0 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.widget-sous { margin: 0; font-size: 12px; color: var(--texte-2); }
.widget-vide { margin: 0; font-size: 13px; color: var(--texte-2); font-style: italic; }
.widget-reste { margin: 8px 0 0; font-size: 12px; color: var(--texte-2); }
.widget-lien {
    display: inline-block;
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #1E5EE8;
    text-decoration: none;
}
.widget-lien:hover { text-decoration: underline; }

/* ---------- Projections de fin d'année ---------- */
/* Groupées par chaîne, seules celles qui posent problème. La barre se
   lit par rapport au seuil, marqué d'un trait : à sa hauteur, le quota
   est juste atteint. */
.proj-chaine { padding: 0; }
.proj-chaine + .proj-chaine { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--surface-2); }
.proj-tete {
    display: flex; align-items: center; gap: 7px;
    font-size: 10.5px; font-weight: 800; letter-spacing: .07em;
    text-transform: uppercase; color: var(--texte-2); margin-bottom: 5px;
}
.proj-pt { width: 9px; height: 9px; border-radius: 50%; background: var(--texte-2); }
.proj-pt.ac-dec { background: var(--decouverte); }
.proj-pt.ac-sto { background: var(--story); }
.proj-pt.ac-lif { background: var(--life); }
/* Tout sur une ligne : libellé, barre, chiffre, verdict. La barre
   posée en dessous doublait la hauteur du bloc pour ne rien dire de
   plus. */
.proj-l {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 76px 54px 76px;
    gap: 10px; align-items: center; padding: 5px 0;
}
@media (max-width: 1320px) {
    /* Sur écran moyen, la barre s'efface : le chiffre et le verdict
       disent l'essentiel, elle n'était qu'un appui. */
    .proj-l { grid-template-columns: minmax(0, 1fr) 58px 84px; }
    .proj-barre { display: none; }
}
.proj-l + .proj-l { border-top: 1px solid var(--surface-2); }
.proj-nom {
    font-size: 13px; line-height: 1.3;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proj-val {
    font-family: 'IBM Plex Mono', monospace; font-weight: 700;
    font-size: 13px; text-align: right;
}
.proj-etat {
    font-size: 10px; font-weight: 800; padding: 3px 8px; border-radius: 999px;
    letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
    text-align: center;
}
.proj-lim { background: #FFF7EA; color: var(--attention); }
.proj-sous { background: #FDF1EF; color: #A32B1E; }
.proj-barre {
    height: 6px; border-radius: 999px;
    background: #EDEBE4; position: relative; overflow: hidden;
}
.proj-barre span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.proj-barre .pb-lim { background: var(--attention); }
.proj-barre .pb-sous { background: #A32B1E; }
.proj-barre::after {
    content: ''; position: absolute; top: 0; bottom: 0;
    left: 71.4%; width: 2px; background: #15171C; opacity: .35;
}
.proj-rien { margin: 0; font-size: 13px; color: var(--texte-2); }
.proj-reste { margin: 12px 0 0; font-size: 12px; color: var(--texte-2); }
.proj-reste + .widget-lien { margin-top: 8px; }

/* ---------- Suivi des productions ---------- */
.sv-l { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--surface-2); align-items: flex-start; }
.sv-l:first-of-type { border-top: 0; padding-top: 0; }
.sv-av {
    width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 9.5px; font-weight: 700; margin-top: 1px;
}
/* L'heure se glisse en fin de phrase plutôt que sur sa propre ligne :
   huit entrées gagnent ainsi le tiers de leur hauteur. */
.sv-corps { flex: 1; min-width: 0; }
.sv-txt {
    font-size: 13px; line-height: 1.42;
    /* Un titre long doit pouvoir se couper plutôt que de pousser la
       ligne hors du bloc. */
    overflow-wrap: anywhere;
}
.sv-quand { font-size: 11px; color: var(--texte-2); white-space: nowrap; margin-left: 5px; }

/* ---------- Baromètres de santé ---------- */
/* Un chiffre pose une question : il doit pouvoir y répondre sans
   quitter la page. */
.baro-grille {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 11px; align-items: stretch;
}
@media (max-width: 1400px) { .baro-grille { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .baro-grille { grid-template-columns: repeat(2, 1fr); } }
.baro-c {
    border: 1px solid var(--ligne); border-radius: 11px;
    padding: 12px 13px 10px; background: var(--surface-2);
    min-height: 0;
}
.baro-c summary { list-style: none; cursor: pointer; }
.baro-c summary::-webkit-details-marker { display: none; }
/* Les cartes s'alignent sur la plus haute de leur rangée : des
   hauteurs inégales donnaient une grille en dents de scie. */
.baro-c { position: relative; display: flex; flex-direction: column; }
.baro-c summary { flex: 1 1 auto; }
/* Le chevron se pose en pied, discret : en haut à droite il entrait en
   concurrence avec le chiffre, qui est ce qu'on vient lire. */
.baro-c summary::after {
    content: 'détail ▸'; display: block; margin-top: 9px;
    color: var(--texte-2); font-size: 10.5px; font-weight: 600;
    letter-spacing: .03em;
}
.baro-c[open] summary::after { content: 'replier ▾'; }
.baro-c[open] summary::after { content: '▾'; }
.baro-n {
    display: block; font-size: 30px; font-weight: 800; line-height: 1;
    font-stretch: 82%; letter-spacing: -.01em;
}
.baro-nom {
    display: block; font-size: 11px; color: var(--texte-2);
    margin-top: 5px; line-height: 1.25;
    /* Deux lignes au plus : au-delà, l'étiquette repoussait le pied de
       la carte hors du cadre. */
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.baro-res {
    display: block; font-size: 11px; color: var(--texte-2); margin-top: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.baro-attente { border-color: #EBD3A4; background: #FFF7EA; }
.baro-attente .baro-n { color: var(--attention); }
.baro-mauvais { border-color: #EEC9C2; background: #FDF1EF; }
.baro-mauvais .baro-n { color: #A32B1E; }
.baro-bon { border-color: #C7DEC7; background: #EDF5ED; }
.baro-bon .baro-n { color: var(--ok); }
.baro-liste { margin-top: 11px; padding-top: 10px; border-top: 1px solid rgba(0,0,0,.07); }
.baro-l {
    display: flex; gap: 10px; justify-content: space-between;
    align-items: baseline; padding: 5px 0; font-size: 12px;
}
.baro-l + .baro-l { border-top: 1px solid rgba(0,0,0,.05); }
.baro-l span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baro-q { color: var(--texte-2); white-space: nowrap; font-size: 11px; }
.baro-vide { margin: 0; font-size: 12px; color: var(--texte-2); font-style: italic; }
.baro-liste .widget-lien { margin-top: 8px; font-size: 12px; }
.widget-compte {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.widget-compte.rose { background: #E63985; }
.widget-compte.ambre { background: var(--attention-bord); }
/* Deux widgets côte à côte : ils se répondent, l'un montre ce qui
   attend, l'autre ce qui menace. */
.widgets-paire {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.widgets-paire .widget { margin-bottom: 0; }

/* Listes internes : une ligne par entrée, toutes de même forme. */
.liste-widget { display: flex; flex-direction: column; gap: 8px; }
.ligne-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface-2);
    border-radius: 8px;
    font-size: 13px;
}
/* Ce qui attend une action porte un liseré : on le repère sans lire. */
.ligne-widget.a-traiter { border-left: 3px solid var(--attention-bord); }
.ligne-titre { flex: 1; min-width: 0; }
.ligne-titre a { color: inherit; }
.ligne-date, .ligne-nb { white-space: nowrap; font-size: 12px; }
.ligne-nb { font-size: 14px; }
.puce-type, .puce-etat, .puce-jours {
    border-radius: 9px;
    padding: 1px 7px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}
.puce-type.visionnage { background: #E8EEF7; color: #1F4E8C; }
.puce-type.livraison { background: #F3ECF9; color: #6B2FA3; }
.puce-etat.actif { background: var(--ok-fond); color: var(--ok); }
.puce-etat.clos { background: var(--ligne); color: var(--texte-2); }
/* Le décompte monte du gris au rouge à mesure que la date approche. */
.puce-jours { background: var(--ligne); color: var(--texte-2); font-size: 12px; }
.puce-jours.bientot { background: var(--attention-fond); color: var(--attention); }
.puce-jours.urgent { background: var(--erreur-fond); color: var(--erreur); }
.puce-jours.depasse { background: var(--erreur); color: #fff; }

/* ---- Audiences ----
   Deux widgets, comme le reste de la page : les journées, puis les
   primes. Ce sont deux lectures d'un même jour, non un seul objet, et
   la page garde ainsi son rythme régulier de fiches posées sur le
   papier.

   La couleur de la chaîne teinte le cadre et le logo ; celle du
   résultat, verte ou rouge, ne touche que la jauge et l'écart. Deux
   sens, deux emplacements : ils ne se mélangent pas. */
/* Six cadres sur une ligne : les quatre chaînes de la maison, puis les
   hausses et les baisses de la concurrence. Une seule ligne fait de la
   journée un objet qu'on embrasse d'un coup, au prix de cartes étroites,
   environ cent soixante pixels : le contenu s'y est plié, et le label du
   record est passé sous le chiffre, faute de place en tête. */
.audiences-jour {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}
.aud-carte {
    background: var(--surface-2);
    border: 1px solid var(--ligne);
    border-radius: 14px;
    padding: 13px;
    min-width: 0;
}
.aud-tete { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; min-width: 0; min-height: 26px; }
/* Le label du record se pose en bout de tête, doré : il se voit sans
   prendre la place du chiffre, qui reste ce qu'on vient lire. Son
   infobulle dit de quel record il s'agit, l'année ou la saison. */
.aud-carte .aud-record {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 800;
    font-stretch: 87%;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--attention);
    background: var(--attention-fond);
    border: 1px solid #EBD9A5;
    border-radius: 5px;
    padding: 2px 5px;
    cursor: help;
}
/* Le logo se pose nu : un cadre autour d'un logo qui a déjà le sien
   fait deux bordures pour rien. */
.aud-carte .aud-logo {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    border-radius: 6px;
    background: transparent;
    display: flex; align-items: center; justify-content: center;
}
.aud-carte .aud-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
/* Le nom se coupe plutôt que de déborder : « RMC Découverte » tient
   tout juste dans une carte de six colonnes. */
.aud-chaine {
    font-size: 12px; font-weight: 700; font-stretch: 92%;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aud-score { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
/* La part d'audience est ce qu'on vient lire : elle prend la place. */
.aud-carte .aud-pda { font-size: 28px; font-weight: 800; line-height: 1; font-stretch: 84%; }
.aud-cible { font-size: 10.5px; color: var(--texte-2); }
/* Chaque chaîne colore son chiffre : on la reconnaît avant de lire son
   nom, et la carte cesse d'être un rectangle gris de plus. */
.aud-carte.decouverte .aud-pda { color: var(--decouverte); }
.aud-carte.story .aud-pda { color: var(--story); }
.aud-carte.life .aud-pda { color: var(--life); }

/* La jauge va de zéro au double de la moyenne : le repère tombe donc
   au milieu, et la barre le dépasse ou non. Aucun chiffre dessus : la
   position parle d'elle-même, et l'écart en points est juste dessous.
   La valeur exacte de la moyenne reste au survol. */
.aud-jauge-zone { position: relative; height: 14px; margin-top: 13px; }
.aud-jauge {
    position: absolute; top: 4px; left: 0; right: 0;
    height: 6px; background: var(--ligne); border-radius: 3px;
}
.aud-jauge-barre { height: 6px; border-radius: 3px; }
.aud-jauge-barre.haut { background: var(--ok); }
.aud-jauge-barre.bas  { background: #A32B1E; }
.aud-jauge-barre.egal { background: var(--texte-2); }
.aud-jauge-repere {
    position: absolute; left: 50%; top: 0;
    width: 2px; height: 14px;
    background: #15171C; opacity: .4; border-radius: 1px;
}
/* Sans historique du même jour, aucune jauge : un bloc muet garde la
   hauteur, pour que les cartes de la ligne restent alignées. */
.aud-sans-repere { height: 14px; margin-top: 13px; }

/* RMC Cube est un agrégat, non une antenne : sa carte reste neutre, et
   son logo, un carré plein, parle seul sur un fond blanc. */
.aud-carte.cube .aud-logo { background: var(--surface); padding: 2px; }

.aud-carte.decouverte { border-color: #D6DEEC; }
.aud-carte.decouverte .aud-logo { background: #F2F6FF; border-color: #D6DEEC; }
.aud-carte.decouverte .aud-chaine, .aud-carte.decouverte .aud-pda { color: #071E7A; }

.aud-carte.story { border-color: #F0DCD5; }
.aud-carte.story .aud-logo { background: #FEF6F3; border-color: #F0DCD5; }
.aud-carte.story .aud-chaine, .aud-carte.story .aud-pda { color: #84140B; }

.aud-carte.life { border-color: #EFD8E8; }
.aud-carte.life .aud-logo { background: #FDF5FA; border-color: #EFD8E8; }
.aud-carte.life .aud-chaine, .aud-carte.life .aud-pda { color: #75004E; }

/* ---- Hausses et baisses ----
   Ni logo ni jauge : trois lignes suffisent. Une jauge n'aurait pas de
   sens entre des chaînes d'échelles trop différentes, et le classement
   est déjà porté par l'écart. */
.aud-mouv { display: flex; flex-direction: column; }
.aud-mouv-tete { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.aud-fleche { font-size: 10px; flex: 0 0 auto; }
.aud-fleche.haut { color: var(--ok); }
.aud-fleche.bas  { color: #A32D2D; }
/* Le titre du cadre se coupe s'il le faut : « Les plus fortes hausses »
   est long pour cent soixante pixels, et son infobulle le rend en
   entier. */
.aud-mouv-titre {
    font-size: 10.5px; font-weight: 800; font-stretch: 87%; color: var(--texte-2);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aud-mouv-ligne {
    display: flex; justify-content: space-between; align-items: baseline; gap: 5px;
    padding: 4px 0;
    border-top: 1px solid var(--ligne);
}
.aud-mouv-ligne:first-of-type { border-top: none; }
/* « Autres TNT gratuites » ne tient pas : le nom se coupe, l'infobulle
   le dit en entier. */
.aud-mouv-chaine {
    font-size: 11px;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aud-mouv-chiffres { flex: 0 0 auto; font-size: 11px; white-space: nowrap; }
.aud-mouv-pda { font-weight: 800; font-stretch: 87%; }
.aud-mouv-vide { font-size: 11px; color: var(--texte-2); margin: 4px 0 0; }

/* ---- Tableau du prime ---- */
.aud-tableau {
    border: 1px solid var(--ligne);
    border-radius: 10px;
    overflow: hidden;
}
.aud-tableau table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.aud-tableau thead tr { background: transparent; }
.aud-tableau th {
    text-align: left; padding: 8px;
    font-size: 10.5px; font-weight: 800; font-stretch: 87%;
    text-transform: uppercase; letter-spacing: .04em; color: var(--texte-2);
}
.aud-tableau td { padding: 9px 10px; }
.aud-tableau tbody tr { border-top: 1px solid var(--surface-2); }
.aud-tableau .col-rang { width: 30px; text-align: right; color: var(--texte-2); font-size: 11px; }
/* Les noms de chaîne, les nombres et les PDA tiennent sur une ligne :
   « TF1 SERIES FILMS » se coupait en deux, ce qui déformait la hauteur
   des lignes. Le titre, lui, a de la place à revendre. */
.aud-tableau .col-chaine { width: 140px; }
.aud-tableau th, .aud-tableau td { white-space: nowrap; }
.aud-tableau td.col-chaine { font-weight: 800; font-stretch: 87%; }
.aud-tableau .col-titre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Les PDA sont centrées : ce sont des nombres courts, à une décimale,
   et les aligner à droite les collait au bord de leur colonne. Le
   nombre de téléspectateurs, lui, reste à droite : ses ordres de
   grandeur se comparent par les unités. */
.aud-tableau .col-num { width: 74px; text-align: center; font-variant-numeric: tabular-nums; }
.aud-tableau .col-telesp { width: 82px; text-align: right; }

/* La PDA 25-49 classe le tableau : elle porte un fond, pour qu'on la
   trouve avant de la chercher. Sans lui, la colonne se noyait entre
   ses deux voisines. */
.aud-tableau .col-fort { width: 84px; }
.aud-tableau th.col-fort { background: var(--ligne); color: var(--texte-2); }
.aud-tableau td.col-fort {
    font-weight: 800;
    font-stretch: 87%;
    background: var(--surface-2);
}

/* Les chaînes de la maison portent une pastille sur leur meilleur
   score : le nombre se lit alors sans avoir à parcourir la ligne. */
.pastille-pda {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid;
    font-weight: 800;
    font-stretch: 87%;
    line-height: 1.25;
}
.pastille-pda.decouverte { background: var(--surface); border-color: #7FA0DC; color: #071E7A; }
.pastille-pda.story      { background: var(--surface); border-color: #E2A093; color: #84140B; }
.pastille-pda.life       { background: var(--surface); border-color: #DFA6CC; color: #75004E; }
.aud-tableau th:last-child, .aud-tableau td:last-child { padding-right: 12px; }

/* ---- Titre corrigeable ----
   Le trait pointillé sous le titre dit qu'on peut le reprendre, sans
   pour autant en faire un champ de saisie : le tableau reste un
   tableau. */
.titre-editable {
    outline: none;
    border-bottom: 1px dashed transparent;
    cursor: text;
}
.aud-tableau tr:hover .titre-editable { border-bottom-color: var(--ligne-forte); }
.titre-editable:focus {
    border-bottom-color: #1F3864;
    background: var(--surface);
}
.titre-editable.enregistre { border-bottom-color: #1D9E75; }
.titre-editable.echec { border-bottom-color: #E24B4A; }
.titre-episodes { color: var(--texte-2); }

/* Une chaîne repêchée est sortie du classement : le trait la sépare de
   celles qui y sont, et son rang dit où elle se situe vraiment. */
.aud-tableau tr.repechee { border-top: 2px solid var(--ligne-forte); }

.aud-tableau tr.decouverte { background: #F2F6FF; }
.aud-tableau tr.decouverte td, .aud-tableau tr.decouverte td.col-fort { background: transparent; }
.aud-tableau tr.decouverte td { color: #0A2CA8; }
.aud-tableau tr.decouverte td.col-chaine, .aud-tableau tr.decouverte td.col-fort { color: #071E7A; }
.aud-tableau tr.decouverte td.col-rang { color: #5C7FD0; }

.aud-tableau tr.story { background: #FEF6F3; }
.aud-tableau tr.story td, .aud-tableau tr.story td.col-fort { background: transparent; }
.aud-tableau tr.story td { color: #9E1E10; }
.aud-tableau tr.story td.col-chaine, .aud-tableau tr.story td.col-fort { color: #84140B; }
.aud-tableau tr.story td.col-rang { color: #C77A68; }

.aud-tableau tr.life { background: #FDF5FA; }
.aud-tableau tr.life td, .aud-tableau tr.life td.col-fort { background: transparent; }
.aud-tableau tr.life td { color: #8F0060; }
.aud-tableau tr.life td.col-chaine, .aud-tableau tr.life td.col-fort { color: #75004E; }
.aud-tableau tr.life td.col-rang { color: #B76BA2; }

@media (max-width: 1100px) {
    .audiences-jour { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .audiences-jour { grid-template-columns: repeat(2, 1fr); }
}

/* Message d'attente, quand la base n'a encore rien reçu. */
.audiences-a-venir {
    border: 1px dashed var(--ligne-forte);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    color: var(--texte-2);
    font-size: 13px;
    margin-bottom: 24px;
    background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface-2) 10px, var(--surface-2) 20px);
}

/* ---- Prochains inédits ---- */
.liste-inedits { display: flex; flex-direction: column; gap: 8px; }
.ligne-inedit {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface-2);
    border-radius: 8px;
    font-size: 13px;
}
.date-inedit { font-weight: 700; white-space: nowrap; min-width: 58px; font-size: 12px; }
/* La chaîne en pastille pleine : trois lettres suffisent à la
   reconnaître, et elle garde ses couleurs. */
.puce-chaine {
    border-radius: 5px;
    padding: 1px 6px;
    font-size: 9.5px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
}
.puce-chaine.decouverte { background: var(--decouverte); }
.puce-chaine.story { background: var(--story); }
.puce-chaine.life { background: var(--life); }
.titre-inedit { flex: 1; min-width: 0; }
.titre-inedit a { color: inherit; }
.detail-inedit { color: var(--texte-2); font-size: 12px; margin-left: 3px; }
.detail-inedit-magazine { display: block; margin-left: 0; color: var(--texte-2); }

/* ---- La base en chiffres ---- */
.chiffres-base {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.chiffre-carte {
    background: var(--surface-2);
    border: 1px solid var(--ligne);
    border-radius: 10px;
    padding: 14px 16px;
}
.chiffre { font-size: 24px; font-weight: 800; line-height: 1.1; }
.chiffre-lib { font-size: 12px; color: var(--texte-2); margin-top: 3px; }
.etat-donnees { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.etat-carte {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--ligne);
    border-radius: 10px;
    padding: 14px 16px;
}
/* Le point dit d'un coup d'œil si la donnée est à jour : vert si elle
   couvre aujourd'hui, ambre si elle s'arrête avant. */
.etat-carte .point { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.etat-carte .point.vert { background: var(--ok); }
.etat-carte .point.ambre { background: var(--attention-bord); }
.etat-date { font-size: 13px; font-weight: 700; }
.etat-lib { font-size: 12px; color: var(--texte-2); }

/* Sur écran étroit, tout s'empile plutôt que de se tasser. */
@media (max-width: 900px) {
    .widgets-paire, .etat-donnees { grid-template-columns: 1fr; }
    .chiffres-base { grid-template-columns: 1fr 1fr; }
}

/* ---- En prime ce soir ----
   Une carte par chaîne, à ses couleurs, comme partout ailleurs sur le
   site. Le logo situe la chaîne d'un coup d'œil, le titre porte
   l'information, l'ayant droit se lit en pied, en retrait. */
/* Les cartes de la soirée, dans leur widget : la marge basse est celle
   du widget, non la leur. */
.primes-soir {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.prime-carte {
    display: flex;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--ligne);
    border-radius: 12px;
    padding: 14px 16px;
}
.prime-logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 1px solid var(--ligne);
    overflow: hidden;
}
/* Les logotypes de chaînes ont des proportions différentes : object-fit
   les cadre tous dans la même pastille sans les déformer. */
.prime-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.aud-tableau .prime-corps { min-width: 0; }
.aud-tableau .prime-titre { font-size: 14px; font-weight: 800; line-height: 1.3; margin-bottom: 5px; }
.prime-detail { font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
.prime-prod { font-size: 11px; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.prime-prod .cle {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .75;
}
.prime-prod .nom { font-weight: 600; }
/* Rond rouge à i blanc : la convention de l'inédit, la même que dans la
   grille et dans Prog. Elle ne change jamais de couleur. */
.prime-inedit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--antenne);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
}
/* Sigle des moins de douze ans, tel que la grille le porte. */
.prime-moins12 { height: 14px; margin-left: 4px; vertical-align: middle; }
/* Deuxième programme de la soirée : un pointillé le sépare du premier,
   sans en faire une carte à part. */
.prime-suivant { border-top: 1px dotted var(--ligne); padding-top: 8px; margin-top: 8px; }
.prime-vide { font-size: 13px; color: var(--texte-2); font-style: italic; }
.prime-carte.sans-prime .prime-logo { opacity: .5; }
.prime-carte.sans-prime .prime-corps { display: flex; align-items: center; }

/* Couleurs propres à chaque chaîne : les mêmes qu'en page Prog. */
.prime-carte.decouverte { border-color: #D6DEEC; }
.prime-carte.decouverte .prime-logo { background: #F2F6FF; border-color: #D6DEEC; }
.prime-carte.decouverte .prime-titre { color: #071E7A; }
.prime-carte.decouverte .prime-detail { color: #0A2CA8; }
.prime-carte.decouverte .prime-prod { color: #5C7FD0; }
.prime-carte.decouverte .prime-suivant { border-top-color: #D6DEEC; }

.prime-carte.story { border-color: #F0DCD5; }
.prime-carte.story .prime-logo { background: #FEF6F3; border-color: #F0DCD5; }
.prime-carte.story .prime-titre { color: #84140B; }
.prime-carte.story .prime-detail { color: #9E1E10; }
.prime-carte.story .prime-prod { color: #C77A68; }
.prime-carte.story .prime-suivant { border-top-color: #F0DCD5; }

.prime-carte.life { border-color: #EFD8E8; }
.prime-carte.life .prime-logo { background: #FDF5FA; border-color: #EFD8E8; }
.prime-carte.life .prime-titre { color: #75004E; }
.prime-carte.life .prime-detail { color: #8F0060; }
.prime-carte.life .prime-prod { color: #B76BA2; }
.prime-carte.life .prime-suivant { border-top-color: #EFD8E8; }

/* Sur écran étroit, les cartes s'empilent plutôt que de se tasser. */
@media (max-width: 900px) {
    .primes-soir { grid-template-columns: 1fr; }
}


/* ---------- Accueil du gérant de portefeuille ---------- */

/* Ces blocs sont des widgets comme les autres de la page : même
   cadre, même arrondi, même espacement. Leur donner une apparence
   propre les faisait paraître rapportés. */
.g-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.g-table th { text-align: left; padding: 8px 11px 8px 0; background: none;
    border-bottom: 1px solid var(--ligne, var(--ligne));
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-2); }
.g-table td { padding: 9px 11px 9px 0; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
.g-table tr:last-child td { border-bottom: 0; }
.g-table th:last-child, .g-table td:last-child { padding-right: 0; }
.g-date { width: 210px; white-space: nowrap; }
.g-chaine-col { width: 110px; }
.g-type { width: 118px; }
.g-puce { display: inline-block; padding: 1px 5px; border-radius: 3px;
    font-size: 9px; font-weight: 700; letter-spacing: .03em; color: #fff; }
.g-puce.g-dec { background: var(--decouverte, var(--decouverte)); }
.g-puce.g-sto { background: var(--story, var(--story)); }
.g-puce.g-lif { background: var(--life, var(--life)); }
.g-ep { color: var(--texte-2); font-size: 12px; display: block; margin-top: 1px; }
.g-jalon { display: inline-block; padding: 2px 9px; border-radius: 11px;
    font-size: 11px; font-weight: 600; }
.g-jalon.visionnage { background: #E8EEF7; color: #1F4E8C; }
.g-jalon.livraison { background: #F7EFE4; color: var(--attention); }
.g-vide { margin: 0; color: var(--texte-2); font-size: 13px; font-style: italic; }
.g-resp-col { width: 210px; }
.g-personne { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 12px; }
.g-personne + .g-personne { margin-top: 4px; }
.g-pastille { width: 20px; height: 20px; border-radius: 50%; color: #fff; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; }
.g-sans { color: var(--texte-2); font-style: italic; font-weight: 400; font-size: 12px; }
.g-quand { width: 190px; white-space: nowrap; }
.g-changement { width: 330px; }
.g-mouv { display: inline-block; padding: 3px 10px; border-radius: 11px;
    font-size: 12px; font-weight: 600; }
.g-mouv.m-ajout { background: #E7F2E7; color: var(--ok); }
.g-mouv.m-transfert, .g-mouv.m-changer { background: #F7EFE4; color: var(--attention); }
.g-mouv.m-suivi { background: #E8EEF7; color: #1F4E8C; }


/* ==================================================================
   MESSAGES DE GRILLE
   ==================================================================
   Un tiroir sur le côté droit, sur le modèle du panneau des quotas de
   grille2 : on l'ouvre quand on en a besoin, il ne mange pas la place
   de la grille le reste du temps.
   ================================================================== */

.gm-panneau {
    /* Sous le tiroir des quotas, jamais à sa hauteur. */
    position: fixed; top: 66%; right: 0; transform: translateY(-50%);
    z-index: 901; display: flex; align-items: stretch;
    transition: right .22s ease;
}
/* Ouvert, un tiroir passe devant l'autre : deux panneaux de trois cents
   pixels côte à côte ne tiendraient pas. */
.gm-panneau:not(.gm-replie) { z-index: 940; }
.g2-quotas:not(.g2-quotas-replie) { z-index: 930; }

/* Sur un écran court, les deux tiroirs se resserrent vers le milieu :
   à 26 % et 66 % de 600 pixels, ils sortiraient de l'écran. */
@media (max-height: 760px) {
    .g2-quotas { top: 30%; }
    .gm-panneau { top: 62%; }
    .g2-quotas-poignee { min-height: 92px; }
    .gm-poignee { min-height: 104px; }
}
.gm-panneau.gm-replie { right: -330px; }

/* La poignée porte son mot : une flèche seule n'aurait pas dit ce que
   le tiroir contient. */
.gm-poignee {
    align-self: center; width: 26px; min-height: 128px; padding: 10px 0;
    border: 1px solid var(--ligne-forte); border-right: 0; border-radius: 7px 0 0 7px;
    background: var(--surface-2); cursor: pointer; color: var(--texte-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; box-shadow: -2px 0 8px rgba(0,0,0,.10); font: inherit;
}
.gm-poignee:hover { background: #E9E9E1; }
.gm-fleche { font-size: 17px; line-height: 1; transition: transform .22s ease; }
.gm-panneau.gm-replie .gm-fleche { transform: rotate(180deg); }
.gm-poignee-mot {
    writing-mode: vertical-rl; text-orientation: mixed;
    font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.gm-pastille {
    min-width: 17px; padding: 1px 4px; border-radius: 999px;
    background: var(--antenne); color: #fff; font-size: 10px; font-weight: 800;
    text-align: center; line-height: 1.5;
}

.gm-corps {
    width: 330px; box-sizing: border-box; background: var(--surface);
    border: 1px solid var(--ligne-forte); border-right: 0; border-radius: 8px 0 0 8px;
    box-shadow: -4px 0 18px rgba(0,0,0,.13);
    display: flex; flex-direction: column; max-height: 74vh;
}
.gm-entete {
    padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--ligne);
    border-radius: 8px 0 0 0;
}
.gm-titre {
    display: block; font-size: 12px; font-weight: 800;
    letter-spacing: .04em; text-transform: uppercase; color: var(--texte-2);
    margin-bottom: 7px;
}
.gm-filtres { display: flex; gap: 6px; }
.gm-select {
    flex: 1 1 auto; min-width: 0; font: inherit; font-size: 12px;
    padding: 5px 7px; border: 1px solid #D8D7D0; border-radius: 6px;
    background: var(--surface); color: #2A2A2A;
}
.gm-select:last-child { flex: 0 0 76px; }

/* La conversation se lit du plus ancien au plus récent : le fil défile,
   et l'on se place en bas à l'ouverture. */
.gm-liste {
    flex: 1 1 auto; overflow-y: auto; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 11px;
}
.gm-attente { margin: 6px 0; font-size: 12px; color: var(--texte-2); font-style: italic; }

.gm-msg { font-size: 13px; }
.gm-msg-tete {
    display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
.gm-av {
    width: 21px; height: 21px; border-radius: 50%; flex: 0 0 auto;
    background: #4A6B8A; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700;
}
.gm-auteur { font-size: 12px; font-weight: 700; color: #2A2A2A; }
.gm-ch {
    font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    background: #EDEBE4; color: var(--texte-2); padding: 2px 5px; border-radius: 4px;
}
.gm-quand { margin-left: auto; font-size: 11px; color: var(--texte-2); white-space: nowrap; }
.gm-retirer {
    border: 0; background: none; color: var(--texte-2); cursor: pointer;
    font-size: 14px; line-height: 1; padding: 0 2px;
}
.gm-retirer:hover { color: #A32B1E; }
.gm-modifier {
    border: 0; background: none; color: var(--texte-2); cursor: pointer;
    font-size: 12px; line-height: 1; padding: 0 2px;
}
.gm-modifier:hover { color: #2E4A62; }

/* La mention de modification, discrète : elle informe sans détourner
   de ce qui est écrit. */
.gm-modifie {
    margin-top: 3px; font-size: 10.5px; color: var(--texte-2); font-style: italic;
}

/* L'édition se fait sur place : ouvrir une fenêtre pour changer un mot
   ferait perdre le fil de la conversation. */
.gm-edition textarea {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 13px;
    padding: 8px 9px; border: 1px solid #9EBBD6; border-radius: 9px;
    resize: vertical; background: var(--surface); line-height: 1.45;
}
.gm-edition-pied { display: flex; gap: 7px; justify-content: flex-end; margin-top: 6px; }
.gm-annuler {
    font: inherit; font-size: 12px; font-weight: 600;
    padding: 7px 13px; border: 1px solid #D8D7D0; border-radius: 7px;
    background: var(--surface); color: var(--texte-2); cursor: pointer;
}
.gm-annuler:hover { background: var(--surface-2); }
.gm-texte {
    padding: 8px 10px; background: var(--surface-2); border-radius: 9px;
    line-height: 1.45; color: #2A2A2A; white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.gm-ecrire {
    padding: 9px 12px; border-top: 1px solid var(--ligne); background: var(--surface-2);
    border-radius: 0 0 0 8px;
}
.gm-ecrire textarea {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 13px;
    padding: 8px 9px; border: 1px solid #D8D7D0; border-radius: 7px;
    resize: vertical; min-height: 46px; background: var(--surface);
}
.gm-ecrire-pied {
    display: flex; align-items: center; gap: 9px; margin-top: 7px;
}
.gm-portee { flex: 1 1 auto; font-size: 11px; color: var(--texte-2); }
.gm-envoyer {
    font: inherit; font-size: 12px; font-weight: 700;
    padding: 7px 15px; border: 0; border-radius: 7px;
    background: #2E4A62; color: #fff; cursor: pointer;
}
.gm-envoyer:hover { background: #253C50; }
.gm-lecture {
    margin: 0; padding: 10px 12px; border-top: 1px solid var(--ligne);
    background: var(--surface-2); font-size: 11px; color: var(--texte-2); font-style: italic;
}

/* Sur écran étroit, le tiroir prend presque toute la largeur : un
   panneau de 330 pixels y masquerait la grille entière. */
@media (max-width: 720px) {
    .gm-corps { width: 88vw; }
    .gm-panneau.gm-replie { right: calc(-88vw - 1px); }
}

/* À l'impression, le tiroir n'a rien à faire sur la feuille. */
@media print { .gm-panneau { display: none; } }


/* ==================================================================
   SYNTHÈSE DES QUOTAS, PANNEAU DE GRILLE
   ==================================================================
   Ces règles vivaient dans grille2.php. Elles servent aux deux grilles
   depuis que le panneau est partagé.
   ================================================================== */
/* ---- Synthèse des quotas, panneau latéral repliable ---- */
.g2-quotas {
    /* Les deux tiroirs se partagent le bord droit : les quotas dans le
       tiers haut, les messages dans le tiers bas. Centrés tous deux,
       leurs poignées se recouvraient. */
    position: fixed; top: 26%; right: 0; transform: translateY(-50%);
    z-index: 900; display: flex; align-items: stretch;
    transition: right 0.22s ease;
}
.g2-quotas.g2-quotas-replie { right: -272px; }
.g2-quotas-poignee {
    align-self: center; width: 26px; min-height: 112px; padding: 10px 0;
    border: 1px solid var(--ligne-forte); border-right: 0; border-radius: 7px 0 0 7px;
    background: var(--surface-2); cursor: pointer; color: var(--texte-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; box-shadow: -2px 0 8px rgba(0,0,0,0.10); font: inherit;
}
/* La poignée porte son mot : deux tiroirs voisins sans étiquette ne se
   distinguent que par leur position, ce qui s'oublie. */
.g2-quotas-mot {
    writing-mode: vertical-rl; text-orientation: mixed;
    font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.g2-quotas-poignee:hover { background: #E9E9E1; }
.g2-quotas-fleche { font-size: 18px; line-height: 1; transition: transform 0.22s ease; }
.g2-quotas.g2-quotas-replie .g2-quotas-fleche { transform: rotate(180deg); }
.g2-quotas-corps {
    width: 272px; box-sizing: border-box; background: var(--surface);
    border: 1px solid var(--ligne-forte); border-right: 0; border-radius: 6px 0 0 6px;
    box-shadow: -4px 0 16px rgba(0,0,0,0.12); overflow: hidden;
}
.g2-quotas-entete {
    padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--ligne);
}
.g2-quotas-titre { font-size: 12px; font-weight: 700; color: #2A2A2A; }
.g2-quotas-liste { padding: 8px 12px; max-height: 46vh; overflow-y: auto; }
.g2-quotas-attente { font-size: 12px; color: var(--texte-2); margin: 4px 0; font-style: italic; }
.g2-quota-ligne { margin-bottom: 10px; }
.g2-quota-ligne:last-child { margin-bottom: 0; }
.g2-quota-tete {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 11px; color: var(--texte); gap: 8px;
}
.g2-quota-libelle { flex: 1 1 auto; min-width: 0; }
.g2-quota-valeur { font-weight: 700; white-space: nowrap; }
.g2-quota-barre {
    height: 6px; margin-top: 3px; border-radius: 3px;
    background: var(--ligne); overflow: hidden;
}
.g2-quota-remplissage { height: 100%; background: var(--ok); border-radius: 3px; }
.g2-quota-ligne.g2-quota-alerte .g2-quota-valeur { color: #C0392B; }
.g2-quota-ligne.g2-quota-alerte .g2-quota-remplissage { background: #C0392B; }
.g2-quotas-pied {
    padding: 8px 12px; border-top: 1px solid var(--ligne);
    background: var(--surface-2); font-size: 11px;
}