/* ==========================================================================
   Scenebase — design system
   Bleu pétrole #0369A1 en couleur d'accent (choisi le 2026-10-01 pour
   remplacer le bleu Google #1A73E8 d'origine, jugé trop "template" —
   voir design-history/v3-google-material/ pour l'ancienne palette),
   surfaces neutres, cartes arrondies, rail de navigation avec pastille active.
   ========================================================================== */

:root {
    --demo-banner-h: 0px; /* remplacé en JS par la vraie hauteur du bandeau, seulement en mode démo */
    --bg: #eef2f6;
    --bg-elevated: #ffffff;
    --bg-sunken: #e7ecf1;
    --border: #ccd3da;
    --text: #1b1f23;
    --text-muted: #4a5057;
    --text-faint: #5e6469;

    --accent: #0369a1;
    --accent-strong: #0369a1;
    --accent-soft: #e0f0fa;
    --on-accent: #ffffff;

    --success: #188038;
    --success-bg: #e6f4ea;
    --warning: #b06000;
    --warning-bg: #fef7e0;

    /* alias historiques (utilisés par les vues JS) */
    --teal-500: var(--success);
    --teal-600: var(--success);
    --rust-500: #d93025;
    --rust-600: #b3261e;
    --ink-800: #323232;

    --shadow-1: 0 1px 2px 0 rgba(8,38,51,.14), 0 1px 4px 1px rgba(8,38,51,.08);
    --shadow-2: 0 1px 3px 0 rgba(8,38,51,.16), 0 4px 10px 2px rgba(8,38,51,.10);

    --font-ui: "Plus Jakarta Sans", -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121a1f;
        --bg-elevated: #1c252c;
        --bg-sunken: #232d35;
        --border: #32404a;
        --text: #e7ecf0;
        --text-muted: #a7b0b8;
        --text-faint: #8b949c;
        --accent: #7dd3fc;
        --accent-soft: rgba(125,211,252,.16);
        --on-accent: #06344a;
        --success: #81c995;
        --success-bg: rgba(129,201,149,.14);
        --warning: #fdd663;
        --warning-bg: rgba(253,214,99,.14);
        --teal-500: var(--success); --teal-600: var(--success);
        --rust-500: #f28b82; --rust-600: #f28b82; --ink-800: #323232;
        --shadow-1: 0 1px 2px 0 rgba(0,0,0,.5), 0 1px 3px 1px rgba(0,0,0,.35);
        --shadow-2: 0 1px 3px 0 rgba(0,0,0,.5), 0 4px 8px 3px rgba(0,0,0,.35);
    }
}
:root[data-theme="dark"] {
    --bg: #121a1f; --bg-elevated: #1c252c; --bg-sunken: #232d35; --border: #32404a;
    --text: #e7ecf0; --text-muted: #a7b0b8; --text-faint: #8b949c;
    --accent: #7dd3fc; --accent-soft: rgba(125,211,252,.16); --on-accent: #06344a;
    --teal-500: #81c995; --teal-600: #81c995; --rust-500: #f28b82; --rust-600: #f28b82; --ink-800: #323232;
    --success: #81c995; --success-bg: rgba(129,201,149,.14);
    --warning: #fdd663; --warning-bg: rgba(253,214,99,.14);
    --shadow-1: 0 1px 2px 0 rgba(0,0,0,.5), 0 1px 3px 1px rgba(0,0,0,.35);
    --shadow-2: 0 1px 3px 0 rgba(0,0,0,.5), 0 4px 8px 3px rgba(0,0,0,.35);
}
:root[data-theme="light"] {
    --bg: #eef2f6; --bg-elevated: #ffffff; --bg-sunken: #e7ecf1; --border: #ccd3da;
    --text: #1b1f23; --text-muted: #4a5057; --text-faint: #5e6469;
    --accent: #0369a1; --accent-soft: #e0f0fa; --on-accent: #ffffff;
    --success: #188038; --success-bg: #e6f4ea;
    --warning: #b06000; --warning-bg: #fef7e0;
    --teal-500: #188038; --teal-600: #188038; --rust-500: #d93025; --rust-600: #b3261e; --ink-800: #323232;
    --shadow-1: 0 1px 2px 0 rgba(8,38,51,.14), 0 1px 4px 1px rgba(8,38,51,.08);
    --shadow-2: 0 1px 3px 0 rgba(8,38,51,.16), 0 4px 10px 2px rgba(8,38,51,.10);
}

html { color-scheme: light dark; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
}

* { border-color: var(--border); }

