/* BrassageMusique — surcouche Bootstrap 5.3. Mobile d'abord. */

/* Pas de zoom du navigateur au double toucher (le pincement reste possible : accessibilité). Spécificité nulle : un composant (carte, signature…) peut redéfinir touch-action. */
:where(html, body, body *) { touch-action: manipulation; }

:root {
    --bm-primary: #4f46e5;
    --bm-primary-hover: #4338ca;
    --bm-primary-soft: #eef0ff;
    --bm-primary-text: #4338ca;
    --bm-bg: #f4f5fb;
    --bm-surface: #ffffff;
    --bm-border: #e6e8f1;
    --bm-muted-bg: #f3f4f9;
    --bm-radius: 14px;
    --sidebar-w: 268px;
    --bottom-nav-h: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);

    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4338ca;
    --bs-link-color-rgb: 67, 56, 202;
    --bs-link-hover-color: #3730a3;
    --bs-link-hover-color-rgb: 55, 48, 163;
    --bs-border-radius: .65rem;
    --bs-border-radius-lg: var(--bm-radius);
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-bs-theme="dark"] {
    --bm-primary-hover: #6366f1;
    --bm-primary-soft: #23264a;
    --bm-primary-text: #a5b4fc;
    --bm-bg: #0e1016;
    --bm-surface: #171a23;
    --bm-border: #272b3a;
    --bm-muted-bg: #1d212c;
    --bs-link-color: #a5b4fc;
    --bs-link-color-rgb: 165, 180, 252;
    --bs-link-hover-color: #c7d2fe;
    --bs-link-hover-color-rgb: 199, 210, 254;
    --bs-body-bg: #0e1016;
}

body { background: var(--bm-bg); -webkit-tap-highlight-color: transparent; }
.text-primary { color: var(--bm-primary-text) !important; }

/* ---- Boutons & champs : cibles tactiles confortables ---- */
.btn { --bs-btn-padding-y: .55rem; --bs-btn-padding-x: 1rem; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn-sm { min-height: 36px; --bs-btn-padding-y: .3rem; --bs-btn-padding-x: .7rem; }
.btn-primary {
    --bs-btn-bg: var(--bm-primary); --bs-btn-border-color: var(--bm-primary);
    --bs-btn-hover-bg: var(--bm-primary-hover); --bs-btn-hover-border-color: var(--bm-primary-hover);
    --bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
    --bs-btn-disabled-bg: var(--bm-primary); --bs-btn-disabled-border-color: var(--bm-primary);
    --bs-btn-focus-shadow-rgb: 79, 70, 229;
}
.btn-outline-primary {
    --bs-btn-color: var(--bm-primary-text); --bs-btn-border-color: var(--bm-primary);
    --bs-btn-hover-bg: var(--bm-primary); --bs-btn-hover-border-color: var(--bm-primary);
    --bs-btn-active-bg: var(--bm-primary); --bs-btn-active-border-color: var(--bm-primary);
}
.btn-icon { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--bs-body-color); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.btn-icon:hover { background: var(--bm-muted-bg); }
.form-control, .form-select { min-height: 46px; font-size: 1rem; }  /* 16px : pas de zoom auto sur iOS */
.form-control:focus, .form-select:focus { border-color: var(--bm-primary); box-shadow: 0 0 0 .25rem rgba(79, 70, 229, .18); }
.form-check-input:checked { background-color: var(--bm-primary); border-color: var(--bm-primary); }
.form-check-input { width: 1.25em; height: 1.25em; }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; }
.form-label { font-weight: 600; font-size: .9rem; }

.card { background: var(--bm-surface); border-color: var(--bm-border); border-radius: var(--bm-radius); }
.card-header { background: transparent; border-color: var(--bm-border); font-weight: 600; }
.modal-content, .dropdown-menu, .offcanvas { background: var(--bm-surface); border-color: var(--bm-border); }
.modal-content { border-radius: var(--bm-radius); }
.dropdown-menu { border-radius: 12px; padding: .4rem; }
.dropdown-item { border-radius: 8px; min-height: 40px; display: flex; align-items: center; }

/* ---- Structure : sidebar (desktop) / topbar + barre du bas (mobile) ---- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.1rem 1rem calc(var(--bottom-nav-h) + var(--safe-bottom) + 1.5rem); }

.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); flex-direction: column; background: var(--bm-surface); border-right: 1px solid var(--bm-border); padding: 1rem .75rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 700; font-size: 1.1rem; color: var(--bs-body-color); text-decoration: none; padding: .25rem .5rem; }
.brand img { object-fit: contain; }
.logo-emblem { object-fit: contain; }
:root:not([data-bs-theme="dark"]) .logo-dark, [data-bs-theme="dark"] .logo-light { display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; margin-top: .75rem; }
.sidebar .sidebar-nav { padding-right: .15rem; }
.sidebar-user { border-top: 1px solid var(--bm-border); padding-top: .75rem; }

.nav-section { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--bs-secondary-color); padding: 1rem .85rem .35rem; }
.nav-item-app { display: flex; align-items: center; gap: .8rem; min-height: 44px; padding: .55rem .85rem; border-radius: 10px; color: var(--bs-body-color); text-decoration: none; font-weight: 500; }
.nav-item-app i.bi:first-child { font-size: 1.2rem; width: 1.4rem; text-align: center; opacity: .8; }
/* Bandeau « voir en tant que » */
.viewas-bar { position: sticky; top: 0; z-index: 1040; display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; min-height: 46px; background: #f59e0b; color: #1f1300; font-size: .92rem; }
.viewas-bar ~ .topbar { top: 46px; }
.access-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; white-space: nowrap; }
.access-tabs .nav-link { color: var(--bs-body-color); }
.access-tabs .nav-link.active { font-weight: 700; }
/* Coche « certifié » (Super-Admin) */
.verified { color: #1d9bf0; display: inline-block; font-size: .95em; line-height: 1; vertical-align: -.1em; }
[data-bs-theme="dark"] .verified { color: #4db5ff; }
.nav-group-toggle { width: 100%; border: 0; background: none; text-align: left; font: inherit; font-weight: 500; margin-top: .25rem; }
.nav-group-toggle .nav-chevron { transition: transform .2s; }
.nav-group-toggle:not(.collapsed) .nav-chevron { transform: rotate(180deg); }
.nav-group { margin-left: 1.15rem; padding-left: .4rem; border-left: 2px solid var(--bm-muted-bg); }
.nav-sub { min-height: 40px; font-size: .95rem; }
.nav-item-app:hover { background: var(--bm-muted-bg); color: var(--bs-body-color); }
.nav-item-app.active { background: var(--bm-primary-soft); color: var(--bm-primary-text); font-weight: 700; }
.nav-item-app.active i.bi:first-child { opacity: 1; }

.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; min-height: calc(56px + var(--safe-top)); padding: var(--safe-top) .75rem 0 1rem; background: color-mix(in srgb, var(--bm-surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--bm-border); }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: var(--bm-surface); border-top: 1px solid var(--bm-border); padding-bottom: var(--safe-bottom); box-shadow: 0 -4px 20px rgba(0, 0, 0, .05); }
.bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--bottom-nav-h); padding: .35rem 0; border: 0; background: transparent; color: var(--bs-secondary-color); text-decoration: none; font-size: .72rem; font-weight: 600; }
.bottom-nav-item i { font-size: 1.4rem; line-height: 1; }
.bottom-nav-item.active { color: var(--bm-primary-text); }
.bottom-nav-item.active i { transform: translateY(-1px); }

@media (min-width: 992px) {
    .app-content { padding: 2rem 2.5rem 3rem; }
}

/* Pleine largeur pour les éditeurs (plan de scène…) */
.app-content.app-content-fluid { max-width: none; padding: .5rem .5rem calc(var(--bottom-nav-h) + var(--safe-bottom) + .75rem); }
@media (min-width: 992px) { .app-content.app-content-fluid { padding: .75rem; } }

