/*
 * PitStop — charte v2, plus sobre et lisible.
 * Noir profond + gris, un seul accent (bleu électrique), boutons pilule blancs
 * façon store Ubisoft. L'or est réservé à l'XP et aux succès. Les couleurs
 * sémantiques (retard / bientôt / ok) restent mais en version feutrée.
 */
:root {
    --ps-bg: #08090b;
    --ps-bg-alt: #0d0e11;
    --ps-surface: #121317;
    --ps-surface-2: #191b20;
    --ps-border: rgba(255, 255, 255, 0.08);
    --ps-accent: #6ea8ff;
    --ps-accent-soft: rgba(110, 168, 255, 0.12);
    --ps-blue: #6ea8ff;
    --ps-cyan: #9db9dd;
    --ps-gold: #e2c078;
    --ps-text: #eceef2;
    --ps-text-muted: #8b8f9a;
    --ps-danger: #f07182;
    --ps-success: #5fd6a9;
    --ps-nav-bg: rgba(5, 6, 8, 0.92);
    --ps-btn-bg: #fff;
    --ps-btn-fg: #0a0a0c;
    --ps-ghost-border: rgba(255, 255, 255, 0.22);
    --ps-soft-fill: rgba(255, 255, 255, 0.05);
    --font-display: 'Barlow Condensed', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    color-scheme: dark;
}

/* ============ THÈME CLAIR ============
 * Activé par data-theme="light" sur <html> (bouton soleil/lune dans la nav).
 * La vitrine reste toujours sombre (identité de marque). */
[data-theme="light"] {
    --ps-bg: #eef0f4;
    --ps-bg-alt: #ffffff;
    --ps-surface: #ffffff;
    --ps-surface-2: #f4f6f9;
    --ps-border: rgba(20, 24, 32, 0.10);
    --ps-accent: #2563d9;
    --ps-accent-soft: rgba(37, 99, 217, 0.08);
    --ps-blue: #2563d9;
    --ps-cyan: #51617a;
    --ps-gold: #9a6d10;
    --ps-text: #171922;
    --ps-text-muted: #5c6472;
    --ps-danger: #c72d47;
    --ps-success: #0e7a58;
    --ps-nav-bg: rgba(255, 255, 255, 0.92);
    --ps-btn-bg: #171922;
    --ps-btn-fg: #ffffff;
    --ps-ghost-border: rgba(20, 24, 32, 0.28);
    --ps-soft-fill: rgba(20, 24, 32, 0.05);
    color-scheme: light;
}
[data-theme="light"] .btn-close { filter: none; }
[data-theme="light"] a:hover { color: #1d4fb0; }
[data-theme="light"] .card-hover:hover { border-color: rgba(20, 24, 32, 0.3); }
[data-theme="light"] .xp-bar { background: rgba(20, 24, 32, 0.12); }
[data-theme="light"] .rank-chip.unlocked { border-color: rgba(20, 24, 32, 0.3); }
[data-theme="light"] .ps-toast { box-shadow: 0 10px 34px rgba(20, 24, 32, 0.18); }
[data-theme="light"] .tour-ring { box-shadow: 0 0 0 9999px rgba(23, 25, 34, 0.45), 0 0 24px rgba(37, 99, 217, 0.25); }
[data-theme="light"] .tour-tip { box-shadow: 0 14px 50px rgba(20, 24, 32, 0.25); }
[data-theme="light"] .ps-logo-big img, [data-theme="light"] .ps-logo-mark img.logo-for-dark { display: none; }
[data-theme="light"] .ps-logo-mark img.logo-for-light { display: block; }
.ps-logo-mark img.logo-for-light { display: none; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
    background:
        radial-gradient(1100px 500px at 50% -20%, rgba(110, 168, 255, 0.07), transparent 60%),
        var(--ps-bg);
    color: var(--ps-text);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
.ps-main { flex: 1; }

/* La vitrine se compose de sections pleine hauteur : le rembourrage vertical de
 * <main> (py-4) ajoutait une bande noire au-dessus du hero et décalait de 48 px
 * son calc(100vh - 62px), ce qui poussait la flèche de défilement hors champ. */
body.is-landing .ps-main { padding-top: 0 !important; padding-bottom: 0 !important; }

h1, h2, h3, h4, h5, h6, .brand-text, .btn {
    font-family: var(--font-display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 700;
}
a { color: var(--ps-accent); text-decoration: none; }
a:hover { color: #9cc3ff; }
.text-muted { color: var(--ps-text-muted) !important; }

/* ============ NAV ============ */
.ps-nav {
    background: var(--ps-nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ps-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}
/* Logo détouré, posé directement sur le fond sombre (pas de tuile blanche) */
.ps-logo-mark {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.ps-logo-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.35); }

/* Logo en grand (pages d'auth) */
.ps-logo-big {
    width: 84px; height: 84px; overflow: hidden;
    display: inline-flex; margin-bottom: 0.6rem;
}
.ps-logo-big img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); }
.auth-card .ps-logo-big { width: 72px; height: 72px; }
.brand-text { font-size: 1.4rem; color: var(--ps-text); font-weight: 800; }
.brand-accent { color: var(--ps-accent); }
/* Étiquette de phase bêta, à côté du logo */
.beta-tag {
    font-family: var(--font-display); font-weight: 700; font-size: 0.62rem;
    text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--ps-accent); border: 1px solid var(--ps-accent);
    border-radius: 999px; padding: 0.08rem 0.5rem;
    align-self: flex-start; margin-top: 2px; opacity: 0.9;
}
.ps-nav .nav-link {
    color: var(--ps-text-muted);
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 0.55rem 0.95rem !important;
    border-bottom: 2px solid transparent;
    transition: color .15s ease, border-color .15s ease;
}
.ps-nav .nav-link i { margin-right: 0.3rem; }
.ps-nav .nav-link:hover { color: var(--ps-text); }
.ps-nav .nav-link.active { color: var(--ps-text); border-bottom-color: var(--ps-accent); }

/* Badge XP dans la nav */
.xp-badge {
    background: transparent;
    border: 1px solid var(--ps-border);
    border-radius: 999px;
    padding: 0.3rem 0.85rem 0.3rem 0.35rem;
    transition: border-color .15s ease, background .15s ease;
}
.xp-badge:hover { border-color: var(--ps-ghost-border); background: var(--ps-soft-fill); }
.xp-rank {
    width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #0a0a0c; font-size: 0.9rem; flex: 0 0 auto;
}
.xp-rank-badge {
    width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
.xp-title {
    font-family: var(--font-display);
    font-size: 0.76rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase;
    color: var(--ps-text); line-height: 1; margin-bottom: 4px;
}
.xp-bar { width: 100px; height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden; }
.xp-bar-fill { height: 100%; display: block; background: var(--ps-gold); transition: width .5s ease; }
.xp-total { font-family: var(--font-display); font-weight: 700; color: var(--ps-gold); font-size: 0.92rem; }

/* Indication discrète de gain d'XP à côté des boutons */
.xp-hint {
    font-family: var(--font-display); font-weight: 600; font-size: 0.78rem;
    letter-spacing: 0.06em; color: var(--ps-gold); opacity: 0.85;
    text-transform: uppercase; white-space: nowrap;
}

/* ============ BOUTONS ============ */
.ps-btn-primary {
    background: var(--ps-btn-bg); color: var(--ps-btn-fg); border: 1px solid var(--ps-btn-bg);
    border-radius: 999px; padding: 0.45rem 1.35rem; font-weight: 700;
    transition: opacity .15s ease, transform .1s ease;
}
.ps-btn-primary:hover { background: var(--ps-btn-bg); border-color: var(--ps-btn-bg); color: var(--ps-btn-fg); opacity: 0.82; }
.ps-btn-primary:active { transform: scale(0.98); }
.ps-btn-ghost {
    background: transparent; color: var(--ps-text);
    border: 1px solid var(--ps-ghost-border); border-radius: 999px;
    padding: 0.45rem 1.2rem;
    transition: border-color .15s ease, background .15s ease;
}
/* Après .ps-btn-ghost pour que le grand padding s'applique aussi aux boutons fantômes ;
   inline-flex + centrage pour un texte toujours centré (même si le flex parent étire). */
.ps-btn-lg {
    padding: 0.7rem 2.1rem; font-size: 1.1rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.ps-btn-ghost:hover { border-color: var(--ps-text); color: var(--ps-text); background: var(--ps-soft-fill); }

/* ============ CARTES / SURFACES ============ */
.card {
    background: var(--ps-surface);
    border: 1px solid var(--ps-border);
    border-radius: 12px;
    color: var(--ps-text);
    transition: border-color .15s ease, transform .15s ease;
}
.card-hover:hover { border-color: rgba(255, 255, 255, 0.22); transform: translateY(-2px); }
.card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--ps-border);
    font-family: var(--font-display);
    text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
    font-size: 0.95rem;
    padding: 0.85rem 1.25rem;
}
.card .card-header i { color: var(--ps-text-muted); margin-right: 0.25rem; }

/* Tuiles de stats */
.stat-tile { position: relative; overflow: hidden; }
.stat-tile .tile-icon {
    position: absolute; right: -4px; bottom: -12px;
    font-size: 3.8rem; opacity: 0.05; line-height: 1;
}
.stat-tile .stat-value {
    font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.1;
}
.stat-tile .stat-label {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.11em;
    color: var(--ps-text-muted); font-weight: 600;
}

/* Carte véhicule */
.vehicle-card { position: relative; overflow: hidden; }
.vehicle-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--vcolor, var(--ps-accent)); z-index: 2;
}
.vehicle-photo {
    width: 100%; height: 170px; object-fit: cover; display: block;
    border-bottom: 1px solid var(--ps-border);
    background: var(--ps-surface-2);
}
.vehicle-photo-placeholder {
    width: 100%; height: 170px; display: flex; align-items: center; justify-content: center;
    border-bottom: 1px solid var(--ps-border);
    background:
        linear-gradient(160deg, var(--ps-surface-2), var(--ps-surface));
    color: rgba(255,255,255,0.12); font-size: 3rem;
}
.vehicle-hero-photo {
    width: 220px; height: 140px; object-fit: cover; border-radius: 10px;
    border: 1px solid var(--ps-border);
}
/* Petit nom du véhicule (a remplacé la plaque d'immatriculation — confidentialité) */
.vehicle-nickname {
    font-family: var(--font-display); font-weight: 600; letter-spacing: 0.04em;
    color: var(--ps-accent); font-size: 0.95rem; font-style: italic;
}
.vehicle-km { font-family: var(--font-display); font-weight: 700; color: var(--ps-text); font-size: 1.05rem; }