.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.bg-elevated { background: var(--bg-elevated); }
.bg-sunken { background: var(--bg-sunken); }
.border-default { border-color: var(--border); }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(from var(--text-faint) r g b / 35%); border-radius: 9999px; }

.tab-view { animation: fade-in .16s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .tab-view { animation: none; }
    * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

.skeleton-block {
    border-radius: 10px;
    background: linear-gradient(100deg, var(--bg-sunken) 30%, var(--border) 50%, var(--bg-sunken) 70%);
    background-size: 250% 100%;
    animation: skeleton-sweep 1.4s ease-in-out infinite;
}
.skeleton-circle { border-radius: 50%; }
@keyframes skeleton-sweep { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }

/* ---------- Structure ---------- */

.app-sidebar {
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    /* Sans ça, l'aside s'étire avec toute la hauteur de la page (flex par défaut) au lieu de
       rester à la hauteur de l'écran — sur un onglet au contenu long (Historique, Groupe...),
       le profil en bas (mt-auto) se retrouvait poussé loin sous la fenêtre visible. */
    position: sticky;
    top: var(--demo-banner-h);
    height: calc(100vh - var(--demo-banner-h));
    overflow-y: auto;
}

.brand-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}

/* ---------- Navigation (rail façon Gmail / Drive) ---------- */

.nav-item {
    display: flex; align-items: center; gap: .75rem;
    padding: .6rem .9rem;
    border-radius: 22px;
    font-size: .84rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: background-color .12s ease, color .12s ease;
    width: 100%;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: var(--bg-sunken); color: var(--text); }
.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.nav-item-mobile {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .2rem;
    padding: .5rem 0;
    color: var(--text-faint);
    font-size: .62rem;
    font-weight: 500;
    flex: 1;
}
.nav-item-mobile.active { color: var(--accent); font-weight: 600; }
/* 7 onglets dans la barre du bas : sur téléphone étroit, texte un peu plus petit et colonnes de même largeur. */
.nav-item-mobile { min-width: 0; flex: 1 1 0; }
@media (max-width: 420px) { .nav-item-mobile { font-size: .56rem; } }

/* ---------- Cartes ---------- */

.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-1);
}

.stub {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow-1);
}
.stub-label {
    font-size: .68rem;
    font-weight: 500;
    color: var(--text-muted);
}
.stub-value {
    font-variant-numeric: tabular-nums;
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -.01em;
}
.stub-sub { font-size: .74rem; color: var(--text-muted); }

/* ---------- Boutons / champs ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    border-radius: 999px;
    padding: .55rem 1.2rem;
    font-size: .84rem;
    font-weight: 500;
    transition: filter .12s ease, background-color .12s ease, box-shadow .12s ease;
    white-space: nowrap;
}
.btn:active { filter: brightness(.96); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-1); }
.btn-primary:hover { box-shadow: var(--shadow-2); }
.btn-secondary { background: var(--bg-elevated); color: var(--accent); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-sunken); }
.btn-ghost { color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
/* Bouton icône seule (pas de texte) : le padding généreux de .btn est pensé pour du texte +
   icône et prend beaucoup trop de place une fois répété plusieurs fois de suite (en-tête
   mobile : recherche, thème, messages, notifications), au point de tasser le reste de la
   ligne (avatar de profil compris). */
.btn-icon { padding: .45rem; }
.btn-danger { color: #d93025; }
.btn-danger:hover { background: rgba(217,48,37,.08); }

.field-label {
    display: block; font-size: .72rem; font-weight: 500;
    color: var(--text-muted); margin-bottom: .3rem;
}
.field {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .55rem .7rem;
    color: var(--text);
    font-size: .88rem;
}
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- Badges de statut ---------- */

.badge { display: inline-flex; align-items: center; padding: .18rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 500; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: rgb(from var(--rust-500) r g b / 12%); color: var(--rust-500); }
.badge-upcoming { background: rgba(153, 102, 204, .14); color: #9966cc; }
.badge-neutral { background: var(--accent-soft); color: var(--accent); }
.badge-info { background: rgba(66, 133, 244, .14); color: #4285f4; }

/* ---------- Interrupteur on/off (remplace les cases à cocher de préférence) ----------
   Réservé aux réglages on/off (notifications, filtres, "masquer"...) — les cases de
   sélection en masse dans les tableaux (colonnes "sélectionner") restent des checkbox
   classiques, la sémantique est différente (choisir plusieurs lignes vs activer un réglage). */
.toggle-switch {
    appearance: none;
    -webkit-appearance: none;
    width: 38px;
    height: 22px;
    min-width: 38px;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    cursor: pointer;
    transition: background .15s ease;
    vertical-align: middle;
    flex-shrink: 0;
}
.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    transition: transform .15s ease;
}
.toggle-switch:checked { background: var(--accent); }
.toggle-switch:checked::before { transform: translateX(16px); }
.toggle-switch:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Tableau ---------- */

.ledger-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.ledger-table thead th {
    text-align: left; font-size: .68rem; font-weight: 500;
    color: var(--text-muted); padding: 0 1rem .6rem; border-bottom: 1px solid var(--border);
}
.ledger-table tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.ledger-table tbody tr:last-child td { border-bottom: none; }
.ledger-table tbody tr:hover { background: var(--bg-sunken); }
.ledger-num { font-variant-numeric: tabular-nums; }

/* ---------- Jauge circulaire (progression 507h) ---------- */

.gauge-track { stroke: var(--border); }
.gauge-value { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1); }
/* Portion "prévu" (dates déjà confirmées) de la jauge 507h, juste après la portion "déjà fait" —
   même couleur que les autres indicateurs d'avertissement du site (voir --warning). */
.gauge-value-future { stroke: var(--warning); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.4,0,.2,1); }
.gauge-tick { stroke: var(--text-faint); }