/* ---- Utilisateur ---- */
.avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--bm-primary-soft); color: var(--bm-primary-text); font-weight: 700; font-size: .85rem; }
.avatar-lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.2rem; }
.avatar-xl { width: 96px; height: 96px; flex-basis: 96px; }
.avatar-photo { background: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-xs { width: 20px; height: 20px; flex-basis: 20px; font-size: .55rem; vertical-align: middle; margin-right: .25rem; }
.user-btn { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .4rem .5rem; border: 0; background: transparent; border-radius: 12px; color: var(--bs-body-color); text-align: left; }
.user-btn:hover { background: var(--bm-muted-bg); }
.user-btn.compact { width: auto; padding: .25rem; }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.user-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mail { font-size: .75rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu { position: relative; }
.sidebar-user .user-menu .dropdown-menu { min-width: 220px; }

/* ---- En-tête de page ---- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.page-title { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-subtitle { margin: .2rem 0 0; color: var(--bs-secondary-color); }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) {
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
}

/* ---- Tuiles de l'accueil ---- */
.tile-grid { display: grid; gap: .85rem; grid-template-columns: 1fr; }
@media (min-width: 576px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tile-grid { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: var(--bm-radius); color: var(--bs-body-color); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .08); border-color: var(--tone, var(--bm-primary)); color: var(--bs-body-color); }
.tile:active { transform: scale(.99); }
.tile-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.5rem; background: var(--tone-bg); color: var(--tone); }
.tile-title { font-weight: 700; }
.tile-desc { font-size: .85rem; color: var(--bs-secondary-color); line-height: 1.3; }
.tile-arrow { margin-left: auto; color: var(--bs-secondary-color); }

.tone-blue   { --tone: #2563eb; --tone-bg: #e3ecff; }
.tone-orange { --tone: #ea580c; --tone-bg: #ffecdc; }
.tone-purple { --tone: #7c3aed; --tone-bg: #efe6ff; }
.tone-green  { --tone: #059669; --tone-bg: #dcf6ea; }
.tone-gray   { --tone: #475569; --tone-bg: #e8ecf2; }
.tone-red    { --tone: #dc2626; --tone-bg: #fde4e4; }
[data-bs-theme="dark"] .tone-red    { --tone: #ff8f8f; --tone-bg: #4a1c1c; }
[data-bs-theme="dark"] .tone-blue   { --tone: #8fb0ff; --tone-bg: #1b2a4d; }
[data-bs-theme="dark"] .tone-orange { --tone: #ffa263; --tone-bg: #44270f; }
[data-bs-theme="dark"] .tone-purple { --tone: #c4a5ff; --tone-bg: #2f2250; }
[data-bs-theme="dark"] .tone-green  { --tone: #5ee0ad; --tone-bg: #11382a; }
[data-bs-theme="dark"] .tone-gray   { --tone: #b3bfd1; --tone-bg: #2a3040; }

.hello { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }

/* ---- Tableau de bord de l'accueil ---- */
.home-hero { display: flex; align-items: stretch; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: 1.25rem 1.35rem; border-radius: calc(var(--bm-radius) + 4px); color: #fff; text-decoration: none; overflow: hidden;
    background: linear-gradient(135deg, var(--bm-primary), #7c3aed); box-shadow: 0 10px 30px rgba(79, 70, 229, .25); transition: transform .12s ease, box-shadow .12s ease; }
.home-hero:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(79, 70, 229, .33); }
.home-hero-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: .35rem; }
.home-kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; opacity: .85; }
.home-hero-title { font-size: 1.6rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.home-hero-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; opacity: .95; }
.home-hero-meta i { margin-right: .25rem; }
.home-hero-date { flex: 0 0 5.2rem; align-self: center; padding: .6rem 0; border-radius: 1rem; text-align: center; line-height: 1.05; background: rgba(255, 255, 255, .18); }
.home-hero-date .d { display: block; font-size: 2.2rem; font-weight: 800; }
.home-hero-date .m { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.home-hero-poster { flex: 0 0 auto; align-self: center; height: 8.5rem; width: auto; max-width: 40%; object-fit: cover; border-radius: .75rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
@media (max-width: 575.98px) { .home-hero { padding: 1rem; } .home-hero-title { font-size: 1.3rem; } .home-hero-poster { height: 6.5rem; } .home-hero-date { flex-basis: 4.2rem; } }
.home-alerts { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .home-alerts { grid-template-columns: repeat(2, 1fr); } }
/* Raccourcis de l'accueil : petites tuiles (icône + libellé court dessous), plusieurs par ligne */
.shortcut-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(5.6rem, 1fr)); }
.shortcut { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .4rem; padding: .7rem .35rem .6rem; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: var(--bm-radius); color: var(--bs-body-color); text-decoration: none; text-align: center; min-width: 0; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.shortcut:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15, 23, 42, .08); border-color: var(--tone, var(--bm-primary)); color: var(--bs-body-color); }
.shortcut:active { transform: scale(.97); }
.shortcut-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; background: var(--tone-bg); color: var(--tone); }
.shortcut-label { font-size: .74rem; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; hyphens: auto; }
.tile-grid-compact .tile-desc { display: none; }
.tile-grid-compact .tile { padding: .75rem 1rem; }
.tile-grid-compact .tile-icon { width: 42px; height: 42px; flex-basis: 42px; font-size: 1.25rem; }

/* ---- Lignes de liste (utilisateurs, rôles…) ---- */
.row-card { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: var(--bm-radius); margin-bottom: .6rem; color: inherit; text-decoration: none; }
a.row-card:hover { border-color: var(--bm-primary); color: inherit; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: .83rem; color: var(--bs-secondary-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.badge-soft { background: var(--bm-primary-soft); color: var(--bm-primary-text); font-weight: 600; }
.badge-muted { background: var(--bm-muted-bg); color: var(--bs-secondary-color); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #9ca3af; }
.dot.on { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.row-inactive { opacity: .6; }

/* Concerts : pastille de date (jour + mois), compte à rebours, concert mis en avant */
.date-chip { flex: 0 0 3.1rem; width: 3.1rem; padding: .35rem 0; border-radius: .75rem; text-align: center; line-height: 1.1; background: var(--bm-primary-soft); color: var(--bm-primary-text); }
.date-chip .d { display: block; font-size: 1.3rem; font-weight: 700; }
.date-chip .m { display: block; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.row-card.is-next { border-color: var(--bm-primary); box-shadow: 0 0 0 1px var(--bm-primary) inset; }
/* Saisie de la répartition : grille à 5 colonnes sur ordinateur, cartes empilées (libellés visibles) sur téléphone */
.rep-head, .rep-row { display: grid; grid-template-columns: minmax(10rem, 1.6fr) minmax(8rem, 1fr) minmax(8rem, 1fr) 8.5rem 8.5rem; gap: .5rem .75rem; align-items: center; padding: .55rem .9rem; }
.rep-head { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); background: var(--bm-muted-bg); }
.rep-row { border-top: 1px solid var(--bm-border); }
.rep-row:has(.rep-check:checked) { background: var(--bm-primary-soft); }
.rep-name { display: flex; gap: .6rem; align-items: flex-start; min-width: 0; }
.rep-name .min-w-0 { min-width: 0; }
.rep-lbl { display: none; }
@media (max-width: 991.98px) {
    .rep-head { display: none; }
    .rep-row { grid-template-columns: 1fr 1fr; padding: .8rem .9rem; }
    .rep-row .rep-name, .rep-row .rep-cell-lieu, .rep-row .rep-cell-tr { grid-column: 1 / -1; }
    .rep-lbl { display: block; font-size: .72rem; color: var(--bs-secondary-color); margin-bottom: .15rem; }
}
.row-when { font-size: .78rem; font-weight: 600; white-space: nowrap; color: var(--bs-secondary-color); }

.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-icon { font-size: 3rem; margin-bottom: .5rem; color: var(--bs-secondary-color); }

.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); margin: 1.5rem 0 .6rem; }

/* ---- Matrice des droits ---- */
.matrix-wrap { overflow: auto; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: var(--bm-radius); max-height: 70vh; }
.matrix { margin: 0; width: 100%; border-collapse: separate; border-spacing: 0; }
.matrix th, .matrix td { padding: .6rem .75rem; border-bottom: 1px solid var(--bm-border); vertical-align: middle; background: var(--bm-surface); }
.matrix thead th { position: sticky; top: 0; z-index: 3; text-align: center; font-size: .82rem; white-space: nowrap; min-width: 96px; }
.matrix .perm-col { position: sticky; left: 0; z-index: 2; min-width: 210px; max-width: 280px; border-right: 1px solid var(--bm-border); }
.matrix thead .perm-col { z-index: 4; }
.matrix td.cell { text-align: center; }
.matrix tr.cat-row td { background: var(--bm-muted-bg); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--bs-secondary-color); position: sticky; left: 0; }
.matrix .perm-label { font-weight: 600; font-size: .92rem; line-height: 1.25; }
.matrix .perm-key { font-size: .72rem; color: var(--bs-secondary-color); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.matrix input[type=checkbox] { width: 1.35rem; height: 1.35rem; cursor: pointer; margin: 0; }
.matrix .is-hidden { display: none; }
.matrix .super-cell { color: var(--bm-primary-text); font-size: 1.1rem; }
.matrix tbody tr:hover td:not(.perm-col) { background: color-mix(in srgb, var(--bm-primary-soft) 55%, var(--bm-surface)); }
.savebar { position: sticky; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + .5rem); z-index: 5; margin-top: 1rem; padding: .75rem 1rem; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: var(--bm-radius); box-shadow: 0 8px 28px rgba(15, 23, 42, .12); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.savebar.dirty { border-color: var(--bm-primary); }
@media (min-width: 992px) { .savebar { bottom: 1rem; } }
@media (max-width: 767.98px) {
    .matrix .perm-col { min-width: 170px; max-width: 200px; }
    .matrix-wrap { max-height: none; }
}

/* ---- Pages d'authentification ---- */
.auth-body { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, rgba(79, 70, 229, .18), transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(234, 88, 12, .12), transparent 60%), var(--bm-bg); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: 22px; padding: 2rem 1.5rem; box-shadow: 0 20px 50px rgba(15, 23, 42, .1); }
@media (min-width: 480px) { .auth-card { padding: 2.25rem 2.25rem; } }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand img { object-fit: contain; }
.auth-brand-name { font-weight: 800; font-size: 1.35rem; margin-top: .5rem; letter-spacing: -.01em; }
.auth-title { font-size: 1.2rem; font-weight: 700; margin-bottom: .25rem; }

.input-group .btn { min-height: 46px; }

/* ---- Transfert de fichiers ---- */
.share-dropzone { border: 2px dashed var(--bm-border); border-radius: 16px; padding: 2.5rem 1rem; text-align: center; background: var(--bm-muted-bg); cursor: pointer; transition: border-color .15s, background .15s; }
.share-dropzone i { font-size: 3rem; color: var(--bs-secondary-color); display: block; margin-bottom: .4rem; }
.share-dropzone:hover, .share-dropzone:focus-visible, .share-dropzone.dragover { border-color: var(--bm-primary); background: var(--bm-primary-soft); outline: none; }

/* ---- Bibliothèque de partitions ---- */
.bp-crumbs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: .35rem; padding-bottom: .25rem; margin-bottom: .75rem; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.bp-crumbs a, .bp-crumbs span { padding: .3rem .65rem; border-radius: 999px; background: var(--bm-muted-bg); font-size: .85rem; text-decoration: none; color: var(--bs-body-color); }
.bp-crumbs span { background: var(--bm-primary-soft); color: var(--bm-primary-text); font-weight: 600; }
.bp-list .row-card { margin-bottom: 0; border-radius: 0; border-bottom-width: 0; }
.bp-list .row-card:first-child { border-top-left-radius: var(--bm-radius); border-top-right-radius: var(--bm-radius); }
.bp-list .row-card:last-child { border-bottom-left-radius: var(--bm-radius); border-bottom-right-radius: var(--bm-radius); border-bottom-width: 1px; }
.bp-name { font-weight: 500; word-break: break-word; white-space: normal; }
.bp-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.bp-sub { font-size: .8rem; color: var(--bs-secondary-color); word-break: break-word; }
.credit-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: var(--bm-surface); border: 1px solid var(--bm-border); font-weight: 600; }
@media (max-width: 575.98px) {
    .bp-list .row-card { flex-wrap: wrap; }
    .bp-list .row-main { flex-basis: 100%; }
    .bp-actions { width: 100%; justify-content: flex-start; }
}

/* ---- Sync Calendriers ---- */
.btn-sync-hero { border-radius: 50rem 0 0 50rem; padding: 12px 24px; font-weight: 600; }
.btn-group > .btn-sync-hero + .btn { border-radius: 0 50rem 50rem 0; padding-left: 18px; padding-right: 18px; }
.card-profile-header { cursor: pointer; transition: background-color .2s; }
.card-profile-header:hover { background: var(--bm-muted-bg) !important; }
.chevron-icon { transition: transform .3s ease; }
.collapsed .chevron-icon { transform: rotate(-90deg); }
.zone-danger { border: 1px dashed #dc3545; background: rgba(220, 53, 69, .06); border-radius: 12px; }
.card-dashed { border: 2px dashed var(--bm-primary); background: rgba(79, 70, 229, .04); }
.gcal-spinner { display: flex; align-items: center; justify-content: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
@media (max-width: 575.98px) {
    .btn-sync-hero { padding: 12px 16px; font-size: .95rem; }
}

/* ---- Signature : suivi des campagnes ---- */
.sign-tl-item { position: relative; list-style: none; padding: 0 0 1rem 2.6rem; }
.sign-timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.sign-timeline::before { content: ''; position: absolute; top: 14px; bottom: 14px; left: 15px; width: 2px; background: var(--bm-border); }
.sign-tl-item:last-child { padding-bottom: 0; }
.sign-tl-icon { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bm-surface); border: 2px solid var(--bm-border); color: var(--bs-secondary-color); z-index: 1; }
.sign-tl-item.signed .sign-tl-icon { background: #10b981; border-color: #10b981; color: #fff; }
.sign-tl-item.active .sign-tl-icon { border-color: #f59e0b; color: #f59e0b; }
.sign-tl-item.waiting .sign-tl-icon { background: var(--bm-muted-bg); }
.sign-tpl-card { transition: transform .15s, box-shadow .15s, border-color .15s; }
.sign-tpl-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(15, 23, 42, .08); border-color: var(--bm-primary); }

/* ---- Divers ---- */
.d-contents { display: contents; }
.min-w-0 { min-width: 0; }
.perm-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px; background: var(--bm-muted-bg); font-size: .78rem; margin: 0 .3rem .3rem 0; }
.role-check { display: flex; align-items: flex-start; gap: .7rem; padding: .75rem .9rem; border: 1px solid var(--bm-border); border-radius: 12px; margin-bottom: .5rem; background: var(--bm-surface); }
.role-check.disabled { opacity: .6; }
.home-notice { background: var(--bm-primary-soft); color: var(--bm-primary-text); border-left: 4px solid var(--bm-primary) !important; }
.tile-urgent { border-color: var(--tone); border-width: 2px; background: var(--tone-bg); }
.tile-urgent .tile-title { color: var(--tone); }
.home-birthday { background: linear-gradient(90deg, #fff4d6, #ffe3ec); color: #6b2b3a; }
@media (prefers-color-scheme: dark) { .home-birthday { background: linear-gradient(90deg, #4a3a14, #4a1f2e); color: #ffe3ec; } }
.home-notice a { color: inherit; text-decoration: underline; }
/* Feuille de route : récapitulatif, tableau de bord des présences */
.fr-recap { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.fr-recap-item { display: flex; align-items: center; gap: .65rem; padding: .65rem .85rem; background: var(--bm-surface); border: 1px solid var(--bm-border); border-radius: var(--bm-radius); min-width: 0; }
.fr-recap-item > i { font-size: 1.25rem; color: var(--bm-primary); flex: 0 0 auto; }
.fr-recap-item span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.fr-recap-item small { color: var(--bs-secondary-color, #6b7280); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.fr-recap-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.fr-stat { display: flex; flex-direction: column; align-items: center; padding: .6rem .4rem; border-radius: var(--bm-radius); border: 1px solid var(--bm-border); background: var(--bm-surface); border-top-width: 3px; }
.fr-stat b { font-size: 1.5rem; line-height: 1.1; }
.fr-stat span { font-size: .75rem; color: var(--bs-secondary-color, #6b7280); }
.fr-stat-ok { border-top-color: var(--bs-success, #198754); } .fr-stat-ko { border-top-color: var(--bs-danger, #dc3545); }
.fr-stat-warn { border-top-color: var(--bs-warning, #ffc107); } .fr-stat-info { border-top-color: var(--bs-info, #0dcaf0); }
.fr-group { margin-bottom: 1.1rem; }
.fr-group-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 .25rem .35rem; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color, #6b7280); }
.fr-count { font-weight: 500; text-transform: none; letter-spacing: 0; }
.fr-avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: .75rem; }
.fr-row.is-absent { border-left: 3px solid var(--bs-danger, #dc3545); }
.fr-state { display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 600; vertical-align: middle; }
.fr-state-ok { background: rgba(25, 135, 84, .14); color: var(--bs-success, #198754); }
.fr-state-ko { background: rgba(220, 53, 69, .14); color: var(--bs-danger, #dc3545); }
.fr-state-warn { background: rgba(255, 193, 7, .22); color: #8a6d00; }
.fr-state-info { background: rgba(13, 202, 240, .18); color: #0a6c80; }
@media (max-width: 520px) { .fr-stats { grid-template-columns: repeat(2, 1fr); } }
.role-grip { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 38px; margin-left: -.35rem; color: var(--bs-secondary-color, #6b7280); cursor: grab; touch-action: none; user-select: none; font-size: 1.2rem; }
.role-grip-off { cursor: default; opacity: .35; font-size: .85rem; }
.role-dragging { position: relative; z-index: 5; box-shadow: 0 8px 22px rgba(0, 0, 0, .22); transition: none; }
.role-dragging .role-grip { cursor: grabbing; }
.role-check .form-check-input { margin-top: .2rem; flex: 0 0 auto; }
.role-check label { flex: 1; cursor: pointer; }
.alert { border-radius: 12px; }
.filter-bar { position: relative; margin-bottom: 1rem; }
.filter-bar .bi-search { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); }
.filter-bar .form-control { padding-left: 2.5rem; }
.table-audit td { vertical-align: top; font-size: .88rem; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* Placement de l'harmonie : pastilles de couleur (boutons radio masqués) */
.swatches { display: flex; flex-wrap: wrap; gap: .35rem; max-width: 9rem; }
.swatch { position: relative; margin: 0; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch span { display: block; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid var(--bm-border); }
.swatch input:checked + span { outline: 2px solid var(--bm-primary); outline-offset: 2px; }
.swatch input:focus-visible + span { outline: 2px solid var(--bm-primary); outline-offset: 2px; }
.swatch .none { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--bm-border) 4px 6px); }
.seat { display: grid; grid-template-columns: 1fr; gap: .5rem; padding: .7rem .85rem; background: var(--bm-surface); border: 1px solid var(--bm-border); border-left-width: 5px; border-radius: var(--bm-radius); margin-bottom: .5rem; }
@media (min-width: 768px) { .seat { grid-template-columns: minmax(8rem, 1.2fr) minmax(9.5rem, 1fr) minmax(7rem, 1.1fr) 9rem auto; align-items: center; } }
/* Programme web : éditeur visuel et statistiques */
.builder-card { border-radius: 1rem; margin-bottom: 1rem; background: var(--bm-surface); border: 1px solid var(--bm-border); }
.builder-card-header { padding: 1rem 1.1rem; cursor: pointer; border-radius: 1rem; }
.builder-card-header:hover { background: var(--bs-tertiary-bg); }
.builder-card .card-body { border-top: 1px solid var(--bm-border); }
.btn-action-circle { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.editor-toolbar { position: sticky; top: .5rem; z-index: 20; }
.preview-wrapper { background: var(--bs-tertiary-bg); border-radius: 1rem; padding: 1rem; border: 2px dashed var(--bm-border); }
#publicPreviewFrame { width: 100%; height: 80vh; border: 0; border-radius: .75rem; background: #fff; }
.pchart { display: flex; align-items: flex-end; gap: 2px; height: 11rem; padding-top: .5rem; }
.pchart .pbar { flex: 1 1 0; min-width: 2px; background: var(--bm-primary); border-radius: 3px 3px 0 0; opacity: .85; }
.pchart .pbar:hover { opacity: 1; }
.pchart-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--bs-secondary-color); margin-top: .25rem; }
.metric { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
/* Covoiturage : cartes Leaflet */
.covoit-map { height: 320px; border-radius: .75rem; border: 1px solid var(--bm-border); z-index: 0; }
.covoit-leg { border: 1px solid var(--bm-border); border-radius: var(--bm-radius); padding: 1rem; background: var(--bm-surface); margin-bottom: 1rem; }
.covoit-car { border: 1px solid var(--bm-border); border-radius: var(--bm-radius); padding: .85rem 1rem; background: var(--bm-surface); margin-bottom: .75rem; }

/* Portail public (covoiturage) */
.public-top { border-bottom: 1px solid var(--bm-border); background: var(--bm-surface); }
.public-top .container { display: flex; align-items: center; justify-content: space-between; padding-top: .6rem; padding-bottom: .6rem; }
.public-body { background: var(--bm-bg, var(--bs-body-bg)); }

/* ---- Dépôts de garantie : lignes compactes (une seule ligne sur grand écran) ---- */
.depot-row { flex-wrap: wrap; gap: .25rem .9rem; padding: .35rem .75rem; margin-bottom: .3rem; }
.depot-who { flex: 1 1 15rem; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .6rem; }
.depot-info { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; flex: 0 1 auto; }
.depot-steps { display: flex; gap: .6rem; flex: 0 0 auto; }
.depot-row .dropdown { margin-left: auto; }
@media (min-width: 992px) { .depot-row { flex-wrap: nowrap; gap: .5rem .75rem; } .depot-who { flex: 1 1 11rem; } .depot-who .text-truncate { max-width: 11rem; } .depot-row .dropdown { margin-left: 0; } .depot-info { justify-content: flex-end; } }

/* ---- Barre du bas : pastille de non lus ---- */
.bottom-nav-item { position: relative; }
.bottom-nav-badge { position: absolute; top: 2px; left: 50%; margin-left: .35rem; min-width: 1.1rem; padding: 0 .3rem; border-radius: 999px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 700; line-height: 1.1rem; text-align: center; }

/* ---- Discussion ---- */
/* Conversation masquée jusqu'à ce que chat.js l'ait placée au bon endroit (dernier message ou premier non lu) : pas de défilement visible. Sans JavaScript : visible après 1,2 s. */
.chat-pending { visibility: hidden; animation: chat-show 0s 1.2s forwards; }
@keyframes chat-show { to { visibility: visible; } }
/* Invitation à installer l'application (assets/js/install.js) */
.install-banner { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: 1rem; padding: .75rem .9rem; border: 1px solid var(--bm-border); border-radius: 14px; background: var(--bm-surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.install-banner .install-icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 10px; background: color-mix(in srgb, #4f46e5 14%, transparent); color: #4f46e5; font-size: 1.25rem; }
.install-banner .install-text { flex: 1 1 auto; min-width: 0; }
.install-banner .btn-close { flex: 0 0 auto; }
/* En-tête de la conversation : collé sous la barre du haut (retour, nom du salon, actions), version compacte */
.chat-head { position: sticky; top: calc(56px + var(--safe-top)); z-index: 1010; background: var(--bm-bg); border-bottom: 1px solid var(--bm-border); margin-bottom: .75rem; }
body:has(.viewas-bar) .chat-head { top: calc(102px + var(--safe-top)); }
.chat-head { display: flex; align-items: center; gap: .15rem; }
.chat-back { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; margin-left: -.5rem; border-radius: 50%; font-size: 1.4rem; color: var(--bs-body-color); text-decoration: none; }
.chat-back:hover, .chat-back:active { background: var(--bs-secondary-bg); color: var(--bs-body-color); }
.chat-head .page-header { flex: 1 1 auto; min-width: 0; margin: 0; padding: .4rem 0; flex-wrap: nowrap; align-items: center; gap: .5rem; }
.chat-head .page-header > div:first-child { min-width: 0; flex: 1 1 auto; }
.chat-head .page-title { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head .page-subtitle { display: none; }
.chat .chat-unread-sep, .chat .chat-day, .chat .chat-msg { scroll-margin-top: calc(130px + var(--safe-top)); }   /* ne pas se cacher sous la barre et l'en-tête collés */
.chat-head .page-actions { flex: 0 0 auto; width: auto; display: flex; flex-wrap: nowrap; gap: .35rem; }   /* le réglage mobile général (100 % de large) écrasait le titre */
.chat-head .page-actions .btn { flex: 0 0 auto; padding-inline: .6rem; }
.chat { padding-bottom: 7rem; max-width: 720px; margin: 0 auto; overflow-anchor: none; }   /* pas d'ancrage auto : chat.js compense lui-même l'ajout de messages plus anciens */
.chat-msg { display: flex; justify-content: flex-start; margin-bottom: .75rem; }
.chat-msg.chat-cont { margin-top: -.5rem; }
.chat-mine { justify-content: flex-end; }
.chat-bubble { position: relative; max-width: 85%; min-width: 4.5rem; padding: .4rem .6rem .3rem; border-radius: .8rem; border-top-left-radius: .2rem; background: var(--bm-surface); border: 1px solid var(--bm-border); box-shadow: 0 1px 1px rgba(0,0,0,.05); cursor: pointer; }
.chat-cont .chat-bubble { border-top-left-radius: .8rem; }
.chat-mine .chat-bubble { background: #d9fdd3; border-color: transparent; border-top-left-radius: .8rem; border-top-right-radius: .2rem; }
.chat-mine.chat-cont .chat-bubble { border-top-right-radius: .8rem; }
:root[data-theme="dark"] .chat-mine .chat-bubble { background: #144d37; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-mine .chat-bubble { background: #144d37; } }
.chat-author { font-size: .8rem; font-weight: 700; color: var(--bm-primary-text); }
.chat-body { overflow-wrap: anywhere; line-height: 1.4; }
.chat-body a { text-decoration: underline; }
.chat-meta { float: right; margin: .35rem 0 0 .6rem; font-size: .68rem; line-height: 1; color: var(--bs-secondary-color); white-space: nowrap; }
.chat-body + .chat-meta, .chat-meta { position: relative; top: .1rem; }
.chat-ticks { margin-left: .15rem; font-size: .95rem; vertical-align: -.1em; }
.chat-ticks.chat-read { color: #34b7f1; }
.chat-gone .chat-bubble { cursor: default; }
.chat-quote { display: block; margin-bottom: .3rem; padding: .25rem .5rem; border-left: 4px solid var(--bm-primary); border-radius: .35rem; background: rgba(0,0,0,.06); color: inherit; text-decoration: none; font-size: .82rem; overflow: hidden; }
.chat-quote-author { display: block; font-weight: 700; color: var(--bm-primary-text); }
.chat-quote-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.chat-img { display: block; max-width: 100%; max-height: 320px; border-radius: .5rem; margin-bottom: .25rem; }
.chat-audio { display: block; width: 100%; max-width: 260px; height: 40px; }
.chat-file { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; padding: .5rem .6rem; border-radius: .5rem; background: rgba(0,0,0,.06); color: inherit; text-decoration: none; }
.chat-file .min-w-0 { min-width: 0; }
.chat-reacts { clear: both; display: flex; flex-wrap: wrap; gap: .25rem; }
.chat-reacts:not(:empty) { margin-top: .35rem; }
.chat-react { padding: .05rem .4rem; border: 1px solid var(--bm-border); border-radius: 999px; background: var(--bm-surface); color: inherit; font-size: .8rem; line-height: 1.4; }
.chat-react.mine { border-color: var(--bm-primary); background: var(--bm-primary-soft); }
.chat-actions { clear: both; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--bm-border); cursor: default; }
.chat-emoji { padding: .1rem .35rem; border: 0; border-radius: .5rem; background: none; font-size: 1.35rem; line-height: 1.3; }
.chat-emoji:active, .chat-emoji:hover { background: var(--bm-primary-soft); }
.chat-day { display: flex; justify-content: center; margin: 1rem 0 .75rem; }
.chat-day span { padding: .15rem .75rem; border-radius: .5rem; background: var(--bm-surface); border: 1px solid var(--bm-border); color: var(--bs-secondary-color); font-size: .75rem; font-weight: 600; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.chat-flash .chat-bubble { animation: chatflash 2s ease-out; }
@keyframes chatflash { from { box-shadow: 0 0 0 3px var(--bm-primary); } to { box-shadow: 0 0 0 0 transparent; } }
.chat-down { position: fixed; right: 1rem; bottom: calc(60px + 5.2rem + env(safe-area-inset-bottom)); z-index: 1030; width: 2.6rem; height: 2.6rem; border: 1px solid var(--bm-border); border-radius: 50%; background: var(--bm-surface); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.chat-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(60px + 6rem + env(safe-area-inset-bottom)); z-index: 1060; max-width: 90vw; padding: .5rem 1rem; border-radius: .6rem; background: #1f2937; color: #fff; font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
.chat-toast.show { opacity: 1; }
.chat-composer { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 1020; padding: .5rem .75rem; background: var(--bm-bg); border-top: 1px solid var(--bm-border); }
.chat-compose-row { display: flex; gap: .5rem; align-items: flex-end; max-width: 720px; margin: 0 auto; }
.chat-compose-row textarea { resize: none; flex: 1; border-radius: 1.2rem; padding: .5rem .9rem; max-height: 140px; }
.chat-attach, .chat-send { flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.chat-compose-top { display: flex; align-items: center; gap: .5rem; max-width: 720px; margin: 0 auto .4rem; padding: .3rem .6rem; border-left: 4px solid var(--bm-primary); border-radius: .4rem; background: var(--bm-surface); font-size: .85rem; }
.chat-compose-quote { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-compose-quote strong { display: block; color: var(--bm-primary-text); }
.chat-composer.sending { opacity: .6; pointer-events: none; }
.chat-readonly { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 1020; padding: .5rem 1rem; background: var(--bm-surface); border-top: 1px solid var(--bm-border); }
@media (min-width: 992px) {
    .chat-composer, .chat-readonly { left: var(--sidebar-w); bottom: 0; }
}

/* ---- Boutons d'action avec légende : icône + petit texte dessous sur téléphone (on ne devine pas toujours à quoi sert une icône), texte à côté dès 576 px ---- */
.btn-act { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: .35rem .3rem; line-height: 1; }
.btn-act > i { font-size: 1.15rem; line-height: 1; }
.btn-act .act-label { font-size: .62rem; font-weight: 600; line-height: 1.05; letter-spacing: .01em; text-align: center; white-space: nowrap; }
@media (min-width: 576px) {
    .btn-act { flex-direction: row; gap: .4rem; padding: .375rem .75rem; line-height: 1.5; }
    .btn-act > i { font-size: 1rem; line-height: inherit; }
    .btn-act .act-label { font-size: inherit; font-weight: inherit; letter-spacing: normal; }
}

/* ---- Informations : sections repliables ---- */
.info-summary { display: flex; align-items: center; gap: .85rem; padding: .9rem 1rem; cursor: pointer; list-style: none; }
.info-summary::-webkit-details-marker { display: none; }
.info-title { flex: 1; min-width: 0; }
.info-chev { transition: transform .15s; color: var(--bs-secondary-color); }
.info-section:not([open]) .info-chev { transform: rotate(-90deg); }
.info-section[open] > .info-summary { padding-bottom: .6rem; }
.info-doc { padding: .7rem 0; }
.info-doc + .info-doc { border-top: 1px solid var(--bm-border); }

/* ---- Informations : widget de paiement HelloAsso (iframe) ---- */
.ha-frame { border: 1px solid var(--bm-border); border-radius: 14px; overflow: hidden; background: #fff; }
/* HelloAsso n'a pas de thème sombre et son contenu ne se stylise pas de l'extérieur : en sombre, on l'encadre comme une carte blanche. */
[data-bs-theme="dark"] .ha-frame { padding: .5rem; border-color: rgba(255, 255, 255, .25); }
[data-bs-theme="dark"] .ha-frame iframe { border-radius: 9px; }
.ha-frame iframe { display: block; width: 100%; height: 760px; max-height: 6000px; border: 0; background: #fff; }

/* ---- Discussion : onglets par orchestre (pastille rouge = à lire) ---- */
.chat-tabs { display: flex; gap: .4rem; overflow-x: auto; margin: 1rem 0 .75rem; padding-bottom: .15rem; }
.chat-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--bm-border); background: var(--bm-surface); color: inherit; border-radius: 999px; padding: .4rem .9rem; font-weight: 600; font-size: .9rem; }
.chat-tab.active { background: var(--bm-primary, #2563eb); border-color: var(--bm-primary, #2563eb); color: #fff; }
#unread { scroll-margin-top: 4.5rem; }
/* ---- Discussion : non lus mis en avant ---- */
.chat-unread { border-left: 4px solid #dc2626; }
.chat-unread .row-title { font-weight: 800; }
.chat-unread-sep { display: flex; align-items: center; gap: .75rem; margin: .8rem 0; color: #dc2626; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.chat-unread-sep::before, .chat-unread-sep::after { content: ""; flex: 1; border-top: 1px solid #dc2626; opacity: .5; }

/* ---- Discussion : sondages (barres de résultat lisibles d'un coup d'œil) ---- */
.chat-has-poll .chat-bubble { width: min(28rem, 88%); max-width: 88%; }
.chat-poll { cursor: default; }
.poll-head { font-size: 1rem; line-height: 1.3; margin-bottom: .15rem; }
.poll-sub { font-size: .76rem; color: var(--bs-secondary-color); margin-bottom: .55rem; }
.poll-opt { margin-bottom: .4rem; }
.poll-btn { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .45rem .55rem; text-align: left; color: inherit; background: rgba(127,127,127,.09); border: 1.5px solid transparent; border-radius: .6rem; }
.poll-btn:disabled { opacity: 1; cursor: default; }
.poll-btn:not(:disabled):hover { background: rgba(127,127,127,.16); }
.poll-opt.mine .poll-btn { border-color: var(--bm-primary, #2563eb); background: rgba(37,99,235,.1); }
.poll-mark { font-size: 1.15rem; line-height: 1; color: var(--bs-secondary-color); flex-shrink: 0; }
.poll-opt.mine .poll-mark { color: var(--bm-primary, #2563eb); }
.poll-main { flex: 1; min-width: 0; display: block; }
.poll-label { display: block; font-size: .93rem; overflow-wrap: anywhere; }
.poll-opt.mine .poll-label { font-weight: 700; }
.poll-bar { display: block; height: .45rem; margin-top: .3rem; border-radius: 999px; background: rgba(127,127,127,.22); overflow: hidden; }
.poll-fill { display: block; height: 100%; border-radius: 999px; background: #94a3b8; transition: width .3s; }
.poll-opt.lead .poll-fill { background: var(--bm-primary, #2563eb); }
.poll-score { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; min-width: 2.6rem; line-height: 1.1; }
.poll-score strong { font-size: 1rem; }
.poll-score small { font-size: .72rem; color: var(--bs-secondary-color); }
.poll-who { margin: .15rem 0 0 2rem; font-size: .8rem; }
.poll-who summary { cursor: pointer; color: var(--bs-secondary-color); }
.poll-who > div { padding: .2rem 0 .1rem; overflow-wrap: anywhere; }
.poll-pending { margin-left: 0; margin-top: .4rem; }
.poll-foot { font-size: .78rem; margin-top: .3rem; }
.poll-tools { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }

/* ---- Orchestre : partitions par concert (liste compacte : concerts repliés, un volet par morceau) ---- */
.orch-head { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .9rem; background: none; border: 0; color: inherit; }
.orch-head .min-w-0 { min-width: 0; }
.orch-head .date-chip { flex-basis: 2.7rem; width: 2.7rem; padding: .2rem 0; }
.orch-head .date-chip .d { font-size: 1.1rem; }
.orch-chevron { transition: transform .15s; color: var(--bs-secondary-color); flex-shrink: 0; }
.orch-head[aria-expanded="true"] .orch-chevron, details[open] > summary > .orch-chevron { transform: rotate(180deg); }
.orch-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .4rem .9rem; border-top: 1px solid var(--bm-border); background: var(--bm-primary-soft); }
.orch-section { border-top: 1px solid var(--bm-border); }
.orch-section > summary { display: flex; align-items: center; gap: .55rem; padding: .4rem .9rem; cursor: pointer; list-style: none; font-weight: 600; font-size: .92rem; }
.orch-section > summary::-webkit-details-marker { display: none; }
.orch-sec-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.orch-file { display: flex; align-items: center; gap: .5rem; padding: .22rem .9rem .22rem 1.6rem; font-size: .88rem; }
.orch-file:hover { background: var(--bm-primary-soft); }
.orch-ico { font-size: 1.05rem; color: var(--bm-primary-text); flex-shrink: 0; }
.orch-name { flex: 1; min-width: 0; overflow-wrap: anywhere; text-decoration: none; color: inherit; }
.orch-name:hover { text-decoration: underline; }
.orch-dl { color: var(--bs-secondary-color); padding: 0 .25rem; flex-shrink: 0; }
.orch-dl:hover { color: var(--bm-primary-text); }

/* ---- Planning : dates, présences, calendrier ---- */
.plan-card { margin-bottom: .75rem; padding: .7rem .85rem; border: 1px solid var(--bm-border); border-left-width: 4px; border-radius: .8rem; background: var(--bm-surface); }
.plan-past { opacity: .7; }
.plan-head { display: flex; align-items: center; gap: .75rem; }
.plan-main { flex: 1; min-width: 0; }
.plan-title { font-weight: 700; overflow-wrap: anywhere; }
.plan-sub { font-size: .85rem; color: var(--bs-secondary-color); }
.plan-badge { font-weight: 600; vertical-align: .1em; }
.plan-notes { margin-top: .5rem; padding: .4rem .6rem; border-radius: .5rem; background: rgba(0,0,0,.04); font-size: .88rem; overflow-wrap: anywhere; }
.plan-me { font-size: 1.5rem; line-height: 1; }
.plan-s-present { color: #16a34a; }
.plan-s-peutetre { color: #d97706; }
.plan-s-absent { color: #dc2626; }
.plan-s-none { color: var(--bs-secondary-color); }
.plan-answer { margin-top: .6rem; display: flex; flex-direction: column; gap: .4rem; }
.plan-btns { display: flex; gap: .4rem; }
.plan-btn { flex: 1; padding: .45rem .3rem; border: 2px solid currentColor; border-radius: .6rem; background: transparent; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.plan-btn.plan-s-present.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.plan-btn.plan-s-peutetre.on { background: #d97706; border-color: #d97706; color: #fff; }
.plan-btn.plan-s-absent.on { background: #dc2626; border-color: #dc2626; color: #fff; }
.plan-comment { max-width: 100%; }
.plan-cal-nav { display: grid; grid-template-columns: 2.25rem 1fr 2.25rem; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.plan-cal-mid { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.plan-cal-title { text-align: center; font-size: 1.05rem; }
.plan-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; background: var(--bm-border); border: 1px solid var(--bm-border); border-radius: .6rem; overflow: hidden; }
.plan-cal-dow { padding: .25rem 0; background: var(--bm-surface); text-align: center; font-size: .75rem; font-weight: 700; color: var(--bs-secondary-color); }
.plan-cal-cell { min-height: 4.2rem; padding: .15rem .2rem; background: var(--bm-surface); overflow: hidden; }
.plan-cal-empty { background: var(--bm-bg); }
.plan-cal-num { display: block; font-size: .78rem; font-weight: 600; color: var(--bs-secondary-color); }
.plan-cal-today .plan-cal-num { display: inline-block; min-width: 1.4rem; text-align: center; border-radius: 999px; background: var(--bm-primary); color: #fff; }
.plan-pill { display: flex; align-items: center; gap: .2rem; margin-top: 2px; padding: 0 .25rem; border-radius: .3rem; border-left: 3px solid; background: rgba(0,0,0,.05); color: inherit; text-decoration: none; font-size: .68rem; line-height: 1.3; overflow: hidden; }
.plan-pill i { font-size: .7rem; flex: 0 0 auto; }
.plan-pill-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-more { display: block; font-size: .66rem; color: var(--bs-secondary-color); text-decoration: none; }
@media (max-width: 575.98px) {
    .plan-cal-cell { min-height: 3.2rem; }
    .plan-pill { justify-content: center; padding: 0; border-left-width: 0; background: none; }
    .plan-pill .plan-pill-t { display: none; }
    .plan-pill i { font-size: 1rem; }
    .plan-pill.plan-t-repetition i.bi-circle { color: #4f46e5; }
    .plan-pill.plan-t-concert i.bi-circle { color: #dc2626; }
    .plan-btn i { display: none; }
}
.plan-counts { display: inline-flex; gap: .6rem; font-size: .85rem; font-weight: 600; }
.plan-pres > summary { cursor: pointer; list-style: none; }
.plan-pres > summary::-webkit-details-marker { display: none; }
.plan-matrix-wrap { max-height: 70vh; border: 1px solid var(--bm-border); border-radius: .6rem; }
.plan-matrix { margin: 0; font-size: .85rem; }
.plan-matrix th, .plan-matrix td { white-space: nowrap; }
.plan-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--bm-surface); }
.plan-matrix-name { position: sticky; left: 0; z-index: 1; background: var(--bm-surface); min-width: 9rem; }
.plan-matrix thead .plan-matrix-name { z-index: 3; }
.plan-matrix-t { max-width: 6.5rem; font-weight: 400; }
.plan-matrix-group td { background: var(--bm-primary-soft); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.plan-answer.plan-busy { opacity: .6; pointer-events: none; }

/* ---- Planning : saisie rapide ---- */
.plan-quick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.plan-card { padding: .55rem .75rem; margin-bottom: .55rem; }
.plan-answer { margin-top: .45rem; gap: .3rem; position: relative; }
.plan-btn { padding: .55rem .2rem; font-size: .9rem; }
.plan-prec > summary { cursor: pointer; font-size: .8rem; color: var(--bs-secondary-color); list-style: none; }
.plan-prec > summary::-webkit-details-marker { display: none; }
.plan-prec[open] > summary { margin-bottom: .3rem; }
.plan-clear { align-self: flex-start; font-size: .78rem; }
.plan-card.plan-leaving { opacity: 0; transform: translateX(24px); transition: opacity .25s, transform .25s; }

/* ---- Planning : bulle de réponse du calendrier ---- */
.plan-dlg { width: min(26rem, calc(100vw - 1.5rem)); max-height: 85vh; padding: 1rem .9rem .6rem; border: 1px solid var(--bm-border); border-radius: 1rem; background: var(--bm-surface); color: var(--bs-body-color); box-shadow: 0 10px 40px rgba(0,0,0,.35); overflow: auto; }
.plan-dlg::backdrop { background: rgba(0,0,0,.45); }
.plan-dlg-close { position: absolute; top: .6rem; right: .6rem; }
.plan-dlg-body .plan-card { margin: 0 0 .6rem; padding-right: .3rem; border-width: 0 0 0 4px; background: transparent; }
.plan-dlg-body .plan-card + .plan-card { border-top: 1px solid var(--bm-border); border-radius: 0; padding-top: .8rem; }
.plan-dlg-body .plan-head { padding-right: 1.6rem; }
@media (max-width: 575.98px) {
    .plan-dlg { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 1rem 1rem 0 0; }
}
.plan-pill { cursor: pointer; }

.date-chip .plan-chip-end { margin-top: .1rem; padding-top: .1rem; border-top: 1px solid currentColor; font-size: .62rem; opacity: .85; }

.plan-pill.plan-cont { opacity: .75; border-left-style: dotted; }

/* ---- Planning : fondu de la bulle ---- */
.plan-dlg { opacity: 0; transform: translateY(8px) scale(.98); transition: opacity .2s ease, transform .2s ease; }
.plan-dlg.show { opacity: 1; transform: none; }
.plan-dlg::backdrop { opacity: 0; transition: opacity .2s ease; }
.plan-dlg.show::backdrop { opacity: 1; }
@media (max-width: 575.98px) {
    .plan-dlg { transform: translateY(24px); }
    .plan-dlg.show { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .plan-dlg, .plan-dlg::backdrop { transition: none; }
}

/* ---- Planning : couleurs des dates (type ou couleur personnalisée, variables --plan-c / --plan-ink) ---- */
.plan-t-repetition { --plan-c: #4f46e5; --plan-ink: #fff; }
.plan-t-concert { --plan-c: #dc2626; --plan-ink: #fff; }
.plan-t-special { --plan-c: #ca8a04; --plan-ink: #fff; }
.plan-t-autre { --plan-c: #6b7280; --plan-ink: #fff; }
.plan-card { border-left-color: var(--plan-c, #6b7280); }
.plan-pill { border-left-color: var(--plan-c, #6b7280); }
.plan-badge { background: var(--plan-c, #6b7280); color: var(--plan-ink, #fff); }
.plan-pill.plan-t-repetition i.bi-circle, .plan-pill.plan-t-concert i.bi-circle, .plan-pill.plan-t-special i.bi-circle, .plan-pill.plan-t-autre i.bi-circle { color: var(--plan-c); }
.plan-legend { display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: center; margin-bottom: .75rem; font-size: .8rem; color: var(--bs-secondary-color); }
.plan-legend .plan-dot { display: inline-block; width: .7rem; height: .7rem; margin-right: .3rem; border-radius: 50%; background: var(--plan-c); vertical-align: -.05em; }
.plan-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.plan-sw { position: relative; display: inline-flex; align-items: center; gap: .3rem; margin: 0; cursor: pointer; font-size: .8rem; }
.plan-sw > input[type="radio"] { position: absolute; opacity: 0; width: 1.6rem; height: 1.6rem; margin: 0; cursor: pointer; }
.plan-sw-dot { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--bm-border); color: #fff; font-size: .7rem; }
.plan-sw > input:checked + .plan-sw-dot { border-color: var(--bm-surface); box-shadow: 0 0 0 3px var(--bm-primary); }
.plan-sw > input:focus-visible + .plan-sw-dot { box-shadow: 0 0 0 3px var(--bm-primary); }
.plan-sw-def { background: linear-gradient(135deg, #4f46e5 33%, #dc2626 33% 66%, #ca8a04 66%); }
.plan-sw input[type="color"] { width: 1.9rem; height: 1.9rem; padding: 0; border: 0; background: none; cursor: pointer; }

/* ---- Planning : filtres par type (légende cliquable) ---- */
.plan-legend .plan-chip { display: inline-flex; align-items: center; padding: .15rem .65rem; border: 1px solid var(--bm-border); border-radius: 999px; background: var(--bm-surface); color: var(--bs-body-color); text-decoration: none; font-weight: 600; }
.plan-legend .plan-chip .plan-dot { margin-right: .4rem; }
.plan-legend .plan-chip.on { background: var(--plan-c, var(--bm-primary)); border-color: var(--plan-c, var(--bm-primary)); color: var(--plan-ink, #fff); }
.plan-legend .plan-chip.on .plan-dot { background: var(--plan-ink, #fff); }
.plan-cell { padding: 0 .3rem; border: 0; border-radius: .4rem; background: none; line-height: 1.4; cursor: pointer; }
.plan-cell:hover, .plan-cell:focus-visible { background: var(--bm-primary-soft); }
.plan-ed.plan-busy { opacity: .6; pointer-events: none; }
.plan-ed .plan-btns { gap: .35rem; }
.plan-bureau { margin-top: .3rem; }

/* ---- Planning : tableau des présences défilable au doigt, nom et date toujours visibles ---- */
.plan-matrix-wrap { max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); overflow: auto; -webkit-overflow-scrolling: touch; }
.plan-matrix th, .plan-matrix td { padding: .25rem .4rem; }
.plan-matrix thead th { min-width: 3.9rem; box-shadow: 0 2px 3px -2px rgba(0,0,0,.4); }
.plan-matrix-name { box-shadow: 2px 0 3px -2px rgba(0,0,0,.4); }
.plan-matrix thead .plan-matrix-name { z-index: 4; }
.plan-matrix-glabel { position: sticky; left: .5rem; z-index: 1; display: inline-block; }
.plan-matrix-total td { position: sticky; bottom: 0; z-index: 2; background: var(--bm-surface); border-top: 2px solid var(--bm-border); }
.plan-matrix-total td.plan-matrix-name { z-index: 3; }
.plan-cell { min-width: 2rem; min-height: 1.9rem; }
@media (max-width: 575.98px) {
    .plan-matrix-name { min-width: 6.6rem; max-width: 7.6rem; white-space: normal !important; line-height: 1.15; font-size: .8rem; }
    .plan-matrix { font-size: .8rem; }
}
/* ---- Planning (gestion) : calendrier des dates, bulle d'ajout / modification / duplication ---- */
.plan-cal-click { cursor: pointer; }
.plan-cal-click:hover { background: var(--bm-primary-soft); }
.plan-cal-click:focus-visible { outline: 2px solid var(--bm-primary); outline-offset: -2px; }
.plan-cal-admin .plan-pill i { display: none; color: var(--plan-c); }
.plan-cal-admin .plan-pill { background: color-mix(in srgb, var(--plan-c, #6b7280) 16%, transparent); }
@media (max-width: 575.98px) { .plan-cal-admin .plan-pill i { display: inline; font-size: .7rem; } .plan-cal-admin .plan-pill { background: none; } }
.plan-dlg.plan-dlg-wide { width: min(36rem, calc(100vw - 1.5rem)); }
@media (max-width: 575.98px) { .plan-dlg.plan-dlg-wide { width: 100vw; } }
.plan-day-row { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-top: 1px solid var(--bm-border); }
.plan-day-row .plan-dot { flex: 0 0 .75rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--plan-c); }
.plan-day .plan-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; background: var(--plan-c); }

/* ---- Planning (gestion) : dans la bulle, les champs de date et d'heure sur deux colonnes (4 colonnes étaient trop étroites pour un champ date) ---- */
.plan-dlg .plan-form > .col-md-3 { width: 50%; }
/* ---- Planning : bulle sur mobile, application épinglée à l'écran d'accueil (bords sûrs de l'iPhone, barre d'état, barres d'outils mobiles) ---- */
.plan-dlg { max-height: calc(100vh - 1.5rem); max-height: calc(100dvh - 1.5rem - env(safe-area-inset-top, 0px)); padding-bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.plan-dlg.plan-dlg-wide { padding-bottom: 0; }
/* les boutons Enregistrer / Dupliquer / Supprimer restent toujours visibles en bas de la bulle, quel que soit le défilement du formulaire */
.plan-dlg .plan-form-actions { position: sticky; bottom: 0; z-index: 3; margin-top: .6rem !important; padding: .6rem 0 calc(.6rem + env(safe-area-inset-bottom, 0px)); background: var(--bm-surface); border-top: 1px solid var(--bm-border); }
.plan-dlg .plan-form-actions.col-12 { width: 100%; }
.plan-dlg-body { padding-bottom: .4rem; }
@media (max-width: 575.98px) {
    .plan-dlg { max-height: calc(100vh - 3rem); max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px)); }
}
/* ---- Planning : bulle compacte sur téléphone (ancrée en haut : la hauteur dépend du contenu, jamais d'un calcul de hauteur d'écran) ---- */
.plan-more-opts > summary { cursor: pointer; font-size: .85rem; font-weight: 600; list-style: none; padding: .3rem 0; }
.plan-more-opts > summary::-webkit-details-marker { display: none; }
.plan-more-opts > summary::after { content: "▾"; margin-left: .35rem; }
.plan-more-opts[open] > summary::after { content: "▴"; }
.plan-more-opts[open] > summary { margin-bottom: .3rem; }
@media (max-width: 575.98px) {
    .plan-dlg, .plan-dlg.plan-dlg-wide { margin: calc(.5rem + env(safe-area-inset-top, 0px)) auto auto; width: calc(100vw - 1rem); max-width: calc(100vw - 1rem); border-radius: .9rem; max-height: 78vh; max-height: min(78vh, 78dvh); padding: .7rem .7rem .7rem; transform: translateY(-12px); }
    .plan-dlg.show, .plan-dlg.plan-dlg-wide.show { transform: none; }
    .plan-dlg.plan-dlg-wide { padding-bottom: 0; }
    .plan-dlg .plan-form { --bs-gutter-x: .5rem; --bs-gutter-y: .35rem; }
    .plan-dlg .form-control, .plan-dlg .form-select { padding: .3rem .5rem; font-size: .9rem; }
    .plan-dlg .form-label { font-size: .74rem !important; }
    .plan-dlg .form-label .text-body-secondary, .plan-dlg .plan-hint { display: none; }
    .plan-dlg .plan-form-actions { padding: .5rem 0 calc(.5rem + env(safe-area-inset-bottom, 0px)); margin-top: .3rem !important; }
    .plan-dlg-close { top: .4rem; right: .4rem; }
}
/* ---- Application épinglée (iPhone) : la barre du bas ne doit jamais disparaître ----
   Un élément « fixed » qui n'a pas sa propre couche de rendu peut s'effacer dans WebKit quand la mise en page change (clavier, boîtes de dialogue, zones défilantes) : on le promeut en couche. */
.bottom-nav { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); will-change: transform; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.chat-composer, .chat-readonly { -webkit-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
/* le tableau des présences ne dépend plus d'unités de hauteur d'écran mouvantes : hauteur fixée par planning.js */
.plan-matrix-wrap { max-height: 70vh; }

/* Planning du Brass Band : présents par rangée de chaises */
.plan-rows{display:flex;flex-wrap:wrap;gap:.35rem .5rem;align-items:center;margin:.4rem 0 .2rem;font-size:.82rem}
.plan-rows-t{font-weight:600;margin-right:.25rem}
.plan-row-chip{background:var(--bs-tertiary-bg);border:1px solid var(--bs-border-color);border-radius:999px;padding:.1rem .55rem;white-space:nowrap}
.plan-row-n{font-weight:700;color:var(--bs-success)}