/* ============ BADGES ============ */
.badge { font-weight: 600; letter-spacing: 0.03em; }
.ps-badge-danger { background: rgba(240, 113, 130, 0.12); color: var(--ps-danger); border: 1px solid rgba(240,113,130,0.3); }
.ps-badge-warn   { background: rgba(226, 192, 120, 0.10); color: var(--ps-gold); border: 1px solid rgba(226,192,120,0.3); }
.ps-badge-ok     { background: rgba(95, 214, 169, 0.10); color: var(--ps-success); border: 1px solid rgba(95,214,169,0.28); }
.ps-badge-muted  { background: var(--ps-soft-fill); color: var(--ps-text-muted); border: 1px solid var(--ps-border); }
.ps-badge-cat    { background: var(--ps-soft-fill); color: var(--ps-cyan); border: 1px solid var(--ps-border); }
.prio-critique { background: rgba(240, 113, 130, 0.12); color: var(--ps-danger); border: 1px solid rgba(240,113,130,0.3); }
.prio-haute    { background: rgba(226, 192, 120, 0.10); color: var(--ps-gold); border: 1px solid rgba(226,192,120,0.3); }
.prio-moyenne  { background: rgba(110, 168, 255, 0.10); color: var(--ps-accent); border: 1px solid rgba(110,168,255,0.28); }
.prio-basse    { background: var(--ps-soft-fill); color: var(--ps-text-muted); border: 1px solid var(--ps-border); }

/* ============ TABLES ============ */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ps-text);
    /* Sans ces variables, Bootstrap repasse le texte en noir au survol (illisible sur fond sombre) */
    --bs-table-hover-color: var(--ps-text);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: var(--ps-text);
    border-color: var(--ps-border);
}
.table thead th {
    font-family: var(--font-display); text-transform: uppercase;
    letter-spacing: 0.08em; font-size: 0.76rem; color: var(--ps-text-muted);
    border-bottom: 1px solid var(--ps-border);
    padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.table td, .table th { border-color: var(--ps-border); padding-top: 0.7rem; padding-bottom: 0.7rem; }

/* ============ FORMULAIRES ============ */
.form-control, .form-select {
    background: var(--ps-bg-alt); border: 1px solid var(--ps-border);
    color: var(--ps-text); border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    background: var(--ps-bg-alt); color: var(--ps-text);
    border-color: var(--ps-accent); box-shadow: 0 0 0 0.2rem rgba(110,168,255,0.12);
}
.form-control::placeholder { color: rgba(139,143,154,0.55); }
.form-control:disabled, .form-control[readonly] {
    background: var(--ps-surface-2); color: var(--ps-text-muted);
    border-color: var(--ps-border); opacity: 1;
}
.form-label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ps-text-muted); font-weight: 600; }
.form-check-input { background-color: var(--ps-bg-alt); border-color: rgba(255,255,255,0.25); }
.form-check-input:checked { background-color: var(--ps-accent); border-color: var(--ps-accent); }
.form-select option { background: var(--ps-surface); }
/* Bootstrap dessine le chevron du select via background-image ; la règle
 * `.form-control, .form-select` ci-dessus emploie le raccourci `background`,
 * qui l'efface. On le redessine ici — en clair, car le chevron Bootstrap par
 * défaut est gris foncé et illisible sur fond sombre (pas de data-bs-theme).
 * L'état :focus est visé explicitement : la règle `.form-select:focus` plus haut
 * est plus spécifique et effacerait de nouveau le chevron au clic. */
.form-select, .form-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%238b8f9a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}
.form-text { color: var(--ps-text-muted); }

/* ============ HERO (pages internes) ============ */
.ps-hero {
    position: relative;
    border: 1px solid var(--ps-border);
    border-radius: 14px;
    background: linear-gradient(140deg, var(--ps-surface-2), var(--ps-surface) 55%);
    padding: 1.9rem 2.1rem;
    overflow: hidden;
}
.ps-hero h1 { font-size: 2.2rem; font-weight: 800; }
.ps-kicker {
    display: inline-block; font-family: var(--font-display);
    text-transform: uppercase; letter-spacing: 0.2em; font-weight: 600;
    font-size: 0.75rem; color: var(--ps-accent);
    margin-bottom: 0.6rem;
}

/* ============ FRISE DE NIVEAU ============ */
.level-timeline { display: flex; align-items: flex-start; justify-content: space-between; position: relative; padding-top: 8px; }
.level-timeline::before {
    content: ''; position: absolute; top: 36px; left: 8%; right: 8%;
    height: 1px; background: var(--ps-border);
}
/* Sans image de blason (fallback icônes), la ligne repasse au niveau des points */
.level-timeline:not(:has(.rank-badge-img))::before { top: 15px; }
/* Grade maximum : deux points seulement, centrés, sans trait qui pendouille */
.level-timeline-max { justify-content: center; gap: 12%; }
.level-timeline-max::before { display: none; }
.level-timeline-max .level-point { width: auto; }
.level-point { position: relative; z-index: 1; text-align: center; width: 33%; }
.level-point-dot {
    width: 14px; height: 14px; border-radius: 50%; margin: 0 auto 8px;
    background: var(--ps-surface-2); border: 2px solid var(--ps-text-muted);
}
.level-point-current .level-point-dot {
    background: var(--ps-gold); border-color: var(--ps-gold);
    box-shadow: 0 0 12px rgba(226,192,120,0.45);
    width: 18px; height: 18px; margin-top: -2px;
}
.level-point-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.11em; color: var(--ps-text-muted); }
.level-point-title { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; }
.level-point-current .level-point-title { color: var(--ps-gold); font-size: 1.25rem; }
.progress { background: rgba(255,255,255,0.08); border-radius: 3px; }
.progress-bar { background: var(--ps-gold); }

/* Échelle des rangs */
.rank-ladder { display: flex; flex-wrap: wrap; gap: 0.55rem; justify-content: center; }
.rank-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: transparent; border: 1px solid var(--ps-border);
    border-radius: 999px; padding: 0.38rem 1rem;
    font-family: var(--font-display); text-transform: uppercase;
    letter-spacing: 0.05em; font-weight: 600; font-size: 0.88rem;
    color: var(--ps-text-muted);
}
.rank-chip i { color: inherit; }
.rank-chip .rank-xp { font-size: 0.75rem; opacity: 0.7; }
.rank-chip.unlocked { color: var(--ps-text); border-color: rgba(255,255,255,0.25); }
.rank-chip.current { color: var(--ps-gold); border-color: rgba(226,192,120,0.5); background: rgba(226,192,120,0.07); }

/* Succès */
.achievement { display: flex; gap: 0.9rem; align-items: center; }
/* Succès verrouillé : on estompe l'icône et les textes, mais pas un éventuel lien d'action */
.achievement:not(.unlocked) .achievement-icon,
.achievement:not(.unlocked) .achievement-title,
.achievement:not(.unlocked) .achievement-desc { opacity: 0.4; filter: grayscale(0.9); }
.achievement-icon {
    width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem; background: rgba(226,192,120,0.08);
    color: var(--ps-gold); border: 1px solid rgba(226,192,120,0.28);
}
.achievement-title { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; line-height: 1.1; }
.achievement-desc { font-size: 0.8rem; color: var(--ps-text-muted); }

/* Leaderboard */
.is-me-row { background: var(--ps-accent-soft); }
.rank-cell { font-family: var(--font-display); font-weight: 800; color: var(--ps-text-muted); }
.avatar-dot {
    width: 26px; height: 26px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-size: 0.75rem;
    font-weight: 700; color: #0a0a0c; flex: 0 0 auto; aspect-ratio: 1 / 1;
}

/* Leaderboard : ~10 lignes visibles, le reste au scroll interne */
.leaderboard-scroll { max-height: 520px; overflow-y: auto; }
.leaderboard-scroll thead th { position: sticky; top: 0; background: var(--ps-surface); z-index: 1; }