/* ---------- FAB (bouton d'action flottant) ---------- */

.fab {
    position: fixed;
    right: 1.5rem; bottom: 1.5rem;
    width: 56px; height: 56px;
    border-radius: 16px;
    background: var(--accent);
    color: var(--on-accent);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-2);
    z-index: 30;
    transition: transform .15s ease, box-shadow .15s ease;
}
.fab:hover { transform: translateY(-1px); }
.fab:active { transform: translateY(0) scale(.96); }
@media (max-width: 1023px) {
    .fab { bottom: calc(1.5rem + env(safe-area-inset-bottom) + 56px); }
}

/* ---------- Divers ---------- */

.section-label {
    font-size: .68rem; font-weight: 500; color: var(--text-muted);
}

#toast {
    font-family: var(--font-ui);
}

/* ---------- Agenda (calendrier) ---------- */

.agenda-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
}
.agenda-weekday {
    text-align: center;
    font-size: .64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-faint);
    padding: .55rem 0;
    background: var(--bg-sunken);
}

.agenda-grid {
    display: grid;
    /* minmax(0, 1fr) et non 1fr seul : sans le "0", une colonne s'élargit pour accueillir
       un texte trop long au lieu de le tronquer, ce qui casse l'alignement des 7 colonnes
       avec l'en-tête des jours de la semaine au-dessus. */
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.agenda-cell {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .2rem;
    min-width: 0;
    min-height: 84px;
    padding: .4rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
    text-align: left;
    cursor: pointer;
    transition: background-color .12s ease;
}
/* Un peu plus spacieux sur grand écran, où la place ne manque pas (demande de Brendan). */
@media (min-width: 1024px) {
    .agenda-cell { min-height: 108px; padding: .55rem; }
}
.agenda-cell:hover { background: var(--bg-sunken); }
.agenda-cell:nth-child(7n) { border-right: none; }
.agenda-cell-empty { background: var(--bg-sunken); cursor: default; }
.agenda-cell-empty:hover { background: var(--bg-sunken); }
.agenda-cell-num { font-size: .74rem; font-weight: 500; color: var(--text-muted); }
.agenda-cell-today .agenda-cell-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    border-radius: 999px;
    background: var(--accent); color: var(--on-accent);
    font-weight: 600;
}
.agenda-cell-items { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agenda-pill {
    font-size: .64rem; font-weight: 600;
    padding: 1px 6px; border-radius: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Réactions emoji (annonces de groupe) ---------- */
.reaction-pill {
    display: inline-flex; align-items: center; gap: .25rem;
    padding: .2rem .5rem;
    border-radius: 999px;
    font-size: .78rem;
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
}
.reaction-pill:hover { background: var(--accent-soft); }
.reaction-pill-active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.agenda-filter-chip {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .78rem; font-weight: 500; color: var(--text-muted);
    cursor: pointer;
}
.agenda-color-dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }

/* ---------- Mode édition des indicateurs (Dashboard) — glisser-déposer façon écran
   d'accueil Android : bouton rond pour masquer/réafficher, tuile "soulevée" (fixed + ombre)
   pendant le glissé. Pas de tremblement (essayé, mais écrasé de façon incontrôlable par la
   règle prefers-reduced-motion ci-dessus dès que ce réglage système est actif). ---------- */

/* align-self: start — sans ça, CSS Grid étire chaque .stub-tile à la hauteur de la ligne
   (déterminée par la tuile la plus haute de la ligne, ex. "Aller à un groupe" avec plusieurs
   lignes de contenu) ; la carte .stub à l'intérieur ne suit pas cet étirement (hauteur de
   contenu), donc la poignée de redimensionnement et le bouton × — positionnés en absolu par
   rapport à .stub-tile — se retrouvaient dans le vide, sous la carte visible, décalés selon
   les tuiles voisines sélectionnées ce jour-là. */
.stub-tile { position: relative; align-self: start; }
/* pan-y (pas none) tant que la tuile n'est pas "armée" par l'appui prolongé (voir
   wireDashboardStubsPanel) : un balayage rapide sur smartphone doit pouvoir faire défiler la
   page, seul un doigt qui reste posé ~350ms doit enclencher le glissé. */
.stub-edit-mode .stub-tile[data-draggable="1"] { cursor: grab; touch-action: pan-y; }
.stub-tile.armed { touch-action: none; }
.stub-tile.dragging { cursor: grabbing; box-shadow: var(--shadow-2); opacity: .92; }
.stub-tile.drop-target .stub { outline: 2px dashed var(--accent); outline-offset: 2px; }
/* Tailles de tuile par glisser le coin (façon widget Android) — voir STUB_SHAPES dans
   dashboard.js pour les 5 combinaisons valables. `cols` (span 2/3) ne s'applique qu'à partir du
   point de rupture sm: du grid 3 colonnes, en dessous tout reste sur une seule colonne. `tall`
   agrandit la tuile (densité de contenu à la charge de chaque indicateur, pas encore fait
   partout — par défaut, juste plus d'espace et un chiffre plus grand). */
.stub-tile[data-stub-cols] { grid-column: span 1; }
@media (min-width: 640px) {
    .stub-tile[data-stub-cols="2"] { grid-column: span 2; }
    .stub-tile[data-stub-cols="3"] { grid-column: span 3; }
}
.stub-tile[data-stub-tall="1"] .stub { min-height: 160px; display: flex; flex-direction: column; justify-content: center; }
/* !important nécessaire : plusieurs constructeurs de stub (ex. stubDual) fixent déjà une
   taille de police en style inline sur .stub-value, qui l'emporterait sinon toujours sur
   cette règle générique. */
.stub-tile[data-stub-tall="1"] .stub-value { font-size: 2.1rem !important; }
/* Tuiles à DEUX valeurs côte à côte (stubDual : Cachets, Heures manquantes, Solde de frais) : 2,1rem
   chacune débordait et se chevauchait dans une tuile "Haute" d'une colonne — plafonné plus bas,
   et remis à la taille générique dès que la tuile fait 2 colonnes ou plus. */
.stub-tile[data-stub-tall="1"] .stub-dual .stub-value { font-size: 1.35rem !important; }
.stub-tile[data-stub-tall="1"][data-stub-cols="2"] .stub-dual .stub-value,
.stub-tile[data-stub-tall="1"][data-stub-cols="3"] .stub-dual .stub-value { font-size: 2.1rem !important; }
.stub-resize-handle {
    position: absolute; right: 2px; bottom: 2px; width: 30px; height: 30px; z-index: 3;
    display: flex; align-items: flex-end; justify-content: flex-end; padding: 5px;
    cursor: nwse-resize; touch-action: none; color: var(--text-faint);
}
.stub-tile.resizing { box-shadow: var(--shadow-2); z-index: 10; }
.stub-tile.resizing .stub { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Bouton forme de la jauge 507h (mode édition) — assez grand pour qu'une icône s'y lise bien,
   contrairement à l'ancienne pastille texte. */
.gauge-shape-btn {
    width: 32px; height: 32px; border-radius: 50%; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-sunken); color: var(--text-faint); border: 1px solid var(--border);
    cursor: pointer;
}
/* Bandeau "Récap du mois" du Dashboard (monthRecapHtml) : 7 chiffres — 4 + 3 en dessous de 1100px
   de large, tous sur une ligne au-delà (7 colonnes ne tiennent pas plus étroit sans rogner les montants). */
.recap-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem .6rem; }
.recap-value { font-size: 1.02rem; white-space: nowrap; }
@media (min-width: 1100px) {
    .recap-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .9rem 1rem; }
    .recap-value { font-size: 1.2rem; }
}
/* Pastille "Perso" de l'éditeur EPK : le sélecteur de couleur natif est carré, on l'arrondit. */
#epk-color-custom { -webkit-appearance: none; appearance: none; overflow: hidden; }
#epk-color-custom::-webkit-color-swatch-wrapper { padding: 0; }
#epk-color-custom::-webkit-color-swatch { border: none; border-radius: 50%; }
#epk-color-custom::-moz-color-swatch { border: none; border-radius: 50%; }
/* Page publique EPK : bio + contact à gauche, photos à droite à partir de 860px, une seule
   colonne en dessous (voir publicEpkHtml dans epk-public.js). */
