/* ==========================================================================
   PHOTOTHÈQUE PHOTOSOL — feuille de style
   --------------------------------------------------------------------------
   CHARTE : toutes les couleurs de marque sont regroupées dans le bloc
   « Jetons de marque » ci-dessous. Pour coller exactement au nuancier
   officiel Photosol, remplacez uniquement ces valeurs.
   ========================================================================== */

/* --- Jetons de marque ---------------------------------------------------- */
:root {
    /*
     * Bleu Photosol — la teinte officielle. Elle reste réservée au TEXTE et
     * aux petits accents (8:1 sur blanc) : en grand aplat, sa saturation
     * maximale fatigue l'œil.
     * Les nuances foncées se désaturent progressivement (210° de teinte,
     * saturation qui descend de 100 % à 80 %) : c'est ce qui donne un bleu
     * profond plutôt qu'électrique sur les grandes surfaces.
     */
    --ps-blue:         #004F9F;
    --ps-blue-700:     #0A4381;
    --ps-blue-800:     #0A3765;  /* en-tête — 12:1 en blanc dessus */
    --ps-blue-900:     #082A4D;  /* texte sur le jaune — 9,6:1 */
    --ps-blue-050:     #EDF2F8;

    /*
     * Jaune Photosol — couleur de remplissage. À 1,5:1 sur blanc il reste
     * illisible en texte sur fond clair : il sert de fond, avec du bleu
     * profond par-dessus (9,6:1), jamais de couleur de texte sur du blanc.
     */
    --ps-yellow:       #FFCC00;
    --ps-yellow-600:   #F0BE00;
    --ps-yellow-700:   #D6A800;
    --ps-yellow-050:   #FFF7DB;

    /* Bleu profond des surfaces sombres (bandeaux, visionneuse, connexion) */
    --ps-navy:         #0B3762;
    --ps-navy-800:     #10467C;
    --ps-navy-600:     #2A5F91;

    /* Accent solaire, conservé pour les étoiles et les mises en avant */
    --ps-solar:        #F5B301;

    /* Neutres */
    --ps-ink:          #10171F;
    --ps-slate:        #5A6B7C;
    --ps-line:         #E2E8EE;
    --ps-paper:        #FFFFFF;
    --ps-paper-2:      #F5F8FA;

    --danger:          #D7392F;
    --warn:            #E08A0B;
    --ok:              #2FA44F;
}

/* --- Thème clair --------------------------------------------------------- */
:root,
:root[data-theme="light"] {
    --bg:            var(--ps-paper-2);
    --bg-elevated:   var(--ps-paper);
    --bg-sunken:     #EDF2F6;
    --text:          var(--ps-ink);
    --text-muted:    var(--ps-slate);
    --border:        var(--ps-line);
    --border-strong: #CBD5DF;
    /* --brand : aplats et fonds. --brand-text : tout ce qui est écrit. */
    --brand:         var(--ps-yellow);
    --brand-hover:   var(--ps-yellow-600);
    --brand-soft:    var(--ps-yellow-050);
    --on-brand:      var(--ps-blue-900);
    --brand-text:    var(--ps-blue);
    --header-bg:     var(--ps-blue-800);
    --header-text:   #FFFFFF;
    --shadow-sm:     0 1px 2px rgba(16, 23, 31, .06), 0 1px 3px rgba(16, 23, 31, .08);
    --shadow-md:     0 4px 12px rgba(16, 23, 31, .08), 0 2px 4px rgba(16, 23, 31, .06);
    --shadow-lg:     0 18px 48px rgba(16, 23, 31, .16);
    --radius:        12px;
    --radius-sm:     8px;
    --radius-lg:     18px;
}

/* --- Thème sombre -------------------------------------------------------- */
:root[data-theme="dark"] {
    --bg:            #0B141D;
    --bg-elevated:   #111E2A;
    --bg-sunken:     #0A1219;
    --text:          #E7EEF4;
    --text-muted:    #90A4B6;
    --border:        #1D2F3F;
    --border-strong: #2A4054;
    --brand:         var(--ps-yellow);
    --brand-hover:   #FFF3CA;
    --brand-soft:    rgba(253, 233, 166, .14);
    --on-brand:      #082A4D;
    /* Sur fond sombre, le jaune est parfaitement lisible : il sert aussi au texte. */
    --brand-text:    var(--ps-yellow);
    --header-bg:     #0A2A4A;
    --header-text:   #E7EEF4;
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md:     0 4px 14px rgba(0, 0, 0, .45);
    --shadow-lg:     0 20px 50px rgba(0, 0, 0, .6);
}

/* --- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* L'attribut hidden doit toujours l'emporter sur un display: de composant. */
[hidden] { display: none !important; }

/*
 * Gouttière de défilement réservée en permanence.
 *
 * Sans cela, passer d'une page courte à une page longue fait apparaître la
 * barre de défilement et décale toute la mise en page de sa largeur.
 * « overflow-y: scroll » suffit à lui seul et fonctionne partout : la barre
 * est toujours dessinée, donc rien ne bouge jamais. scrollbar-gutter la
 * complète sur les navigateurs récents, notamment quand le défilement est
 * verrouillé (visionneuse ouverte).
 *
 * Aucune bascule conditionnelle ici : c'est précisément le repli vers
 * « auto » qui laissait le décalage réapparaître selon les cas.
 */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}
/* Ouverture de la visionneuse : la page ne défile plus, la gouttière reste réservée. */
html.is-locked { overflow: hidden; }

body {
    margin: 0;
    /* Helvetica Neue en tête ; sous Windows la substitution naturelle est
       Arial, dont le dessin est très proche. */
    font-family: "Helvetica Neue", HelveticaNeue, Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86em; }
code { background: var(--bg-sunken); padding: .12em .42em; border-radius: 5px; }
pre.code { background: var(--ps-navy); color: #DCE8F2; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.muted { color: var(--text-muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; word-break: break-all; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ellipsis { display: inline-block; max-width: 36ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; border-radius: 4px; }
/* Dans l'en-tête bleu et la visionneuse, c'est le jaune qui tranche. */
.topbar :focus-visible, .lightbox :focus-visible { outline-color: var(--ps-yellow); }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--brand); color: var(--on-brand); padding: 10px 16px; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* --- Barre supérieure ---------------------------------------------------- */
.topbar {
    position: sticky; top: 0; z-index: 60;
    background: var(--header-bg); color: var(--header-text);
    /* Le filet jaune donne son arête à l'en-tête et met la couleur de marque
       à sa place : un accent, pas un aplat. */
    border-bottom: 2px solid var(--ps-yellow);
    /* Texte clair sur fond foncé : l'anticrénelage fin évite l'effet gras. */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.topbar__inner {
    max-width: 1680px; margin: 0 auto; padding: 10px 20px;
    display: grid; grid-template-columns: auto minmax(220px, 1fr) auto auto;
    align-items: center; gap: 18px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--header-text); flex-shrink: 0; }
.brand__logo { height: 34px; width: auto; }
.brand__fallback { font-weight: 800; letter-spacing: .1em; font-size: .95rem; color: #fff; }
.brand__fallback--dark { color: var(--ps-navy); }
.brand__sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .28); }
.brand__label { font-size: .84rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(255, 255, 255, .82); }