/* Fil d'activité XP */
.xp-feed-item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--ps-border); font-size: 0.9rem; }
.xp-feed-item:last-child { border-bottom: none; }
.xp-feed-points { font-family: var(--font-display); font-weight: 700; color: var(--ps-gold); white-space: nowrap; }

/* Mode « Depuis un modèle » : seuls les boutons + la liste des modèles restent
 * visibles tant qu'aucun modèle n'est choisi */
#intervModal .modal-body > .row.fields-hidden > div:not(#templateWrap) { display: none; }

/* Boutons-bascule (type de feedback, modes de saisie des pièces…) */
.btn-check:checked + .ps-btn-ghost,
.ps-btn-ghost.active {
    background: var(--ps-accent-soft);
    border-color: var(--ps-accent);
    color: var(--ps-accent);
}

/* ============ CLOCHE DE NOTIFICATIONS ============ */
.notif-dot {
    position: absolute; top: 4px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--ps-gold);
    box-shadow: 0 0 0 2px var(--ps-bg);
}
.notif-dot-danger { background: var(--ps-danger); }
.notif-menu {
    background: var(--ps-surface-2); border: 1px solid var(--ps-border);
    border-radius: 12px; width: 340px; max-width: 92vw;
    box-shadow: 0 14px 50px rgba(0,0,0,0.5);
    max-height: 70vh; overflow-y: auto;
}
/* Nav repliée (mobile) : la rangée XP / cloche / thème / déconnexion passe à la
 * ligne au lieu de déborder à droite de l'écran. */
.nav-actions { min-width: 0; }
@media (max-width: 991px) {
    .nav-actions { padding: 0.6rem 0 0.8rem; }
    .nav-actions .xp-badge { max-width: 100%; }
}

/* Mobile (nav repliée) : le panneau devient une feuille pleine largeur sous la barre,
 * au lieu du positionnement absolu de Bootstrap qui déborde de l'écran. */
@media (max-width: 991px) {
    .notif-menu {
        position: fixed !important;
        top: 72px !important;
        left: 12px !important;
        right: 12px !important;
        bottom: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        max-height: 65vh;
    }
}
.notif-title {
    font-family: var(--font-display); text-transform: uppercase;
    letter-spacing: 0.1em; font-size: 0.72rem; font-weight: 700;
    color: var(--ps-text-muted); padding: 0.7rem 1rem 0.35rem;
}
.notif-empty { padding: 0.4rem 1rem 0.6rem; color: var(--ps-text-muted); font-size: 0.85rem; }
.notif-item {
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.45rem 1rem; font-size: 0.85rem; color: var(--ps-text);
    border-bottom: 1px solid var(--ps-border);
}
.notif-item:last-of-type { border-bottom: none; }
.notif-item:hover { background: var(--ps-soft-fill); color: var(--ps-text); }
.notif-news { padding: 0.45rem 1rem 0.55rem; border-bottom: 1px solid var(--ps-border); }
.notif-news:last-child { border-bottom: none; }
.notif-news strong { display: block; font-size: 0.83rem; color: var(--ps-text); }
.notif-news-date { float: right; font-size: 0.7rem; color: var(--ps-text-muted); font-family: var(--font-display); letter-spacing: 0.05em; }
.notif-news-text { font-size: 0.78rem; color: var(--ps-text-muted); line-height: 1.45; }

/* ============ TOASTS ============ */
.ps-toasts { position: fixed; top: 76px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.ps-toast {
    background: var(--ps-surface-2); border: 1px solid var(--ps-border);
    border-left: 3px solid var(--ps-accent);
    color: var(--ps-text); border-radius: 10px; padding: 0.6rem 1rem;
    box-shadow: 0 10px 34px rgba(0,0,0,0.55);
    animation: toastIn .3s ease;
    max-width: 340px; font-size: 0.92rem;
}
.ps-toast-success { border-left-color: var(--ps-success); }
.ps-toast-danger { border-left-color: var(--ps-danger); }
.ps-toast-xp {
    border-left-color: var(--ps-gold);
    font-family: var(--font-display); text-transform: uppercase;
    font-weight: 800; font-size: 1.02rem; letter-spacing: 0.05em;
    color: var(--ps-gold);
}
.ps-toast-levelup {
    position: relative; overflow: hidden;
    border: 1px solid rgba(226,192,120,0.6); border-left-width: 3px;
    background: linear-gradient(120deg, rgba(226,192,120,0.16), var(--ps-surface-2));
    font-family: var(--font-display); text-transform: uppercase; font-weight: 800;
    box-shadow: 0 0 0 rgba(226,192,120,0.5); animation: levelupGlow 1.4s ease-out 1;
}
/* Le blason « pop » à l'apparition */
.ps-toast-levelup img { animation: badgePop .7s cubic-bezier(.18,1.4,.4,1) 1; transform-origin: center; }
/* Reflet doré qui balaie le toast */
.ps-toast-levelup::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-18deg); animation: levelupShine 1.1s ease-out .25s 1;
}
@keyframes badgePop { 0% { transform: scale(0) rotate(-25deg); } 60% { transform: scale(1.25) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes levelupShine { from { left: -60%; } to { left: 130%; } }
@keyframes levelupGlow { 0% { box-shadow: 0 0 0 rgba(226,192,120,0); } 30% { box-shadow: 0 0 26px rgba(226,192,120,0.55); } 100% { box-shadow: 0 0 0 rgba(226,192,120,0); } }
@keyframes toastIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.ps-toast.hide { transition: opacity .4s ease, transform .4s ease; opacity: 0; transform: translateX(30px); }

/* ============ AUTH ============ */
.auth-wrap { max-width: 430px; margin: 3rem auto; }
.auth-card { padding: 2rem; }

/* ============ FOOTER ============ */
.ps-footer {
    border-top: 1px solid var(--ps-border);
    padding: 1.1rem 0; margin-top: 2.5rem;
    color: var(--ps-text-muted); font-size: 0.88rem;
    background: var(--ps-bg-alt);
}
.footer-grid {
    display: flex; flex-wrap: wrap;
    justify-content: space-between; align-items: center;
    gap: 0.5rem 1.5rem;
}
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; }

/* Actions rapides du tableau de bord : label au-dessus, contrôles en dessous */
.quick-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; }
/* Mobile : sélecteur pleine largeur, puis 3 boutons en colonnes égales sur une ligne */
@media (max-width: 575px) {
    .quick-hero { align-self: stretch; }
    .quick-row { width: 100%; }
    .quick-vehicle { width: 100% !important; max-width: none; }
    .quick-btns { width: 100%; }
    .quick-btns .quick-go {
        flex: 1 1 0; min-width: 0; justify-content: center;
        padding-left: 0.35rem; padding-right: 0.35rem;
    }
}

/* Blasons de grade (images détourées) */
.rank-badge-img { display: block; object-fit: contain; margin: 0 auto 0.15rem; }
.rank-badge-img.lg { width: 104px; height: 104px; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.45)); }
.rank-badge-img.sm { width: 56px; height: 56px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35)); }
/* Rang non encore débloqué : grisé et estompé */
.rank-badge-img.locked { filter: grayscale(0.9) brightness(0.7) opacity(0.55); }
[data-theme="light"] .rank-badge-img.lg { filter: drop-shadow(0 4px 14px rgba(0,0,0,0.18)); }
[data-theme="light"] .rank-badge-img.sm { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15)); }
/* Mini-blason dans le leaderboard (seul, centré dans la colonne Rang) */
.rank-badge-mini { width: 32px; height: 32px; object-fit: contain; vertical-align: middle; }

/* Fiche véhicule — actions (compteur / export / partage) : pleine largeur empilée sur mobile
   pour éviter le débordement horizontal dû aux largeurs fixes. */
@media (max-width: 767px) {
    .vehicle-actions { width: 100%; align-items: stretch !important; }
    .vehicle-actions .km-form { width: 100%; }
    .vehicle-actions .km-field { flex: 1 1 auto; }
    .vehicle-actions .km-input { width: 100% !important; }
    .vehicle-actions .share-row { width: 100%; flex-wrap: nowrap; }
    .vehicle-actions .share-input { width: 100% !important; flex: 1 1 auto; min-width: 0; }
}

/* Puce « connecté aujourd'hui » (admin) */
.active-chip { padding: 0.4rem 0.7rem 0.4rem 0.4rem; border: 1px solid var(--ps-border); border-radius: 999px; }

/* Avatar photo (remplace la pastille à initiale quand l'utilisateur a une image) */
.avatar-photo { border-radius: 50%; object-fit: cover; display: inline-block; vertical-align: middle; }