.epk-two-col { display: grid; gap: 1.75rem; }
@media (min-width: 860px) {
    .epk-two-col { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
}
.stub-tile-remove-btn {
    position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
    font-weight: 600; cursor: pointer; z-index: 5; border: 2px solid var(--bg-elevated);
    background: var(--rust-500); color: #fff;
}

/* ---------- Liste compacte de dates (Dashboard) ---------- */

.dash-entry-row {
    border-bottom: 1px solid var(--border);
    transition: background-color .12s ease;
}
.dash-entry-row:last-child { border-bottom: none; }
.dash-entry-row:hover { background: var(--bg-sunken); }

/* ---------- Liste mobile avec sélection par appui long (Historique, Groupe) ---------- */

.mobile-entry-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background-color .15s ease;
}
.mobile-entry-row:last-child { border-bottom: none; }
.mobile-entry-row.mobile-row-selected { background: var(--accent-soft); }
.mobile-entry-chevron { color: var(--text-faint); flex-shrink: 0; }
.mobile-entry-actions {
    display: none;
    gap: .5rem;
    flex-shrink: 0;
}
.mobile-entry-actions.flex { display: flex; }
.mobile-entry-actions button {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 999px;
    background: var(--bg-sunken);
    color: var(--text-muted);
    flex-shrink: 0;
}
.mobile-entry-actions button.danger { color: var(--rust-500); }