/* Recherche globale */
.searchbar { position: relative; display: flex; align-items: center; }
.searchbar__icon {
    position: absolute; left: 14px; color: var(--text-muted); display: inline-flex; pointer-events: none;
}
.searchbar input[type="search"] {
    width: 100%; padding: 11px 130px 11px 40px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .20); background: rgba(255, 255, 255, .10);
    color: #fff; font-size: .92rem; font-family: inherit; transition: background .15s, border-color .15s;
}
.searchbar input[type="search"]::placeholder { color: rgba(255, 255, 255, .58); }
.searchbar input[type="search"]:focus {
    background: rgba(255, 255, 255, .17); border-color: var(--brand); outline: none;
}
.searchbar__submit {
    position: absolute; right: 5px; padding: 8px 18px; border: 0; border-radius: 999px;
    background: var(--brand); color: var(--on-brand); font-weight: 650; font-size: .85rem; cursor: pointer;
    font-family: inherit; transition: background .15s;
}
.searchbar__submit:hover { background: var(--brand-hover); }

.searchbar__suggestions {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 80;
    background: var(--bg-elevated); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
    overflow: hidden; max-height: 60vh; overflow-y: auto;
}
.searchbar__suggestions a {
    display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: .9rem;
    border-bottom: 1px solid var(--border);
}
.searchbar__suggestions a:last-child { border-bottom: 0; }
.searchbar__suggestions a:hover,
.searchbar__suggestions a.is-active { background: var(--brand-soft); }
.searchbar__suggestions .sg-type { color: var(--text-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }

/* Navigation */
.topnav { display: flex; gap: 4px; }
.topnav__link {
    padding: 8px 12px; border-radius: 8px; font-size: .88rem; font-weight: 500;
    color: rgba(255, 255, 255, .88); white-space: nowrap;
}
.topnav__link:hover { background: rgba(255, 255, 255, .11); color: #fff; }
.topnav__link.is-active { background: rgba(255, 255, 255, .16); color: #fff; }
.topnav__link--admin { color: var(--brand); }

.topbar__actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 9px; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .08); color: inherit; transition: background .15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .18); }
.burger { display: none; }

/* Menu utilisateur */
.usermenu { position: relative; }
.usermenu__trigger {
    display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px;
    background: rgba(255, 255, 255, .08); border: 0; border-radius: 999px; color: inherit;
    cursor: pointer; font-family: inherit; font-size: .86rem;
}
.usermenu__trigger:hover { background: rgba(255, 255, 255, .16); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand);
    display: grid; place-items: center; font-weight: 700; font-size: .8rem;
}
.usermenu__name { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu__panel {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; z-index: 90;
    background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; display: grid; gap: 2px;
}
.usermenu__panel a { padding: 9px 12px; border-radius: 8px; font-size: .9rem; }
.usermenu__panel a:hover { background: var(--bg-sunken); }
.usermenu__header { padding: 10px 12px; display: grid; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.usermenu__header span { font-size: .82rem; color: var(--text-muted); }
.usermenu__logout { color: var(--danger); }

/* --- Structure ----------------------------------------------------------- */
.app-main { min-height: 62vh; }
.page { max-width: 1680px; margin: 0 auto; padding: 28px 20px 64px; }
.page--narrow { max-width: 900px; }

.pagehead {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
    flex-wrap: wrap; margin-bottom: 22px;
}
.pagehead__sub { color: var(--text-muted); margin: 0; }
.pagehead__desc { margin: .5rem 0 0; max-width: 70ch; }
.pagehead__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section { max-width: 1680px; margin: 0 auto; padding: 34px 20px; }
.section--alt { background: var(--bg-sunken); max-width: none; }
.section--alt > * { max-width: 1680px; margin-left: auto; margin-right: auto; }
.section--stats { padding-top: 26px; padding-bottom: 8px; }
.section__head {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
    margin-bottom: 18px; flex-wrap: wrap;
}
.section__head p { margin: 0; color: var(--text-muted); font-size: .92rem; }
.link-more { color: var(--brand-text); font-weight: 600; font-size: .9rem; white-space: nowrap; }

.panel {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm);
}
.panel--accent { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

.layout-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 26px; align-items: start; }
.layout-split__side { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 4px; }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }

/* --- Héros --------------------------------------------------------------- */
.hero {
    position: relative; min-height: 420px; display: grid; align-items: center;
    background-color: var(--ps-navy);
    background-image: var(--hero-image); background-size: cover; background-position: center;
    color: #fff; overflow: hidden;
}
.hero__overlay {
    position: absolute; inset: 0;
    /* Voile bleu Photosol : dense à gauche pour porter le texte, ouvert à
       droite pour laisser respirer la photo. */
    background: linear-gradient(105deg,
        rgba(8, 42, 77, .93) 0%,
        rgba(10, 55, 101, .78) 38%,
        rgba(14, 68, 120, .40) 72%,
        rgba(14, 68, 120, .10) 100%);
}
.hero__content { position: relative; max-width: 1680px; width: 100%; margin: 0 auto; padding: 56px 20px; }
.hero__eyebrow {
    text-transform: uppercase; letter-spacing: .18em; font-size: .74rem; font-weight: 600;
    color: var(--brand); margin: 0 0 12px;
}
.hero__title { font-size: clamp(1.7rem, 1.1rem + 2.4vw, 3rem); margin: 0 0 12px; text-wrap: balance; }
.hero__lead { color: rgba(255, 255, 255, .8); font-size: 1rem; margin: 0 0 26px; }
.hero__search { display: flex; gap: 10px; max-width: 780px; flex-wrap: wrap; }
.hero__search input {
    flex: 1 1 380px; padding: 15px 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .1); color: #fff; font-size: 1rem; font-family: inherit;
}
.hero__search input::placeholder { color: rgba(255, 255, 255, .6); }
.hero__search input:focus { outline: none; background: rgba(255, 255, 255, .17); border-color: var(--brand); }
.hero__suggestions { margin-top: 16px; font-size: .88rem; color: rgba(255, 255, 255, .62); display: flex; gap: 10px; flex-wrap: wrap; }
.hero__suggestions a { color: #fff; border-bottom: 1px dotted rgba(255, 255, 255, .45); }
.hero__credit { position: absolute; right: 20px; bottom: 12px; font-size: .74rem; color: rgba(255, 255, 255, .5); margin: 0; }
.hero__credit a { color: rgba(255, 255, 255, .75); }

/* --- Statistiques -------------------------------------------------------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.statgrid--compact { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.statcard {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; display: grid; gap: 2px; box-shadow: var(--shadow-sm);
}
.statcard__value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.statcard__label { font-size: .82rem; font-weight: 600; color: var(--text); }
.statcard__hint { font-size: .74rem; color: var(--text-muted); }

/* --- Catégories ---------------------------------------------------------- */
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.catgrid--large { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 26px; }
.catcard {
    position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
    background: var(--tone, var(--ps-navy)); box-shadow: var(--shadow-sm); isolation: isolate;
    transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s;
}
.catcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.catcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.catcard:hover img { transform: scale(1.06); }
.catcard__shade {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(8, 42, 77, .88) 0%, rgba(10, 55, 101, .28) 55%, rgba(10, 55, 101, .05) 100%);
}
.catcard__body { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; display: grid; gap: 2px; }
.catcard__body strong { font-size: 1rem; line-height: 1.3; }
.catcard__body em { font-style: normal; font-size: .8rem; color: rgba(255, 255, 255, .72); }

