.gallery-page-bar { position: sticky; top: var(--app-header-height); z-index: 80; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.65rem 1.25rem; background: var(--bg-card); border-bottom: 1px solid var(--border-color); }
.gallery-page-bar h2 { margin: 0; font-size: 1rem; }.gallery-page-bar p { margin: 0.15rem 0 0; color: var(--text-muted); font-size: 0.75rem; }
.gallery-page-filters { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; color: var(--text-muted); font-size: 0.78rem; font-weight: 700; }.gallery-page-filters label { display: inline-flex; align-items: center; gap: 0.35rem; }.gallery-page-filters select { padding: 0.35rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-main); font: inherit; }.gallery-page-main { padding-bottom: 5rem; }.gallery-page-grid { --gallery-card-min-width: 230px; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--gallery-card-min-width), 1fr)); gap: 0.85rem; padding: 1rem 1.25rem; }.gallery-page-card { overflow: hidden; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-main); text-decoration: none; transition: transform var(--transition-fast), border-color: var(--transition-fast); }.gallery-page-card:hover { transform: translateY(-3px); border-color: var(--color-success); }.gallery-page-preview { position: relative; display: grid; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; background: #050506; }.gallery-page-preview img, .gallery-page-preview video { width: 100%; height: 100%; object-fit: cover; }.gallery-page-preview > i { position: absolute; color: var(--text-main); font-size: 2rem; filter: drop-shadow(0 2px 5px #000); }.gallery-page-info { display: grid; gap: 0.16rem; padding: 0.55rem 0.65rem; font-size: 0.72rem; }.gallery-page-info span { color: var(--text-muted); }.gallery-page-info b { color: var(--color-success); }.gallery-page-empty { grid-column: 1 / -1; padding: 2rem; color: var(--text-muted); text-align: center; }@media(max-width:700px){.gallery-page-bar{align-items:flex-start;flex-direction:column}.gallery-page-grid{padding-inline:.7rem}.gallery-page-filters{gap:.45rem}}
/* Portfolio : seulement les visuels, cinq cartes à la taille par défaut. */
.gallery-page-grid { --gallery-columns: 5; grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr)); }
.gallery-page-card { display: block; padding: 0; cursor: pointer; }
@media(max-width:700px){.gallery-page-grid{gap:.35rem;padding:.55rem .4rem;}}

