/* ============================================================
   Sélecteurs partagés : menu des livres (SelecteurLivre) et calendrier de plage (SelecteurPeriode).
   Mêmes variables que le reste de l'application (site.css) ; fenêtre fermée au clic sur un fond transparent plein écran.
   ============================================================ */
.sl-racine, .sp-racine { position: relative; }
.sl-fond, .sp-fond { position: fixed; inset: 0; z-index: 70; background: transparent; }

/* ---- bouton commun (livre et période) ---- */
.sl-bouton, .sp-bouton {
    height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
    background: var(--sol-panel); border: 1px solid var(--kdp-line-strong); border-radius: 8px;
    color: var(--sol-text); font-family: inherit; font-size: 15px; text-align: left; cursor: pointer;
}
.sl-bouton:hover, .sp-bouton:hover { border-color: var(--kdp-accent-border); }
.sl-bouton:focus-visible, .sp-bouton:focus-visible { outline: 2px solid var(--kdp-accent-border); outline-offset: 1px; border-color: var(--sol-accent); }
.sl-chev, .sp-chev { width: 9px; height: 9px; flex: none; border-right: 2px solid var(--sol-muted); border-bottom: 2px solid var(--sol-muted); transform: rotate(45deg) translate(-2px, -2px); }
.sl-ouvert .sl-chev, .sp-ouvert .sp-chev { transform: rotate(-135deg) translate(-2px, -2px); }

/* ---- menu des livres ---- */
.sl-bouton { min-width: 280px; max-width: 420px; }
.sl-titre { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-asin { color: var(--kdp-placeholder); font-size: 12.5px; letter-spacing: .02em; }
.sl-liste {
    position: absolute; left: 0; top: 50px; z-index: 80; width: 380px; max-width: 92vw; max-height: 60vh; overflow: auto;
    background: var(--sol-panel); border: 1px solid var(--kdp-line-strong); border-radius: 12px;
    box-shadow: 0 10px 28px rgba(33, 31, 26, .14); padding: 6px;
}
.sl-rech { width: 100%; height: 38px; border: 1px solid var(--sol-line); border-radius: 8px; padding: 0 10px; margin-bottom: 6px; background: var(--sol-bg); font: inherit; }
.sl-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.sl-item:hover { background: var(--kdp-hover); }
.sl-sel { background: #fdf1e2; }
.sl-tt { font-weight: 600; line-height: 1.25; }
.sl-aa { color: var(--kdp-placeholder); font-size: 12.5px; }
.sl-coche { margin-left: auto; color: var(--sol-accent); font-weight: 800; visibility: hidden; }
.sl-sel .sl-coche { visibility: visible; }

/* ---- calendrier de plage ---- */
.sp-ico { font-size: 16px; }
.sp-texte { font-weight: 600; white-space: nowrap; }
.sp-nb { color: var(--kdp-placeholder); font-size: 13px; }
.sp-cal {
    position: absolute; left: 0; top: 50px; z-index: 80; width: max-content; max-width: 94vw;
    background: var(--sol-panel); border: 1px solid var(--kdp-line-strong); border-radius: 12px;
    box-shadow: 0 10px 28px rgba(33, 31, 26, .14); padding: 14px;
}
.sp-corps { display: flex; gap: 18px; }
.sp-rac { display: flex; flex-direction: column; gap: 2px; min-width: 150px; border-right: 1px solid var(--sol-line); padding-right: 14px; }
.sp-rac-btn { height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; color: var(--sol-muted); font-family: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sp-rac-btn:hover { background: var(--kdp-hover); color: var(--sol-text); }
.sp-rac-actif, .sp-rac-actif:hover { background: #fdf1e2; color: var(--sol-accent); }
.sp-mois-zone { display: flex; gap: 22px; flex-wrap: wrap; }
.sp-mois { width: 252px; }
.sp-mois-t { display: flex; align-items: center; justify-content: space-between; height: 32px; font-weight: 700; text-transform: capitalize; }
.sp-nav { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; font-size: 18px; color: var(--sol-muted); cursor: pointer; }
.sp-nav:hover { background: var(--kdp-hover); }
.sp-cache { visibility: hidden; }
.sp-grille { display: grid; grid-template-columns: repeat(7, 36px); row-gap: 2px; }
.sp-jsem { font-size: 12px; color: var(--kdp-placeholder); text-align: center; height: 26px; line-height: 26px; font-weight: 600; }
.sp-j { height: 36px; border: 0; background: transparent; padding: 0; font-family: inherit; font-size: 14px; color: var(--sol-text); cursor: pointer; border-radius: 0; }
.sp-j > span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin: 1px; border-radius: 50%; }
.sp-j:hover > span { background: var(--kdp-hover); }
.sp-vide { visibility: hidden; }
.sp-j:disabled { color: #c3bdae; cursor: default; }
.sp-j:disabled:hover > span { background: none; }
.sp-dans { background: #fdf1e2; }
.sp-deb { background: linear-gradient(90deg, transparent 50%, #fdf1e2 50%); }
.sp-fin { background: linear-gradient(90deg, #fdf1e2 50%, transparent 50%); }
.sp-deb.sp-fin { background: none; }
.sp-deb > span, .sp-fin > span { background: var(--sol-text); color: #fff; font-weight: 700; }
.sp-auj > span { box-shadow: inset 0 0 0 1.5px var(--kdp-accent-border); }
.sp-pied { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--sol-line); margin-top: 12px; padding-top: 12px; }
.sp-res { flex: 1; color: var(--sol-muted); font-size: 14px; }
.sp-res b { color: var(--sol-text); }
.sp-derniere { color: var(--kdp-placeholder); font-size: 13px; white-space: nowrap; }
.sp-ok { height: 38px; padding: 0 20px; border-radius: 8px; border: 1px solid var(--sol-text); background: var(--sol-text); color: #fff; font-family: inherit; font-weight: 700; cursor: pointer; }
.sp-ok:disabled { opacity: .4; cursor: default; }
/* Analyse : les jours sans rapport restent sélectionnables dans une plage. */
.sp-j.sp-sans-donnee:not(.sp-deb):not(.sp-fin) { color: var(--kdp-placeholder, #888); opacity: .55; }
/* La fiche est dans un tableau défilant : le calendrier s'ouvre au-dessus de celui-ci. */
.sp-cal.sp-cal-dialogue { position: fixed; top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%); width: min(900px, calc(100vw - 32px)); max-height: 85vh; overflow: auto; }
@media (max-width: 640px) { .sl-bouton { min-width: 0; width: 100%; } .sp-cal { left: 0; right: 0; } .sp-corps { flex-direction: column; } .sp-rac { flex-direction: row; flex-wrap: wrap; border-right: 0; padding-right: 0; } }

/* Entrée « Tous les livres » du menu des livres (Diagnostic, vue globale) */
.sl-item.sl-global { background: var(--sol-accent-soft, #fdf1e2); border: 1px solid #e9c39a; margin-bottom: 6px; }