.subcats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.subcat {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; font-size: .88rem;
}
.subcat:hover { border-color: var(--ps-yellow-700); }
.subcat em { font-style: normal; color: var(--text-muted); font-size: .8rem; }

.cattree { list-style: none; margin: 0; padding-left: 0; }
.cattree--depth-1, .cattree--depth-2, .cattree--depth-3, .cattree--depth-4 {
    padding-left: 18px; border-left: 1px solid var(--border); margin-left: 6px;
}
.cattree a {
    display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 7px; font-size: .92rem;
}
.cattree a:hover { background: var(--bg-sunken); }
.cattree__count { color: var(--text-muted); font-size: .82rem; font-variant-numeric: tabular-nums; }

/* --- Barre de grille ----------------------------------------------------- */
.gridbar {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.gridbar__left, .gridbar__right { display: flex; align-items: center; gap: 12px; }
.gridbar__count { font-size: .84rem; color: var(--text-muted); }
.checkall { display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; cursor: pointer; }

.viewswitch { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.viewswitch__btn {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 32px;
    background: var(--bg-elevated); color: var(--text-muted); border-right: 1px solid var(--border);
}
.viewswitch__btn:last-child { border-right: 0; }
.viewswitch__btn:hover { background: var(--bg-sunken); color: var(--text); }
.viewswitch__btn.is-active { background: var(--brand); color: var(--on-brand); }

/* --- Grilles de photos --------------------------------------------------- */
.photogrid { display: grid; gap: 14px; }
/*
 * Nombre de colonnes explicite (piloté par le curseur) plutôt que auto-fill :
 * auto-fill crée des colonnes vides quand la largeur disponible dépasse le
 * besoin, ce qui laissait des trous en fin de ligne.
 */
.photogrid--grid { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
@media (max-width: 1000px) { .photogrid--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .photogrid--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.photogrid--list { grid-template-columns: 1fr; gap: 8px; }

.scroller {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 250px); gap: 14px;
    overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity;
}
.scroller .pcard { scroll-snap-align: start; }
.scroller::-webkit-scrollbar { height: 8px; }
.scroller::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

.pcard {
    position: relative; background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform .2s cubic-bezier(.2, .7, .3, 1), box-shadow .2s, border-color .2s;
}
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }

.pcard__media {
    display: block; width: 100%; padding: 0; border: 0; cursor: pointer; position: relative;
    background: var(--tone, var(--bg-sunken)); aspect-ratio: 4 / 3; overflow: hidden;
}
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .3s; }
.pcard:hover .pcard__media img { transform: scale(1.04); }
/*
 * La loupe n'occupe plus toute la vignette : le clic sur l'image mène à la
 * fiche, seule la pastille ouvre l'aperçu plein écran.
 */
.pcard__zoom {
    position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px;
    display: grid; place-items: center; border-radius: 10px; color: #fff; cursor: zoom-in;
    background: rgba(10, 20, 28, .55); opacity: 0; transition: opacity .18s, background .15s;
}
.pcard:hover .pcard__zoom, .pcard__zoom:focus-visible { opacity: 1; }
.pcard__zoom:hover { background: rgba(10, 20, 28, .85); }
.pcard__zoom svg { width: 19px; height: 19px; }

.pcard__select { position: absolute; top: 9px; left: 9px; z-index: 3; cursor: pointer; }
.pcard__select input { position: absolute; opacity: 0; width: 0; height: 0; }
.pcard__select span {
    display: block; width: 21px; height: 21px; border-radius: 6px;
    background: rgba(255, 255, 255, .9); border: 2px solid rgba(10, 20, 28, .2); transition: all .15s;
}
.pcard__select input:checked + span {
    background: var(--brand); border-color: var(--brand);
    box-shadow: inset 0 0 0 2px #fff;
}
.pcard__select input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.pcard__overlay {
    position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column;
    justify-content: space-between; padding: 9px;
}
.pcard__badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.pcard__actions { display: flex; gap: 5px; justify-content: flex-end; opacity: 0; transition: opacity .18s; pointer-events: auto; }
.pcard:hover .pcard__actions, .pcard:focus-within .pcard__actions { opacity: 1; }
.pcard__act {
    display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
    border-radius: 8px; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .94); color: var(--ps-ink); box-shadow: var(--shadow-sm);
}
.pcard__act:hover { background: #fff; color: var(--brand-hover); }
.pcard__act.is-on { color: var(--danger); }

.pcard__body { padding: 10px 12px 12px; }
.pcard__title {
    display: block; font-weight: 600; font-size: .9rem; line-height: 1.35;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pcard__meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0; font-size: .76rem; color: var(--text-muted); }
.pcard__cat { color: var(--brand-text); font-weight: 600; }

/* Vue liste : vignette à gauche, informations au centre, actions à droite. */
.pcard--list { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; align-items: stretch; }
.pcard--list .pcard__media { aspect-ratio: 3 / 2; height: 100%; }
.pcard--list .pcard__detail { min-width: 0; padding: 13px 16px; display: grid; align-content: start; gap: 5px; }
.pcard--list .pcard__title { white-space: normal; overflow: visible; font-size: .95rem; overflow-wrap: anywhere; }
.pcard--list .pcard__line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: .76rem; }
.pcard--list .pcard__caption { margin: 2px 0 0; font-size: .83rem; line-height: 1.45; color: var(--text-muted); overflow-wrap: anywhere; }
.pcard__facts { display: flex; flex-wrap: wrap; gap: 3px 18px; margin: 7px 0 0; }
.pcard__facts > div { min-width: 0; }
.pcard__facts dt { font-size: .64rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.pcard__facts dd { margin: 0; font-size: .81rem; overflow-wrap: anywhere; }
.pcard--list .pcard__side {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    padding: 12px 14px; border-left: 1px solid var(--border); background: var(--bg-sunken);
}
.pcard--list .pcard__act { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); }

.chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
    font-size: .68rem; font-weight: 650; letter-spacing: .02em;
    background: rgba(10, 20, 28, .62); color: #fff; backdrop-filter: blur(4px);
}
.chip--ghost { background: rgba(255, 255, 255, .82); color: var(--ps-ink); }
.chip--star { background: var(--ps-solar); color: #2A1E00; }
.chip--ai { background: var(--brand); color: var(--on-brand); }
.chip--link { background: var(--bg-sunken); color: var(--text); }

.empty {
    display: grid; place-items: center; gap: 12px; padding: 64px 20px; text-align: center;
    color: var(--text-muted); background: var(--bg-elevated);
    border: 1px dashed var(--border-strong); border-radius: var(--radius);
}

/* --- Barre de sélection -------------------------------------------------- */
.selectionbar {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70;
    background: var(--ps-navy); color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
    padding: 12px 18px;
    /* 100vw inclut la largeur de la barre de défilement et provoquerait un
       débordement horizontal ; le pourcentage, lui, s'en tient à la zone utile. */
    max-width: calc(100% - 32px);
}
.selectionbar__inner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.selectionbar__count { font-size: .88rem; }
.selectionbar select {
    background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 8px; padding: 7px 10px; font-family: inherit; font-size: .86rem;
}
.selectionbar select option { color: #111; }
.selectionbar .field--inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.selectionbar .field--inline > span { font-size: .84rem; color: rgba(255, 255, 255, .7); }
.selectionbar__collection { display: flex; gap: 8px; align-items: center; }

/* --- Filtres ------------------------------------------------------------- */
.filters {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; display: grid; gap: 14px; box-shadow: var(--shadow-sm);
}
.filters__head { display: flex; justify-content: space-between; align-items: center; }
.filters__head h2 { margin: 0; font-size: 1rem; }
.filters__reset { font-size: .82rem; color: var(--text-muted); }
.filters__field { display: grid; gap: 6px; }
.filters__field > label { font-size: .82rem; font-weight: 600; }
.filters__hint { font-size: .76rem; color: var(--text-muted); margin: 4px 0 0; }
.filters__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filters__group { border-top: 1px solid var(--border); padding-top: 12px; }
.filters__group > summary {
    cursor: pointer; font-weight: 650; font-size: .88rem; list-style: none; display: flex;
    justify-content: space-between; align-items: center; padding: 2px 0;
}
.filters__group > summary::-webkit-details-marker { display: none; }
.filters__group > summary::after { content: "+"; color: var(--text-muted); font-weight: 400; }
.filters__group[open] > summary::after { content: "−"; }
.filters__group > *:not(summary) { margin-top: 10px; }
.filters__tags { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }

.tagcheck { display: flex; align-items: center; gap: 8px; font-size: .85rem; cursor: pointer; padding: 3px 0; }
.tagcheck em { font-style: normal; color: var(--text-muted); font-size: .76rem; }

.swatchgrid { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch-radio { cursor: pointer; }
.swatch-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch-radio span {
    display: block; width: 26px; height: 26px; border-radius: 8px; background: var(--swatch);
    border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .15s;
}
.swatch-radio input:checked + span { border-color: var(--text); transform: scale(1.1); }
.swatch-radio--none span {
    background: linear-gradient(135deg, transparent 45%, var(--danger) 45%, var(--danger) 55%, transparent 55%);
    border: 1px dashed var(--border-strong);
}

.colorpicker-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.colorpicker-row__label { font-size: .86rem; font-weight: 600; margin-right: 4px; }
.swatch {
    width: 30px; height: 30px; border-radius: 9px; background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); transition: transform .15s;
}
.swatch:hover { transform: scale(1.12); }

/* --- Nuage de mots-clés -------------------------------------------------- */
.tagcloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tagchip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    background: var(--bg-elevated); border: 1px solid var(--border); font-size: .85rem; font-weight: 500;
    transition: border-color .15s, background .15s;
}
.tagchip:hover { border-color: var(--ps-yellow-700); background: var(--brand-soft); }
.tagchip span { color: var(--text-muted); font-size: .74rem; font-variant-numeric: tabular-nums; }
.tagcloud--sm .tagchip { padding: 4px 10px; font-size: .8rem; }
.tagchip--ai { border-style: dashed; }

/* --- Palette de couleurs ------------------------------------------------- */
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.palette__chip {
    display: inline-flex; align-items: center; justify-content: center; min-width: 74px; height: 42px;
    border-radius: 9px; background: var(--swatch); color: var(--ink); font-size: .72rem; font-weight: 650;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); transition: transform .15s;
}
.palette__chip:hover { transform: translateY(-2px); color: var(--ink); }

/* --- Fiche photo --------------------------------------------------------- */
.photoview { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 26px; align-items: start; }
.photoview__stage { position: relative; position: sticky; top: 76px; }
.photoview__figure { margin: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.photoview__zoom { display: block; width: 100%; padding: 0; border: 0; background: var(--bg-sunken); cursor: zoom-in; }
.photoview__zoom img { width: 100%; height: auto; max-height: 76vh; object-fit: contain; }
.photoview__figure figcaption { padding: 12px 18px; font-size: .88rem; color: var(--text-muted); border-top: 1px solid var(--border); }
.photoview__nav {
    position: absolute; top: 42%; z-index: 4; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ps-ink);
    box-shadow: var(--shadow-md);
}
.photoview__nav--prev { left: -12px; }
.photoview__nav--next { right: -12px; }

.photoview__aside { display: grid; gap: 18px; }
.photoview__header h1 { font-size: 1.32rem; margin-bottom: 6px; }
.photoview__cat { display: inline-block; color: var(--brand-text); font-weight: 600; font-size: .88rem; margin-bottom: 8px; }
.photoview__stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--text-muted); margin: 0; }
.photoview__actions { display: grid; gap: 10px; }
.photoview__block {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.photoview__block h2 { font-size: .94rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 12px; }

.dl-group { display: flex; gap: 8px; align-items: stretch; }
.dl-group > .btn { flex: 1; }
.dl-group__more { position: relative; }
.dl-group__panel {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 30;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px;
}
.dl-group__panel a { padding: 8px 12px; border-radius: 7px; font-size: .86rem; }
.dl-group__panel a:hover { background: var(--bg-sunken); }

.metalist { margin: 0; display: grid; gap: 1px; }
.metarow { display: grid; grid-template-columns: 44% 1fr; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.metarow:last-child { border-bottom: 0; }
.metarow dt { font-size: .8rem; color: var(--text-muted); }
.metarow dd { margin: 0; font-size: .85rem; font-weight: 500; overflow-wrap: anywhere; }

.hotlist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.hotlist__item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 10px 12px; background: var(--bg-sunken); border-radius: var(--radius-sm); font-size: .84rem;
}
.hotlist__item.is-revoked { opacity: .5; }
.hotlist__item code { display: block; font-size: .76rem; word-break: break-all; background: none; padding: 0; }
.hotlist__item .muted { font-size: .74rem; }

.addcoll { display: flex; gap: 8px; }
.addcoll select { flex: 1; }

.inline-form { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.inline-form > summary { cursor: pointer; font-weight: 600; font-size: .86rem; }
.inline-form > *:not(summary) { margin-top: 12px; }
.inline-form--tight { border: 0; padding: 0; }

/* --- Formulaires --------------------------------------------------------- */
.field { display: grid; gap: 5px; margin-bottom: 2px; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.field--full { grid-column: 1 / -1; }

input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--bg-elevated); color: var(--text); font-family: inherit; font-size: .9rem;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand-text); box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea { resize: vertical; min-height: 78px; }
input[type="color"] { padding: 3px; height: 38px; cursor: pointer; }
input[type="range"] { padding: 0; accent-color: var(--brand-text); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-text); width: 16px; height: 16px; }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: .86rem; cursor: pointer; padding: 3px 0; }
.form-grid { display: grid; gap: 14px; }
.form-grid--2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: end; }
.form-grid__title { grid-column: 1 / -1; margin: 6px 0 0; font-size: .92rem; }
.inline-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-row input, .inline-row select { width: auto; min-width: 180px; flex: 0 1 auto; }
.danger-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.savesearch { display: flex; gap: 8px; }
.savesearch input { min-width: 200px; }