.gallery-page-preview img, .gallery-page-preview video { object-fit: cover !important; object-position: 50% 50% !important; }
.gallery-page-card, .gallery-page-card:hover { transform: none; border-color: var(--border-color); transition: none; }
.gallery-dual-range { --range-start: 70%; --range-end: 0%; position: relative; display: inline-block; width: 13rem; height: 1.8rem; vertical-align: middle; }
.gallery-dual-range::before, .gallery-range-fill { position: absolute; top: 50%; height: 0.28rem; border-radius: 99px; transform: translateY(-50%); content: ''; }
.gallery-dual-range::before { inset-inline: 0; background: #3d3d3d; }
.gallery-range-fill { left: var(--range-start); right: var(--range-end); background: #f2f2f2; }
.gallery-dual-range input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; pointer-events: none; }
.gallery-dual-range input[type="range"]::-webkit-slider-runnable-track { height: 0.28rem; background: transparent; }
.gallery-dual-range input[type="range"]::-moz-range-track { height: 0.28rem; background: transparent; }
.gallery-dual-range input[type="range"]::-webkit-slider-thumb { width: 1.45rem; height: 1.45rem; margin-top: -0.58rem; appearance: none; -webkit-appearance: none; border: 5px solid #f2f2f2; border-radius: 50%; background: #101010; box-shadow: 0 0 0 1px rgba(255,255,255,.08); pointer-events: auto; cursor: grab; }
.gallery-dual-range input[type="range"]::-moz-range-thumb { width: 0.95rem; height: 0.95rem; border: 5px solid #f2f2f2; border-radius: 50%; background: #101010; box-shadow: 0 0 0 1px rgba(255,255,255,.08); pointer-events: auto; cursor: grab; }
.gallery-filter-panel { position: fixed; z-index: 150; top: calc(var(--app-header-height) + 0.6rem); right: 1rem; display: none; width: min(35rem, calc(100vw - 2rem)); padding: 1rem 1.1rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: 0 16px 36px rgba(0,0,0,.4); }
.gallery-filter-panel.active { display: block; }
.gallery-filter-panel select { appearance: none; -webkit-appearance: none; min-width: 10.5rem; padding: 0.45rem 2rem 0.45rem 0.58rem; border: 1px solid rgba(242,242,242,.55); border-radius: 0.42rem; outline: none; background-color: #111113; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23f2f2f2' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.62rem center; color: #f2f2f2; box-shadow: inset 0 1px rgba(255,255,255,.04); transition: border-color .15s ease, background-color .15s ease; }
.gallery-filter-panel select:hover { border-color: rgba(242,242,242,.88); background-color: #171719; }
.gallery-filter-panel select:focus { border-color: #f2f2f2; box-shadow: 0 0 0 2px rgba(242,242,242,.14); }
.gallery-filter-panel select option { background: #111113; color: #f2f2f2; }
.gallery-custom-select { position: relative; display: inline-block; min-width: 16rem; }
.gallery-filter-panel .gallery-sort-field { grid-column: 1 / -1; }
.gallery-custom-select select { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.gallery-custom-select-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 2.15rem; padding: 0.45rem 0.6rem; border: 1px solid rgba(242,242,242,.55); border-radius: 0.42rem; background: #111113; color: #f2f2f2; font: inherit; font-size: 0.76rem; font-weight: 600; text-align: left; cursor: pointer; box-shadow: inset 0 1px rgba(255,255,255,.04); transition: border-color .15s ease, background-color .15s ease; }
.gallery-custom-select-trigger:hover, .gallery-custom-select-trigger[aria-expanded="true"] { border-color: #f2f2f2; background: #171719; }
.gallery-custom-select-trigger i { font-size: 0.66rem; color: rgba(242,242,242,.75); transition: transform .15s ease; }
.gallery-custom-select-trigger[aria-expanded="true"] i { transform: rotate(180deg); }
.gallery-custom-select-menu { position: absolute; z-index: 220; top: calc(100% + 0.38rem); left: 0; display: none; width: 100%; overflow: hidden; border: 1px solid rgba(242,242,242,.72); border-radius: 0.42rem; background: #101011; box-shadow: 0 14px 28px rgba(0,0,0,.56); }
.gallery-custom-select-menu.active { display: block; }
.gallery-custom-select-menu button { display: block; width: 100%; padding: 0.58rem 0.65rem; border: 0; border-bottom: 1px solid rgba(242,242,242,.09); background: transparent; color: rgba(242,242,242,.78); font: inherit; font-size: 0.75rem; font-weight: 600; text-align: left; white-space: nowrap; cursor: pointer; }
.gallery-custom-select-menu button:last-child { border-bottom: 0; }
.gallery-custom-select-menu button:hover { background: #262628; color: #fff; }
.gallery-custom-select-menu button.selected { background: #f2f2f2; color: #111113; }
.gallery-calendar-access-icon { color: #fff; opacity: 1; }
#galleryLoginAccess,
#galleryCalendarAccess { border-color: rgba(242,242,242,.2); background: #202024; color: #fff; font-size: 13px; font-weight: 500; text-decoration: none; }
#galleryLoginAccess[hidden] { display: none !important; }
#galleryLoginAccess:hover,
#galleryCalendarAccess:hover { border-color: rgba(242,242,242,.5); background: #29292e; color: #fff; text-decoration: none; }
.gallery-auth-control[hidden] { display: none !important; }
.gallery-auth-control { cursor: default; user-select: none; }
.gallery-font-test-toggle { border-color: rgba(242,242,242,.2); background: #202024; color: #fff; }
.gallery-font-test-toggle[hidden] { display: none !important; }
.gallery-font-test-toggle:hover,
.gallery-font-test-toggle[aria-expanded="true"] { border-color: rgba(242,242,242,.5); background: #29292e; color: #fff; }
.gallery-font-test-panel {
  position: fixed;
  z-index: 180;
  top: calc(var(--app-header-height) + .6rem);
  right: 1rem;
  display: grid;
  width: min(22rem, calc(100vw - 2rem));
  gap: .72rem;
  padding: .95rem 1rem 1rem;
  border: 1px solid rgba(242,242,242,.28);
  border-radius: var(--radius-md);
  background: #111113;
  box-shadow: 0 16px 36px rgba(0,0,0,.48);
  color: rgba(242,242,242,.78);
  font-size: .76rem;
  font-weight: 700;
}
.gallery-font-test-panel[hidden] { display: none !important; }
.gallery-font-test-title { display: flex; align-items: center; gap: .45rem; color: #f2f2f2; font-size: .84rem; }
.gallery-font-test-panel label { display: grid; gap: .34rem; }
.gallery-font-test-panel select {
  width: 100%;
  min-height: 2.1rem;
  padding: .42rem .55rem;
  border: 1px solid rgba(242,242,242,.35);
  border-radius: .42rem;
  outline: none;
  background: #18181b;
  color: #f2f2f2;
  font: inherit;
}
.gallery-font-test-panel select:focus { border-color: #f2f2f2; box-shadow: 0 0 0 2px rgba(242,242,242,.12); }
.gallery-font-test-check { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: .45rem !important; }
.gallery-font-test-check input { width: .92rem; height: .92rem; accent-color: #f2f2f2; }
.gallery-font-test-spacing { grid-template-columns: 1fr auto; align-items: center; }
.gallery-font-test-spacing output { color: rgba(242,242,242,.55); font-variant-numeric: tabular-nums; }
.gallery-font-test-spacing input { grid-column: 1 / -1; width: 100%; accent-color: #f2f2f2; }
.gallery-font-test-reset { justify-self: start; padding: .42rem .7rem; border-color: rgba(242,242,242,.28); background: #202024; color: #f2f2f2; }
.gallery-font-test-reset:hover { border-color: rgba(242,242,242,.6); background: #29292e; }
.gallery-font-test-actions { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.gallery-font-test-apply { min-width: 6.4rem; padding: .42rem .7rem; }
.gallery-font-test-apply[hidden] { display: none !important; }
.gallery-font-test-apply:disabled { opacity: .38; cursor: not-allowed; }
.gallery-font-test-status { color: rgba(242,242,242,.48); font-size: .66rem; line-height: 1.35; }
.gallery-filter-panel .gallery-page-filters { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0.95rem 1rem; }
.gallery-filter-panel .gallery-page-filters > label { min-width: 0; }
.gallery-range { grid-column: 1 / -1; }
.gallery-range #galleryScoreMinValue, .gallery-range #galleryScoreMaxValue { display: inline-block; width: 1.3rem; text-align: center; font-variant-numeric: tabular-nums; }
.gallery-page-filters [hidden] { display: none !important; }
.gallery-creation-range { display: grid !important; grid-template-columns: 11rem minmax(13rem, 1fr); align-items: center !important; column-gap: 0.15rem; row-gap: 0; }
.gallery-creation-label { white-space: nowrap; }
.gallery-creation-score-hint { position: relative; z-index: 1; grid-column: 1; grid-row: 2; margin-top: -0.85rem; color: rgba(185, 191, 198, 0.2); font-size: 0.66rem; font-weight: 600; }
.gallery-creation-range .gallery-single-range { grid-column: 2; grid-row: 1; align-self: center; }
.gallery-category-filter { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem 1rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.gallery-category-filter legend { grid-column: 1 / -1; margin-bottom: 0.5rem; padding: 0; color: var(--text-muted); font-size: 0.82rem; font-weight: 700; }
.gallery-filter-panel .gallery-category-filter label { display: flex; gap: 0.32rem; min-width: 0; color: rgba(225, 229, 233, 0.72); font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.gallery-category-filter input { width: 0.78rem; height: 0.78rem; margin: 0; appearance: none; -webkit-appearance: none; border: 1.5px solid #f2f2f2; border-radius: 50%; background: transparent; cursor: pointer; }
.gallery-category-filter input:checked { background: #f2f2f2; box-shadow: inset 0 0 0 0.16rem #151515; }
.gallery-group-toggle { grid-column: 1 / -1; justify-self: start; }
.gallery-group-management { grid-column: 1 / -1; display: grid; gap: .65rem; padding: .75rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: rgba(255,255,255,.025); }
.gallery-group-management[hidden] { display: none !important; }
.gallery-group-management-heading { display: grid; gap: .15rem; color: var(--text-main); font-size: .78rem; font-weight: 800; }
.gallery-group-management-heading small { color: var(--text-muted); font-size: .68rem; font-weight: 500; }
.gallery-group-add { display: flex; gap: .5rem; }
.gallery-group-add input { min-width: 0; flex: 1; padding: .42rem .58rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #111113; color: var(--text-main); font: inherit; }
.gallery-group-list { display: grid; gap: .35rem; }
.gallery-group-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--text-muted); font-size: .74rem; }
.gallery-group-row .group-delete { padding: .25rem .45rem; border: 1px solid rgba(242,242,242,.2); border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; }
.gallery-group-row .group-delete:hover { border-color: rgba(255,120,120,.7); color: #ffb0b0; }
.gallery-group-row .group-system { color: rgba(242,242,242,.35); font-size: .66rem; }
#galleryPageCount { margin-top: 0; line-height: 1.15; }
.gallery-apply-btn { min-width: 7.5rem; margin-top: 0; }
.gallery-single-range { --range-progress: 33.333%; position: relative; display: inline-block; width: 13rem; height: 1.8rem; vertical-align: middle; }
.gallery-single-range::before, .gallery-single-range .gallery-range-fill { position: absolute; top: 50%; height: 0.28rem; border-radius: 99px; transform: translateY(-50%); content: ''; }
.gallery-single-range::before { inset-inline: 0; background: #3d3d3d; }
.gallery-single-range .gallery-range-fill { left: 0; width: var(--range-progress); background: #f2f2f2; }
.gallery-single-range input[type="range"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.gallery-single-range input[type="range"]::-webkit-slider-runnable-track { height: 0.28rem; background: transparent; }
.gallery-single-range input[type="range"]::-moz-range-track { height: 0.28rem; background: transparent; }
.gallery-single-range input[type="range"]::-webkit-slider-thumb { width: 1.45rem; height: 1.45rem; margin-top: -0.58rem; appearance: none; -webkit-appearance: none; border: 5px solid #f2f2f2; border-radius: 50%; background: #101010; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.gallery-single-range input[type="range"]::-moz-range-thumb { width: 0.95rem; height: 0.95rem; border: 5px solid #f2f2f2; border-radius: 50%; background: #101010; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.gallery-image-preview { background-color: #050506; background-repeat: no-repeat; background-position: center center !important; background-size: cover !important; }
.gallery-pdf-preview { display: block; max-width: 100%; max-height: 100%; background: #fff; }
.gallery-generated-preview { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.gallery-load-sentinel { grid-column: 1 / -1; height: 1px; }
.gallery-bulk-toolbar { display: grid; gap: .8rem; margin: .8rem 1.25rem 0; padding: .8rem .9rem; border: 1px solid rgba(242,242,242,.22); border-radius: var(--radius-md); background: #111113; color: var(--text-main); }
.gallery-bulk-toolbar[hidden] { display: none !important; }
.gallery-page-main > .gallery-bulk-toolbar { position: sticky; top: var(--app-header-height); z-index: 110; width: 100%; margin: 0; border-radius: 0; border-right: 0; border-left: 0; background: rgba(32,32,36,.97); }
.gallery-bulk-heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.gallery-bulk-heading strong { font-size: .8rem; }
.gallery-bulk-selection-actions { display: flex; gap: .45rem; }
.gallery-bulk-selection-actions .btn, .gallery-bulk-action-row .btn, #btnApplyBulkGroups { padding: .38rem .58rem; font-size: .7rem; }
.gallery-bulk-actions { display: grid; gap: .65rem; }
.gallery-bulk-action-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; color: var(--text-muted); font-size: .74rem; font-weight: 700; }
.gallery-bulk-action-row select { min-height: 2rem; padding: .35rem 1.8rem .35rem .5rem; border: 1px solid rgba(242,242,242,.4); border-radius: var(--radius-sm); background: #18181b; color: #f2f2f2; font: inherit; }
.gallery-bulk-groups { display: flex; flex-wrap: wrap; gap: .45rem .8rem; margin: 0; padding: .45rem .55rem .55rem; border: 1px solid rgba(242,242,242,.14); border-radius: var(--radius-sm); }
.gallery-bulk-groups legend { padding: 0 .2rem; color: var(--text-muted); font-size: .7rem; font-weight: 700; }
.gallery-bulk-groups label { display: inline-flex; align-items: center; gap: .32rem; color: rgba(242,242,242,.75); font-size: .72rem; font-weight: 600; }
.gallery-bulk-groups input { width: .82rem; height: .82rem; accent-color: #f2f2f2; }
.gallery-bulk-status { min-height: 1em; margin: 0; color: rgba(242,242,242,.48); font-size: .68rem; }
.gallery-card-shell { position: relative; min-width: 0; }
.gallery-selection-label { position: absolute; z-index: 4; top: .45rem; left: .45rem; display: grid; width: 1.65rem; height: 1.65rem; place-items: center; border: 1px solid rgba(255,255,255,.65); border-radius: 50%; background: rgba(8,8,10,.82); cursor: pointer; }
.gallery-selection-toggle { width: 1rem; height: 1rem; margin: 0; accent-color: #fff; cursor: pointer; }
.gallery-page-card.is-selected { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.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; }
.gallery-apply-btn { justify-self: end; }
@media(max-width:700px){.gallery-page-main > .gallery-bulk-toolbar{top:50px;width:100%;margin:0;padding:.3rem .5rem;border-radius:0}}
.gallery-bulk-toolbar { z-index: 110; }
@media(max-width:700px){.gallery-bulk-toolbar{top:50px;width:100%;margin:0;padding:.42rem .5rem;border-radius:0}}
@media(max-width:700px){.gallery-bulk-toolbar{margin:.55rem .4rem 0;padding:.7rem}.gallery-bulk-heading{align-items:flex-start;flex-direction:column}.gallery-bulk-selection-actions{width:100%}.gallery-bulk-selection-actions .btn{flex:1}.gallery-bulk-action-row{align-items:stretch;flex-direction:column}.gallery-bulk-action-row select,.gallery-bulk-action-row .btn,#btnApplyBulkGroups{width:100%}.gallery-selection-label{top:.3rem;left:.3rem;width:1.9rem;height:1.9rem}.gallery-selection-toggle{width:1.1rem;height:1.1rem}}
.gallery-bulk-toolbar { position: sticky; top: var(--app-header-height); z-index: 95; gap: .45rem; margin: .5rem 1.25rem 0; padding: .45rem .6rem; border-color: rgba(242,242,242,.28); background: rgba(17,17,19,.96); box-shadow: 0 8px 22px rgba(0,0,0,.28); backdrop-filter: blur(14px); }
.gallery-bulk-heading { min-height: 2rem; }
.gallery-bulk-selection-actions { align-items: center; }
.gallery-bulk-selection-actions .btn { min-height: 1.9rem; padding: .3rem .55rem; border-color: rgba(242,242,242,.22); background: #202024; color: #f2f2f2; }
.gallery-bulk-selection-actions .btn:hover { border-color: rgba(242,242,242,.55); background: #2b2b30; }
.gallery-bulk-more, .gallery-bulk-delete { width: 1.9rem; padding-inline: 0 !important; }
.gallery-bulk-options[hidden] { display: none !important; }
.gallery-bulk-options { display: grid; gap: .45rem; padding: .4rem .1rem .05rem; }
.gallery-bulk-action-row { min-height: 2.1rem; }
.gallery-bulk-action-label { min-width: 3rem; color: var(--text-muted); }
.gallery-bulk-score-select { min-width: 12rem; }
.gallery-bulk-score-select .gallery-custom-select-trigger { min-height: 1.95rem; padding: .35rem .55rem; font-size: .72rem; }
.gallery-bulk-score-select .gallery-custom-select-menu { top: calc(100% + .25rem); max-height: 15rem; overflow-y: auto; }
.gallery-bulk-groups { padding: .4rem .5rem .5rem; }
.gallery-bulk-groups legend { font-size: .68rem; }
.gallery-bulk-status { font-size: .64rem; }
.gallery-selection-label { width: 1.9rem; height: 1.9rem; border: 0; background: rgba(8,8,10,.72); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.gallery-selection-label[hidden] { display: none !important; }
.gallery-selection-toggle { position: absolute; width: 100%; height: 100%; appearance: none; -webkit-appearance: none; opacity: 0; }
.gallery-selection-label::before { content: ''; display: grid; width: 1.12rem; height: 1.12rem; place-items: center; border: 2px solid rgba(255,255,255,.86); border-radius: 50%; color: #111113; font-size: .72rem; font-weight: 900; transition: transform .16s ease, background .16s ease, box-shadow .16s ease; }
.gallery-selection-label.is-selected::before { content: '✓'; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.16), 0 2px 7px rgba(0,0,0,.35); transform: scale(1.05); }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card { transform: scale(.965); border-color: rgba(255,255,255,.86); box-shadow: 0 0 0 2px rgba(255,255,255,.18); }
.gallery-card-shell .gallery-page-card { transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }

/* Mode sélection : une bande pleine largeur, plus claire, directement sous l’en-tête. */
.gallery-bulk-toolbar { top: var(--app-header-height); width: 100%; margin: 0; padding: .32rem 1.25rem; border-right: 0; border-left: 0; border-radius: 0; border-color: rgba(255,255,255,.18); background: rgba(32,32,36,.97); box-shadow: 0 6px 16px rgba(0,0,0,.26); }
.gallery-bulk-selection-actions .btn { display: inline-grid; place-items: center; font-size: .76rem; }
.gallery-bulk-selection-actions .btn i, .gallery-bulk-selection-actions .btn > .fa-solid { font-size: 1rem; }
.gallery-bulk-delete { color: #f2f2f2 !important; }
.gallery-bulk-selection-actions .btn.is-active { border-color: rgba(255,255,255,.8); background: #f2f2f2; color: #111113; }
.gallery-card-shell .gallery-page-card { position: relative; }
.gallery-card-shell:has(.gallery-selection-label.is-selected)::after { content: ''; position: absolute; z-index: 5; inset: -6px; pointer-events: none; border: 4px solid rgba(255,255,255,.76); border-radius: calc(var(--radius-md) + 3px); box-shadow: 0 0 0 2px rgba(255,255,255,.16), 0 0 16px rgba(255,255,255,.12); }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card { transform: scale(.965); box-shadow: none; }

/* Une seule coche, sans cercle ni double contour. */
.gallery-selection-label { display: grid; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.gallery-selection-label::before { content: '✓'; width: auto; height: auto; border: 0; border-radius: 0; background: transparent; color: rgba(255,255,255,.62); font-size: 1.42rem; font-weight: 900; line-height: 1; text-shadow: 0 2px 5px rgba(0,0,0,.72); transform: none; }
.gallery-selection-label.is-selected::before { content: '✓'; background: transparent; color: #fff; box-shadow: 0 0 12px rgba(255,255,255,.5); transform: scale(1.08); }
.gallery-card-shell:has(.gallery-selection-label.is-selected)::after { content: none; }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card { border-color: rgba(255,255,255,.95); box-shadow: 0 0 0 5px rgba(255,255,255,.7), 0 0 0 8px rgba(255,255,255,.12); transform: scale(.965); }

/* Finition du mode sélection : une seule sphère de coche, à droite. */
.gallery-bulk-toolbar { display: grid; gap: 0; min-height: 2.45rem; padding-block: 0; border-top: 0; border-bottom-color: rgba(255,255,255,.13); }
.gallery-bulk-heading { min-height: 2.45rem; }
.gallery-bulk-selection-actions { gap: .32rem; }
.gallery-bulk-selection-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: .34rem; min-height: 1.72rem; padding: .24rem .46rem; font-size: .7rem; line-height: 1; }
.gallery-bulk-selection-actions .btn i { font-size: .85rem; line-height: 1; }
.gallery-bulk-more, .gallery-bulk-delete { width: 1.72rem; padding: 0 !important; }
.gallery-selection-label { top: .42rem; right: .42rem; left: auto; display: grid; width: 1.78rem; height: 1.78rem; place-items: center; border: 1.5px solid rgba(255,255,255,.82); border-radius: 50%; background: rgba(12,12,15,.78); box-shadow: 0 2px 7px rgba(0,0,0,.42); }
.gallery-selection-label::before { content: '✓'; color: rgba(255,255,255,.82); font-size: 1rem; font-weight: 900; text-shadow: none; }
.gallery-selection-label.is-selected { border-color: #fff; background: #fff; box-shadow: 0 2px 9px rgba(0,0,0,.42); }
.gallery-selection-label.is-selected::before { color: #111113; box-shadow: none; transform: none; }
.gallery-card-shell:has(.gallery-selection-label.is-selected)::after { content: none; }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card { border-color: rgba(255,255,255,.58); box-shadow: 0 0 0 2px rgba(255,255,255,.24), 0 7px 18px rgba(0,0,0,.22); transform: scale(.972); }
@media(max-width:700px){.gallery-bulk-toolbar{min-height:2.3rem;padding-block:0}.gallery-bulk-heading{min-height:2.3rem}.gallery-bulk-selection-actions .btn{min-height:1.68rem;font-size:0;padding:.25rem .38rem}.gallery-bulk-selection-actions .btn i{font-size:.92rem}.gallery-bulk-selection-actions .btn span{display:none}.gallery-selection-label{top:.32rem;right:.32rem;left:auto;width:1.86rem;height:1.86rem}.gallery-selection-label::before{font-size:1.05rem}}

/* Glisser pour ajouter rapidement plusieurs créations en mode sélection. */
.gallery-page-grid.is-selection-mode { user-select: none; -webkit-user-select: none; }
.gallery-page-grid.is-selection-mode .gallery-card-shell { touch-action: none; }
.gallery-page-grid.is-drag-selecting { cursor: crosshair; touch-action: none; }
.gallery-page-grid.is-drag-selecting .gallery-card-shell { cursor: crosshair; }

/* Sélection inspirée de la référence : pastille blanche + voile très léger. */
.gallery-card-shell { transition: transform .18s ease; }
.gallery-selection-label { top: .42rem; left: .42rem; right: auto; width: 1.72rem; height: 1.72rem; border: 1.5px solid rgba(255,255,255,.88); border-radius: 50%; background: rgba(12,12,15,.64); }
.gallery-selection-label::before { content: '✓'; color: rgba(255,255,255,.9); font-size: .94rem; font-weight: 900; }
.gallery-selection-label.is-selected { border-color: #fff; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.gallery-selection-label.is-selected::before { color: #16161a; }
.gallery-card-shell:has(.gallery-selection-label.is-selected) { transform: scale(.972); }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card { transform: none; border-color: rgba(255,255,255,.82); box-shadow: none; }
.gallery-card-shell .gallery-page-card::after { content: ''; position: absolute; z-index: 2; inset: 0; pointer-events: none; background: rgba(255,255,255,0); transition: background .18s ease; }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card::after { background: rgba(255,255,255,.10); }
@media(max-width:700px){.gallery-selection-label{top:.3rem;left:.3rem;right:auto;width:1.8rem;height:1.8rem}.gallery-selection-label::before{font-size:1rem}}

/* Même symbole que l’état « Connecté » : Font Awesome circle-check. */
.gallery-selection-label { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.gallery-selection-label::before { content: none; }
.gallery-selection-label > .fa-circle-check { color: rgba(255,255,255,.72); font-size: 1.72rem; line-height: 1; filter: drop-shadow(0 2px 5px rgba(0,0,0,.52)); transition: color .16s ease, transform .16s ease, filter .16s ease; }
.gallery-selection-label.is-selected { border: 0; background: transparent; box-shadow: none; }
.gallery-selection-label.is-selected > .fa-circle-check { color: #f2f2f2; transform: scale(1.06); filter: drop-shadow(0 2px 7px rgba(0,0,0,.48)); }
@media(max-width:700px){.gallery-selection-label > .fa-circle-check{font-size:1.8rem}}

/* État sélectionné plus affirmé, sans masquer le visuel. */
.gallery-card-shell:has(.gallery-selection-label.is-selected) { transform: scale(.94); }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card::after { background: rgba(255,255,255,.19); }

/* Corrections de stabilité : pas de seconde coche, pas d'espace fantôme. */
.gallery-selection-label.is-selected::before { content: none; }
.gallery-bulk-status:empty { display: none; }
.gallery-bulk-toolbar { display: flex; align-items: center; min-height: 3.1rem; padding-block: 0; }
.gallery-bulk-toolbar:has(.gallery-bulk-options[hidden]) { height: 3.1rem; }
.gallery-bulk-heading { display: flex; width: 100%; height: 100%; min-height: 0; align-items: center; }
.gallery-bulk-heading strong { display: flex; align-items: center; }
.gallery-page-grid.is-selection-mode img { -webkit-user-drag: none; user-drag: none; }
.gallery-card-shell:has(.gallery-selection-label.is-selected) .gallery-page-card { border-color: rgba(255,255,255,.92); box-shadow: 0 0 0 3px rgba(255,255,255,.74), 0 0 0 5px rgba(255,255,255,.13); }
@media(max-width:700px){.gallery-bulk-toolbar{min-height:2.8rem}.gallery-bulk-toolbar:has(.gallery-bulk-options[hidden]){height:2.8rem}.gallery-bulk-heading{height:2.8rem}}

/* La ligne d’actions reste exactement au centre de la barre. */
.gallery-bulk-toolbar { align-content: center; }
.gallery-bulk-heading { align-items: center; height: 2.45rem; }
.gallery-bulk-heading strong, .gallery-bulk-selection-actions { align-self: center; }
@media(max-width:700px){.gallery-bulk-heading{height:2.3rem}}
@media(max-width:700px){.gallery-selection-label{top:.28rem;left:.28rem;width:2.1rem;height:2.1rem}.gallery-selection-label::before{font-size:1.55rem}}
@media(max-width:700px){.gallery-bulk-toolbar{top:50px;width:100%;margin:0;padding:.42rem .5rem;border-radius:0}.gallery-bulk-selection-actions .btn{font-size:.72rem}.gallery-bulk-selection-actions .btn i,.gallery-bulk-selection-actions .btn > .fa-solid{font-size:.95rem}}
@media(max-width:700px){.gallery-bulk-toolbar{top:50px;margin:.35rem .4rem 0;padding:.4rem .5rem}.gallery-bulk-heading{align-items:center;flex-direction:row}.gallery-bulk-heading strong{font-size:.72rem}.gallery-bulk-selection-actions .btn:not(.gallery-bulk-more):not(.gallery-bulk-delete){font-size:0;padding-inline:.45rem}.gallery-bulk-selection-actions .btn:not(.gallery-bulk-more):not(.gallery-bulk-delete)::before{font-size:.75rem}.gallery-bulk-selection-actions #btnSelectVisibleGallery::before{content:'✓';}.gallery-bulk-selection-actions #btnClearGallerySelection::before{content:'×';}.gallery-bulk-score-select{width:100%;min-width:0}.gallery-bulk-action-row{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center}.gallery-bulk-action-row .btn{grid-column:1 / -1;width:100%}.gallery-bulk-groups{grid-template-columns:repeat(2,minmax(0,1fr));display:grid}.gallery-bulk-groups legend{grid-column:1 / -1}.gallery-bulk-options{padding-top:.45rem}.gallery-selection-label{top:.35rem;left:.35rem;width:2rem;height:2rem}}

/* Commandes de sélection cohérentes : le cercle vide signifie « tout sélectionner ». */
#btnSelectVisibleGallery > .fa-circle,
#btnSelectVisibleGallery > .fa-circle-check { font-size: .92rem; line-height: 1; }
#btnClearGallerySelection > .fa-xmark { font-size: 1.18rem; line-height: 1; }
@media(max-width:700px){
  .gallery-bulk-selection-actions #btnSelectVisibleGallery::before,
  .gallery-bulk-selection-actions #btnClearGallerySelection::before { content: none; }
  .gallery-bulk-selection-actions #btnSelectVisibleGallery,
  .gallery-bulk-selection-actions #btnClearGallerySelection { width: 2.08rem; min-width: 2.08rem; height: 2.08rem; padding: 0; }
  .gallery-bulk-selection-actions #btnSelectVisibleGallery > .fa-circle,
  .gallery-bulk-selection-actions #btnSelectVisibleGallery > .fa-circle-check { font-size: 1.22rem; }
  .gallery-bulk-selection-actions #btnClearGallerySelection > .fa-xmark { font-size: 1.38rem; }
}

/* Les réglages d'application constituent une seconde ligne complète sous les actions de sélection. */
.gallery-bulk-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; height: auto; gap: .5rem; }
.gallery-bulk-toolbar:has(.gallery-bulk-options[hidden]) { height: 3.1rem; }
.gallery-bulk-heading { width: 100%; height: 2.45rem; }
.gallery-bulk-options { width: 100%; padding: .05rem 0 .2rem; }
@media(max-width:700px){
  .gallery-bulk-toolbar:has(.gallery-bulk-options[hidden]) { height: 2.8rem; }
  .gallery-bulk-heading { height: 2.3rem; }
}

/* Barre mobile : quatre commandes compactes, lisibles et réellement centrées. */
@media(max-width:700px){
  .gallery-bulk-heading { gap: .45rem; }
  .gallery-bulk-selection-actions { width: auto; margin-left: auto; flex: 0 0 auto; flex-wrap: nowrap; gap: .38rem; }
  .gallery-bulk-selection-actions .btn,
  .gallery-bulk-selection-actions #btnSelectVisibleGallery,
  .gallery-bulk-selection-actions #btnClearGallerySelection,
  .gallery-bulk-selection-actions .gallery-bulk-more,
  .gallery-bulk-selection-actions .gallery-bulk-delete {
    display: grid;
    flex: 0 0 2.18rem;
    width: 2.18rem;
    min-width: 2.18rem;
    height: 2.18rem;
    min-height: 2.18rem;
    padding: 0;
    place-items: center;
    border-radius: .58rem;
  }
  .gallery-bulk-selection-actions .btn > i { display: grid; width: 1.12rem; height: 1.12rem; place-items: center; line-height: 1; }
  /* Le cercle est dessiné plutôt que dépendre de la police « regular », absente sur certains téléphones. */
  .gallery-bulk-selection-actions #btnSelectVisibleGallery > i {
    position: relative;
    box-sizing: border-box;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 0 !important;
  }
  .gallery-bulk-selection-actions #btnSelectVisibleGallery.is-active > i { background: currentColor; }
  .gallery-bulk-selection-actions #btnSelectVisibleGallery.is-active > i::after {
    content: '✓';
    color: #111113;
    font-family: Arial, sans-serif;
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
  }
  .gallery-bulk-selection-actions #btnClearGallerySelection > .fa-xmark { font-size: 1.35rem !important; }
  .gallery-bulk-selection-actions .gallery-bulk-more > .fa-plus,
  .gallery-bulk-selection-actions .gallery-bulk-delete > .fa-trash { font-size: 1.08rem !important; }
}

/* Même repère de sélection sur ordinateur et téléphone, sans changement d'icône au chargement. */
#btnSelectVisibleGallery > i {
  position: relative;
  display: grid;
  box-sizing: border-box;
  width: 1.05rem;
  height: 1.05rem;
  place-items: center;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 0 !important;
  line-height: 1;
  transition: none;
}
#btnSelectVisibleGallery.is-active { border-color: rgba(255,255,255,.72) !important; background: #25252a !important; color: #f2f2f2 !important; }
#btnSelectVisibleGallery.is-active > i { border-color: #f2f2f2; background: #f2f2f2; }
#btnSelectVisibleGallery.is-active > i::after { content: '✓'; color: #111113; font-family: Arial, sans-serif; font-size: .74rem; font-weight: 900; line-height: 1; }
@media(max-width:700px){
  .gallery-bulk-selection-actions #btnSelectVisibleGallery > i { width: 1.12rem; height: 1.12rem; }
}

/* Ordinateur : réglages visibles directement, bouton plus réservé au téléphone. */
#btnToggleBulkOptions { display: inline-grid; }
@media(min-width:701px){
  .gallery-bulk-toolbar { position: sticky; overflow: visible; }
  .gallery-bulk-toolbar:has(.gallery-bulk-options:not([hidden])) { padding-bottom: 0; }
  .gallery-bulk-options {
    position: absolute;
    top: calc(100% + .5rem);
    right: 1.25rem;
    z-index: 120;
    width: min(38rem, calc(100vw - 2.5rem));
    gap: .62rem;
    padding: .7rem;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--radius-md);
    background: rgba(32,32,36,.98);
    box-shadow: 0 12px 28px rgba(0,0,0,.38);
  }
  .gallery-bulk-category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .65rem; }
  .gallery-bulk-category-row .gallery-bulk-groups { width: 100%; min-width: 0; }
  .gallery-bulk-category-row #btnApplyBulkGroups { width: auto; white-space: nowrap; }
}
@media(max-width:700px){ #btnToggleBulkOptions { display: grid; } }

/* Panneau d'actions groupées : mêmes proportions, quelles que soient les catégories. */
.gallery-bulk-options { gap: .78rem; }
.gallery-bulk-action-row { display: grid; grid-template-columns: 3.45rem minmax(0, 1fr) auto; align-items: center; gap: .62rem; }
.gallery-bulk-action-label { min-width: 0; }
.gallery-bulk-score-select { min-width: 0; width: 100%; }
.gallery-bulk-score-select .gallery-custom-select-trigger,
.gallery-bulk-action-row > .btn,
.gallery-bulk-category-row #btnApplyBulkGroups { min-height: 2.2rem; box-sizing: border-box; }
.gallery-bulk-action-row > .btn,
.gallery-bulk-category-row #btnApplyBulkGroups { padding-inline: .78rem; white-space: nowrap; }
.gallery-bulk-category-row { grid-template-columns: minmax(0, 1fr) auto; }
.gallery-bulk-category-row .gallery-bulk-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.4rem, 1fr));
  width: 100%;
  max-height: 11rem;
  gap: .48rem .65rem;
  overflow: auto;
  overscroll-behavior: contain;
  padding: .58rem .65rem .65rem;
}
.gallery-bulk-groups legend { margin-bottom: .25rem; }
.gallery-bulk-groups label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media(max-width:700px){
  /* Le filtre devient un bouton flottant : il ne déplace pas le nom centré
     et son panneau s'ouvre naturellement vers le haut. */
  body.gallery-page #btnToggleGalleryFilters {
    position: fixed;
    right: .8rem;
    bottom: calc(max(.8rem, env(safe-area-inset-bottom)) + .48rem);
    z-index: 190;
    margin: 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  body.gallery-page #btnToggleGalleryFilters i { display: grid; width: 1em; height: 1em; place-items: center; line-height: 1; }
  body.gallery-page .gallery-filter-panel {
    top: auto;
    right: .8rem;
    bottom: calc(max(.8rem, env(safe-area-inset-bottom)) + 3.8rem);
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .gallery-bulk-options { gap: .7rem; padding: .1rem 0 .65rem; }
  .gallery-bulk-action-row,
  .gallery-bulk-category-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .42rem; }
  .gallery-bulk-action-label { font-size: .72rem; }
  .gallery-bulk-score-select,
  .gallery-bulk-category-row .gallery-bulk-groups { grid-column: 1; width: 100%; }
  .gallery-bulk-action-row > .btn,
  .gallery-bulk-category-row #btnApplyBulkGroups { grid-column: 1; width: 100%; min-height: 2.28rem; }
  .gallery-bulk-category-row .gallery-bulk-groups { grid-template-columns: repeat(auto-fill, minmax(7.1rem, 1fr)); max-height: 10.5rem; }
}

/* Les catégories restent cumulables, avec des pastilles plutôt que des coches. */
.gallery-bulk-groups input,
.gallery-category-filter input {
  width: .9rem;
  height: .9rem;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid rgba(242,242,242,.82);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.gallery-bulk-groups input:checked,
.gallery-category-filter input:checked {
  border-color: #f2f2f2;
  background: radial-gradient(circle, #f2f2f2 0 34%, transparent 39%);
  box-shadow: none;
}

/* Gestion des groupes : lignes stables et alignement constant des actions. */
.gallery-group-management { gap: .72rem; padding: .78rem; }
.gallery-group-management-heading { gap: .18rem; line-height: 1.2; }
.gallery-group-management-heading small { line-height: 1.35; }
.gallery-group-add { align-items: stretch; gap: .52rem; }
.gallery-group-add input,
.gallery-group-add .btn { min-height: 2rem; box-sizing: border-box; }
.gallery-group-list { max-height: 15rem; gap: .22rem; overflow: auto; overscroll-behavior: contain; padding-right: .08rem; }
.gallery-group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 2rem;
  align-items: center;
  gap: .7rem;
  padding: 0 .05rem;
}
.gallery-group-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-group-row .group-system,
.gallery-group-row .group-delete { justify-self: end; min-width: 5.05rem; box-sizing: border-box; text-align: right; }
.gallery-group-row .group-system { display: inline-flex; min-height: 1.75rem; align-items: center; justify-content: flex-end; }
.gallery-group-row .group-delete { min-height: 1.75rem; padding: .25rem .48rem; text-align: center; }
@media(max-width:700px){
  .gallery-group-management { padding: .7rem; }
  .gallery-group-add .btn { min-width: 4.9rem; }
  .gallery-group-list { max-height: 13rem; }
}

/* Même comportement dans une fenêtre presque carrée : les commandes restent
   au format tactile et le filtre se place sur le dock inférieur. */
@media (min-width:701px) and (max-width:1100px) and (max-aspect-ratio:5/4){
  body.gallery-page #btnToggleGalleryFilters {
    position: fixed;
    right: .8rem;
    bottom: calc(max(.8rem, env(safe-area-inset-bottom)) + .48rem);
    z-index: 190;
    margin: 0;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  body.gallery-page #btnToggleGalleryFilters i { display: grid; width: 1em; height: 1em; place-items: center; line-height: 1; }
  body.gallery-page .gallery-filter-panel {
    top: auto;
    right: .8rem;
    bottom: calc(max(.8rem, env(safe-area-inset-bottom)) + 3.8rem);
    max-height: calc(100dvh - 4.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