/* Micro-NPS */
.nps-num {
    width: 40px; height: 40px; border-radius: 9px; flex: 0 0 auto;
    border: 1px solid var(--ps-border); background: var(--ps-soft-fill);
    color: var(--ps-text); font-weight: 700; cursor: pointer; transition: all .15s ease;
}
.nps-num:hover { border-color: var(--ps-accent); color: var(--ps-accent); }
.nps-num.sel { background: var(--ps-accent); border-color: var(--ps-accent); color: #08090b; }
@media (max-width: 480px) { .nps-num { width: 32px; height: 36px; font-size: 0.85rem; } }

/* Défis saisonniers */
.challenge-row { padding: 0.55rem 0.7rem; border: 1px solid var(--ps-border); border-radius: 10px; }
.challenge-row.done { opacity: 0.65; }
.challenge-ic { color: var(--ps-accent); font-size: 1.1rem; flex: 0 0 auto; }
.challenge-row.done .challenge-ic { color: #2ee6a8; }
.challenge-xp { color: var(--ps-gold); font-weight: 700; white-space: nowrap; }

/* Bandeau profil : avatar toujours en ligne à gauche du texte, même sur mobile */
.hero-avatar { width: 64px; height: 64px; font-size: 1.6rem; flex: 0 0 auto; }
.hero-text { min-width: 0; }
@media (max-width: 575px) {
    /* Avatar aligné en haut avec le nom (plus centré sur un pavé de texte haut) */
    .hero-head { align-items: flex-start !important; }
    .hero-avatar { width: 48px; height: 48px; font-size: 1.2rem; }
    .hero-text h1 { font-size: 1.55rem; }
    /* La date d'inscription passe sur sa propre ligne, discrète */
    .hero-since { display: block; font-size: 0.85em; opacity: 0.85; margin-top: 0.15rem; }
}
.footer-links a { white-space: nowrap; }
@media (max-width: 767px) {
    /* Mobile : marque, puis liens en grille 2 colonnes bien alignées, puis mention */
    .footer-grid { flex-direction: column; align-items: stretch; gap: 0.9rem; }
    .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem 1rem; }
    .footer-links a { white-space: normal; }
}

/* Documents attachés aux interventions */
.doc-chip {
    display: inline-flex; align-items: center; gap: 0.15rem;
    background: var(--ps-soft-fill); border: 1px solid var(--ps-border);
    border-radius: 999px; padding: 0.05rem 0.3rem 0.05rem 0.55rem;
    font-size: 0.74rem; margin: 0.15rem 0.2rem 0 0;
}
.doc-chip a { color: var(--ps-cyan); }
.doc-chip-del {
    background: none; border: none; color: var(--ps-text-muted);
    font-size: 0.85rem; line-height: 1; padding: 0 0.25rem; cursor: pointer;
}
.doc-chip-del:hover { color: var(--ps-danger); }

/* Matrice d'échéances du tableau de bord */
.deadline-matrix th { white-space: nowrap; }
.deadline-matrix td { vertical-align: top; min-width: 120px; }
.deadline-matrix td:first-child { min-width: 160px; vertical-align: middle; }
.deadline-matrix .badge { font-size: 0.72rem; }

/* ============ STOCK ============ */
.qty-stepper { display: inline-flex; align-items: center; gap: 0.4rem; }
.qty-stepper button {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--ps-ghost-border); background: transparent;
    color: var(--ps-text); font-weight: 700; line-height: 1;
    display: inline-flex; align-items: center; justify-content: center;
    transition: border-color .15s ease;
}
.qty-stepper button:hover { border-color: var(--ps-text); }
.qty-value { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; min-width: 28px; text-align: center; }
.qty-zero { color: var(--ps-danger); }

/* ============ BOUTON D'ACTION RAPIDE (FAB) ============
 * Réservé au mobile/tablette (et donc à la PWA) : sur desktop,
 * la navigation et la souris rendent ce raccourci superflu. */
.fab-wrap {
    position: fixed; right: 18px; bottom: 18px; z-index: 1500;
    display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem;
}
@media (min-width: 992px) {
    .fab-wrap { display: none; }
}
.fab {
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--ps-btn-bg); color: var(--ps-btn-fg); border: none;
    font-size: 1.35rem; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease;
}
.fab:active { transform: scale(0.94); }
.fab i { transition: transform 0.2s ease; }
.fab.open i { transform: rotate(45deg); }
.fab-menu {
    background: var(--ps-surface-2); border: 1px solid var(--ps-border);
    border-radius: 12px; padding: 0.35rem; width: 250px;
    box-shadow: 0 14px 50px rgba(0, 0, 0, 0.5);
}
.fab-title {
    font-family: var(--font-display); text-transform: uppercase;
    letter-spacing: 0.1em; font-size: 0.7rem; font-weight: 700;
    color: var(--ps-text-muted); padding: 0.45rem 0.7rem 0.25rem;
}
.fab-item {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    background: none; border: none; color: var(--ps-text);
    padding: 0.55rem 0.7rem; border-radius: 8px; text-align: left; font-size: 0.9rem;
}
.fab-item:hover { background: var(--ps-soft-fill); }

/* Invitation à la visite guidée (première visite d'une page) */
.tour-invite {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.8rem; flex-wrap: wrap;
    background: var(--ps-accent-soft);
    border: 1px solid rgba(110, 168, 255, 0.3);
    border-radius: 10px;
    padding: 0.55rem 0.9rem;
    margin-bottom: 1.2rem;
    animation: toastIn 0.3s ease;
}
.tour-invite-text { font-size: 0.9rem; color: var(--ps-text); }
.tour-invite-go {
    background: var(--ps-btn-bg); color: var(--ps-btn-fg); border: none;
    border-radius: 999px; padding: 0.3rem 1rem;
    font-family: var(--font-display); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8rem;
}
.tour-invite-close {
    background: none; border: none; color: var(--ps-text-muted);
    font-size: 0.95rem; padding: 0.2rem 0.4rem;
}
.tour-invite-close:hover { color: var(--ps-text); }

/* ============ VISITE GUIDÉE ============ */
.tour-ring {
    position: absolute; z-index: 3000; pointer-events: none;
    border: 2px solid var(--ps-accent); border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7), 0 0 24px rgba(110,168,255,0.35);
    /* pas de transition : la position est pilotée à chaque frame par le JS */
}
.tour-tip {
    position: absolute; z-index: 3001; width: 360px; max-width: calc(100vw - 24px);
    background: var(--ps-surface-2); border: 1px solid rgba(110,168,255,0.4);
    border-radius: 12px; padding: 1rem 1.1rem;
    box-shadow: 0 14px 50px rgba(0,0,0,0.6);
}
.tour-tip-title { font-family: var(--font-display); text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; margin-bottom: 0.3rem; color: var(--ps-accent); }
.tour-tip-text { font-size: 0.9rem; color: var(--ps-text); line-height: 1.5; }
.tour-tip-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.8rem; }
.tour-tip-count { font-size: 0.75rem; color: var(--ps-text-muted); font-family: var(--font-display); letter-spacing: 0.1em; }
.tour-btn-next {
    background: var(--ps-btn-bg); color: var(--ps-btn-fg); border: none; border-radius: 999px;
    padding: 0.3rem 1rem; font-family: var(--font-display); font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.82rem;
}
.tour-btn-skip {
    background: none; border: none; color: var(--ps-text-muted);
    font-size: 0.8rem; text-decoration: underline;
}
.tour-btn-skip:hover { color: var(--ps-text); }

/* ============ DIVERS ============ */
.section-title { display: flex; align-items: center; gap: 0.6rem; font-size: 1.3rem; margin: 0; }
.section-title i { color: var(--ps-text-muted); }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ps-text-muted); }
.empty-state > i { font-size: 2.5rem; display: block; margin-bottom: 0.6rem; opacity: 0.4; }
.modal-content { background: var(--ps-surface); border: 1px solid var(--ps-border); color: var(--ps-text); border-radius: 14px; }
.modal-header, .modal-footer { border-color: var(--ps-border); }
.btn-close { filter: invert(1); }
.task-done { text-decoration: line-through; opacity: 0.5; }
.dropdown-menu { background: var(--ps-surface-2); border: 1px solid var(--ps-border); }
.dropdown-item { color: var(--ps-text); }
.dropdown-item:hover { background: var(--ps-soft-fill); color: var(--ps-text); }

/* ==========================================================
   LANDING (vitrine) — sections plein écran, reveal au scroll
   ========================================================== */
.landing-body { overflow-x: hidden; }
.landing-section {
    min-height: 88vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: 5rem 1.5rem;
    position: relative;
}
.landing-hero-v2 {
    /* `vh` vaut la fenêtre BARRE D'ADRESSE MASQUÉE sur mobile : le hero dépassait
     * donc la zone réellement visible et la flèche passait sous la barre. `svh`
     * prend la plus petite fenêtre (barre affichée), ce qui garantit que tout
     * tient au chargement — contrairement à `dvh`, qui reflowerait au défilement.
     * La ligne `vh` reste en repli pour les navigateurs sans `svh`. */
    min-height: calc(100vh - 62px);
    min-height: calc(100svh - 62px);
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(900px 500px at 50% 110%, rgba(110,168,255,0.10), transparent 65%),
        radial-gradient(700px 380px at 50% -10%, rgba(255,255,255,0.045), transparent 60%);
}
/* Fond de section fondu vers le noir en bas : pas de ligne de démarcation avec la suite */
.landing-hero-v2::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 180px;
    background: linear-gradient(to bottom, transparent, var(--ps-bg));
    z-index: -1;
    pointer-events: none;
}
.landing-hero-v2 h1 {
    font-size: clamp(3.2rem, 9vw, 6.5rem);
    font-weight: 800; line-height: 0.98; margin: 0;
}
.landing-hero-v2 h1 .line { display: block; }
.landing-hero-v2 .line-dim { color: var(--ps-text-muted); }
.landing-hero-v2 .line-accent { color: var(--ps-accent); }
.landing-sub {
    color: var(--ps-text-muted); max-width: 520px;
    margin: 1.6rem auto 2.2rem; font-size: 1.08rem; line-height: 1.65;
}