/* --- Boutons ------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-family: inherit; font-size: .89rem; font-weight: 650; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn--ghost { background: var(--bg-elevated); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--ps-yellow-700); color: var(--text); background: var(--brand-soft); }
.btn--ghost.is-on { color: var(--danger); border-color: var(--danger); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #B92E25; color: #fff; }
.btn--ms { background: #fff; color: #1B1B1B; border-color: #D0D5DB; }
.btn--ms:hover { background: #F3F4F6; color: #1B1B1B; }
.btn--lg { padding: 13px 26px; font-size: .95rem; }
.btn--sm { padding: 6px 12px; font-size: .8rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.sticky-save {
    position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--bg) 60%, transparent);
    display: flex; justify-content: flex-end;
}

/* --- Tableaux ------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 650; }
.table--striped tbody tr:nth-child(odd) { background: var(--bg-sunken); }
.table tbody tr:hover { background: var(--brand-soft); }

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 650;
    background: var(--bg-sunken); color: var(--text-muted); border: 1px solid var(--border);
}
.badge--role { background: var(--brand-soft); color: var(--brand-hover); border-color: transparent; }
.badge--done, .badge--running { background: rgba(47, 164, 79, .14); color: var(--ok); }
.badge--failed, .badge--cancelled { background: rgba(215, 57, 47, .12); color: var(--danger); }
.badge--pending { background: rgba(224, 138, 11, .14); color: var(--warn); }
.badge--ai { background: var(--brand-soft); color: var(--brand-hover); }

.simplelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.simplelist li {
    display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--border); font-size: .86rem;
}
.simplelist li:last-child { border-bottom: 0; }

.healthlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.healthlist__item { display: flex; gap: 11px; align-items: flex-start; font-size: .86rem; }
.healthlist__item > div { display: grid; }
.healthlist__item span:last-child { color: var(--text-muted); font-size: .8rem; }
.healthlist__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--text-muted); }
.healthlist__item.is-ok .healthlist__dot { background: var(--ok); }
.healthlist__item.is-warn .healthlist__dot { background: var(--warn); }
.healthlist__item.is-error .healthlist__dot { background: var(--danger); }
.healthlist__item.is-off .healthlist__dot { background: var(--border-strong); }

.barchart { display: flex; align-items: flex-end; gap: 6px; min-height: 170px; padding-top: 12px; }
.barchart__col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: center; }
.barchart__bar {
    display: block; height: var(--h); min-height: 4px; background: var(--brand);
    border: 1px solid var(--ps-yellow-700); border-radius: 4px 4px 0 0;
    transition: opacity .15s;
}
.barchart__col:hover .barchart__bar { opacity: .75; }
.barchart__label { font-size: .68rem; color: var(--text-muted); }

/* --- Pagination ---------------------------------------------------------- */
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 26px; flex-wrap: wrap; }
.pagination__summary { font-size: .84rem; color: var(--text-muted); margin: 0; }
.pagination__list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.pagination__list a, .pagination__list span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px;
    padding: 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-elevated);
    font-size: .86rem; font-variant-numeric: tabular-nums;
}
.pagination__list a:hover { border-color: var(--ps-yellow-700); background: var(--brand-soft); }
.pagination__list .is-current { background: var(--brand); color: var(--on-brand); border-color: var(--brand); font-weight: 700; }
.pagination__list .is-disabled, .pagination__list .is-gap { opacity: .4; border-color: transparent; background: none; }

/* --- Fil d'Ariane -------------------------------------------------------- */
.breadcrumb { display: flex; gap: 7px; flex-wrap: wrap; font-size: .84rem; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--brand-hover); }
.breadcrumb .is-current { color: var(--text); font-weight: 600; }

/* --- Messages ------------------------------------------------------------ */
.flash-stack { position: fixed; top: 70px; right: 20px; z-index: 95; display: grid; gap: 8px; max-width: 420px; }
.flash-stack--inline, .flash-stack--auth { position: static; max-width: none; margin-bottom: 18px; }
.flash {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--bg-elevated); border-left: 4px solid var(--brand); box-shadow: var(--shadow-md);
    animation: flash-in .25s ease-out;
}
.flash p { margin: 0; font-size: .88rem; }
.flash--error { border-left-color: var(--danger); }
.flash--warning { border-left-color: var(--warn); }
.flash--info { border-left-color: var(--ps-navy-600); }
.flash__close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; line-height: 1; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.callout {
    background: var(--brand-soft); border: 1px solid var(--brand); border-radius: var(--radius);
    padding: 14px 18px; margin: 14px 0;
}
.callout--warn { background: rgba(224, 138, 11, .1); border-color: var(--warn); }
.callout p { margin: 4px 0 0; font-size: .86rem; }
.copyrow { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.copyrow code { flex: 1; min-width: 200px; word-break: break-all; }
.testoutput {
    margin-top: 12px; background: var(--ps-navy); color: #DCE8F2; padding: 14px; border-radius: var(--radius-sm);
    max-height: 340px; overflow: auto; font-size: .76rem; white-space: pre-wrap;
}

/* --- Visionneuse (lightbox) ---------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 200; display: grid; }
.lightbox[hidden] { display: none; }
.lightbox__backdrop { position: absolute; inset: 0; background: #070C12; }
.lightbox__bar {
    position: relative; z-index: 7; display: flex; justify-content: space-between; align-items: center;
    gap: 16px; padding: 12px 18px; color: #fff;
    background: linear-gradient(to bottom, rgba(0, 20, 40, .72), transparent);
}
.lightbox__title { display: grid; min-width: 0; }
.lightbox__title strong { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__title span { font-size: .78rem; color: rgba(255, 255, 255, .6); }
.lightbox__tools { display: flex; gap: 6px; align-items: center; }
.lightbox__tools .icon-btn { background: rgba(255, 255, 255, .12); color: #fff; }
.lightbox__tools .icon-btn:hover { background: rgba(255, 255, 255, .25); }
.lightbox__counter { font-size: .8rem; color: rgba(255, 255, 255, .65); margin-right: 8px; font-variant-numeric: tabular-nums; }

.lightbox__stage {
    position: relative; z-index: 2; margin: 0; display: grid; place-items: center;
    padding: 0 70px 14px; overflow: hidden;
}
.lightbox__stage img {
    max-width: 100%; max-height: calc(100vh - 210px); width: auto; height: auto; object-fit: contain;
    border-radius: 6px; box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
    animation: lb-in .22s ease-out;
}
@keyframes lb-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.lightbox__stage figcaption {
    margin-top: 10px; color: rgba(255, 255, 255, .72); font-size: .84rem; text-align: center; max-width: 80ch;
}

.lightbox__nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
    width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center;
    transition: background .15s;
}
.lightbox__nav:hover { background: rgba(255, 255, 255, .26); }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }

.lightbox__panel {
    position: absolute; top: 68px; right: 0; bottom: 100px; width: 330px; z-index: 5; overflow-y: auto;
    background: rgba(14, 22, 30, .96); border-left: 1px solid rgba(255, 255, 255, .1);
    padding: 18px; color: #fff;
}
.lightbox__panel h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .55); }
.lightbox__panelhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.lightbox__panelhead h3 { margin: 0; }
.lightbox__panelhead .icon-btn { color: #fff; background: rgba(255, 255, 255, .12); flex: 0 0 auto; }
.lightbox__panelhead .icon-btn:hover { background: rgba(255, 255, 255, .26); }
.lightbox__tools .icon-btn.is-on { background: rgba(255, 255, 255, .3); }
.lightbox__panel dl { display: grid; gap: 1px; margin: 0 0 16px; }
.lightbox__panel .metarow { border-color: rgba(255, 255, 255, .08); }
.lightbox__panel .metarow dt { color: rgba(255, 255, 255, .5); }
.lightbox__colors { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 14px; }
.lightbox__colors span { width: 30px; height: 30px; border-radius: 7px; }
.lightbox__tags { display: flex; gap: 5px; flex-wrap: wrap; }
.lightbox__tags a {
    padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); font-size: .76rem; color: #fff;
}

.lightbox__filmstrip {
    position: relative; z-index: 3; display: flex; gap: 7px; padding: 10px 18px 16px;
    overflow-x: auto; justify-content: flex-start; align-items: center;
}
.lightbox__filmstrip img {
    width: 76px; height: 54px; object-fit: cover; border-radius: 5px; cursor: pointer;
    opacity: .45; border: 2px solid transparent; transition: opacity .15s, border-color .15s; flex-shrink: 0;
}
.lightbox__filmstrip img:hover { opacity: .85; }
.lightbox__filmstrip img.is-active { opacity: 1; border-color: var(--ps-yellow); }

.lightbox.is-slideshow .lightbox__filmstrip,
.lightbox.is-slideshow .lightbox__nav { opacity: .15; }

/* --- Connexion ----------------------------------------------------------- */
.auth-body { margin: 0; min-height: 100vh; background: var(--ps-navy); }
.loginpage { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.loginpage__visual { position: relative; overflow: hidden; background: var(--ps-navy); }
.loginpage__grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 204, 0, .18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 204, 0, .18) 1px, transparent 1px);
    background-size: 46px 46px;
    transform: perspective(700px) rotateX(58deg) scale(2.1); transform-origin: center 32%;
    mask-image: linear-gradient(to bottom, transparent, #000 35%, transparent 92%);
}
.loginpage__glow {
    position: absolute; left: 50%; top: 18%; width: 460px; height: 460px; transform: translateX(-50%);
    background: radial-gradient(circle, rgba(245, 179, 1, .32), transparent 62%); filter: blur(28px);
}
.loginpage__quote {
    position: absolute; left: 48px; right: 48px; bottom: 56px; margin: 0; color: rgba(255, 255, 255, .88);
    font-size: 1.28rem; line-height: 1.55; font-weight: 500; max-width: 34ch;
}
.loginpage__quote::before { content: ""; display: block; width: 44px; height: 3px; background: var(--ps-yellow); margin-bottom: 18px; }