/* ---------- Groupe : tuiles + onglets de détail ---------- */

.group-tile {
    cursor: pointer;
    transition: box-shadow .12s ease, transform .12s ease;
}
.group-tile:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

.group-detail-tab {
    padding: .7rem .9rem;
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .12s ease, border-color .12s ease;
}
/* Barre d'onglets fixe : pas de défilement vertical (le -1px de l'onglet créait une barre de
   scroll qui faisait bouger la barre) ; défilement horizontal seulement si les onglets
   dépassent (petits écrans), sans barre visible. */
.overflow-x-auto:has(> .group-detail-tab) {
    overflow-y: hidden;
    scrollbar-width: none;
}
.overflow-x-auto:has(> .group-detail-tab)::-webkit-scrollbar { display: none; }
.overflow-x-auto:has(> .group-detail-tab) > .group-detail-tab { margin-bottom: 0; flex-shrink: 0; white-space: nowrap; }
.group-detail-tab:hover { color: var(--text); }
.group-detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.group-cat-pill {
    padding: .4rem .85rem;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-sunken);
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.group-cat-pill:hover { color: var(--text); }
.group-cat-pill.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.group-tile-add {
    background: transparent;
    border: 1.5px dashed var(--border);
    box-shadow: none;
    color: var(--text-faint);
    min-height: 100%;
    transition: border-color .12s ease, color .12s ease;
}
.group-tile-add:hover { border-color: var(--accent); color: var(--accent); }