/* Boutons d'appel à l'action à largeur égale : le flex-basis commun les fait
 * se partager la largeur, quelle que soit la longueur des libellés. Sur écran
 * étroit ils passent l'un sous l'autre et occupent toute la place. */
/* Deux boutons strictement égaux : colonnes de grille de largeur fixe plutôt
 * qu'un calcul de contenu, qui se repliait selon la largeur de fenêtre. */
.landing-cta {
    display: grid; grid-template-columns: repeat(2, 15rem);
    justify-content: center; gap: 1rem; margin: 0 auto;
}
.landing-cta .btn { width: 100%; padding-left: 1rem; padding-right: 1rem; }
@media (max-width: 34rem) {
    .landing-cta { grid-template-columns: minmax(0, 18rem); }
}
.landing-kicker {
    font-family: var(--font-display); text-transform: uppercase;
    letter-spacing: 0.35em; font-size: 0.78rem; font-weight: 600;
    color: var(--ps-text-muted); margin-bottom: 1.4rem;
}
.landing-h2 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; margin-bottom: 0.6rem; }
.landing-p { color: var(--ps-text-muted); max-width: 460px; margin: 0 auto; line-height: 1.65; }
/* Chapeau de la section « en action » : un peu plus large que les autres pour
 * tenir sur une seule ligne — un retour à la ligne y rallonge toute la section,
 * déjà contrainte par la hauteur du carrousel. */
.landing-bg-showcase .landing-p { max-width: 34rem; }

/* Preuve sociale avant l'appel à l'action final : trois tuiles de largeur égale,
 * le chiffre en vedette et le libellé en dessous — plus lisible qu'une ligne
 * de texte, et ça donne du rythme à une section sinon très verticale. */
.landing-stats {
    display: grid; grid-template-columns: repeat(3, minmax(0, 11rem));
    justify-content: center; gap: 0.9rem;
    margin: 2rem auto 1.1rem;
}
.ls-tile {
    display: flex; flex-direction: column; gap: 0.15rem;
    padding: 1rem 0.8rem; border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
}
.ls-num {
    font-family: var(--font-display); font-size: 1.9rem; font-weight: 800;
    line-height: 1; color: var(--ps-text);
}
.ls-lab {
    font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--ps-text-muted); line-height: 1.3;
}
.landing-trust {
    font-size: 0.82rem; color: var(--ps-text-muted);
    margin: 0; letter-spacing: 0.01em;
}
.landing-trust i { color: var(--ps-success); margin-right: 0.15rem; }
@media (max-width: 575.98px) {
    .landing-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; max-width: 22rem; }
    .ls-tile { padding: 0.75rem 0.4rem; }
    .ls-num { font-size: 1.45rem; }
    .ls-lab { font-size: 0.66rem; letter-spacing: 0.05em; }
    .landing-trust { font-size: 0.75rem; }
}

/* Indicateur scroll */
/* Indicateur de défilement : c'est un lien vers la section suivante, donc il
 * doit se voir et s'atteindre — d'où le contraste relevé, le cercle de fond et
 * une zone de clic de 44 px (taille de cible tactile recommandée). */
.scroll-cue {
    position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%);
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--ps-text); font-size: 1.5rem; text-decoration: none;
    border: 1px solid rgba(255,255,255,0.16); background: rgba(255,255,255,0.05);
    animation: cueBounce 2.2s ease-in-out infinite;
    transition: background .2s ease, border-color .2s ease;
}
.scroll-cue:hover {
    color: var(--ps-text);
    background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.35);
}
@keyframes cueBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.7; }
    50% { transform: translateX(-50%) translateY(7px); opacity: 1; }
}

/* Animations d'entrée du hero */
.hero-anim { opacity: 0; animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.hero-anim-1 { animation-delay: 0.05s; }
.hero-anim-2 { animation-delay: 0.2s; }
.hero-anim-3 { animation-delay: 0.35s; }
.hero-anim-4 { animation-delay: 0.55s; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(26px); }
    to { opacity: 1; transform: none; }
}

/* Reveal au scroll (IntersectionObserver ajoute .visible) */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.22s; }
.reveal-d3 { transition-delay: 0.34s; }

/* Carrousel défilant (marquee) */
.marquee { width: 100vw; margin: 3rem 0 0; margin-left: calc(50% - 50vw); overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
    mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}
.marquee-track { display: flex; gap: 1.1rem; width: max-content; animation: marqueeScroll 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.m-card {
    width: 290px; flex: 0 0 auto; text-align: left;
    background: var(--ps-surface); border: 1px solid var(--ps-border);
    border-radius: 14px; padding: 1.5rem;
}
.m-card i { font-size: 1.5rem; color: var(--ps-accent); display: block; margin-bottom: 0.8rem; }
.m-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.m-card p { color: var(--ps-text-muted); font-size: 0.88rem; margin: 0; line-height: 1.55; }

/* Sections de la vitrine avec décor "art CSS" pleine largeur.
 * Dessiné directement dans la palette du site : aucun raccord d'image à gérer,
 * les motifs s'estompent d'eux-mêmes vers le fond via le masque de ::before. */
.landing-bg {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    position: relative;
    isolation: isolate;
}
.landing-bg::before {
    content: ''; position: absolute; inset: 0; z-index: -1;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 78%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 22%, black 78%, transparent 100%);
    pointer-events: none;
}
/* Features — planche technique : grille blueprint, trame de points, halos bleus */
.landing-bg-features::before {
    background:
        radial-gradient(620px 320px at 12% 22%, rgba(110, 168, 255, 0.09), transparent 62%),
        radial-gradient(700px 360px at 88% 78%, rgba(110, 168, 255, 0.07), transparent 62%),
        radial-gradient(rgba(110, 168, 255, 0.16) 1px, transparent 1.5px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 90px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 90px);
    background-size: auto, auto, 26px 26px, auto, auto;
}
/* CTA — image "piste" (22_54_12), fondue en haut/bas par le masque de .landing-bg::before */
.landing-bg-cta::before {
    background-image: url('../img/landing-bg-cta.jpg');
    background-size: cover;
    background-position: center;
}

/* Rangs sur la vitrine — la liste s'estompe vers le sombre (les hauts grades se méritent) */
/* ===== Carrousel coverflow (vitrine) ===== */
/* Trois plafonds simultanés : une limite absolue, la largeur disponible, et la
 * HAUTEUR de fenêtre. La diapositive active occupe ~30 % de la largeur du
 * conteneur en hauteur — borner à 130vh la maintient donc sous ~40 vh, ce qui
 * remplace l'ancien rétrécissement brutal des diapositives sur écran bas.
 * Avant, le plafond fixe de 1120 px laissait le carrousel minuscule au milieu
 * d'un écran large. */
.cf {
    position: relative; width: 100%;
    max-width: min(2000px, 92vw, 150vh);
    margin: 2.6rem auto 0; padding: 0 8px;
}
.cf-stage { position: relative; min-height: 440px; }

/* Fenêtres basses (portables, fenêtre non maximisée) : la section « en action »
 * porte un carrousel de captures qui la fait facilement dépasser la hauteur
 * d'écran. On réduit le rembourrage ET la largeur des diapositives — leur
 * hauteur en découle, et le JS qui ajuste la scène suit automatiquement. */
@media (max-height: 800px) {
    /* Hero : on ne touche qu'au rembourrage, jamais à la taille du titre. */
    .landing-section.landing-hero-v2 { padding-top: 3rem; padding-bottom: 3rem; }
    .landing-section.landing-bg-showcase { padding-top: 2.2rem; padding-bottom: 2.2rem; }
    .landing-bg-showcase .landing-kicker { margin-bottom: 0.7rem; }
    .landing-bg-showcase .landing-p { margin-bottom: 0.2rem; }
    .cf-stage { min-height: 260px; }
}
.cf-slide {
    position: absolute; top: 0; left: 50%; width: 62%; margin: 0; cursor: pointer;
    transform: translateX(-50%) scale(0.78); opacity: 0; pointer-events: none;
    transition: transform .55s cubic-bezier(.22,1,.36,1), opacity .55s ease, filter .55s ease;
}
.cf-slide .app-browser { width: 100%; box-shadow: 0 30px 70px rgba(0,0,0,0.6); }
.cf-slide.is-active { transform: translateX(-50%) scale(1); opacity: 1; pointer-events: auto; }
.cf-slide.is-left { transform: translateX(-82%) scale(0.8); opacity: 0.5; filter: brightness(0.55); pointer-events: auto; }
.cf-slide.is-right { transform: translateX(-18%) scale(0.8); opacity: 0.5; filter: brightness(0.55); pointer-events: auto; }
.cf-slide.is-far-left { transform: translateX(-104%) scale(0.7); opacity: 0; }
.cf-slide.is-far-right { transform: translateX(4%) scale(0.7); opacity: 0; }
/* Mockup mobile flottant (desktop) */
.cf-phone {
    position: absolute; right: 8px; bottom: -18px; z-index: 20;
    width: clamp(96px, 10%, 190px);   /* proportionnel au conteneur, sinon il rétrécit visuellement quand le carrousel grandit */
    border-radius: 20px; overflow: hidden; background: #0a0b0d; border: 5px solid #22262e;
    box-shadow: 0 18px 40px rgba(0,0,0,0.65);
}
.cf-phone img { display: block; width: 100%; height: auto; }
.cf-nav {
    position: absolute; top: 44%; transform: translateY(-50%); z-index: 30;
    width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18);
    background: rgba(20,22,28,0.85); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
    transition: background .15s ease;
}
.cf-prev { left: 0; } .cf-next { right: 0; }
.cf-nav:hover { background: rgba(48,52,62,0.98); }
.cf-caption { margin: 1.4rem auto 0; color: var(--ps-text-muted); font-size: 0.98rem; text-align: center; max-width: 620px; min-height: 2.6em; }
.cf-dots { display: flex; gap: 8px; justify-content: center; margin-top: 0.4rem; }
.cf-dot { width: 9px; height: 9px; border-radius: 50%; border: none; background: rgba(255,255,255,0.22); cursor: pointer; padding: 0; transition: all .2s ease; }
.cf-dot.active { background: var(--ps-accent); width: 22px; border-radius: 5px; }
@media (max-width: 900px) {
    .cf-stage { min-height: 300px; overflow: hidden; }
    .cf-slide { width: 82%; }
    .cf-phone { display: none; }
}
@media (max-width: 560px) {
    .cf-stage { min-height: 220px; }
    .cf-slide { width: 90%; }
    .cf-slide.is-left, .cf-slide.is-right { opacity: 0; }
    .cf-nav { width: 40px; height: 40px; }
}