.loginpage__panel { display: grid; place-items: center; padding: 32px; background: #0B1822; }
.loginpage__box { width: 100%; max-width: 380px; color: #E7EEF4; }
.loginpage__logo { margin-bottom: 26px; height: 40px; width: auto; }
.loginpage__box h1 { font-size: 1.55rem; margin-bottom: 4px; }
.loginpage__sub { color: #8FA5B8; margin-bottom: 26px; font-size: .9rem; }
.loginpage__box .field > span { color: #8FA5B8; }
.loginpage__box input {
    background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #fff;
}
.loginpage__box .field { margin-bottom: 14px; }
.loginpage__sep { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #55697B; font-size: .8rem; }
.loginpage__sep::before, .loginpage__sep::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .12); }
.loginpage__legal { margin-top: 26px; font-size: .76rem; color: #55697B; line-height: 1.5; }

/* --- Installateur -------------------------------------------------------- */
.installpage { min-height: 100vh; display: grid; place-items: start center; padding: 40px 20px 80px; }
.installpage__box {
    width: 100%; max-width: 760px; color: #E7EEF4;
    background: #0B1822; border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius-lg); padding: 32px;
}
.installpage__box--narrow { max-width: 520px; }
.installpage__box h1 { font-size: 1.5rem; }
.installpage__box .field > span { color: #8FA5B8; }
.installpage__box input, .installpage__box select {
    background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); color: #fff;
}
.installpage__box code { background: rgba(255, 255, 255, .08); color: #B7E06B; }
.installpage__box .healthlist__item span:last-child { color: #8FA5B8; }
.installpage__box .filters__hint { color: #7E93A6; }
.installpage__box .callout { background: rgba(224, 138, 11, .12); }

.install-section { margin: 26px 0; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .1); }
.install-section:first-of-type { border-top: 0; padding-top: 0; }
.install-section h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .07em; color: #8FA5B8; }
.install-advanced {
    margin: 22px 0; padding: 14px 16px; border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius-sm);
}
.install-advanced > summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.install-advanced > *:not(summary) { margin-top: 14px; }

/* --- Administration ------------------------------------------------------ */
.admin-shell {
    display: grid; grid-template-columns: 236px minmax(0, 1fr); max-width: 1680px; margin: 0 auto;
    min-height: calc(100vh - 57px);
    background: linear-gradient(to right, var(--bg-elevated) 0 236px, transparent 236px);
}
.admin-sidebar {
    padding: 22px 14px; border-right: 1px solid var(--border); position: sticky; top: 57px;
    height: calc(100vh - 57px); overflow-y: auto; background: var(--bg-elevated);
}
.admin-sidebar__title {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted);
    font-weight: 700; margin: 0 10px 12px;
}
.admin-sidebar nav { display: grid; gap: 2px; }
.admin-sidebar nav a { padding: 8px 11px; border-radius: 8px; font-size: .88rem; }
.admin-sidebar nav a:hover { background: var(--bg-sunken); }
.admin-sidebar nav a.is-active { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.admin-sidebar__foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); font-size: .84rem; }
.admin-content { padding: 24px 26px 64px; min-width: 0; }
.admin-content__head { margin-bottom: 18px; }
.admin-content__head h1 { margin: 0; }

.bulkbar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
    position: sticky; top: 57px; z-index: 20;
}
.bulkbar select, .bulkbar input { width: auto; min-width: 170px; }

.adminphotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.adminphoto {
    display: grid; grid-template-columns: 22px 66px 1fr auto; gap: 10px; align-items: center;
    padding: 9px; background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s;
}
.adminphoto:hover { border-color: var(--ps-yellow-700); }
.adminphoto:has(input:checked) { border-color: var(--brand-text); background: var(--brand-soft); }
.adminphoto img { width: 66px; height: 50px; object-fit: cover; border-radius: 5px; }
.adminphoto__info { display: grid; gap: 1px; min-width: 0; }
.adminphoto__info strong { font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adminphoto__info span { font-size: .74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adminphoto__flags { display: grid; gap: 3px; justify-items: end; }

.admintree { list-style: none; margin: 0; padding-left: 0; }
.admintree ul { padding-left: 20px; border-left: 1px solid var(--border); margin-left: 8px; }
.admintree__item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 5px; background: var(--bg-elevated); }
.admintree__item > summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.admintree__name { font-weight: 600; font-size: .9rem; }
.admintree__meta { font-size: .76rem; color: var(--text-muted); }
.admintree__item > *:not(summary) { margin-top: 12px; }

/* --- Téléversement ------------------------------------------------------- */
.dropzone {
    border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 40px 20px;
    text-align: center; background: var(--bg-sunken); transition: border-color .15s, background .15s; margin-bottom: 18px;
}
.dropzone.is-dragover { border-color: var(--brand-text); background: var(--brand-soft); }
.dropzone__inner { display: grid; gap: 8px; justify-items: center; color: var(--text-muted); }
.dropzone__inner p { margin: 0; }

.uploadlist { display: grid; gap: 5px; max-height: 300px; overflow-y: auto; margin-bottom: 18px; }
.uploadlist__item {
    display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .82rem;
    padding: 7px 11px; background: var(--bg-sunken); border-radius: 7px;
}
.uploadlist__item.is-ok { border-left: 3px solid var(--ok); }
.uploadlist__item.is-dup { border-left: 3px solid var(--warn); }
.uploadlist__item.is-error { border-left: 3px solid var(--danger); }
.uploadbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.uploadbar progress { flex: 1; min-width: 200px; height: 9px; accent-color: var(--brand-text); }

/* --- Pages d'erreur ------------------------------------------------------ */
.errorpage { display: grid; place-items: center; gap: 8px; text-align: center; padding: 100px 20px; }
.errorpage__code { font-size: 4.5rem; font-weight: 800; color: var(--brand-text); margin: 0; line-height: 1; }
.errorpage p { color: var(--text-muted); max-width: 46ch; }
.errorpage .btn { margin-top: 14px; }

.minimal-header {
    display: flex; align-items: center; gap: 14px; padding: 14px 22px;
    border-bottom: 1px solid var(--border); background: var(--bg-elevated);
}
.minimal-header__title { color: var(--text-muted); font-size: .9rem; }

/* --- Pied de page -------------------------------------------------------- */
.appfooter { border-top: 1px solid var(--border); background: var(--bg-elevated); margin-top: 40px; }
.appfooter__inner {
    max-width: 1680px; margin: 0 auto; padding: 26px 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
}
.appfooter p { margin: 0; font-size: .84rem; }
.appfooter__brand { font-weight: 600; }
.appfooter__note { color: var(--text-muted); }
.appfooter__links { display: flex; gap: 16px; font-size: .84rem; flex-wrap: wrap; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1280px) {
    .photoview { grid-template-columns: 1fr; }
    .photoview__aside { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

@media (max-width: 1080px) {
    .topbar__inner { grid-template-columns: auto 1fr auto; }
    .topnav { display: none; }
    .burger { display: inline-flex; }
    .topbar.is-open .topnav {
        display: flex; flex-direction: column; grid-column: 1 / -1; padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 8px;
    }
    .layout-split { grid-template-columns: 1fr; }
    .layout-split__side { position: static; max-height: none; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .admin-sidebar nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
    .loginpage { grid-template-columns: 1fr; }
    .loginpage__visual { display: none; }
}

@media (max-width: 860px) {
    .brand__label, .brand__sep { display: none; }
}

@media (max-width: 720px) {
    .topbar__inner { grid-template-columns: 1fr auto; row-gap: 10px; }
    .searchbar { grid-column: 1 / -1; order: 3; }
    .flash-stack { top: auto; bottom: 14px; left: 14px; right: 14px; max-width: none; }
    .hero__search { flex-direction: column; }
    .hero__search input, .hero__search .btn { width: 100%; }
    .searchbar input[type="search"] { padding-right: 46px; }
    .searchbar__submit { font-size: 0; padding: 8px 12px; }
    .searchbar__submit::after { content: "→"; font-size: 1rem; }
    .usermenu__name { display: none; }
    .page, .section { padding-left: 14px; padding-right: 14px; }
    .photogrid--grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .lightbox__stage { padding: 0 10px 10px; }
    .lightbox__nav { width: 38px; height: 38px; }
    .lightbox__panel { width: 100%; top: auto; bottom: 0; height: 55vh; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
    .pcard--list { grid-template-columns: 1fr; }
    .pcard--list .pcard__side { flex-direction: row; border-left: 0; border-top: 1px solid var(--border); }
    .selectionbar { left: 12px; right: 12px; transform: none; }
    .selectionbar__inner { justify-content: center; }
    .filters__row { grid-template-columns: 1fr; }
    .metarow { grid-template-columns: 1fr; gap: 0; }
    .appfooter__inner { flex-direction: column; align-items: flex-start; }
}

@media print {
    .topbar, .appfooter, .gridbar, .selectionbar, .filters, .lightbox, .admin-sidebar { display: none !important; }
    body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    html { scroll-behavior: auto; }
}


/* ---- Fiche photo : volet des actions réservées aux gestionnaires ---------- */
.adminpanel {
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-text);
    border-radius: 12px;
    padding: 4px 16px;
    margin-bottom: 18px;
    background: var(--bg-elevated);
}
.adminpanel .photoview__block { border: 0; padding-left: 0; padding-right: 0; }
.adminpanel .photoview__block + .photoview__block { border-top: 1px solid var(--border); }
[data-admin-toggle] .chevron { transition: transform .15s ease; display: inline-block; }
[data-admin-toggle][aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* ---- Onglets (journal d'audit) ------------------------------------------ */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs__item {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 10px 10px 0 0;
    font-weight: 600; font-size: .88rem; color: var(--text-muted);
    border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px;
}
.tabs__item:hover { color: var(--text); background: var(--bg-sunken); }
.tabs__item.is-active {
    color: var(--text); background: var(--bg-elevated);
    border-color: var(--border); border-bottom: 1px solid var(--bg-elevated);
}
.tabs__badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px;
    padding: 1px 6px; border-radius: 999px; font-size: .7rem;
    background: rgba(215, 57, 47, .14); color: var(--danger);
}

/* ---- Journal des erreurs ------------------------------------------------ */
.chip--danger { background: rgba(215, 57, 47, .14); color: var(--danger); }
.chip--warn { background: rgba(224, 138, 11, .16); color: var(--warn); }
.nowrap { white-space: nowrap; }
.logtable td { vertical-align: top; font-size: .84rem; }
.logtable tr.log--error td:nth-child(3) { color: var(--text); font-weight: 550; }
.logtable__ctx { max-width: 360px; }
.logtable__ctx summary { cursor: pointer; color: var(--text-muted); font-size: .78rem; }
.logtable__ctx pre {
    margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; font-size: .74rem;
    background: var(--bg-sunken); white-space: pre-wrap; overflow-wrap: anywhere;
}
/* En-têtes de colonne triables. */
.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable:hover { color: var(--brand-text); }
.sortable::after {
    content: '↕'; margin-left: 6px; font-size: .72em; opacity: .35;
}
.sortable.is-asc::after  { content: '↑'; opacity: 1; color: var(--brand-text); }
.sortable.is-desc::after { content: '↓'; opacity: 1; color: var(--brand-text); }

/* Palette dominante en bandeau compact (liste d'administration). */
.palettebar {
    display: flex; height: 5px; margin-top: 6px; width: 100%;
    border-radius: 999px; overflow: hidden; border: 1px solid var(--border);
}
.palettebar > span { display: block; min-width: 3px; }

/* Plein écran / diaporama : rappel des raccourcis, effacé après quelques secondes. */
.lightbox__hint {
    position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%);
    z-index: 8; margin: 0; padding: 7px 16px; border-radius: 999px;
    background: rgba(10, 16, 22, .82); color: rgba(255, 255, 255, .85);
    font-size: .78rem; white-space: nowrap; pointer-events: none; opacity: 0;
}
.lightbox__hint kbd {
    padding: 1px 6px; border-radius: 5px; font-family: inherit; font-size: .95em;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
}
.lightbox.is-fullscreen .lightbox__hint,
.lightbox.is-slideshow .lightbox__hint { animation: lb-hint 6s ease forwards; }
@keyframes lb-hint {
    0%   { opacity: 0; }
    8%   { opacity: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}
.lightbox__tools .icon-btn.is-on { background: var(--brand); color: var(--on-brand); }
.lightbox__tools [data-lb-close]:hover { background: var(--danger); color: #fff; }
@media (max-width: 560px) { .lightbox__hint { display: none; } }


/* Curseur de taille des vignettes. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.zoomer { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.zoomer input[type="range"] { width: 92px; accent-color: var(--brand-text); }
.zoomer output { font-size: .76rem; font-variant-numeric: tabular-nums; min-width: 58px; }
@media (max-width: 1000px) { .zoomer { display: none; } }

/* Sélecteur « par page » dans la pagination. */
.pagination__perpage { display: flex; align-items: center; gap: 8px; }
.pagination__perpage label { display: flex; align-items: center; gap: 7px; font-size: .82rem; color: var(--text-muted); }
.pagination__perpage select { padding: 5px 9px; }

/* Filtres appliqués à la volée. */
.filters__state { font-size: .74rem; color: var(--brand-text); }
.filters.is-loading { opacity: .55; pointer-events: none; transition: opacity .12s; }
.filters__reset { margin-bottom: 16px; justify-content: center; gap: 8px; }
.filters__reset.is-disabled { opacity: .4; pointer-events: none; }


/* Volet de partage de la fiche photo. */
.sharebox { border: 1px solid var(--border); border-left: 3px solid var(--brand-text); border-radius: 12px; padding: 4px 16px 16px; margin-bottom: 18px; }
.sharebox textarea { resize: vertical; }
.testoutput { max-height: 300px; overflow: auto; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.5; }
.field--full { grid-column: 1 / -1; }

/* Barre de filtres de l'administration. */
.adminfilters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adminfilters.is-loading { opacity: .55; pointer-events: none; }
.adminfilters__reset { margin-left: auto; }

.adminfilters__reset.is-disabled { opacity: .4; pointer-events: none; }
.adminfilters .filters__state { font-size: .74rem; color: var(--brand-text); }

/* ---- Carte des sites ---------------------------------------------------- */
.sitemap { height: 620px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 26px; }
.mappop { display: grid; gap: 6px; text-align: center; }
.mappop img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }
.mappop strong { font-size: .92rem; }
.mappop__addr, .mappop__n { font-size: .78rem; color: var(--text-muted); }
@media (max-width: 700px) { .sitemap { height: 420px; } }

/* ---- Dédoublonnage ------------------------------------------------------ */
.dupgroup__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.dupgroup__head h2 { display: flex; align-items: center; gap: 8px; }
.dupgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 14px 0 16px; }
.dupcard { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-elevated); }
.dupcard.is-best { border-color: var(--brand-text); box-shadow: 0 0 0 1px var(--brand-text) inset; }
.dupcard img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.dupcard__body { display: grid; gap: 2px; padding: 9px 11px; font-size: .78rem; }
.dupcard__body strong { font-size: .84rem; overflow-wrap: anywhere; }
.dupcard__choice { padding: 0 11px 10px; }

/* ---- Jetons d'API ------------------------------------------------------- */
.tokenvalue {
    display: block; padding: 9px 12px; border-radius: 8px; font-size: .86rem;
    background: var(--bg-sunken); border: 1px solid var(--border-strong); overflow-wrap: anywhere;
}
tr.is-revoked { opacity: .55; }
.num.is-zero { color: var(--danger); font-weight: 600; }

/* ---- Notation par étoiles ----------------------------------------------- */
/* Lecture seule : superposition d'un calque plein sur un calque vide, pour
   qu'une moyenne de 4,3 s'affiche comme telle et non arrondie. */
.stars { position: relative; display: inline-block; white-space: nowrap; line-height: 1; vertical-align: -1px; }
.stars__track, .stars__fill { letter-spacing: 1px; }
.stars__track { color: var(--border-strong); }
.stars__fill { position: absolute; inset: 0; overflow: hidden; color: var(--ps-solar, #F2C230); }
.stars--sm { font-size: .78rem; }
.stars__count { font-size: .74rem; color: var(--text-muted); margin-left: 6px; }

/* Interactif */
.rating { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rating__stars { display: flex; gap: 2px; }
.rating__star {
    background: none; border: 0; cursor: pointer; padding: 0 2px;
    font-size: 1.5rem; line-height: 1; color: var(--border-strong);
    transition: color .12s, transform .12s;
}
.rating__star:hover, .rating__star:focus-visible { transform: scale(1.15); outline: none; }
.rating__star.is-on { color: var(--ps-solar, #F2C230); }
/* Survol : les étoiles jusqu'au curseur s'allument, comme partout ailleurs. */
.rating__stars:hover .rating__star { color: var(--ps-solar, #F2C230); }
.rating__stars .rating__star:hover ~ .rating__star { color: var(--border-strong); }
.rating__summary { font-size: .82rem; color: var(--text-muted); }
.rating__clear {
    background: none; border: 0; padding: 0; cursor: pointer;
    font-size: .76rem; color: var(--text-muted); text-decoration: underline;
}
.rating__clear:hover { color: var(--danger); }
.ratingbox h2 { margin-bottom: 10px; }

/* --- Vidéos --------------------------------------------------------------
   Pas de vignette : la photothèque n'embarque pas ffmpeg. La tuile affiche
   un aplat bleu de marque, un pictogramme de film et la durée — assez pour
   reconnaître une vidéo dans une grille de photos sans la confondre avec
   une image sombre.
   ------------------------------------------------------------------------ */
.pcard__film {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--ps-blue-800) 0%, var(--ps-navy) 60%, var(--ps-blue-900) 100%);
    color: rgba(255, 255, 255, .82);
}
.pcard:hover .pcard__film { color: var(--ps-yellow); transition: color .18s; }

.pcard__duration {
    position: absolute; right: 8px; bottom: 8px; z-index: 3;
    padding: 2px 7px; border-radius: 5px;
    background: rgba(0, 20, 40, .78); color: #fff;
    font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums;
    letter-spacing: .02em; pointer-events: none;
}

.chip--video { background: var(--ps-blue); color: #fff; }

/* Le lecteur occupe la place de l'image sur la fiche, sans la déborder. */
.photoview__video {
    display: block; width: 100%; height: auto; max-height: 76vh;
    background: #000; border-radius: var(--radius); outline: none;
}

/* Format que le navigateur ne sait pas lire : on l'explique plutôt que de
   laisser un rectangle noir muet. */
.photoview__unplayable {
    display: grid; place-items: center; gap: 14px; text-align: center;
    min-height: 320px; padding: 40px 28px;
    background: var(--bg-sunken); border: 1px dashed var(--border-strong);
    border-radius: var(--radius); color: var(--text-muted);
}
.photoview__unplayable svg { color: var(--brand-text); opacity: .7; }
.photoview__unplayable p { margin: 0; max-width: 46ch; font-size: .92rem; line-height: 1.5; }