.skeleton {
    background: linear-gradient(90deg, rgb(from var(--text-faint) r g b / 12%) 25%, rgb(from var(--text-faint) r g b / 22%) 37%, rgb(from var(--text-faint) r g b / 12%) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Carte de visite : taille adaptée à la place disponible à l'écran ---------- */

.card-flip-wrap { max-width: 24rem; }
@media (min-width: 768px) { .card-flip-wrap { max-width: 30rem; } }
@media (min-width: 1024px) { .card-flip-wrap { max-width: 40rem; } }
/* Téléphone à l'horizontal : peu de HAUTEUR (pas juste large) — se baser uniquement sur la
   largeur d'écran (85vw) fait déborder la carte (ratio 1.6/1) hors de l'écran une fois sa
   hauteur calculée. On plafonne aussi par la hauteur dispo (70vh, un peu de marge pour le
   texte/les boutons autour) et on garde la plus petite des deux limites. */
@media (orientation: landscape) and (max-height: 500px) { .card-flip-wrap { max-width: min(85vw, calc(70vh * 1.6)); } }

/* Contenu de la face "infos" (logo, nom, coordonnées) : agrandi par palier avec la carte
   elle-même, pour ne pas rester minuscule et tassé au centre d'une grande carte sur PC. */
.biz-card-logo { width: 44px; height: 44px; }
.biz-card-name { font-size: .8rem; }
.biz-card-row { font-size: .72rem; }
.biz-card-icon svg { width: 16px; height: 16px; display: block; }
@media (min-width: 768px) {
    .biz-card-logo { width: 58px; height: 58px; }
    .biz-card-name { font-size: 1rem; }
    .biz-card-row { font-size: .85rem; }
    .biz-card-icon svg { width: 20px; height: 20px; }
}
@media (min-width: 1024px) {
    .biz-card-logo { width: 78px; height: 78px; }
    .biz-card-name { font-size: 1.3rem; }
    .biz-card-row { font-size: 1rem; }
    .biz-card-icon svg { width: 26px; height: 26px; }
}

/* Tutoriel guidé (onboarding.js) : voile sombre + surbrillance de l'élément expliqué + bulle. */
.tour-blocker { position: fixed; inset: 0; z-index: 9990; background: transparent; }
.tour-blocker.tour-dim { background: rgba(20, 24, 32, .62); }
.tour-highlight {
    position: fixed; z-index: 9991; border-radius: 10px; pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(20, 24, 32, .62), 0 0 0 2px var(--accent);
    transition: top .2s ease, left .2s ease, width .2s ease, height .2s ease;
}
.tour-highlight[hidden] { display: none; }
.tour-pop { position: fixed; z-index: 9992; padding: 1rem 1.1rem; max-height: calc(100vh - 24px); overflow-y: auto; box-shadow: 0 8px 28px rgba(0, 0, 0, .25); }
.tour-pop-center { top: 50% !important; left: 50% !important; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 24px)) !important; }

/* Compte visiteur : pas de bouton d'ajout rapide */
.visitor-only .fab { display: none !important; }

/* Agenda sur mobile : des libellés tronqués (« Indi… », « La T… ») sont illisibles dans des cases de
   ~50 px, donc on affiche un point de couleur par évènement ; le détail s'ouvre en touchant le jour. */
@media (max-width: 640px) {
    .agenda-cell { min-height: 58px; padding: .35rem .1rem; align-items: center; gap: .3rem; }
    .agenda-cell-num { font-size: .8rem; }
    .agenda-cell-items { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px; }
    .agenda-pill {
        width: 9px; height: 9px; padding: 0; border-radius: 999px;
        font-size: 0; background: currentColor !important;
    }
    .agenda-cell-items > span:not(.agenda-pill) { font-size: .6rem; }
    .agenda-weekday { font-size: .66rem; }
}

/* Agenda : repères d'intermittent (fenêtre d'actualisation, date anniversaire) */
.agenda-cell-actu { background: var(--accent-soft); }
.agenda-pill-actu { background: var(--accent-soft) !important; color: var(--accent) !important; border: 1px solid var(--accent); }
.agenda-pill-anniv { background: var(--warning-bg) !important; color: var(--warning) !important; border: 1px solid var(--warning); }
@media (max-width: 640px) {
    .agenda-pill-actu, .agenda-pill-anniv { border-width: 0; }
    .agenda-pill-actu { background: var(--accent) !important; }
    .agenda-pill-anniv { background: var(--warning) !important; }
}

/* Menu ⋮ de l'Historique : lignes uniformes (icône + texte), groupées par section */
.hist-menu-item { width: 100%; justify-content: flex-start; font-size: .82rem; display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: 8px; }
.hist-menu-item svg { flex-shrink: 0; opacity: .8; }