/* ===== Showcase captures d'app (vitrine) ===== */
.app-showcase { max-width: 1040px; margin: 2.6rem auto 0; }
.app-showcase-hero { position: relative; }
.app-browser {
    margin: 0; border-radius: 12px; overflow: hidden; background: #15171c;
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.app-browser-bar { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #1c1f26; }
.app-browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3f4a; display: block; }
.app-browser-bar i:nth-child(1) { background: #ff5f57; }
.app-browser-bar i:nth-child(2) { background: #febc2e; }
.app-browser-bar i:nth-child(3) { background: #28c840; }
.app-browser img { display: block; width: 100%; height: auto; }
.app-browser figcaption {
    padding: 0.7rem 1rem; font-size: 0.85rem; color: var(--ps-text-muted);
    background: #15171c; text-align: center;
}
/* Téléphone en superposition sur le hero (desktop) */
.app-phone {
    position: absolute; right: -10px; bottom: -28px; width: 168px; margin: 0;
    border-radius: 26px; overflow: hidden; background: #0a0b0d;
    border: 5px solid #22262e; box-shadow: 0 20px 44px rgba(0,0,0,0.6);
}
.app-phone img { display: block; width: 100%; height: auto; }
.app-showcase-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2.6rem;
}
@media (max-width: 767px) {
    .app-phone { position: static; width: 60%; margin: 1.2rem auto 0; }
    .app-showcase-grid { grid-template-columns: 1fr; gap: 1.4rem; margin-top: 1.6rem; }
}

.landing-ranks {
    display: flex; flex-direction: column; gap: 0.4rem; align-items: center; margin-top: 2.2rem;
    -webkit-mask-image: linear-gradient(to bottom, black 25%, rgba(0,0,0,0.06) 97%);
    mask-image: linear-gradient(to bottom, black 25%, rgba(0,0,0,0.06) 97%);
}
.landing-rank-row {
    display: flex; align-items: baseline; gap: 1rem;
    font-family: var(--font-display); text-transform: uppercase; font-weight: 700;
    font-size: clamp(1.1rem, 3vw, 1.7rem); letter-spacing: 0.04em;
    color: var(--ps-text);
}
.landing-rank-row .rank-num { font-size: 0.8em; opacity: 0.5; width: 2ch; text-align: right; }
.landing-rank-row:hover { color: var(--ps-accent); }

@media (max-width: 768px) {
    .ps-hero { padding: 1.4rem 1.2rem; }
    .ps-hero h1 { font-size: 1.7rem; }
    .xp-bar { width: 70px; }
    .vehicle-hero-photo { width: 100%; height: 180px; }
}

/* ===== Guides (pages SEO) ===== */
.guide-card { display: block; transition: transform .15s ease, border-color .15s ease; }
.guide-card:hover { transform: translateY(-3px); border-color: var(--ps-accent); }
.guide-card-icon {
    width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
    background: rgba(110,168,255,0.12); color: var(--ps-accent); font-size: 1.4rem;
}
.guide-card h2 { color: var(--ps-text); }
.guide-card-more { color: var(--ps-accent); display: inline-block; margin-top: 0.8rem; font-weight: 600; }
.guide-card-accent { border-color: rgba(226,192,120,0.35); }
.guide-card-accent .guide-card-icon { background: rgba(226,192,120,0.14); color: var(--ps-gold); }
.guide-card-accent .guide-card-more { color: var(--ps-gold); }

/* Corps d'article des guides */
.guide-body h2 { font-size: 1.25rem; margin: 1.6rem 0 0.6rem; }
.guide-body h2:first-child { margin-top: 0; }
.guide-body p, .guide-body li { line-height: 1.7; }
.guide-body table { width: 100%; margin: 0.6rem 0; }
.guide-toc a { color: var(--ps-accent); text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }

/* ===== Bouton menu mobile (toggler) — visible en thème sombre ET clair ===== */
.navbar-toggler { border-color: var(--ps-ghost-border); padding: .3rem .55rem; }
.navbar-toggler:focus { box-shadow: none; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23eceef2' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
[data-theme="light"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23171922' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== Nom de véhicule : pastille de livrée + texte toujours lisible ===== */
.veh-link { text-decoration: none; }
.veh-link:hover { text-decoration: underline; }
/* Matrice d'échéances : surnom et compteur sur une seconde ligne sous le nom,
 * au lieu d'une colonne « Compteur » dédiée. Libère toute une largeur de colonne
 * sur écran étroit, et aligne le desktop sur les cartes mobiles. */
.deadline-matrix .veh-sub {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.45rem;
    margin-top: 0.1rem; font-weight: 400;
}
.deadline-matrix .veh-km { font-size: 0.78rem; color: var(--ps-text-muted); white-space: nowrap; }
/* Le surnom porte déjà sa propre couleur ; on neutralise juste son retour à la ligne. */
.deadline-matrix .vehicle-nickname { display: inline; }

/* Sélecteur du catalogue de suivis (Réglages) : la liste prend la place
 * disponible, le bouton reste à sa largeur. */
.rules-add { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.rules-add select { flex: 1 1 14rem; min-width: 0; }

/* ===== Onglets de la page admin ===== */
.admin-tabs { border-bottom: 1px solid var(--ps-border); gap: 0.25rem; }
.admin-tabs .nav-link {
    border: none; border-bottom: 2px solid transparent; border-radius: 0;
    padding: 0.55rem 1.1rem; background: none;
    font-family: var(--font-display); font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem;
    color: var(--ps-text-muted);
}
.admin-tabs .nav-link:hover { color: var(--ps-text); border-bottom-color: var(--ps-border); }
.admin-tabs .nav-link.active {
    color: var(--ps-text); background: none;
    border-bottom-color: var(--ps-accent);
}

/* Liste à barres des répartitions (onglet Contenu) : le libellé à gauche, la
 * barre proportionnelle au maximum de la série, le nombre à droite. */
.stat-bar-row {
    display: grid; grid-template-columns: minmax(0, 11rem) 1fr auto;
    align-items: center; gap: 0.7rem; padding: 0.3rem 0;
}
.stat-bar-label {
    font-size: 0.88rem; color: var(--ps-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-bar-track { height: 7px; border-radius: 4px; background: var(--ps-soft-fill); overflow: hidden; }
.stat-bar-fill  { display: block; height: 100%; border-radius: 4px; min-width: 2px; }
.stat-bar-value { font-weight: 700; font-size: 0.9rem; min-width: 2.2rem; text-align: right; }
@media (max-width: 575.98px) {
    .stat-bar-row { grid-template-columns: minmax(0, 7.5rem) 1fr auto; gap: 0.5rem; }
    .stat-bar-label { font-size: 0.8rem; }
}

/* ===== Support moto : distinction visuelle du type de véhicule ===== */
/* Icône discrète devant le nom : elle informe sans concurrencer le titre. */
.veh-type-icon { color: var(--ps-text-muted); font-size: 0.82em; vertical-align: 1px; }

/* Intitulé de groupe au-dessus de chaque matrice d'échéances, affiché
 * uniquement quand le garage est mixte. */
.matrix-group {
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0.7rem 1rem 0.2rem;
    font-family: var(--font-display); font-weight: 700;
    font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--ps-text-muted);
}
.matrix-group i { color: var(--ps-accent); font-size: 1rem; }

/* Sélecteur voiture / moto du formulaire véhicule. */
.veh-type-choice .btn-check:checked + .btn {
    border-color: var(--ps-accent); color: var(--ps-text);
    background: rgba(110, 168, 255, 0.12);
}

.veh-dot {
    display: inline-block; width: 11px; height: 11px; border-radius: 50%;
    margin-right: .5rem; vertical-align: middle; flex: 0 0 auto;
    border: 1px solid rgba(128, 134, 145, .55);
}

/* ============================================================
   MOBILE : barre d'onglets, échéances en cartes, polish
   ============================================================ */

/* ---- Barre d'onglets fixe en bas (< 992px, connectés) ---- */
.ps-bottomnav { display: none; }
@media (max-width: 991.98px) {
    .ps-bottomnav {
        display: flex;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1035;
        background: var(--ps-nav-bg); backdrop-filter: blur(12px);
        border-top: 1px solid var(--ps-border);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bn-item {
        flex: 1 1 0; min-width: 0;
        display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 0.5rem 0.2rem 0.55rem;
        color: var(--ps-text-muted); text-decoration: none;
        font-family: var(--font-display); font-weight: 700; font-size: 0.66rem;
        text-transform: uppercase; letter-spacing: 0.06em;
        border-top: 2px solid transparent;
        transition: color .15s ease, border-color .15s ease;
    }
    .bn-item i { font-size: 1.2rem; line-height: 1; }
    .bn-item:active { background: var(--ps-soft-fill); }
    .bn-item.active { color: var(--ps-text); border-top-color: var(--ps-accent); }
    .bn-item.active i { color: var(--ps-accent); }
    /* Place réservée pour que la barre ne masque ni le footer ni le FAB */
    body.has-bottomnav { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
    body.has-bottomnav .fab-wrap { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* ---- Échéances en cartes (mobile) : une carte par véhicule ----
   Liseré gauche = pire statut du véhicule, puces en grille 2 colonnes
   pour un alignement net, icône de statut en plus de la couleur. */
.dl-cards { display: flex; flex-direction: column; }
.dl-card {
    position: relative;
    padding: 0.85rem 1rem 0.95rem 1.15rem;
    border-top: 1px solid var(--ps-border);
}
.dl-card:first-child { border-top: none; }
/* Liseré de statut */
.dl-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: transparent;
}
.dl-card.dl-card-retard::before  { background: var(--ps-danger); }
.dl-card.dl-card-bientot::before { background: var(--ps-gold); }
.dl-card.dl-card-ok::before      { background: var(--ps-success); }

/* En-tête cliquable : nom + résumé + chevron */
.dl-card-head {
    display: flex; align-items: center; gap: 0.5rem;
    text-decoration: none; margin-bottom: 0.6rem;
}
.dl-card-name {
    display: inline-flex; align-items: center; min-width: 0;
    font-family: var(--font-display); font-weight: 700;
    font-size: 1.02rem; letter-spacing: 0.02em;
    color: var(--ps-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Compteur sous le nom dans la carte mobile : reprend l'info du bloc « Mon garage »
 * supprimé du tableau de bord. Il lui faut un conteneur en colonne — .dl-card-name
 * est en inline-flex avec nowrap et ellipse, un enfant s'y placerait à côté du nom
 * et serait tronqué. */
.dl-card-id { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.dl-card-km { font-size: 0.76rem; font-weight: 400; color: var(--ps-text-muted); line-height: 1.2; }
.dl-card-go { color: var(--ps-text-muted); font-size: 0.8rem; flex: 0 0 auto; }
/* Pastille de résumé, poussée à droite */
.dl-sum {
    margin-left: auto; flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.12rem 0.45rem; border-radius: 999px;
    font-family: var(--font-display); font-weight: 700;
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
    border: 1px solid transparent;
}
.dl-sum-retard  { color: var(--ps-danger);  background: rgba(240,113,130,0.12); border-color: rgba(240,113,130,0.35); }
.dl-sum-bientot { color: var(--ps-gold);    background: rgba(226,192,120,0.12); border-color: rgba(226,192,120,0.35); }
.dl-sum-ok      { color: var(--ps-success); background: rgba(95,214,169,0.10);  border-color: rgba(95,214,169,0.30); }

/* Lignes d'échéance : pleine largeur, type à gauche / échéance à droite.
   Toutes les lignes ont la même largeur → symétrie garantie quel que soit le nombre. */
.dl-chips { display: flex; flex-direction: column; }
.dl-chip {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.48rem 0.55rem;
    border-top: 1px solid var(--ps-border);
    border-radius: 6px;
}
.dl-chip:first-child { border-top: none; }
.dl-chip-type {
    display: flex; align-items: center; gap: 0.45rem;
    min-width: 0; flex: 1 1 auto;
    font-size: 0.86rem; font-weight: 600; color: var(--ps-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dl-chip-type i { font-size: 0.82rem; flex: 0 0 auto; }
.dl-chip-detail {
    flex: 0 0 auto; text-align: right;
    font-size: 0.78rem; color: var(--ps-text-muted);
    font-variant-numeric: tabular-nums;
}
/* Couleur portée par l'icône (et le détail quand c'est urgent) */
.dl-chip.dl-retard  .dl-chip-type i { color: var(--ps-danger); }
.dl-chip.dl-retard  .dl-chip-detail { color: var(--ps-danger); font-weight: 600; }
.dl-chip.dl-retard  { background: rgba(240,113,130,0.07); }
.dl-chip.dl-bientot .dl-chip-type i { color: var(--ps-gold); }
.dl-chip.dl-bientot .dl-chip-detail { color: var(--ps-gold); }
.dl-chip.dl-ok      .dl-chip-type i { color: var(--ps-success); }
.dl-chip.dl-inconnu .dl-chip-type   { color: var(--ps-text-muted); font-weight: 500; }
.dl-chip.dl-inconnu .dl-chip-type i { color: var(--ps-text-muted); }
.dl-chip.dl-inconnu .dl-chip-detail { font-style: italic; }

/* ---- Polish mobile ---- */
@media (max-width: 575.98px) {
    /* Vitrine : sur écran étroit, imposer 88vh à chaque section réserve une
     * hauteur très supérieure au contenu — d'où de grands vides qui donnent
     * l'impression d'un bloc mal centré. Les sections se dimensionnent donc sur
     * leur contenu ; seul le hero garde la pleine hauteur, qui fait son effet. */
    .landing-section { min-height: auto; padding: 3.5rem 1rem; }
    .landing-section.landing-hero-v2 {
        min-height: calc(100vh - 62px);
        min-height: calc(100svh - 62px);
        padding-top: 1.6rem; padding-bottom: 3rem;
    }
    /* Le plancher du clamp (3,2 rem) s'appliquait identiquement à 360 px et à
     * 413 px : « Ton garage. » tenait sur un Fold mais cassait en deux lignes sur
     * un S23, transformant le triptyque en quatre lignes et poussant la flèche
     * hors écran. Une valeur purement proportionnelle règle les deux cas —
     * 12vw rend 43 px sur un S23 (ça tient) et 50 px sur un Fold (inchangé). */
    .landing-hero-v2 h1 { font-size: clamp(2.3rem, 12vw, 4.2rem); }
    .landing-hero-v2 .landing-sub { margin: 1.2rem auto 1.7rem; }
    /* Cartes et héros plus compacts : moins de scroll pour la même info */
    .card-body { padding: 0.9rem; }
    .ps-hero { padding: 1.1rem 1rem; }
    .section-title.h2 { font-size: 1.5rem; }
    /* Cibles tactiles confortables dans les tableaux restants */
    .table > :not(caption) > * > * { padding: 0.6rem 0.5rem; }
    /* Les tuiles de stats gagnent en densité */
    .stat-tile .card-body { padding: 0.75rem; }
    .stat-value { font-size: 1.5rem; }
}
/* Le FAB flotte au-dessus du footer : on réserve sa gouttière pour que la mention
   d'hébergement ne passe pas dessous. */
@media (max-width: 991.98px) {
    body.has-bottomnav .footer-note { padding-right: 72px; }
}

/* ---- Tableaux transformés en fiches empilées sur mobile ----
   Transformation 100 % CSS : le HTML des tableaux reste intact (important pour
   le journal, qui contient des formulaires modifier/supprimer et les documents).
   Chaque ligne devient une grille ; les colonnes secondaires sont masquées. */
@media (max-width: 767.98px) {
    .ps-stack { display: block; }
    .ps-stack thead { display: none; }
    .ps-stack tbody { display: block; }
    .ps-stack tbody tr {
        display: grid; grid-template-columns: 1fr auto;
        gap: 0.2rem 0.6rem; align-items: center;
        padding: 0.8rem 0.9rem;
        border-top: 1px solid var(--ps-border);
    }
    .ps-stack tbody tr:first-child { border-top: none; }
    .ps-stack td { display: block; border: none !important; padding: 0 !important; min-width: 0; }

    /* Entretien périodique : Type | Statut, puis prochaine échéance, puis dernier */
    .ps-stack-deadlines tbody tr { grid-template-areas: "type stat" "next next" "last last"; }
    .ps-stack-deadlines td:nth-child(1) { grid-area: type; font-size: 0.95rem; }
    .ps-stack-deadlines td:nth-child(2) { grid-area: last; }
    .ps-stack-deadlines td:nth-child(3) { grid-area: next; }
    .ps-stack-deadlines td:nth-child(4) { grid-area: stat; justify-self: end; }

    /* Journal de suivi : date | coût, titre, catégorie | statut, actions */
    .ps-stack-interv tbody tr { grid-template-areas: "date cost" "title title" "cat stat" "act act"; }
    .ps-stack-interv td:nth-child(1) { grid-area: date; }
    .ps-stack-interv td:nth-child(2) { grid-area: cat; }
    .ps-stack-interv td:nth-child(3) { grid-area: title; }
    .ps-stack-interv td:nth-child(4) { display: none; }   /* Pièces */
    .ps-stack-interv td:nth-child(5) { grid-area: cost; text-align: right; font-size: 1rem; font-weight: 700; }
    .ps-stack-interv td:nth-child(6) { display: none; }   /* Réalisé par */
    .ps-stack-interv td:nth-child(7) { display: none; }   /* Facture : les documents sont déjà listés sous le titre */
    .ps-stack-interv td:nth-child(8) { grid-area: stat; justify-self: end; }
    .ps-stack-interv td:nth-child(9) { grid-area: act; justify-self: end; padding-top: 0.4rem !important; }

    /* Dernières interventions (tableau de bord) : véhicule | coût, intervention, date */
    .ps-stack-recent tbody tr { grid-template-areas: "veh cost" "title title" "date date"; }
    .ps-stack-recent td:nth-child(1) { grid-area: date; }
    .ps-stack-recent td:nth-child(2) { grid-area: veh; }
    .ps-stack-recent td:nth-child(3) { grid-area: title; }
    .ps-stack-recent td:nth-child(4) { grid-area: cost; text-align: right; font-size: 1rem; font-weight: 700; }

    /* Chantiers à venir : véhicule et coût sur la première ligne, le titre en
       dessous sur toute la largeur, la priorité en pied de carte. */
    .ps-stack-chantier tbody tr { grid-template-areas: "veh cost" "title title" "prio prio"; }
    .ps-stack-chantier td:nth-child(1) { grid-area: prio; padding-top: 0.15rem !important; }
    .ps-stack-chantier td:nth-child(2) { grid-area: veh; }
    .ps-stack-chantier td:nth-child(3) { grid-area: title; font-size: 0.95rem; }
    .ps-stack-chantier td:nth-child(4) { grid-area: cost; font-size: 1rem; font-weight: 700; }

    /* Stock : le nom prend toute la largeur (sinon il s'enroulait sur 3 lignes,
       écrasé par le sélecteur de quantité), puis catégorie | quantité,
       prix | véhicule, emplacement | actions. */
    .ps-stack-stock tbody tr { grid-template-areas: "name name" "cat qty" "price veh" "loc act"; }
    .ps-stack-stock td:nth-child(1) { grid-area: name; font-size: 0.95rem; }
    .ps-stack-stock td:nth-child(2) { grid-area: cat; }
    .ps-stack-stock td:nth-child(3) { grid-area: veh; justify-self: end; }
    .ps-stack-stock td:nth-child(4) { grid-area: qty; justify-self: end; }
    .ps-stack-stock td:nth-child(5) { grid-area: price; font-weight: 700; }
    .ps-stack-stock td:nth-child(6) { grid-area: loc; }
    .ps-stack-stock td:nth-child(7) { grid-area: act; justify-self: end; padding-top: 0.4rem !important; }

    /* Alignement : les classes Bootstrap text-end / text-center (utiles en mode
       tableau desktop) se battaient avec le placement en grille — le prix du stock
       partait au milieu. On impose donc l'alignement selon la colonne occupée. */
    .ps-stack td { text-align: left !important; }
    .ps-stack-stock td:nth-child(3),      /* véhicule */
    .ps-stack-stock td:nth-child(4),      /* quantité */
    .ps-stack-stock td:nth-child(7),      /* actions */
    .ps-stack-interv td:nth-child(5),     /* coût */
    .ps-stack-interv td:nth-child(8),     /* statut */
    .ps-stack-interv td:nth-child(9),     /* actions */
    .ps-stack-recent td:nth-child(4),     /* coût */
    .ps-stack-chantier td:nth-child(4),   /* coût estimé */
    .ps-stack-deadlines td:nth-child(4)   /* statut */
    { text-align: right !important; }

    /* Colonnes secondaires masquées : Échéance (plan d'action), €/L et Complet (pleins) */
    .ps-hide-mob-2 th:nth-child(2), .ps-hide-mob-2 td:nth-child(2) { display: none; }
    .ps-hide-fuel th:nth-child(5), .ps-hide-fuel td:nth-child(5),
    .ps-hide-fuel th:nth-child(6), .ps-hide-fuel td:nth-child(6) { display: none; }
}

/* ---- Correctif modales plein écran (mobile) ----
   Nos modales enveloppent header/body/footer dans un <form>, qui interrompt la
   chaîne flex de .modal-content. En plein écran (height:100%), le body ne pouvait
   donc pas scroller et le contenu débordait hors du cadre, par-dessus la page.
   On relaie la chaîne flex jusqu'au body. */
@media (max-width: 575.98px) {
    .modal-fullscreen-sm-down .modal-content > form {
        display: flex; flex-direction: column;
        flex: 1 1 auto; min-height: 0;
    }
    .modal-fullscreen-sm-down .modal-content > form > .modal-header,
    .modal-fullscreen-sm-down .modal-content > form > .modal-footer { flex: 0 0 auto; }
    .modal-fullscreen-sm-down .modal-content > form > .modal-body {
        flex: 1 1 auto; min-height: 0; overflow-y: auto;
    }
}
/* Le FAB (z-index 1500) passait au-dessus de la modale (1055) : on le masque
   pendant qu'une modale est ouverte, quelle que soit la largeur. */
body.modal-open .fab-wrap { display: none !important; }

/* ---- Visite guidée : apparition en fondu après le défilement ----
   On n'anime QUE l'opacité : l'anneau est repositionné à chaque frame, une
   transition sur la position le ferait « ramper » derrière la cible. */
.tour-ring, .tour-tip { opacity: 0; transition: opacity .26s ease; }
.tour-ring.is-in, .tour-tip.is-in { opacity: 1; }
.tour-progress {
    height: 3px; border-radius: 2px; overflow: hidden;
    background: rgba(128, 134, 145, 0.25); margin: 0.75rem 0 0.1rem;
}
.tour-progress span { display: block; height: 100%; background: var(--ps-accent); transition: width .3s ease; }
.tour-btn-prev {
    background: none; border: none; padding: 0;
    color: var(--ps-text-muted); font-size: 0.8rem;
    font-family: var(--font-display); letter-spacing: 0.04em; text-transform: uppercase;
}
.tour-btn-prev:hover { color: var(--ps-text); }

/* ============================================================
   ASSETS GRAPHIQUES — illustrations, damier, fond pit lane
   ============================================================ */

/* ---- Illustrations d'états vides ----
   Posées en MASQUE plutôt qu'en image : la couleur vient alors de la charte
   (var(--ps-accent)), donc l'illustration s'adapte toute seule au thème clair
   comme au thème sombre. Repli en image directe si mask-image n'est pas géré. */
.empty-state.has-illus > i { display: none; }         /* l'icône cède la place */
.empty-state.has-illus::before {
    content: ''; display: block;
    width: min(240px, 62%); aspect-ratio: 3 / 2;
    margin: 0 auto 1rem;
    background: var(--illus) center / contain no-repeat;
    opacity: 0.85;
}
@supports (mask-image: url('')) {
    .empty-state.has-illus::before {
        background: var(--ps-accent);
        -webkit-mask: var(--illus) center / contain no-repeat;
        mask: var(--illus) center / contain no-repeat;
    }
}
.illus-garage  { --illus: url('../img/empty/garage.png'); }
.illus-journal { --illus: url('../img/empty/journal.png'); }
.illus-stock   { --illus: url('../img/empty/stock.png'); }
.illus-plan    { --illus: url('../img/empty/plan.png'); }
@media (max-width: 575.98px) {
    .empty-state.has-illus::before { width: min(190px, 58%); margin-bottom: 0.8rem; }
}

/* ---- Damier de course ----
   En CSS plutôt qu'en image : couleur et opacité exactes, raccord parfait à
   n'importe quelle échelle, et 0 Ko téléchargé. */
.ps-checker { position: relative; }
.ps-checker::before {
    content: ''; position: absolute; inset: 0;
    pointer-events: none; border-radius: inherit;
    background:
        repeating-conic-gradient(var(--ps-accent) 0% 25%, transparent 0% 50%)
        0 0 / 16px 16px;
    opacity: 0.045;
}
/* Le bandeau de page porte la trame : touche « paddock » discrète, présente
   partout sans alourdir. `.ps-hero` est déjà en position:relative + overflow:hidden. */
.ps-hero::after {
    content: ''; position: absolute; inset: 0;
    pointer-events: none;
    background: repeating-conic-gradient(var(--ps-accent) 0% 25%, transparent 0% 50%) 0 0 / 18px 18px;
    opacity: 0.035;
}
[data-theme="light"] .ps-hero::after { opacity: 0.028; }
[data-theme="light"] .ps-checker::before { opacity: 0.03; }

/* Bandeau de damier fin, pour souligner un en-tête facon ligne d'arrivée */
.ps-checker-strip {
    height: 6px; width: 100%;
    background: repeating-conic-gradient(var(--ps-accent) 0% 25%, transparent 0% 50%) 0 0 / 12px 12px;
    opacity: 0.25;
}

/* ---- Fond « pit lane de nuit » : section vitrine « PitStop en action » ----
   Réutilise la machinerie .landing-bg (plein écran + fondu haut/bas déjà définis).
   La photo est déjà très sombre (7 % de luminance) : pas de voile nécessaire. */
.landing-bg-showcase::before {
    background-image: url('../img/landing-bg-showcase.jpg');
    background-size: cover;
    background-position: center;
}