/* ---------- Vue Groupe (2026-10-03) : cartes de groupe et vue d'ensemble plus modernes ---------- */
.group-card { position: relative; overflow: hidden; padding: 0; display: flex; flex-direction: column; text-align: left; }
.group-card:focus-visible { outline: 2px solid var(--gc, var(--accent)); outline-offset: 2px; }
.gc-band { height: 5px; background: var(--gc, var(--accent)); }
.gc-top { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem .6rem; background: linear-gradient(135deg, color-mix(in srgb, var(--gc, var(--accent)) 14%, transparent), transparent 70%); }
.gc-role { font-size: .7rem; color: var(--text-faint); }
.gc-body { padding: 0 1rem 1rem; display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.gc-label { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.gc-date { font-size: 1.02rem; font-weight: 700; margin-top: .1rem; text-transform: capitalize; }
.gc-count { font-size: .72rem; font-weight: 600; color: var(--gc, var(--accent)); margin-left: .35rem; text-transform: none; }
.gc-where { font-size: .76rem; color: var(--text-muted); }
.gc-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.gc-avatars { display: flex; align-items: center; }
.gc-avatars > * { margin-left: -7px; border: 2px solid var(--bg-elevated); border-radius: 50%; }
.gc-avatars > *:first-child { margin-left: 0; }
.gc-more { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 600; background: var(--bg-sunken); color: var(--text-muted); }
.gc-chips { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.gc-chip { font-size: .68rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.gc-chip-danger { background: color-mix(in srgb, var(--rust-500) 15%, transparent); color: var(--rust-500); }
.gc-chip-warn { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.gc-chip-live { background: var(--success-bg); color: var(--success); }
.gc-live { width: 7px; height: 7px; border-radius: 50%; background: var(--success); animation: gc-pulse 1.6s ease-in-out infinite; }
@keyframes gc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.group-overview-hero { display: flex; align-items: center; gap: 1.1rem; padding: 1.2rem 1.4rem; cursor: pointer; background: linear-gradient(135deg, color-mix(in srgb, var(--gc, var(--accent)) 16%, var(--bg-elevated)), var(--bg-elevated) 75%); transition: box-shadow .12s ease, transform .12s ease; }
.group-overview-hero:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.gc-hero-title { font-size: 1.3rem; font-weight: 800; line-height: 1.2; margin: .15rem 0 .25rem; }
.gc-cal { width: 58px; flex-shrink: 0; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid color-mix(in srgb, var(--gc, var(--accent)) 40%, transparent); background: var(--bg-elevated); }
.gc-cal span { display: block; background: var(--gc, var(--accent)); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .15rem 0; }
.gc-cal b { display: block; font-size: 1.35rem; line-height: 1.7rem; }
.gc-row { display: flex; align-items: center; gap: .75rem; cursor: pointer; padding: .2rem; border-radius: 10px; transition: background .12s ease; }
.gc-row:hover { background: var(--bg-sunken); }
.gc-row .gc-cal { width: 44px; }
.gc-row .gc-cal b { font-size: 1.05rem; line-height: 1.3rem; }
.gc-row .gc-cal span { font-size: .55rem; }
.gc-todo { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: .6rem; text-align: left; font-size: .8rem; padding: .5rem .7rem; border-radius: 10px; cursor: pointer; border: 0; }
.gc-todo-danger { background: color-mix(in srgb, var(--rust-500) 12%, transparent); color: var(--rust-500); }
.gc-todo-warn { background: color-mix(in srgb, var(--warning) 14%, transparent); color: var(--text); }
.gc-todo-live { background: var(--success-bg); color: var(--success); font-weight: 600; }
.gc-todo-cta { font-weight: 700; flex-shrink: 0; }
.gc-grid-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: .75rem; }
.gc-grid-hero, .gc-grid-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
@media (min-width: 1024px) { .gc-grid-hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .gc-grid-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.gc-top svg { display: inline-block; }

/* ---------- Animations des pages publiques (EPK, carte de visite) — 2026-10-03 ----------
   Toutes derrière prefers-reduced-motion: no-preference : un visiteur qui demande moins d'animations ne voit
   aucun mouvement. Seule la page publique de l'EPK porte .epk-animate : l'aperçu de l'éditeur reste calme. */
/* (déclenchées par html.motion-ok, posée par publicMotionAllowed() dans card-public.js) */
    @keyframes epkFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
    @keyframes epkPop { 0% { opacity: 0; transform: scale(.55) rotate(-6deg); } 65% { transform: scale(1.08) rotate(1deg); } 100% { opacity: 1; transform: none; } }
    @keyframes epkSweep { from { transform: translateX(-130%) skewX(-18deg); } to { transform: translateX(230%) skewX(-18deg); } }
    @keyframes epkPage { from { opacity: 0; } to { opacity: 1; } }

    html.motion-ok .epk-animate { animation: epkPage .5s ease-out both; }
    html.motion-ok .epk-animate .epk-hero { position: relative; overflow: hidden; }
    html.motion-ok .epk-animate .epk-hero::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); animation: epkSweep 1.7s .55s ease-in-out both; pointer-events: none; }
    html.motion-ok .epk-animate .epk-hero-logo { animation: epkPop .7s .1s cubic-bezier(.2, .9, .3, 1.2) both; }
    html.motion-ok .epk-animate .epk-hero-title { animation: epkFadeUp .6s .3s ease-out both; }
    html.motion-ok .epk-animate .epk-hero-sub { animation: epkFadeUp .6s .42s ease-out both; }
    html.motion-ok .epk-animate .epk-hero-socials a { animation: epkPop .5s ease-out both; transition: transform .18s ease; }
    html.motion-ok .epk-animate .epk-hero-socials a:nth-child(1) { animation-delay: .55s; }
    html.motion-ok .epk-animate .epk-hero-socials a:nth-child(2) { animation-delay: .62s; }
    html.motion-ok .epk-animate .epk-hero-socials a:nth-child(3) { animation-delay: .69s; }
    html.motion-ok .epk-animate .epk-hero-socials a:nth-child(4) { animation-delay: .76s; }
    html.motion-ok .epk-animate .epk-hero-socials a:nth-child(5) { animation-delay: .83s; }
    html.motion-ok .epk-animate .epk-hero-socials a:nth-child(6) { animation-delay: .9s; }
    html.motion-ok .epk-animate .epk-hero-socials a:hover { transform: translateY(-3px) scale(1.15); }

    /* Contenu : n'est masqué que si le script a posé .epk-js (navigateur capable d'observer le défilement). */
    html.motion-ok .epk-animate.epk-js .epk-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease-out, transform .6s ease-out; transition-delay: calc(var(--i, 0) * 70ms); }
    html.motion-ok .epk-animate.epk-js .epk-reveal.epk-in { opacity: 1; transform: none; }
    html.motion-ok .epk-animate .epk-photo img { transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .3s ease; }
    html.motion-ok .epk-animate .epk-photo:hover img { transform: scale(1.07); filter: saturate(1.08); }

    /* Carte de visite */
    @keyframes pcDrop { from { opacity: 0; transform: translateY(26px) rotateX(16deg) scale(.95); } to { opacity: 1; transform: none; } }
    @keyframes pcRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
    html.motion-ok .pc-page .pc-tilt { animation: pcDrop .8s cubic-bezier(.2, .8, .2, 1) backwards; }
    html.motion-ok .pc-page .pc-rise, html.motion-ok .pc-page > .btn, html.motion-ok .pc-page > .flex, html.motion-ok .pc-page > a.btn { animation: pcRise .55s ease-out both; }
    html.motion-ok .pc-page > :nth-child(2) { animation-delay: .45s; }
    html.motion-ok .pc-page > :nth-child(3) { animation-delay: .55s; }
    html.motion-ok .pc-page > :nth-child(4) { animation-delay: .65s; }
    html.motion-ok .pc-page > :nth-child(5) { animation-delay: .75s; }
    html.motion-ok .pc-page > :nth-child(6) { animation-delay: .85s; }


/* QR de la carte : posé sur la carte à partir de 520px de large ; en dessous il recouvrait les coordonnées et les
   icônes (signalé par Brendan sur mobile) et un bouton « Afficher le QR » prend le relais. */
.biz-qr-btn { display: none; }
@media (max-width: 520px) { .biz-qr-overlay { display: none !important; } .biz-qr-btn { display: flex; } }

/* Foil holographique et paillettes de la carte publique (pilotés par wirePublicCardTilt : --hx/--hy, --sx/--sy). */
.pc-holo, .pc-sparkle { position: absolute; inset: 0; border-radius: 14px; pointer-events: none; opacity: 0; transition: opacity .3s ease-out; }
.pc-holo {
    mix-blend-mode: color-dodge;
    background:
        linear-gradient(115deg, transparent 12%, rgba(255, 60, 140, .3) 26%, rgba(255, 215, 60, .3) 37%, rgba(60, 255, 175, .3) 48%, rgba(60, 170, 255, .3) 59%, rgba(175, 75, 255, .3) 70%, transparent 84%);
    background-size: 300% 300%;
    background-position: var(--hx, 50%) var(--hy, 50%);
}
.pc-sparkle {
    mix-blend-mode: screen;
    background-image: radial-gradient(circle, #fff 0 1.1px, transparent 1.7px), radial-gradient(circle, rgba(255, 255, 255, .85) 0 .8px, transparent 1.3px);
    background-size: 21px 21px, 13px 13px;
    background-position: calc(var(--sx, 50%) * .5) calc(var(--sy, 50%) * .5), calc(var(--sx, 50%) * -.3) calc(var(--sy, 50%) * .3);
    -webkit-mask-image: linear-gradient(115deg, transparent 18%, #000 45%, transparent 72%);
    mask-image: linear-gradient(115deg, transparent 18%, #000 45%, transparent 72%);
    -webkit-mask-size: 300% 300%; mask-size: 300% 300%;
    -webkit-mask-position: var(--sx, 50%) var(--sy, 50%); mask-position: var(--sx, 50%) var(--sy, 50%);
}
