﻿/* ═══════════════════════════════════════════════════════════
   SOUND DOCTOR — Thérapie Sonore Médicale
   Interface clinique moderne / dark mode immersif
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variables ──────────────────────────────────────────── */
.sounddoctor-app {
    --hw-bg:            #020811;
    --hw-bg2:           #06101f;
    --hw-bg3:           #0a1628;
    --hw-surface:       rgba(255,255,255,0.035);
    --hw-surface-hover: rgba(255,255,255,0.065);
    --hw-border:        rgba(255,255,255,0.07);
    --hw-border-light:  rgba(255,255,255,0.12);

    /* Primary : Teal sounddoctor.fr — médical, tech, précision */
    --hw-teal:          #0dd9c0;
    --hw-teal-dark:     #09a896;
    --hw-teal-glow:     rgba(13,217,192,0.25);
    --hw-teal-glow2:    rgba(13,217,192,0.10);

    --hw-indigo:        #6366f1;
    --hw-indigo-glow:   rgba(99,102,241,0.22);

    --hw-red:           #ef4444;
    --hw-red-dark:      #b91c1c;
    --hw-red-glow:      rgba(239,68,68,0.25);

    --hw-amber:         #f59e0b;
    --hw-amber-glow:    rgba(245,158,11,0.2);

    --hw-purple:        #a855f7;
    --hw-purple-glow:   rgba(168,85,247,0.22);

    --hw-green:         #22c55e;
    --hw-green-glow:    rgba(34,197,94,0.22);

    --hw-text:          #f1f5f9;
    --hw-text-soft:     #94a3b8;
    --hw-text-dim:      #64748b;

    --hw-radius:        16px;
    --hw-radius-sm:     10px;
    --hw-radius-lg:     22px;

    --hw-font:          'Outfit', system-ui, sans-serif;
    --hw-font-body:     'Inter', system-ui, sans-serif;

    --hw-transition:    0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --hw-transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────── */
.sounddoctor-app *,
.sounddoctor-app *::before,
.sounddoctor-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Force le rendu dark sur tous les selects de l'app */
.sounddoctor-app select {
    color-scheme: dark;
}

.sounddoctor-app option,
.sounddoctor-app select option {
    background-color: #0f172a;
    color: #e2e8f0;
}

.sounddoctor-app {
    font-family: var(--hw-font-body);
    background: var(--hw-bg);
    color: var(--hw-text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Halo ambiant animé — tonalité bleue médicale */
.sounddoctor-app::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 65% 55% at 15% 8%,  rgba(13,217,192,0.09) 0%, transparent 65%),
        radial-gradient(ellipse 55% 65% at 85% 92%, rgba(99,102,241,0.07) 0%, transparent 65%),
        radial-gradient(ellipse 45% 45% at 50% 50%, rgba(13,217,192,0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.sounddoctor-app > * { position: relative; z-index: 1; }

/* ── Header ─────────────────────────────────────────────── */
.hw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: rgba(2,8,17,0.97);
    border-bottom: 1px solid var(--hw-border);
    position: sticky;
    top: 0;
    z-index: 100;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.hw-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0; /* autorise le rétrécissement au lieu de pousser/chevaucher le cluster droit */
}

/* Logo — <img> avec src injecte par JS depuis data-logo (contourne LightSpeed + bug GPU Android) */
.hw-brand-logo {
    height: 60px;
    width: 140px;
    display: block;
    object-fit: contain;
    object-position: left center;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.hw-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-indigo));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 22px var(--hw-teal-glow);
    flex-shrink: 0;
}

.hw-logo-icon svg {
    width: 26px;
    height: 26px;
    color: white;
}

.hw-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0; /* nécessaire pour que l'ellipsis fonctionne dans un flex */
}

.hw-brand-name {
    font-family: var(--hw-font);
    /* Taille responsive : suit la largeur de l'écran, bornée entre 0.82rem et 1.3rem */
    font-size: clamp(0.82rem, 3.6vw, 1.3rem);
    font-weight: 700;
    color: var(--hw-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-brand-tagline {
    font-size: 0.72rem;
    color: var(--hw-teal);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hw-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ── Sélecteur de langue ─────────────────────────────── */
.hw-lang-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--hw-surface);
    border: 1px solid var(--hw-border-light);
    border-radius: 20px;
    color: var(--hw-text-soft);
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hw-transition);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.hw-lang-switcher:hover {
    background: var(--hw-surface-hover);
    border-color: rgba(13,217,192,0.3);
    color: var(--hw-teal);
}

.hw-lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.hw-lang-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hw-freq-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: 8px;
    padding: 6px 14px;
    min-width: 100px;
    justify-content: center;
}

.hw-freq-value {
    font-family: var(--hw-font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--hw-teal);
    font-variant-numeric: tabular-nums;
}

.hw-freq-unit {
    font-size: 0.75rem;
    color: var(--hw-text-soft);
}

.hw-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--hw-text-dim);
    transition: var(--hw-transition);
}

.hw-status-dot.active {
    background: var(--hw-teal);
    box-shadow: 0 0 10px var(--hw-teal-glow), 0 0 20px var(--hw-teal-glow2);
    animation: hw-pulse-dot 2s ease-in-out infinite;
}

.hw-status-dot.emergency {
    background: var(--hw-red);
    box-shadow: 0 0 10px var(--hw-red-glow);
    animation: hw-pulse-dot 1s ease-in-out infinite;
}

@keyframes hw-pulse-dot {
    /* opacity seul — transform:scale créait un GPU layer permanent DANS le header,
       bloquant le rendu du logo sur Android Chrome */
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

/* ── Navigation ─────────────────────────────────────────── */
.hw-nav {
    display: flex;
    gap: 0;
    padding: 16px 20px;
    background: var(--hw-bg2);
    border-bottom: 1px solid var(--hw-border);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.hw-nav::-webkit-scrollbar { display: none; }

.hw-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--hw-text-soft);
    font-family: var(--hw-font);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--hw-transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.hw-nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.hw-nav-btn:hover {
    background: var(--hw-surface);
    color: var(--hw-text);
    border-color: var(--hw-border-light);
}

.hw-nav-btn.active {
    background: var(--hw-teal-glow2);
    color: var(--hw-teal);
    border-color: rgba(13,217,192,0.3);
}

.hw-nav-emergency.active {
    background: rgba(239,68,68,0.1);
    color: var(--hw-red);
    border-color: rgba(239,68,68,0.3);
}

.hw-nav-special.active {
    background: rgba(168,85,247,0.1);
    color: var(--hw-purple);
    border-color: rgba(168,85,247,0.3);
}

/* ── Sections ───────────────────────────────────────────── */
.hw-section {
    display: none;
    padding: 32px 24px 120px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.hw-section.active { display: block; }

.hw-section-header {
    text-align: center;
    margin-bottom: 36px;
}

.hw-section-header h2 {
    font-family: var(--hw-font);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--hw-text);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.hw-section-header p {
    font-size: 0.95rem;
    color: var(--hw-text-soft);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ── Body Zone Section ──────────────────────────────────── */
.hw-body-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 32px;
    align-items: start;
}

/* La barre "Récemment utilisé" est injectée par JS entre le médecin (col 1) et
   la grille, ce qui décalait la grille en col 1 ligne 2 (sous le médecin, étroit).
   On force barre + grille en colonne 2, et le médecin span 2 lignes en col 1
   pour que barre (ligne 1) + grille (ligne 2) s'empilent en haut à droite sans
   laisser de trou vide. */
.hw-body-layout > .hw-body-map-container { grid-row: span 2; }
.hw-body-layout > .hw-recent-row,
.hw-body-layout > .hw-zones-grid { grid-column: 2; }

.hw-body-map-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    position: sticky;
    top: 120px;
    overflow: visible;
}

/* ══ Infobulle guide « Dr Serge » ══════════════════════════ */
.hw-guide {
    position: relative;
    width: 250px;
    max-width: 100%;
    margin-bottom: 2px;
    z-index: 4;
}
@keyframes hw-guide-in {
    from { transform: translateY(10px) scale(0.94); }
    to   { transform: translateY(0) scale(1); }
}
.hw-guide-bubble {
    position: relative;
    background: rgba(8,18,34,0.97);
    border: 1px solid rgba(13,217,192,0.30);
    border-radius: 18px;
    padding: 14px 14px 12px;
    box-shadow: 0 12px 34px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}
/* petite flèche pointant vers la tête du médecin */
.hw-guide-tail {
    display: block;
    width: 18px;
    height: 18px;
    margin: -9px auto 0;
    background: rgba(10,22,40,0.96);
    border-right: 1px solid rgba(13,217,192,0.30);
    border-bottom: 1px solid rgba(13,217,192,0.30);
    transform: rotate(45deg);
    border-radius: 0 0 4px 0;
}
.hw-guide-q {
    font-family: var(--hw-font);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--hw-text);
    margin-bottom: 9px;
    text-align: center;
}
.hw-guide-chips {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.hw-guide-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--hw-border-light);
    border-radius: 10px;
    color: var(--hw-text-soft);
    font-family: var(--hw-font-body);
    font-size: 0.72rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--hw-transition);
    line-height: 1.1;
    white-space: nowrap;      /* libellé court sur 1 ligne → chip peu haut */
    overflow: hidden;
    text-overflow: ellipsis;
}
.hw-guide-chip:hover,
.hw-guide-chip:focus-visible {
    background: rgba(13,217,192,0.12);
    border-color: rgba(13,217,192,0.5);
    color: var(--hw-text);
    transform: translateY(-1px);
    outline: none;
}
.hw-guide-chip-emoji { font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
/* Icônes SVG line-art des chips */
.hw-guide-chip-ic { display: inline-flex; flex-shrink: 0; }
.hw-guide-chip-ic svg { width: 18px; height: 18px; color: var(--hw-teal); }
.hw-guide-chip:hover .hw-guide-chip-ic svg,
.hw-guide-chip:focus-visible .hw-guide-chip-ic svg { color: var(--hw-text); }

/* ── Carte de recommandation ── */
.hw-guide-reco { animation: hw-guide-fade 0.35s ease both; }
@keyframes hw-guide-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.hw-guide-reco-intro {
    font-size: 0.74rem;
    color: var(--hw-text-soft);
    margin-bottom: 8px;
    line-height: 1.35;
}
.hw-guide-reco-intro strong { color: var(--hw-teal); font-weight: 600; }
.hw-guide-reco-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(13,217,192,0.07);
    border: 1px solid rgba(13,217,192,0.28);
    border-radius: 13px;
    margin-bottom: 10px;
}
.hw-guide-reco-emoji {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    filter: drop-shadow(0 0 8px rgba(13,217,192,0.4));
}
.hw-guide-reco-emoji svg { width: 26px; height: 26px; color: var(--hw-teal); }
.hw-guide-reco-txt { min-width: 0; }
.hw-guide-reco-name {
    font-family: var(--hw-font);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--hw-text);
    line-height: 1.2;
}
.hw-guide-reco-freq {
    font-size: 0.68rem;
    color: var(--hw-teal);
    font-weight: 600;
    margin-top: 2px;
}
.hw-guide-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-teal-dark));
    color: #04211d;
    border: none;
    border-radius: 11px;
    font-family: var(--hw-font);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hw-transition);
    box-shadow: 0 5px 16px rgba(13,217,192,0.32);
}
.hw-guide-start:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(13,217,192,0.45); }
.hw-guide-reset {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13,217,192,0.12);
    border: 1px solid rgba(13,217,192,0.4);
    border-radius: 50%;
    color: var(--hw-teal);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--hw-transition);
    line-height: 1;
    z-index: 3;              /* au-dessus du contenu de reco, sinon le <p> intercepte le clic */
    pointer-events: auto;
}
/* respecter l'attribut hidden (sinon display:flex l'affiche en permanence) */
.hw-guide-reset[hidden] { display: none; }
.hw-guide-reset:hover { background: rgba(13,217,192,0.22); border-color: rgba(13,217,192,0.7); transform: rotate(-90deg); }
/* laisser la place au bouton ↺ pour ne pas coller le texte dessous */
.hw-guide-reco-intro { padding-right: 30px; }

.hw-body-silhouette {
    position: relative;
    width: 190px;
}

/* Photo du médecin : <img> standard positionné derrière le SVG des hotspots */
.hw-doctor-photo {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: top center;
    pointer-events: none;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.hw-body-svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    display: block;
}

.hw-hotspot { cursor:pointer; fill:none; stroke:transparent; pointer-events:all; transition:all 0.25s cubic-bezier(0.4,0,0.2,1); }
.hw-hs-brain:hover,.hw-hs-brain.active { fill:rgba(168,85,247,0.22); stroke:#a855f7; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(168,85,247,0.7)); }
.hw-hs-throat:hover,.hw-hs-throat.active { fill:rgba(13,217,192,0.22); stroke:#0dd9c0; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(13,217,192,0.7)); }
.hw-hs-heart:hover,.hw-hs-heart.active { fill:rgba(239,68,68,0.22); stroke:#ef4444; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(239,68,68,0.7)); }
.hw-hs-solar:hover,.hw-hs-solar.active { fill:rgba(245,158,11,0.22); stroke:#f59e0b; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(245,158,11,0.7)); }
.hw-hs-abdomen:hover,.hw-hs-abdomen.active { fill:rgba(245,158,11,0.18); stroke:#f59e0b; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(245,158,11,0.6)); }
.hw-hs-lowerback:hover,.hw-hs-lowerback.active { fill:rgba(99,102,241,0.22); stroke:#6366f1; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(99,102,241,0.7)); }
.hw-hs-arms:hover,.hw-hs-arms.active { fill:rgba(13,217,192,0.18); stroke:#0dd9c0; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(13,217,192,0.6)); }
.hw-hs-legs:hover,.hw-hs-legs.active { fill:rgba(34,197,94,0.22); stroke:#22c55e; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(34,197,94,0.7)); }
.hw-hs-feet:hover,.hw-hs-feet.active { fill:rgba(34,197,94,0.18); stroke:#22c55e; stroke-width:1.8; filter:drop-shadow(0 0 10px rgba(34,197,94,0.6)); }
.hw-hotspot-back { display:none; }

.hw-body-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(13,217,192,0.92);
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: var(--hw-transition);
    z-index: 10;
}

.hw-body-tooltip.visible {
    opacity: 1;
}

/* ── Zones Grid ─────────────────────────────────────────── */
.hw-zones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

/* ── Session Card ───────────────────────────────────────── */
.hw-card {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    padding: 22px;
    cursor: pointer;
    transition: var(--hw-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hw-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--hw-teal-glow2) 0%, transparent 60%);
    opacity: 0;
    transition: var(--hw-transition);
    border-radius: inherit;
}

.hw-card:hover {
    transform: translateY(-3px);
    border-color: rgba(13,217,192,0.3);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(13,217,192,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.055);
}

.hw-card:hover::before { opacity: 1; }

.hw-card.active-card {
    border-color: rgba(13,217,192,0.5);
    box-shadow: 0 0 0 1px rgba(13,217,192,0.3), 0 0 30px var(--hw-teal-glow2);
}

/* ── Recently Used ── */
.hw-recent-row {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(13,217,192,0.06), rgba(99,102,241,0.04));
    border: 1px solid rgba(13,217,192,0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hw-recent-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hw-teal);
    white-space: nowrap;
    flex-shrink: 0;
}
.hw-recent-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hw-recent-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(13,217,192,0.08);
    border: 1px solid rgba(13,217,192,0.2);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--hw-transition);
    font-family: var(--hw-font);
    font-size: 0.78rem;
    color: var(--hw-text);
}
.hw-recent-chip:hover {
    background: rgba(13,217,192,0.18);
    border-color: rgba(13,217,192,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,217,192,0.2);
}
.hw-recent-chip-icon { font-size: 0.88rem; }
.hw-recent-chip-name { font-weight: 500; color: var(--hw-text-soft); }

.hw-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.hw-card-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.hw-card-title {
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--hw-text);
    line-height: 1.3;
}

.hw-card-freq {
    font-size: 0.78rem;
    color: var(--hw-teal);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.hw-card-desc {
    font-size: 0.84rem;
    color: var(--hw-text-soft);
    line-height: 1.55;
    flex: 1;
}

.hw-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.hw-card-duration {
    font-size: 0.78rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hw-card-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--hw-teal-glow2);
    border: 1px solid rgba(13,217,192,0.3);
    border-radius: 8px;
    color: var(--hw-teal);
    font-family: var(--hw-font);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hw-transition);
}

.hw-card-btn:hover {
    background: var(--hw-teal-glow);
    border-color: var(--hw-teal);
}

.hw-card-btn svg {
    width: 13px;
    height: 13px;
}

/* Variantes couleur cartes */
.hw-card-red .hw-card-btn, .hw-card-red .hw-card-freq { color: var(--hw-red); }
.hw-card-red .hw-card-btn { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); }
.hw-card-red .hw-card-btn:hover { background: var(--hw-red-glow); border-color: var(--hw-red); }
.hw-card-red::before { background: linear-gradient(135deg, rgba(239,68,68,0.08) 0%, transparent 60%); }

.hw-card-indigo .hw-card-btn, .hw-card-indigo .hw-card-freq { color: var(--hw-indigo); }
.hw-card-indigo .hw-card-btn { background: var(--hw-indigo-glow); border-color: rgba(99,102,241,0.35); }
.hw-card-indigo .hw-card-btn:hover { background: rgba(99,102,241,0.3); border-color: var(--hw-indigo); }
.hw-card-indigo::before { background: linear-gradient(135deg, var(--hw-indigo-glow) 0%, transparent 60%); }

.hw-card-amber .hw-card-btn, .hw-card-amber .hw-card-freq { color: var(--hw-amber); }
.hw-card-amber .hw-card-btn { background: var(--hw-amber-glow); border-color: rgba(245,158,11,0.35); }
.hw-card-amber .hw-card-btn:hover { background: rgba(245,158,11,0.3); border-color: var(--hw-amber); }
.hw-card-amber::before { background: linear-gradient(135deg, var(--hw-amber-glow) 0%, transparent 60%); }

.hw-card-purple .hw-card-btn, .hw-card-purple .hw-card-freq { color: var(--hw-purple); }
.hw-card-purple .hw-card-btn { background: var(--hw-purple-glow); border-color: rgba(168,85,247,0.35); }
.hw-card-purple .hw-card-btn:hover { background: rgba(168,85,247,0.3); border-color: var(--hw-purple); }
.hw-card-purple::before { background: linear-gradient(135deg, var(--hw-purple-glow) 0%, transparent 60%); }

.hw-card-green .hw-card-btn, .hw-card-green .hw-card-freq { color: var(--hw-green); }
.hw-card-green .hw-card-btn { background: var(--hw-green-glow); border-color: rgba(34,197,94,0.35); }
.hw-card-green .hw-card-btn:hover { background: rgba(34,197,94,0.3); border-color: var(--hw-green); }
.hw-card-green::before { background: linear-gradient(135deg, var(--hw-green-glow) 0%, transparent 60%); }

/* ── Pathologies / Special Grids ────────────────────────── */
.hw-pathologies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.hw-special-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

/* ── Emergency Grid ─────────────────────────────────────── */
.hw-emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.hw-emergency-btn {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 28px;
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius-lg);
    cursor: pointer;
    transition: var(--hw-transition);
    text-align: left;
    width: 100%;
    color: var(--hw-text);
    font-family: var(--hw-font);
}

.hw-emergency-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--hw-red-glow) 0%, transparent 70%);
    opacity: 0;
    transition: var(--hw-transition-slow);
}

.hw-emergency-btn:hover::before,
.hw-emergency-btn.running::before { opacity: 1; }

.hw-emergency-btn:hover {
    border-color: rgba(239,68,68,0.4);
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(239,68,68,0.15);
}

.hw-emergency-btn.running {
    border-color: rgba(239,68,68,0.6);
    box-shadow: 0 0 0 1px rgba(239,68,68,0.4), 0 0 40px rgba(239,68,68,0.2);
    animation: hw-emergency-pulse 2.5s ease-in-out infinite;
}

@keyframes hw-emergency-pulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(239,68,68,0.4), 0 0 40px rgba(239,68,68,0.2); }
    50% { box-shadow: 0 0 0 2px rgba(239,68,68,0.6), 0 0 60px rgba(239,68,68,0.3); }
}

.hw-emergency-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: var(--hw-transition);
}

.hw-emergency-btn.running .hw-emergency-icon-wrap {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.5);
    animation: hw-icon-bounce 1s ease-in-out infinite;
}

@keyframes hw-icon-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hw-emergency-content { position: relative; z-index: 1; flex: 1; width: 100%; }

.hw-emergency-name {
    font-family: var(--hw-font);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hw-text);
    margin-bottom: 4px;
}

.hw-emergency-desc {
    font-size: 0.84rem;
    color: var(--hw-text-soft);
    line-height: 1.5;
    margin-bottom: 10px;
}

.hw-emergency-freq-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hw-red);
    font-variant-numeric: tabular-nums;
}

.hw-emergency-state {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--hw-text-dim);
    z-index: 1;
    transition: var(--hw-transition);
}

.hw-emergency-btn.running .hw-emergency-state { color: var(--hw-red); }

.hw-emergency-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 6px;
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--hw-red);
    letter-spacing: 0.05em;
    margin-right: 10px;
    vertical-align: middle;
}

/* ── Player Bar ─────────────────────────────────────────── */
.hw-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 190; /* TOUJOURS sous le menu (mobile-nav = 350) pour ne jamais bloquer les onglets */
    background: rgba(2,8,17,0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--hw-border);
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    /* Masqué tant qu'aucune séance n'est active : glisse hors écran + pas de clics.
       Apparaît (slide-up) uniquement quand une séance de thérapie est lancée. */
    transform: translateY(130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.3s ease,
                border-color 0.22s ease, box-shadow 0.22s ease;
}

.hw-player.playing {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    border-top-color: rgba(13,217,192,0.3);
    box-shadow: 0 -4px 40px rgba(13,217,192,0.08);
}

.hw-player-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.hw-player-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 32px;
    flex-shrink: 0;
}

.hw-player-wave span {
    display: block;
    width: 3px;
    height: 6px;
    background: var(--hw-text-dim);
    border-radius: 3px;
    transition: var(--hw-transition);
}

.hw-player.playing .hw-player-wave span {
    background: var(--hw-teal);
    animation: hw-wave-bar 1.2s ease-in-out infinite;
}

.hw-player-wave span:nth-child(1) { animation-delay: 0s; }
.hw-player-wave span:nth-child(2) { animation-delay: 0.15s; }
.hw-player-wave span:nth-child(3) { animation-delay: 0.3s; }
.hw-player-wave span:nth-child(4) { animation-delay: 0.15s; }
.hw-player-wave span:nth-child(5) { animation-delay: 0s; }

@keyframes hw-wave-bar {
    0%, 100% { height: 6px; }
    50% { height: 26px; }
}

.hw-player-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hw-player-name {
    font-family: var(--hw-font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--hw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-player-freq {
    font-size: 0.78rem;
    color: var(--hw-teal);
    font-variant-numeric: tabular-nums;
}

.hw-player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.hw-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hw-vol-icon {
    width: 18px;
    height: 18px;
    color: var(--hw-text-soft);
    flex-shrink: 0;
}

.hw-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    background: var(--hw-border-light);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.hw-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hw-teal);
    cursor: pointer;
    box-shadow: 0 0 6px var(--hw-teal-glow);
}

.hw-volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hw-teal);
    cursor: pointer;
    border: none;
}

.hw-timer-display {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: 8px;
    padding: 6px 14px;
    min-width: 68px;
    text-align: center;
}

#hw-timer-text {
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--hw-text);
    font-variant-numeric: tabular-nums;
}

.hw-stop-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 10px;
    color: var(--hw-red);
    font-family: var(--hw-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hw-transition);
}

.hw-stop-btn:not(:disabled):hover {
    background: rgba(239,68,68,0.2);
    border-color: var(--hw-red);
}

.hw-stop-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.hw-stop-btn svg { width: 15px; height: 15px; }

/* ── Modal ──────────────────────────────────────────────── */
.hw-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hw-modal-overlay.open { display: flex; }

.hw-modal {
    background: var(--hw-bg3);
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-lg);
    max-width: 560px;
    width: 100%;
    max-height: 88vh;
    position: relative;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
    animation: hw-modal-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Flex column : header fixe + contenu scrollable + footer fixe */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes hw-modal-in {
    from { transform: scale(0.9) translateY(10px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.hw-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--hw-border);
    background: var(--hw-surface);
    color: var(--hw-text-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--hw-transition);
}
.hw-modal-close:hover { background: var(--hw-surface-hover); color: var(--hw-text); }
.hw-modal-close svg { width: 16px; height: 16px; }

.hw-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 28px 32px 20px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.055);
}

.hw-modal-icon {
    width: 56px;
    height: 56px;
    background: var(--hw-teal-glow2);
    border: 1px solid rgba(13,217,192,0.25);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.hw-modal-header h3 {
    font-family: var(--hw-font);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--hw-text);
    line-height: 1.3;
    margin-bottom: 4px;
}

.hw-modal-subtitle {
    font-size: 0.84rem;
    color: var(--hw-teal);
    font-weight: 500;
}

/* Zone scrollable : body + source */
.hw-modal-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;       /* critical pour Firefox */
    padding: 20px 32px 8px;
    /* scrollbar discrète */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.hw-modal-scroll::-webkit-scrollbar { width: 4px; }
.hw-modal-scroll::-webkit-scrollbar-track { background: transparent; }
.hw-modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.14);
    border-radius: 2px;
}

.hw-modal-body {
    font-size: 0.9rem;
    color: var(--hw-text-soft);
    line-height: 1.7;
    margin-bottom: 20px;
}

.hw-modal-body h4 {
    font-family: var(--hw-font);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--hw-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 16px 0 8px;
}

.hw-modal-body ul { padding-left: 18px; }
.hw-modal-body ul li { margin-bottom: 4px; }

.hw-freq-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--hw-teal-glow2);
    border: 1px solid rgba(13,217,192,0.25);
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hw-teal);
    margin: 0 4px 8px 0;
    font-variant-numeric: tabular-nums;
}

/* Bannière placement */
.hw-placement-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 0.86rem;
    line-height: 1.55;
}

.hw-placement-tip.tip-headphones {
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.28);
    color: #c7c8ff;
}
.hw-placement-tip.tip-proximity {
    background: rgba(13,217,192,0.08);
    border: 1px solid rgba(13,217,192,0.28);
    color: #bae6fd;
}
.hw-placement-tip.tip-ambient {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.28);
    color: #fde68a;
}

.hw-placement-tip-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.hw-placement-tip strong { color: #fff; }

/* Durée recommandée */
.hw-recommended-duration {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(34,197,94,0.07);
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: #86efac;
    line-height: 1.4;
}

.hw-recommended-duration svg { width: 16px; height: 16px; flex-shrink: 0; color: #22c55e; }
.hw-recommended-duration strong { color: #fff; }

.hw-modal-source {
    padding: 12px 16px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--hw-border);
    border-radius: 10px;
    margin-bottom: 8px;
}

.hw-modal-source p { font-size: 0.75rem; color: var(--hw-text-dim); line-height: 1.5; }
.hw-modal-source strong { color: var(--hw-text-soft); }
.hw-modal-source a { color: var(--hw-teal); text-decoration: none; }
.hw-modal-source a:hover { text-decoration: underline; }

.hw-modal-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 16px 32px 24px;
    background: var(--hw-bg3);
    border-top: 1px solid rgba(255,255,255,0.07);
    /* Dégradé pour signaler le contenu scrollable au-dessus */
    box-shadow: 0 -20px 36px rgba(10,22,40,0.85);
    position: relative;
    z-index: 2;
}

.hw-btn-launch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 28px;
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-teal-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hw-transition);
    flex: 1;
    justify-content: center;
    box-shadow: 0 4px 20px var(--hw-teal-glow);
}

.hw-btn-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--hw-teal-glow);
}

.hw-btn-launch svg { width: 16px; height: 16px; }

.hw-duration-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hw-duration-selector label {
    font-size: 0.85rem;
    color: var(--hw-text-soft);
    white-space: nowrap;
}

.hw-duration-selector select {
    padding: 8px 32px 8px 13px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 10px;
    color: #e2e8f0;
    font-family: var(--hw-font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23818cf8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hw-duration-selector select:hover {
    border-color: rgba(99,102,241,0.45);
}

.hw-duration-selector select:focus {
    border-color: rgba(99,102,241,0.6);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.hw-duration-selector select option {
    background-color: #0f172a;
    color: #e2e8f0;
    font-weight: 500;
}

/* ── Toast Notification ─────────────────────────────────── */
.hw-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--hw-bg3);
    border: 1px solid var(--hw-border-light);
    border-radius: 10px;
    padding: 12px 22px;
    font-family: var(--hw-font);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--hw-text);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 400;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.hw-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Scrollbar ──────────────────────────────────────────── */
.sounddoctor-app ::-webkit-scrollbar { width: 5px; height: 5px; }
.sounddoctor-app ::-webkit-scrollbar-track { background: transparent; }
.sounddoctor-app ::-webkit-scrollbar-thumb { background: var(--hw-border-light); border-radius: 4px; }
.sounddoctor-app ::-webkit-scrollbar-thumb:hover { background: var(--hw-text-dim); }

/* ── Progress bar cartes ────────────────────────────────── */
.hw-card-progress {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: var(--hw-border);
    overflow: hidden;
}
.hw-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--hw-teal), var(--hw-indigo));
    width: 0%;
    transition: width 1s linear;
}

/* ── Barre de navigation mobile (bottom tab bar) ──────── */
.hw-mobile-nav {
    display: none; /* caché sur desktop */
}

@media (max-width: 768px) {
    /* Cacher la nav du haut, afficher le bottom bar */
    .hw-nav { display: none; }

    .hw-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 350; /* au-dessus du lecteur (280) et de la barre musique : le menu doit TOUJOURS rester cliquable */
        background: rgba(2, 8, 17, 0.98);
        border-top: 1px solid var(--hw-border);
        padding: 0;
        gap: 0;
        /* safe area iOS */
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .hw-mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 10px 4px 8px;
        background: transparent;
        border: none;
        color: var(--hw-text-dim);
        font-family: var(--hw-font);
        font-size: 0.65rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        cursor: pointer;
        transition: var(--hw-transition);
        position: relative;
        -webkit-tap-highlight-color: transparent;
        outline: none;
    }

    .hw-mobile-nav-btn svg {
        width: 22px;
        height: 22px;
        transition: var(--hw-transition);
        flex-shrink: 0;
    }

    .hw-mobile-nav-btn span {
        display: block;
        line-height: 1.1;
    }

    /* Indicateur actif — pill lumineuse sous l'icône */
    .hw-mobile-nav-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--hw-teal);
        opacity: 0;
        transition: var(--hw-transition);
    }

    .hw-mobile-nav-btn.active {
        color: var(--hw-teal);
    }

    .hw-mobile-nav-btn.active svg {
        filter: drop-shadow(0 0 6px var(--hw-teal-glow));
    }

    .hw-mobile-nav-btn.active::before {
        opacity: 1;
    }

    /* Couleurs spécifiques urgences / spécial */
    .hw-mobile-nav-emergency.active {
        color: var(--hw-red);
    }
    .hw-mobile-nav-emergency.active svg {
        filter: drop-shadow(0 0 6px var(--hw-red-glow));
    }
    .hw-mobile-nav-emergency.active::before {
        background: var(--hw-red);
    }

    .hw-mobile-nav-special.active {
        color: var(--hw-purple);
    }
    .hw-mobile-nav-special.active svg {
        filter: drop-shadow(0 0 6px var(--hw-purple-glow));
    }
    .hw-mobile-nav-special.active::before {
        background: var(--hw-purple);
    }

    /* Hover states */
    .hw-mobile-nav-btn:hover {
        color: var(--hw-text-soft);
        background: var(--hw-surface);
    }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    /* Header mobile sur 2 lignes : la marque « Sound Doctor » centrée tout en haut
       (nom complet, sans troncature), puis les contrôles centrés en dessous. */
    .hw-header { flex-direction: column; align-items: center; gap: 10px; padding: 12px 14px; }
    .hw-brand { gap: 10px; justify-content: center; min-width: 0; overflow: visible; }
    .hw-brand-logo { height: 52px; width: 121px; object-position: center center; }
    .hw-brand-tagline { display: none; }
    .hw-freq-display { display: none; }
    .hw-header .hw-status-dot { display: none; }
    .hw-header-right { gap: 12px; justify-content: center; flex-wrap: wrap; width: 100%; }

    .hw-section-header h2 { font-size: 1.4rem; }
    /* Section « Zones du corps » : titre resserré pour laisser voir le médecin sous la bulle */
    #section-body .hw-section-header { margin-bottom: 16px; }
    #section-body .hw-section-header p { font-size: 0.84rem; }
    #section-body { padding-top: 18px; }

    .hw-recent-row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .hw-body-layout { grid-template-columns: 1fr; }
    .hw-body-layout > .hw-recent-row,
    .hw-body-layout > .hw-zones-grid { grid-column: auto; }
    .hw-body-layout > .hw-body-map-container { grid-row: auto; }
    .hw-body-map-container { position: static; order: -1; }
    .hw-body-silhouette { width: 150px; margin: 0 auto; }

    .hw-zones-grid,
    .hw-pathologies-grid,
    .hw-special-grid { grid-template-columns: 1fr; }
    .hw-emergency-grid { grid-template-columns: 1fr; }

    /* Le player remonte au-dessus du bottom tab bar (~68px) */
    .hw-player { padding: 12px 16px; flex-wrap: wrap; gap: 12px; bottom: 66px; z-index: 150; }
    /* Breathing panel remonte aussi (tab bar + player bar) */
    .hw-breath-panel-inner { max-height: 82vh; }
    .hw-volume-control { display: none; }
    .hw-player-controls { gap: 12px; }
    /* Sections: padding bottom = tab bar + player bar height when playing */
    .hw-section { padding: 24px 16px 155px; }

    .hw-modal { max-height: 92vh; }
    .hw-modal-header { padding: 22px 20px 16px; }
    .hw-modal-scroll { padding: 16px 20px 8px; }
    .hw-modal-actions { padding: 14px 20px 20px; flex-direction: column; }
    .hw-btn-launch { width: 100%; }

    /* Cacher le switcher label sur très petits écrans si besoin */
    .hw-lang-label { display: none; }
}

/* ── Animations ─────────────────────────────────────────── */
/* SANS transform : transform+opacity crée des compositing layers GPU
   permanents (fill:forwards conserve transform:translateY(0) même après
   l'animation, bloquant le repaint du header = logo invisible Android). */
@keyframes hw-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.hw-section.active .hw-card,
.hw-section.active .hw-emergency-btn {
    animation: hw-fade-in 0.35s ease both;
}

.hw-section.active .hw-card:nth-child(1)  { animation-delay: 0.02s; }
.hw-section.active .hw-card:nth-child(2)  { animation-delay: 0.06s; }
.hw-section.active .hw-card:nth-child(3)  { animation-delay: 0.10s; }
.hw-section.active .hw-card:nth-child(4)  { animation-delay: 0.14s; }
.hw-section.active .hw-card:nth-child(5)  { animation-delay: 0.18s; }
.hw-section.active .hw-card:nth-child(6)  { animation-delay: 0.22s; }
.hw-section.active .hw-card:nth-child(7)  { animation-delay: 0.26s; }
.hw-section.active .hw-card:nth-child(8)  { animation-delay: 0.30s; }
.hw-section.active .hw-card:nth-child(n+9){ animation-delay: 0.34s; }

/* ═══════════════════════════════════════════════════════
   PANNEAU RESPIRATION
═══════════════════════════════════════════════════════ */

/* Bouton respiration dans le player */
.hw-breath-toggle-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 10px;
    color: var(--hw-indigo);
    font-family: var(--hw-font);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hw-transition);
    flex-shrink: 0;
}

.hw-breath-toggle-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.hw-breath-toggle-btn:hover {
    background: rgba(99,102,241,0.2);
    border-color: var(--hw-indigo);
}

.hw-breath-toggle-btn.active {
    background: rgba(99,102,241,0.22);
    border-color: var(--hw-indigo);
    box-shadow: 0 0 16px rgba(99,102,241,0.25);
}

/* Panneau principal — bottom-sheet modale : fond plein écran (tap dehors = fermer),
   sheet plafonnée avec header toujours visible + contenu scrollable. */
.hw-breath-panel {
    position: fixed;
    inset: 0;
    z-index: 9000;               /* au-dessus du menu (350) et du player */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;   /* sheet en bas */
    align-items: center;
    padding: 14px 12px 22px;     /* le padding-bottom réserve la place (nav en mobile) */
    background: rgba(2, 8, 17, 0.55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
}

.hw-breath-panel.open {
    opacity: 1;
    pointer-events: all;
}

.hw-breath-panel-inner {
    width: 100%;
    max-width: 900px;
    /* 100% = hauteur du content-box du panneau (viewport - padding) → tient toujours
       à l'écran quel que soit le padding-bottom, header visible + contenu scrollable. */
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: rgba(6,16,31,0.98);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--hw-border-light);
    border-radius: var(--hw-radius-lg);
    box-shadow: 0 -20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(99,102,241,0.1);
    overflow: hidden;
    transform: translateY(24px);
    transition: transform 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.hw-breath-panel.open .hw-breath-panel-inner { transform: translateY(0); }

.hw-breath-panel-header { flex-shrink: 0; }
.hw-breath-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
/* Les enfants ne doivent PAS rétrécir (content est un flex column) sinon ils se
   compriment au lieu de déborder → le scroll ne s'active jamais. */
.hw-breath-content > * { flex-shrink: 0; }

/* Header panneau */
.hw-breath-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--hw-border);
    background: rgba(99,102,241,0.05);
}

.hw-breath-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 700;
    color: var(--hw-text);
}

.hw-breath-panel-title svg { color: var(--hw-indigo); }

.hw-breath-coupled-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--hw-teal-glow2);
    border: 1px solid rgba(13,217,192,0.3);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--hw-teal);
    letter-spacing: 0.05em;
    animation: hw-fade-in 0.3s ease;
}

.hw-breath-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--hw-border);
    background: var(--hw-surface);
    color: var(--hw-text-soft);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--hw-transition);
    flex-shrink: 0;
}
.hw-breath-close:hover { background: var(--hw-surface-hover); color: var(--hw-text); }

/* Contenu — flex colonne */
.hw-breath-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px 20px 12px;
}

/* ── Paywall quotidien (gratuit = 30 min/jour) ─────────── */
.hw-daily-paywall {
    position: fixed;
    inset: 0;
    z-index: 10800;              /* au-dessus de l'app, mais SOUS la modale upgrade (11000)
                                    pour que le CTA "Passer Premium" s'affiche par-dessus */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 18px;
    background: rgba(2, 8, 17, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.hw-daily-paywall.show { opacity: 1; pointer-events: all; }
.hw-daily-paywall-card {
    max-width: 380px;
    width: 100%;
    text-align: center;
    background: linear-gradient(160deg, rgba(13,217,192,0.10), rgba(10,22,40,0.98));
    border: 1px solid rgba(13,217,192,0.30);
    border-radius: 22px;
    padding: 32px 26px 26px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
    animation: hw-paywall-in 0.45s cubic-bezier(0.34,1.4,0.64,1) both;
}
@keyframes hw-paywall-in { from { opacity:0; transform: translateY(14px) scale(0.96); } to { opacity:1; transform:none; } }
.hw-daily-paywall-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 12px; }
.hw-daily-paywall-title {
    font-family: var(--hw-font);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hw-text);
    line-height: 1.25;
    margin-bottom: 12px;
    text-wrap: balance;
}
.hw-daily-paywall-text {
    font-size: 0.9rem;
    color: var(--hw-text-soft);
    line-height: 1.55;
    margin-bottom: 22px;
}
.hw-daily-paywall-text strong { color: var(--hw-teal); font-weight: 600; }
.hw-daily-paywall-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-teal-dark));
    color: #04211d;
    border: none;
    border-radius: 13px;
    font-family: var(--hw-font);
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hw-transition);
    box-shadow: 0 8px 24px rgba(13,217,192,0.35);
}
.hw-daily-paywall-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(13,217,192,0.5); }
.hw-daily-paywall-reset {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--hw-text-dim);
}
.hw-daily-paywall-reset strong { color: var(--hw-text-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── CTA "Trouver un sonothérapeute" (dans la modale de séance) ── */
.hw-find-therapist-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    background: rgba(13,217,192,0.10);
    border: 1px solid rgba(13,217,192,0.35);
    border-radius: 12px;
    color: var(--hw-teal);
    font-family: var(--hw-font);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hw-transition);
}
.hw-find-therapist-cta:hover { background: rgba(13,217,192,0.18); border-color: rgba(13,217,192,0.6); }
.hw-find-therapist-cta svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Finder sonothérapeutes (modale géoloc) ── */
.hw-therapist-finder {
    position: fixed;
    inset: 0;
    z-index: 11500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    background: rgba(2,8,17,0.9);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.32s ease;
}
.hw-therapist-finder.open { opacity: 1; pointer-events: all; }
.hw-tf-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: rgba(8,18,33,0.99);
    border: 1px solid var(--hw-border-light);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
    overflow: hidden;
    animation: hw-paywall-in 0.4s cubic-bezier(0.34,1.4,0.64,1) both;
}
.hw-tf-close {
    position: absolute; top: 12px; right: 12px; z-index: 2;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.06); border: 1px solid var(--hw-border-light); border-radius: 50%;
    color: var(--hw-text-soft); cursor: pointer; transition: var(--hw-transition);
}
.hw-tf-close:hover { color: var(--hw-text); background: rgba(255,255,255,0.12); }
.hw-tf-close svg { width: 15px; height: 15px; }
.hw-tf-header { padding: 22px 22px 12px; flex-shrink: 0; }
.hw-tf-title { font-family: var(--hw-font); font-size: 1.3rem; font-weight: 700; color: var(--hw-text); }
.hw-tf-sub { font-size: 0.85rem; color: var(--hw-text-soft); margin-top: 4px; }
.hw-tf-search { display: flex; align-items: center; gap: 10px; padding: 0 22px 12px; flex-shrink: 0; flex-wrap: wrap; }
.hw-tf-geo-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 14px; border-radius: 11px;
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-teal-dark));
    color: #04211d; border: none; font-family: var(--hw-font); font-weight: 700; font-size: 0.84rem; cursor: pointer;
    transition: var(--hw-transition); flex-shrink: 0;
}
.hw-tf-geo-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(13,217,192,0.4); }
.hw-tf-geo-btn svg { width: 16px; height: 16px; }
.hw-tf-or { color: var(--hw-text-dim); font-size: 0.8rem; }
.hw-tf-addr { display: flex; flex: 1; min-width: 160px; gap: 6px; }
.hw-tf-addr-input {
    flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--hw-border-light);
    color: var(--hw-text); font-family: var(--hw-font-body); font-size: 0.85rem;
}
.hw-tf-addr-input:focus { outline: none; border-color: rgba(13,217,192,0.5); }
.hw-tf-addr-btn {
    width: 40px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--hw-border-light);
    background: rgba(255,255,255,0.05); color: var(--hw-teal); font-size: 1.1rem; cursor: pointer;
}
.hw-tf-addr-btn:hover { background: rgba(13,217,192,0.12); }
.hw-tf-status { padding: 0 22px 8px; font-size: 0.78rem; color: var(--hw-text-soft); min-height: 14px; flex-shrink: 0; }
.hw-tf-map {
    height: 200px;
    margin: 0 18px 12px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--hw-border-light);
    flex-shrink: 0;
    display: none;              /* affichée seulement quand la carte est initialisée */
    background: #0a1628;
}
.hw-tf-map.ready { display: block; }
.hw-tf-map .leaflet-container { height: 100%; width: 100%; background: #0a1628; font-family: var(--hw-font-body); }
.hw-tf-map .leaflet-popup-content-wrapper { background: #0d1b2e; color: var(--hw-text); border-radius: 10px; }
.hw-tf-map .leaflet-popup-tip { background: #0d1b2e; }
.hw-tf-map .leaflet-popup-content { font-size: 0.8rem; margin: 10px 12px; }
.hw-tf-map .leaflet-popup-content b { color: var(--hw-teal); }
.hw-tf-map .leaflet-control-attribution { background: rgba(10,22,40,0.7); color: #7a8ba0; }
.hw-tf-map .leaflet-control-attribution a { color: #9fb3c8; }
.hw-tf-marker-featured {
    filter: hue-rotate(120deg) saturate(1.4) drop-shadow(0 0 4px rgba(13,217,192,0.7));
}
.hw-tf-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.hw-tf-empty { text-align: center; color: var(--hw-text-dim); padding: 30px 0; }

.hw-tf-item {
    position: relative;
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--hw-border);
    border-radius: 14px;
    padding: 14px 15px;
}
.hw-tf-item-featured {
    background: linear-gradient(150deg, rgba(13,217,192,0.10), rgba(255,255,255,0.03));
    border: 1.5px solid rgba(13,217,192,0.5);
    box-shadow: 0 0 20px rgba(13,217,192,0.14);
}
.hw-tf-badge {
    display: inline-block; margin-bottom: 8px;
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-teal-dark)); color: #04211d;
    font-size: 0.68rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.03em;
}
.hw-tf-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hw-tf-name { font-family: var(--hw-font); font-size: 0.98rem; font-weight: 700; color: var(--hw-text); line-height: 1.25; }
.hw-tf-dist { font-size: 0.78rem; font-weight: 700; color: var(--hw-teal); white-space: nowrap; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.hw-tf-spec { font-size: 0.8rem; color: var(--hw-teal); margin-top: 3px; }
.hw-tf-addr-line { font-size: 0.8rem; color: var(--hw-text-soft); margin-top: 6px; }
.hw-tf-ctas { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.hw-tf-cta {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 11px; border-radius: 9px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--hw-border-light);
    color: var(--hw-text); font-size: 0.76rem; font-weight: 600; text-decoration: none;
    transition: var(--hw-transition);
}
.hw-tf-cta:hover { background: rgba(13,217,192,0.14); border-color: rgba(13,217,192,0.45); color: var(--hw-teal); }

/* ── Bandeau tuto respiration ──────────────────────────── */
.hw-breath-tuto {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, rgba(13,217,192,0.12), rgba(99,102,241,0.10));
    border: 1px solid rgba(13,217,192,0.28);
    border-radius: 12px;
    padding: 11px 12px 11px 13px;
    margin-bottom: 14px;
}
.hw-breath-tuto[hidden] { display: none; }
.hw-breath-tuto-icon { font-size: 1.1rem; line-height: 1.3; flex-shrink: 0; }
.hw-breath-tuto-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--hw-text-soft);
    margin: 0;
}
.hw-breath-tuto-text strong { color: var(--hw-teal); font-weight: 600; }
.hw-breath-tuto-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: var(--hw-text-dim);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: var(--hw-transition);
}
.hw-breath-tuto-close:hover { color: var(--hw-text); }

/* Nudge : quand une séance joue, le bouton "Respiration" pulse pour inciter
   l'utilisateur à respirer en même temps. */
.hw-player.playing .hw-breath-toggle-btn {
    border-color: rgba(13,217,192,0.45);
    color: var(--hw-teal);
    animation: hw-breath-nudge 2.6s ease-in-out infinite;
}
@keyframes hw-breath-nudge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13,217,192,0); }
    50%      { box-shadow: 0 0 0 5px rgba(13,217,192,0.16); }
}
@media (prefers-reduced-motion: reduce) {
    .hw-player.playing .hw-breath-toggle-btn { animation: none; }
}

/* Flèche/bulle invitante au-dessus du bouton Respiration */
.hw-breath-toggle-btn { position: relative; }
.hw-breath-hint {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    display: none;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-teal-dark));
    color: #04211d;
    font-family: var(--hw-font);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 11px;
    border-radius: 9px;
    box-shadow: 0 6px 20px rgba(13,217,192,0.35);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    animation: hw-hint-in 0.4s ease forwards, hw-hint-bob 2.2s ease-in-out 0.4s infinite;
}
.hw-breath-hint-arrow {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid var(--hw-teal-dark);
}
@keyframes hw-hint-in { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes hw-hint-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-4px); }
}
/* Visible seulement pendant une séance, tant que l'utilisateur n'a pas ouvert la respiration */
.hw-player.playing .hw-breath-hint { display: inline-flex; }
.sounddoctor-app.hw-breath-hint-seen .hw-breath-hint { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    .hw-breath-hint { animation: hw-hint-in 0.4s ease forwards; }
}

/* ── Exercices scroll ──────────────────────────────────── */
.hw-breath-exercises-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    margin-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.35) transparent;
    padding-bottom: 6px;
}
.hw-breath-exercises-scroll::-webkit-scrollbar { height: 4px; }
.hw-breath-exercises-scroll::-webkit-scrollbar-track { background: transparent; }
.hw-breath-exercises-scroll::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.35); border-radius: 4px; }

.hw-breath-exercises {
    display: flex;
    gap: 8px;
}

.hw-breath-ex-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 10px 16px;
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius-sm);
    color: var(--hw-text-soft);
    font-family: var(--hw-font);
    cursor: pointer;
    transition: var(--hw-transition);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 130px;
}

.hw-breath-ex-btn:hover {
    background: var(--hw-surface-hover);
    border-color: rgba(99,102,241,0.3);
    color: var(--hw-text);
}

.hw-breath-ex-btn.active {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.45);
    color: var(--hw-indigo);
    box-shadow: 0 0 20px rgba(99,102,241,0.12);
}

.hw-breath-ex-name { font-size: 0.88rem; font-weight: 700; line-height: 1.2; }
.hw-breath-ex-pattern { font-size: 0.72rem; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* ── Rangée centrale : cercle + info ──────────────────── */
.hw-breath-main-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 0;
}

/* ── Visuel central ────────────────────────────────────── */
.hw-breath-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.hw-breath-circle-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

.hw-breath-svg { width: 100%; height: 100%; }

.hw-breath-ring-bg { stroke: rgba(255,255,255,0.06); stroke-width: 3; fill: none; }

.hw-breath-ring-progress {
    stroke: var(--hw-indigo);
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 130px 130px;
    transition: stroke-dashoffset 0.8s linear, stroke 0.5s;
}

/* ── Cercles décoratifs — écho en retard pour effet de profondeur ── */
.hw-breath-deco1,
.hw-breath-deco2 {
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1);
    transition: transform 1.6s cubic-bezier(0.37, 0, 0.63, 1), opacity 1.2s ease;
}

/* ── Cercle principal — animé par CSS transition via custom property ── */
.hw-breath-main-circle {
    fill: rgba(99,102,241,0.10);
    stroke: rgba(99,102,241,0.4);
    stroke-width: 2.5;
    transform-box: fill-box;
    transform-origin: center;
    /* --hw-breath-scale injecté par JS à chaque changement de phase */
    /* --hw-breath-dur  = durée de la phase courante (ex : 5s pour inhale)  */
    transform: scale(var(--hw-breath-scale, 0.62));
    transition: transform var(--hw-breath-dur, 0.4s) cubic-bezier(0.37, 0, 0.63, 1),
                fill 0.7s ease, stroke 0.7s ease, filter 0.7s ease;
    filter: drop-shadow(0 0 0px transparent);
}

/* Phase inhale — indigo vif, glow lumineux */
.hw-breath-main-circle.phase-inhale {
    fill: rgba(99,102,241,0.22);
    stroke: #818cf8;
    filter: drop-shadow(0 0 18px rgba(99,102,241,0.75))
            drop-shadow(0 0  7px rgba(99,102,241,0.45));
}
/* Phase hold (rétention pleine) — ambre chaud, glow pulsant */
.hw-breath-main-circle.phase-hold {
    fill: rgba(245,158,11,0.18);
    stroke: var(--hw-amber);
    filter: drop-shadow(0 0 16px rgba(245,158,11,0.7))
            drop-shadow(0 0  6px rgba(245,158,11,0.4));
}
/* Phase exhale — teal calme, glow doux */
.hw-breath-main-circle.phase-exhale {
    fill: rgba(13,217,192,0.14);
    stroke: var(--hw-teal);
    filter: drop-shadow(0 0 12px rgba(13,217,192,0.6))
            drop-shadow(0 0  5px rgba(13,217,192,0.3));
}
/* Phase hold2 (rétention vide) — violet discret */
.hw-breath-main-circle.phase-hold2 {
    fill: rgba(168,85,247,0.11);
    stroke: var(--hw-purple);
    filter: drop-shadow(0 0  8px rgba(168,85,247,0.45));
}

/* Pulsation de glow pendant les holds — scale fixe, glow qui respire */
@keyframes hw-glow-peak {
    0%, 100% {
        filter: drop-shadow(0 0 14px rgba(245,158,11,0.55))
                drop-shadow(0 0  5px rgba(245,158,11,0.35));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(245,158,11,0.95))
                drop-shadow(0 0 12px rgba(245,158,11,0.65));
    }
}
@keyframes hw-glow-rest {
    0%, 100% { filter: drop-shadow(0 0  6px rgba(168,85,247,0.3)); }
    50%       { filter: drop-shadow(0 0 20px rgba(168,85,247,0.7)); }
}

.hw-breath-main-circle.hw-glow-pulse-peak {
    animation: hw-glow-peak 1.8s ease-in-out infinite;
}
.hw-breath-main-circle.hw-glow-pulse-rest {
    animation: hw-glow-rest 1.8s ease-in-out infinite;
}

.hw-breath-ripple {
    fill: none;
    stroke: var(--hw-indigo);
    stroke-width: 1.5;
    transform-box: fill-box;
    transform-origin: center;
    pointer-events: none;
}

.hw-breath-center-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    pointer-events: none;
}

.hw-breath-phase-label {
    font-family: var(--hw-font);
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--hw-text-soft);
    transition: color 0.5s ease, opacity 0.3s ease;
}

.hw-breath-phase-label.phase-inhale { color: #a5b4fc; text-shadow: 0 0 12px rgba(99,102,241,0.5); }
.hw-breath-phase-label.phase-hold   { color: #fbbf24; text-shadow: 0 0 12px rgba(245,158,11,0.5); }
.hw-breath-phase-label.phase-exhale { color: #38bdf8; text-shadow: 0 0 10px rgba(13,217,192,0.4); }
.hw-breath-phase-label.phase-hold2  { color: #c084fc; text-shadow: 0 0  8px rgba(168,85,247,0.4); }

.hw-breath-countdown {
    font-family: var(--hw-font);
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--hw-text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color 0.5s ease;
    letter-spacing: -0.04em;
}

.hw-breath-countdown.phase-inhale { color: #a5b4fc; }
.hw-breath-countdown.phase-hold   { color: #fbbf24; }
.hw-breath-countdown.phase-exhale { color: #38bdf8; }
.hw-breath-countdown.phase-hold2  { color: #c084fc; }

.hw-breath-cycle-info {
    font-size: 0.72rem;
    color: var(--hw-text-dim);
    font-variant-numeric: tabular-nums;
}

/* ── Barre de phases ──────────────────────────────────── */
.hw-breath-phase-bar {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

.hw-breath-phase-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1 1 0;      /* les phases partagent la largeur au lieu de déborder */
    min-width: 0;
}

.hw-breath-phase-track {
    height: 5px;
    border-radius: 3px;
    background: var(--hw-border-light);
    position: relative;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.hw-breath-phase-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 0%;
    border-radius: 3px;
    transition: none;
}

.hw-breath-phase-fill.phase-inhale { background: linear-gradient(90deg, #6366f1, #818cf8); }
.hw-breath-phase-fill.phase-hold   { background: linear-gradient(90deg, var(--hw-amber), #fbbf24); }
.hw-breath-phase-fill.phase-exhale { background: linear-gradient(90deg, var(--hw-teal), #38bdf8); }
.hw-breath-phase-fill.phase-hold2  { background: linear-gradient(90deg, var(--hw-purple), #c084fc); }

.hw-breath-phase-segment-label {
    font-size: 0.6rem;
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.hw-breath-phase-segment.active .hw-breath-phase-segment-label { color: var(--hw-text); }

.hw-phase-divider {
    width: 1px;
    height: 14px;
    background: var(--hw-border);
    flex-shrink: 0;
}

/* ── Instruction ──────────────────────────────────────── */
.hw-breath-instruction {
    font-size: 0.85rem;
    color: var(--hw-text-soft);
    text-align: center;
    line-height: 1.5;
    min-height: 36px;
    max-width: 340px;
    transition: opacity 0.4s;
}

/* ── Info box ─────────────────────────────────────────── */
.hw-breath-info-box {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius-sm);
    padding: 14px 16px;
    width: 240px;
    flex-shrink: 0;
}

.hw-breath-info-title {
    font-family: var(--hw-font);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hw-text-soft);
    margin-bottom: 10px;
}

.hw-breath-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 7px;
    font-size: 0.8rem;
    color: var(--hw-text-soft);
    line-height: 1.4;
}

.hw-breath-benefit-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hw-indigo);
    flex-shrink: 0;
    margin-top: 4px;
}

.hw-breath-info-source {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--hw-border);
    font-size: 0.7rem;
    color: var(--hw-text-dim);
    line-height: 1.45;
}

.hw-breath-info-source a { color: var(--hw-indigo); text-decoration: none; }
.hw-breath-info-source a:hover { text-decoration: underline; }

/* ── Actions ──────────────────────────────────────────── */
.hw-breath-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    padding-top: 14px;
    border-top: 1px solid var(--hw-border);
    margin-top: 12px;
}

.hw-breath-start-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--hw-indigo), #4f46e5);
    border: none;
    border-radius: 12px;
    color: white;
    font-family: var(--hw-font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hw-transition);
    box-shadow: 0 4px 20px rgba(99,102,241,0.35);
}

.hw-breath-start-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

.hw-breath-start-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.45);
}

.hw-breath-start-btn.running {
    background: linear-gradient(135deg, var(--hw-red), #dc2626);
    box-shadow: 0 4px 20px var(--hw-red-glow);
}
.hw-breath-start-btn.running:not(:disabled):hover { box-shadow: 0 8px 30px var(--hw-red-glow); }

.hw-breath-rounds-wrap { display: flex; align-items: center; gap: 8px; }

.hw-breath-rounds-label { font-size: 0.85rem; color: var(--hw-text-soft); white-space: nowrap; }

.hw-breath-rounds-select {
    padding: 8px 30px 8px 13px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 10px;
    color: #e2e8f0;
    font-family: var(--hw-font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23818cf8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hw-breath-rounds-select:hover {
    border-color: rgba(99,102,241,0.45);
}

.hw-breath-rounds-select:focus {
    border-color: rgba(99,102,241,0.6);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.hw-breath-rounds-select option {
    background-color: #0f172a;
    color: #e2e8f0;
    font-weight: 500;
}

/* ── Responsive panneau ────────────────────────────────── */
@media (max-width: 760px) {
    .hw-breath-main-row { flex-direction: column; align-items: stretch; }
    .hw-breath-info-box { width: 100%; }
    .hw-breath-circle-wrap { width: 180px; height: 180px; }
    .hw-breath-countdown { font-size: 2.2rem; }
}

@media (max-width: 600px) {
    .hw-breath-panel { padding-bottom: 74px; }  /* laisse la place à la nav mobile */
    .hw-breath-panel-header { padding: 12px 16px; }
    .hw-breath-content { padding: 12px 16px 10px; }
    .hw-breath-toggle-btn span { display: none; }
    .hw-breath-toggle-btn { padding: 10px 12px; }
    .hw-breath-actions { flex-direction: column; }
    .hw-breath-start-btn { width: 100%; justify-content: center; }
}

/* Keyframes respiration */
@keyframes hw-breath-ripple-out {
    0%   { r: 58; opacity: 0.5; stroke-width: 2; }
    100% { r: 90; opacity: 0; stroke-width: 0.5; }
}

@keyframes hw-breath-glow-pulse {
    0%, 100% { opacity: 0.2; }
    50%       { opacity: 0.5; }
}

/* ══════════════════════════════════════════════════════
   GAMIFICATION — XP HUD & REWARD SYSTEM
══════════════════════════════════════════════════════ */

/* ── XP HUD (header) ────────────────────────────────── */
.hw-xp-hud {
    display: flex;
    align-items: center;
    cursor: default;
    user-select: none;
}

.hw-xp-level-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(13,217,192,0.14), rgba(13,217,192,0.04));
    border: 1px solid rgba(13,217,192,0.30);
    border-radius: 20px;
    padding: 5px 12px 5px 9px;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.hw-xp-level-badge:hover {
    background: linear-gradient(135deg, rgba(13,217,192,0.22), rgba(13,217,192,0.06));
    border-color: rgba(13,217,192,0.55);
    box-shadow: 0 0 14px rgba(13,217,192,0.20);
}

.hw-xp-level-icon { display: inline-flex; line-height: 1; color: var(--hw-teal); }
.hw-xp-level-icon svg { width: 17px; height: 17px; filter: drop-shadow(0 0 4px rgba(13,217,192,0.45)); }

.hw-xp-level-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hw-xp-level-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--hw-text);
    font-family: var(--hw-font);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.hw-xp-bar-wrap {
    width: 70px;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
}

.hw-xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--hw-teal-dark), var(--hw-teal));
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reward overlay ─────────────────────────────────── */
.hw-reward-overlay {
    position: fixed;         /* fixed = centré dans l'écran visible (pas absolute sur la page géante) */
    inset: 0;
    background: rgba(2, 8, 17, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9000;           /* au-dessus du menu (350) et des barres du bas */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.hw-reward-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.hw-reward-card {
    position: relative;
    background: linear-gradient(145deg, #0d1829, #111e35);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 24px;
    padding: 32px 28px 24px;
    width: min(440px, 92%);
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
    transform: translateY(24px) scale(0.96);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s;
    overflow: hidden;
}

.hw-reward-overlay.show .hw-reward-card {
    transform: translateY(0) scale(1);
}

/* Ambient glow top */
.hw-reward-card::before {
    content: '';
    position: absolute;
    top: -60px; left: 50%;
    transform: translateX(-50%);
    width: 300px; height: 200px;
    background: radial-gradient(ellipse, rgba(99,102,241,0.2) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Particles (level-up confetti) ──────────────────── */
.hw-reward-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.hw-particle {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 50%;
    animation: hw-particle-fly var(--dur, 1.2s) ease-out forwards;
    opacity: 0;
}

@keyframes hw-particle-fly {
    0%   { transform: translate(0,0) scale(1); opacity: 1; }
    100% { transform: translate(var(--tx,0px), var(--ty,-120px)) scale(0); opacity: 0; }
}

/* ── Session header ─────────────────────────────────── */
.hw-reward-header {
    text-align: center;
    margin-bottom: 20px;
}

.hw-reward-session-icon {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 8px;
    display: block;
    animation: hw-reward-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes hw-reward-pop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.hw-reward-title {
    font-family: var(--hw-font);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--hw-text);
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.hw-reward-subtitle {
    font-size: 0.82rem;
    color: var(--hw-text-dim);
    margin: 0;
    font-family: var(--hw-font);
}

/* ── XP Gained — big number ─────────────────────────── */
.hw-reward-xp-gained {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin: 16px 0 10px;
    animation: hw-reward-slidein 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes hw-reward-slidein {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.hw-reward-plus {
    font-size: 1.8rem;
    font-weight: 800;
    color: #a5b4fc;
    font-family: var(--hw-font);
    line-height: 1;
}

.hw-reward-xp-number {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: var(--hw-font);
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    min-width: 120px;
    text-align: center;
}

.hw-reward-xp-unit {
    font-size: 1.4rem;
    font-weight: 800;
    color: #a5b4fc;
    font-family: var(--hw-font);
    align-self: flex-end;
    margin-bottom: 4px;
}

/* ── XP Breakdown (detail lines) ────────────────────── */
.hw-reward-breakdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 18px;
    padding: 0 8px;
    animation: hw-reward-slidein 0.5s ease 0.3s both;
}

.hw-reward-breakdown-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--hw-text-soft);
    font-family: var(--hw-font);
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.hw-reward-breakdown-line:last-child { border-bottom: none; }

.hw-reward-breakdown-line span:last-child {
    font-weight: 700;
    color: #a5b4fc;
}

.hw-reward-breakdown-line.bonus span:last-child { color: #fbbf24; }
.hw-reward-breakdown-line.lucky span:last-child {
    color: #fb923c;
    animation: hw-lucky-pulse 1s ease infinite;
}

@keyframes hw-lucky-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ── Level progress bar ─────────────────────────────── */
.hw-reward-progress-section {
    margin-bottom: 14px;
    animation: hw-reward-slidein 0.5s ease 0.4s both;
}

.hw-reward-level-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    font-family: var(--hw-font);
    font-weight: 700;
    color: var(--hw-text-soft);
    margin-bottom: 6px;
}

.hw-reward-cur-level { color: var(--hw-text); }
.hw-reward-next-level { color: var(--hw-text-dim); }

.hw-reward-progress-track {
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    margin-bottom: 6px;
}

.hw-reward-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8, #c084fc);
    border-radius: 6px;
    width: 0%;
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.hw-reward-progress-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 20px;
    background: rgba(255,255,255,0.4);
    filter: blur(4px);
}

.hw-reward-progress-glow {
    position: absolute;
    top: 50%; left: 0%;
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    background: radial-gradient(circle, rgba(129,140,248,0.8) 0%, transparent 70%);
    transition: left 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.hw-reward-xp-needed {
    font-size: 0.72rem;
    color: var(--hw-text-dim);
    text-align: right;
    font-family: var(--hw-font);
}

/* ── Streak ─────────────────────────────────────────── */
.hw-reward-streak {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 12px;
    padding: 8px 16px;
    margin-bottom: 12px;
    animation: hw-reward-slidein 0.5s ease 0.45s both;
}

.hw-reward-streak-flame { font-size: 1.1rem; }

.hw-reward-streak-text {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fbbf24;
    font-family: var(--hw-font);
}

/* ── Achievement ─────────────────────────────────────── */
.hw-reward-achievement {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(168,85,247,0.08));
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 12px;
    animation: hw-achievement-shine 0.6s ease 0.6s both;
}

@keyframes hw-achievement-shine {
    from { transform: scale(0.9) translateX(-10px); opacity: 0; }
    to   { transform: scale(1) translateX(0);       opacity: 1; }
}

.hw-reward-achievement-icon { font-size: 1.6rem; }

.hw-reward-achievement-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a5b4fc;
    font-family: var(--hw-font);
}

.hw-reward-achievement-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--hw-text);
    font-family: var(--hw-font);
}

/* ── CTA Button ──────────────────────────────────────── */
.hw-reward-cta {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 14px;
    color: white;
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 24px rgba(99,102,241,0.4);
    animation: hw-reward-slidein 0.5s ease 0.5s both;
}

.hw-reward-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(99,102,241,0.55);
}

/* ── Level-up mode ───────────────────────────────────── */
.hw-reward-overlay.levelup .hw-reward-card {
    border-color: rgba(245,158,11,0.5);
}

.hw-reward-overlay.levelup .hw-reward-card::before {
    background: radial-gradient(ellipse, rgba(245,158,11,0.25) 0%, transparent 70%);
}

.hw-reward-overlay.levelup .hw-reward-xp-number {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hw-reward-overlay.levelup .hw-reward-cta {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 6px 24px rgba(245,158,11,0.45);
}

.hw-reward-levelup-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(245,158,11,0.15), rgba(251,191,36,0.08));
    border: 1px solid rgba(245,158,11,0.4);
    border-radius: 40px;
    padding: 6px 16px;
    font-family: var(--hw-font);
    font-size: 0.82rem;
    font-weight: 800;
    color: #fbbf24;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
    animation: hw-levelup-glow 1.5s ease-in-out infinite;
}

@keyframes hw-levelup-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(245,158,11,0.3); }
    50%       { box-shadow: 0 0 28px rgba(245,158,11,0.6); }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
    .hw-xp-level-name { display: none; }
    .hw-xp-bar-wrap { width: 50px; }
    .hw-reward-xp-number { font-size: 3rem; }
    .hw-reward-card { padding: 24px 18px 18px; }
}

/* ══════════════════════════════════════════════════════
   AUTH GATE — Écran connexion / inscription
══════════════════════════════════════════════════════ */

.sounddoctor-auth-gate {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px 16px;
}

.hw-auth-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    animation: hw-auth-fadein 0.5s ease both;
}

@keyframes hw-auth-fadein {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Brand ─────────────────────────────────────────── */
.hw-auth-brand {
    text-align: center;
    color: var(--hw-text);
}

.hw-auth-logo {
    width: 52px; height: 52px;
    margin: 0 auto 12px;
    color: var(--hw-indigo);
    filter: drop-shadow(0 0 12px rgba(99,102,241,0.5));
}

.hw-auth-brand-name {
    font-family: var(--hw-font);
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 0 0 4px;
    background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hw-auth-brand-sub {
    font-size: 0.8rem;
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    letter-spacing: 0.05em;
    margin: 0;
}

/* ── Card ──────────────────────────────────────────── */
.hw-auth-card {
    width: 100%;
    background: linear-gradient(145deg, #0d1829, #111e35);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 24px;
    padding: 28px 28px 24px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
    position: relative;
    overflow: hidden;
}

.hw-auth-card::before {
    content: '';
    position: absolute;
    top: -80px; left: 50%;
    transform: translateX(-50%);
    width: 280px; height: 180px;
    background: radial-gradient(ellipse, rgba(99,102,241,0.15) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Tabs ──────────────────────────────────────────── */
.hw-auth-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 24px;
}

.hw-auth-tab {
    flex: 1;
    padding: 9px 8px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-family: var(--hw-font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hw-text-dim);
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
    white-space: nowrap;
}

.hw-auth-tab.active {
    background: linear-gradient(135deg, rgba(99,102,241,0.3), rgba(99,102,241,0.15));
    color: var(--hw-text);
    border: 1px solid rgba(99,102,241,0.35);
}

/* ── Fields ────────────────────────────────────────── */
.hw-auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hw-auth-hidden { display: none !important; }

.hw-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hw-auth-label {
    font-family: var(--hw-font);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hw-text-soft);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hw-auth-input-wrap {
    position: relative;
}

.hw-auth-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    font-family: var(--hw-font);
    font-size: 0.9rem;
    color: var(--hw-text);
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
    -webkit-appearance: none;
}

.hw-auth-input-wrap .hw-auth-input {
    padding-right: 44px;
}

.hw-auth-input::placeholder { color: rgba(148,163,184,0.35); }
.hw-auth-input:focus {
    border-color: rgba(99,102,241,0.5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    background: rgba(255,255,255,0.06);
}

.hw-auth-input.hw-input-error {
    border-color: rgba(239,68,68,0.6);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

.hw-auth-eye {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--hw-text-dim);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.hw-auth-eye:hover { color: var(--hw-text); }
.hw-auth-eye svg { width: 16px; height: 16px; }

/* ── Error ─────────────────────────────────────────── */
.hw-auth-error {
    min-height: 0;
    font-family: var(--hw-font);
    font-size: 0.78rem;
    color: #f87171;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.hw-auth-error.visible {
    padding: 9px 12px;
    max-height: 80px;
    opacity: 1;
}

/* ── Submit Button ─────────────────────────────────── */
.hw-auth-submit {
    position: relative;
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 14px;
    color: white;
    font-family: var(--hw-font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    box-shadow: 0 6px 24px rgba(99,102,241,0.4);
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    overflow: hidden;
}

.hw-auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(99,102,241,0.55);
}

.hw-auth-submit:disabled { opacity: 0.65; cursor: default; }

.hw-auth-spinner {
    display: none;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: hw-spin 0.7s linear infinite;
}

.hw-auth-submit.loading .hw-auth-spinner { display: block; }
.hw-auth-submit.loading .hw-auth-submit-text { opacity: 0.6; }

@keyframes hw-spin {
    to { transform: rotate(360deg); }
}

.hw-auth-terms {
    font-size: 0.7rem;
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    text-align: center;
    margin: 4px 0 0;
    line-height: 1.5;
}

/* ── Auth success feedback ─────────────────────────── */
.hw-auth-submit.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 6px 24px rgba(34,197,94,0.4);
}

/* ── Footer features list ──────────────────────────── */
.hw-auth-footer {
    text-align: center;
}

.hw-auth-features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    font-family: var(--hw-font);
    font-size: 0.72rem;
    color: var(--hw-text-dim);
}

.hw-auth-features span {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 20px;
    padding: 5px 12px;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   PARCOURS SONORES — Protocol System
══════════════════════════════════════════════════════ */

/* ── Color helpers ────────────────────────────────── */
.hw-protocol-color-teal    { --pc: var(--hw-teal);   --pc-glow: rgba(13,217,192,0.25); }
.hw-protocol-color-indigo  { --pc: var(--hw-indigo); --pc-glow: rgba(99,102,241,0.25); }
.hw-protocol-color-purple  { --pc: var(--hw-purple); --pc-glow: rgba(168,85,247,0.25); }
.hw-protocol-color-green   { --pc: #22c55e;          --pc-glow: rgba(34,197,94,0.25); }
.hw-protocol-color-amber   { --pc: var(--hw-amber);  --pc-glow: rgba(245,158,11,0.25); }
.hw-protocol-color-rose    { --pc: #f43f5e;          --pc-glow: rgba(244,63,94,0.25); }

/* ── Disclaimer ───────────────────────────────────── */
.hw-protocol-disclaimer {
    font-size: 0.72rem;
    color: var(--hw-text-dim);
    text-align: center;
    max-width: 600px;
    margin: 24px auto 0;
    line-height: 1.6;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--hw-border);
    border-radius: 10px;
}

/* ── Protocol grid ────────────────────────────────── */
.hw-protocol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.hw-protocol-card {
    position: relative;
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    overflow: hidden;
    transition: var(--hw-transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.hw-protocol-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--pc, var(--hw-indigo));
    opacity: 0.85;
}

.hw-protocol-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
}

/* Card header */
.hw-protocol-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 14px;
}

.hw-protocol-card-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.hw-protocol-card-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.hw-protocol-duration-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--hw-border);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--hw-text-soft);
    font-family: var(--hw-font);
    white-space: nowrap;
}

.hw-protocol-sessions-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: color-mix(in srgb, var(--pc, var(--hw-indigo)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--pc, var(--hw-indigo)) 30%, transparent);
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--pc, var(--hw-indigo));
    font-family: var(--hw-font);
    white-space: nowrap;
}

/* Fallback for browsers without color-mix */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .hw-protocol-sessions-badge { background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.3); color: var(--hw-indigo); }
}

.hw-protocol-card-body {
    padding: 0 20px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hw-protocol-card-name {
    font-family: var(--hw-font);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--hw-text);
    line-height: 1.2;
    margin: 0;
}

.hw-protocol-card-tagline {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--pc, var(--hw-indigo));
    line-height: 1.3;
}

.hw-protocol-card-desc {
    font-size: 0.8rem;
    color: var(--hw-text-soft);
    line-height: 1.55;
    margin-top: 4px;
}

/* Milestone dot preview */
.hw-protocol-card-milestones {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.hw-protocol-ms-dot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
}

.hw-protocol-ms-dot::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hw-border-light);
    flex-shrink: 0;
}

/* Start button */
.hw-protocol-card-footer {
    padding: 0 20px 20px;
}

.hw-protocol-start-btn {
    width: 100%;
    padding: 11px 20px;
    background: color-mix(in srgb, var(--pc, var(--hw-indigo)) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--pc, var(--hw-indigo)) 35%, transparent);
    border-radius: 10px;
    color: var(--pc, var(--hw-indigo));
    font-family: var(--hw-font);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hw-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .hw-protocol-start-btn { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.35); color: var(--hw-indigo); }
}

.hw-protocol-start-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px var(--pc-glow, rgba(99,102,241,0.25));
}

/* ── Nav active colors (protocol) ─────────────────── */
.hw-nav-protocol.active,
.hw-mobile-nav-protocol.active {
    color: var(--hw-teal) !important;
}

.hw-mobile-nav-protocol.active::before {
    background: var(--hw-teal) !important;
}

/* ══════════════════════════════════════════════════════
   PROTOCOL ACTIVE DASHBOARD
══════════════════════════════════════════════════════ */

#hw-protocol-active {
    animation: hw-fade-in 0.35s ease both;
}

.hw-protocol-dash {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 860px;
    margin: 0 auto;
}

/* ── Dashboard header ─────────────────────────────── */
.hw-protocol-dash-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.hw-protocol-dash-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hw-protocol-dash-icon {
    font-size: 2.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.hw-protocol-dash-name {
    font-family: var(--hw-font);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--hw-text);
    letter-spacing: -0.02em;
    margin: 0 0 4px;
}

.hw-protocol-dash-tagline {
    font-size: 0.85rem;
    color: var(--pc, var(--hw-teal));
    font-weight: 600;
}

.hw-protocol-abandon-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 10px;
    color: rgba(239,68,68,0.7);
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hw-transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.hw-protocol-abandon-btn:hover {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.5);
    color: #f87171;
}

/* ── Progress bar ─────────────────────────────────── */
.hw-protocol-progress-wrap {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    padding: 18px 20px;
}

.hw-protocol-progress-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.hw-protocol-progress-label {
    font-family: var(--hw-font);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--hw-text-soft);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.hw-protocol-progress-pct {
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 800;
    color: var(--pc, var(--hw-teal));
}

.hw-protocol-progress-track {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.hw-protocol-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pc, var(--hw-teal)), color-mix(in srgb, var(--pc, var(--hw-teal)) 60%, white));
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .hw-protocol-progress-fill { background: linear-gradient(90deg, var(--hw-teal), #67e8f9); }
}

/* ── Stats row ────────────────────────────────────── */
.hw-protocol-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hw-protocol-stat {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius-sm);
    padding: 14px 16px;
    text-align: center;
}

.hw-protocol-stat-value {
    font-family: var(--hw-font);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--hw-text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 4px;
}

.hw-protocol-stat-label {
    font-size: 0.72rem;
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Roadmap ──────────────────────────────────────── */
.hw-roadmap-wrap {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    padding: 20px 20px 24px;
}

.hw-roadmap-title {
    font-family: var(--hw-font);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hw-text-soft);
    margin-bottom: 20px;
}

.hw-roadmap {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    padding: 40px 10px 32px;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.2) transparent;
}

.hw-roadmap::-webkit-scrollbar { height: 4px; }
.hw-roadmap::-webkit-scrollbar-track { background: transparent; }
.hw-roadmap::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.2); border-radius: 4px; }

.hw-roadmap-bar {
    position: relative;
    display: flex;
    align-items: flex-start;
    min-width: max-content;
}

/* Track */
.hw-roadmap-track-bg {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px;
    z-index: 0;
}

.hw-roadmap-track-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pc, var(--hw-teal)), color-mix(in srgb, var(--pc, var(--hw-teal)) 50%, white));
    border-radius: 3px;
    max-width: 100%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .hw-roadmap-track-fill { background: linear-gradient(90deg, var(--hw-teal), #67e8f9); }
}

/* Roadmap nodes */
.hw-roadmap-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 80px;
}

.hw-rn-pip {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hw-bg);
    border: 2.5px solid var(--hw-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    position: relative;
    z-index: 2;
    transition: var(--hw-transition);
    flex-shrink: 0;
}

.hw-rn-label {
    font-family: var(--hw-font);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--hw-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
    text-align: center;
    white-space: nowrap;
}

.hw-rn-title {
    font-size: 0.68rem;
    color: var(--hw-text-soft);
    text-align: center;
    line-height: 1.3;
    margin-top: 3px;
    max-width: 72px;
    word-break: break-word;
    white-space: normal;
}

/* Passed milestone */
.hw-rn-passed .hw-rn-pip {
    border-color: var(--rn-color, var(--hw-teal));
    background: color-mix(in srgb, var(--rn-color, var(--hw-teal)) 20%, var(--hw-bg));
}

@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .hw-rn-passed .hw-rn-pip { background: var(--hw-bg); }
}

.hw-rn-passed .hw-rn-label { color: var(--hw-text-soft); }

/* Near milestone (next upcoming) */
.hw-rn-near .hw-rn-pip {
    border-color: var(--rn-color, var(--hw-teal));
    box-shadow: 0 0 12px var(--rn-color, var(--hw-teal));
    animation: hw-rn-pulse 2s ease-in-out infinite;
}

@keyframes hw-rn-pulse {
    0%, 100% { box-shadow: 0 0 6px var(--rn-color, var(--hw-teal)); }
    50%       { box-shadow: 0 0 18px var(--rn-color, var(--hw-teal)); }
}

.hw-rn-near .hw-rn-label { color: var(--rn-color, var(--hw-teal)); }
.hw-rn-near .hw-rn-title  { color: var(--hw-text); font-weight: 600; }

/* Color variants */
.hw-rn-green  { --rn-color: #22c55e; }
.hw-rn-teal   { --rn-color: var(--hw-teal); }
.hw-rn-indigo { --rn-color: var(--hw-indigo); }
.hw-rn-purple { --rn-color: var(--hw-purple); }
.hw-rn-amber  { --rn-color: var(--hw-amber); }
.hw-rn-rose   { --rn-color: #f43f5e; }

/* Roadmap cursor (current day) */
.hw-roadmap-cursor {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 28px;
    z-index: 3;
    pointer-events: none;
    transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hw-roadmap-cursor-pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25), 0 0 16px rgba(255,255,255,0.4);
    animation: hw-cursor-pulse 1.8s ease-in-out infinite;
    margin-bottom: 4px;
}

@keyframes hw-cursor-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.2), 0 0 8px rgba(255,255,255,0.3); }
    50%       { box-shadow: 0 0 0 5px rgba(255,255,255,0.1), 0 0 20px rgba(255,255,255,0.5); }
}

.hw-roadmap-cursor-label {
    font-family: var(--hw-font);
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--hw-text);
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: 8px;
    padding: 2px 7px;
    white-space: nowrap;
}

/* ── Current milestone card ───────────────────────── */
.hw-protocol-ms-card {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    padding: 20px;
    border-left: 3px solid var(--ms-color, var(--hw-teal));
    animation: hw-fade-in 0.4s ease both;
}

.hw-protocol-ms-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hw-protocol-ms-card-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.hw-protocol-ms-card-meta {
    flex: 1;
}

.hw-protocol-ms-card-day {
    font-family: var(--hw-font);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ms-color, var(--hw-teal));
    margin-bottom: 2px;
}

.hw-protocol-ms-card-title {
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 800;
    color: var(--hw-text);
    line-height: 1.2;
}

.hw-protocol-ms-card-body {
    font-size: 0.83rem;
    color: var(--hw-text-soft);
    line-height: 1.6;
}

/* Color variants */
.hw-ms-green  { --ms-color: #22c55e; }
.hw-ms-teal   { --ms-color: var(--hw-teal); }
.hw-ms-indigo { --ms-color: var(--hw-indigo); }
.hw-ms-purple { --ms-color: var(--hw-purple); }
.hw-ms-amber  { --ms-color: var(--hw-amber); }
.hw-ms-rose   { --ms-color: #f43f5e; }

/* ── Next milestone teaser ────────────────────────── */
.hw-protocol-next-ms {
    background: rgba(255,255,255,0.02);
    border: 1px dashed var(--hw-border-light);
    border-radius: var(--hw-radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.hw-protocol-next-ms-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    opacity: 0.6;
}

.hw-protocol-next-ms-info {
    flex: 1;
}

.hw-protocol-next-ms-label {
    font-family: var(--hw-font);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hw-text-dim);
    margin-bottom: 3px;
}

.hw-protocol-next-ms-title {
    font-family: var(--hw-font);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--hw-text-soft);
}

.hw-protocol-next-ms-day {
    font-family: var(--hw-font);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--pc, var(--hw-teal));
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Today's sessions ─────────────────────────────── */
.hw-protocol-today {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    overflow: hidden;
}

.hw-protocol-today-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hw-border);
    background: rgba(255,255,255,0.02);
}

.hw-protocol-today-title {
    font-family: var(--hw-font);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--hw-text-soft);
}

.hw-protocol-today-progress {
    font-family: var(--hw-font);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--pc, var(--hw-teal));
}

.hw-protocol-sessions-list {
    display: flex;
    flex-direction: column;
}

/* Session item */
.hw-ps-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--hw-border);
    transition: background 0.2s;
}

.hw-ps-item:last-child { border-bottom: none; }

.hw-ps-item:hover { background: rgba(255,255,255,0.02); }

.hw-ps-item.done { opacity: 0.55; }

.hw-ps-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--hw-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--hw-transition);
}

.hw-ps-item.done .hw-ps-check {
    background: rgba(34,197,94,0.15);
    border-color: #22c55e;
    color: #22c55e;
}

.hw-ps-check-icon { display: none; }
.hw-ps-item.done .hw-ps-check-icon { display: block; }

.hw-ps-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.hw-ps-info {
    flex: 1;
    min-width: 0;
}

.hw-ps-name {
    font-family: var(--hw-font);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--hw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.hw-ps-desc {
    font-size: 0.75rem;
    color: var(--hw-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-ps-duration {
    font-size: 0.72rem;
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.hw-ps-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.hw-ps-launch-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 8px;
    color: var(--hw-indigo);
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hw-transition);
    white-space: nowrap;
}

.hw-ps-launch-btn:hover {
    background: rgba(99,102,241,0.2);
    border-color: rgba(99,102,241,0.5);
}

.hw-ps-mark-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid rgba(34,197,94,0.25);
    border-radius: 8px;
    color: rgba(34,197,94,0.8);
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--hw-transition);
    white-space: nowrap;
}

.hw-ps-mark-btn:hover {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.5);
    color: #22c55e;
}

.hw-ps-done-label {
    display: none;
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 700;
    color: #22c55e;
    gap: 5px;
    align-items: center;
}

.hw-ps-item.done .hw-ps-done-label { display: flex; }
.hw-ps-item.done .hw-ps-actions .hw-ps-launch-btn,
.hw-ps-item.done .hw-ps-actions .hw-ps-mark-btn { display: none; }

/* All done banner */
.hw-ps-all-done {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    background: rgba(34,197,94,0.07);
    border-top: 1px solid rgba(34,197,94,0.15);
    font-family: var(--hw-font);
    font-size: 0.85rem;
    font-weight: 700;
    color: #22c55e;
    animation: hw-fade-in 0.3s ease both;
}

/* ── Protocol source ──────────────────────────────── */
.hw-protocol-source {
    font-size: 0.7rem;
    color: var(--hw-text-dim);
    line-height: 1.5;
    padding: 10px 16px;
    background: rgba(255,255,255,0.015);
    border: 1px solid var(--hw-border);
    border-radius: 8px;
    margin-top: 4px;
}

.hw-protocol-source a {
    color: var(--hw-indigo);
    text-decoration: none;
}

.hw-protocol-source a:hover { text-decoration: underline; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .hw-protocol-grid { grid-template-columns: 1fr; }
    .hw-protocol-stats-row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .hw-protocol-stat-value { font-size: 1.3rem; }
    .hw-protocol-stat { padding: 12px; }
    .hw-protocol-dash-header { flex-direction: column; align-items: flex-start; }
    .hw-ps-item { padding: 12px 16px; gap: 10px; }
    .hw-ps-desc { display: none; }
    .hw-roadmap { padding: 36px 4px 28px; }
    .hw-roadmap-node { width: 66px; }
    .hw-protocol-next-ms { flex-wrap: wrap; }
}

/* ── XP HUD — clickable cursor ─────────────────────── */
.hw-xp-hud { cursor: pointer; }

/* ══════════════════════════════════════════════════════
   PROFILE OVERLAY
══════════════════════════════════════════════════════ */

.hw-profile-overlay {
    position: fixed;         /* centré dans l'écran visible (pas absolute sur la page géante) */
    inset: 0;
    background: rgba(2, 8, 17, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;           /* au-dessus du menu (350) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    padding: 20px 16px;
}

.hw-profile-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.hw-profile-card {
    position: relative;
    background: linear-gradient(145deg, #0d1829, #111e35);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 26px;
    padding: 28px 24px 24px;
    width: min(460px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    box-shadow: 0 32px 80px rgba(0,0,0,0.65);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.35s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(99,102,241,0.3) transparent;
}

.hw-profile-overlay.show .hw-profile-card {
    transform: translateY(0) scale(1);
}

/* Ambient glow */
.hw-profile-card::before {
    content: '';
    position: absolute;
    top: -60px; left: 50%;
    transform: translateX(-50%);
    width: 280px; height: 160px;
    background: radial-gradient(ellipse, rgba(99,102,241,0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hw-profile-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--hw-text-dim);
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.hw-profile-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--hw-text);
}

/* ── Header (avatar + identity) ─────────────────────── */
.hw-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}

.hw-profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--hw-font);
    font-size: 1.6rem;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(99,102,241,0.4);
    text-transform: uppercase;
}

.hw-profile-identity { flex: 1; min-width: 0; }

.hw-profile-name {
    font-family: var(--hw-font);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--hw-text);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-profile-level-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 700;
    color: #a5b4fc;
}

/* ── XP Progress ────────────────────────────────────── */
.hw-profile-xp-section {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.hw-profile-xp-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--hw-font);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--hw-text-soft);
    margin-bottom: 7px;
}

.hw-profile-xp-labels span:first-child { color: var(--hw-text); }

.hw-profile-progress-track {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.hw-profile-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8, #c084fc);
    border-radius: 5px;
    width: 0%;
    transition: width 1s cubic-bezier(0.34,1.56,0.64,1);
}

.hw-profile-xp-sub {
    font-size: 0.7rem;
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    text-align: right;
}

/* ── Stats Grid ─────────────────────────────────────── */
.hw-profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}

.hw-profile-stat {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 12px 8px;
    text-align: center;
}

.hw-profile-stat-val {
    font-family: var(--hw-font);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--hw-text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 4px;
}

.hw-profile-stat-lbl {
    font-family: var(--hw-font);
    font-size: 0.65rem;
    color: var(--hw-text-dim);
    line-height: 1.3;
    font-weight: 500;
}

/* ── Section title ──────────────────────────────────── */
.hw-profile-section-title {
    font-family: var(--hw-font);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hw-text-dim);
    margin: 0 0 12px;
    position: relative;
    z-index: 1;
}

/* ── Achievements Grid ──────────────────────────────── */
.hw-profile-achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    position: relative;
    z-index: 1;
}

.hw-profile-ach {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 10px 12px;
    transition: background 0.2s, border-color 0.2s;
}

.hw-profile-ach.unlocked {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(168,85,247,0.06));
    border-color: rgba(99,102,241,0.25);
}

.hw-profile-ach-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.hw-profile-ach.locked .hw-profile-ach-icon { filter: grayscale(1); opacity: 0.35; }

.hw-profile-ach-info { min-width: 0; }

.hw-profile-ach-name {
    font-family: var(--hw-font);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-profile-ach.locked .hw-profile-ach-name { color: var(--hw-text-dim); }

.hw-profile-ach-status {
    font-family: var(--hw-font);
    font-size: 0.65rem;
    font-weight: 600;
    color: #a5b4fc;
    margin-top: 2px;
}

.hw-profile-ach.locked .hw-profile-ach-status { color: rgba(148,163,184,0.4); }

/* ── Logout link ────────────────────────────────────── */
.hw-profile-logout {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 10px;
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.18);
    border-radius: 12px;
    font-family: var(--hw-font);
    font-size: 0.8rem;
    font-weight: 600;
    color: #f87171;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    position: relative;
    z-index: 1;
}

.hw-profile-logout:hover {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.3);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 520px) {
    .hw-profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hw-profile-achievements-grid { grid-template-columns: 1fr; }
    .hw-auth-card { padding: 22px 18px 18px; }
    .hw-auth-features { gap: 6px; }
    .hw-auth-features span { font-size: 0.68rem; padding: 4px 10px; }
}

/* ══════════════════════════════════════════════════════
   MESSAGES D'ENCOURAGEMENT — Nuages doux de coton
══════════════════════════════════════════════════════ */

/* ── Respiration douce de la bulle (box-shadow seulement,
      ne conflicte pas avec les transitions transform/opacity) */
@keyframes hw-enc-breathe {
    0%, 100% {
        box-shadow:
            0 14px 44px rgba(0,0,0,0.28),
            0  4px 14px rgba(0,0,0,0.18),
            inset 0 1px 0 rgba(255,255,255,0.14),
            inset 0 -1px 0 rgba(0,0,0,0.12);
    }
    50% {
        box-shadow:
            0 22px 60px rgba(0,0,0,0.36),
            0  6px 20px rgba(0,0,0,0.24),
            inset 0 1px 0 rgba(255,255,255,0.20),
            inset 0 -1px 0 rgba(0,0,0,0.14);
    }
}

@keyframes hw-enc-breathe-power {
    0%, 100% {
        box-shadow:
            0 14px 44px rgba(0,0,0,0.32),
            0  0  24px rgba(99,102,241,0.14),
            inset 0 1px 0 rgba(129,140,248,0.18);
    }
    50% {
        box-shadow:
            0 22px 60px rgba(0,0,0,0.40),
            0  0  42px rgba(99,102,241,0.28),
            inset 0 1px 0 rgba(129,140,248,0.26);
    }
}

/* ── Élément principal ── */
#hw-encouragement {
    /* Position — centré, au-dessus du player */
    position: fixed;
    bottom: 104px;
    left: 50%;
    z-index: 145;
    pointer-events: none;

    /* Dimensions */
    max-width: 520px;
    width: calc(100% - 60px);
    text-align: center;

    /* ── Bulle coton — fond frosted glass ── */
    padding: 20px 36px 22px;
    border-radius: 38px;

    /* Dégradé interne : reflet doux en haut-gauche → transparence */
    background:
        radial-gradient(ellipse 85% 55% at 32% 28%,
            rgba(255,255,255,0.14) 0%,
            rgba(255,255,255,0.04) 45%,
            transparent 100%),
        rgba(10, 18, 36, 0.60);

    backdrop-filter: blur(28px) saturate(1.6) brightness(1.08);
    -webkit-backdrop-filter: blur(28px) saturate(1.6) brightness(1.08);

    border: 1px solid rgba(255,255,255,0.12);
    border-top-color: rgba(255,255,255,0.22);   /* highlight supérieur */
    border-bottom-color: rgba(0,0,0,0.15);

    box-shadow:
        0 14px 44px rgba(0,0,0,0.28),
        0  4px 14px rgba(0,0,0,0.18),
        inset 0 1px 0 rgba(255,255,255,0.14),
        inset 0 -1px 0 rgba(0,0,0,0.12);

    /* ── Typographie ── */
    font-family: var(--hw-font);
    font-size: 1.05rem;
    font-weight: 500;
    font-style: italic;
    line-height: 1.65;
    color: rgba(226,232,240,0.92);
    letter-spacing: 0.015em;

    /* ── État initial : invisible, légèrement bas, flou ── */
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.92);
    filter: blur(6px);

    /* Transition entrée (définie ici pour être active quand .hw-enc-visible est ajouté) */
    transition:
        opacity  0.95s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.95s cubic-bezier(0.30, 1.20, 0.64, 1),
        filter   0.95s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Visible : monte en douceur + respiration de la bulle ── */
#hw-encouragement.hw-enc-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    filter: blur(0px);
    /* Respiration légère sur le box-shadow — ne conflicte pas avec transform */
    animation: hw-enc-breathe 4.5s 0.95s ease-in-out infinite;
}

/* ── Sortie : s'évapore vers le haut ── */
#hw-encouragement.hw-enc-visible.hw-enc-out {
    opacity: 0;
    transform: translateX(-50%) translateY(-22px) scale(0.96);
    filter: blur(6px);
    animation: none;
    transition:
        opacity  0.78s cubic-bezier(0.4, 0, 1, 1),
        transform 0.78s cubic-bezier(0.4, 0, 0.8, 1),
        filter   0.78s ease;
}

/* ── Mode puissant — aura indigo/teal ── */
#hw-encouragement.hw-enc-power {
    font-style: normal;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: 0.03em;
    color: rgba(255,255,255,0.96);

    background:
        radial-gradient(ellipse 80% 55% at 28% 28%,
            rgba(99,102,241,0.22) 0%,
            transparent 70%),
        radial-gradient(ellipse 60% 50% at 72% 68%,
            rgba(13,217,192,0.14) 0%,
            transparent 70%),
        rgba(8, 15, 32, 0.68);

    border-color: rgba(99,102,241,0.20);
    border-top-color: rgba(129,140,248,0.30);
    border-bottom-color: rgba(0,0,0,0.2);
}

#hw-encouragement.hw-enc-power.hw-enc-visible {
    animation: hw-enc-breathe-power 3.8s 0.95s ease-in-out infinite;
}

/* ── Responsive ── */

/* Tablette large : on commence à réduire */
@media (max-width: 900px) {
    #hw-encouragement {
        max-width: 400px;
        font-size: 0.95rem;
        padding: 16px 28px 18px;
    }
}

/* Tablette / mobile — au-dessus de la tab bar + player */
@media (max-width: 768px) {
    #hw-encouragement {
        bottom: 150px;
        max-width: 320px;
        width: calc(100% - 48px);
        font-size: 0.875rem;
        padding: 13px 22px 15px;
        border-radius: 28px;
        /* Légèrement plus opaque pour lisibilité sur petits écrans */
        background:
            radial-gradient(ellipse 85% 55% at 32% 28%,
                rgba(255,255,255,0.12) 0%,
                transparent 100%),
            rgba(10, 18, 36, 0.72);
    }
    #hw-encouragement.hw-enc-power {
        font-size: 0.938rem;
        background:
            radial-gradient(ellipse 80% 55% at 28% 28%,
                rgba(99,102,241,0.22) 0%,
                transparent 70%),
            rgba(8, 15, 32, 0.78);
    }
}

/* Très petits écrans */
@media (max-width: 400px) {
    #hw-encouragement {
        bottom: 145px;
        width: calc(100% - 36px);
        font-size: 0.825rem;
        padding: 11px 18px 13px;
        border-radius: 24px;
    }
    #hw-encouragement.hw-enc-power {
        font-size: 0.875rem;
    }
}

/* ══════════════════════════════════════════════════════
   PROTOCOL — Progress fill color variants
══════════════════════════════════════════════════════ */
.hw-pf-teal   { background: linear-gradient(90deg, var(--hw-teal), #67e8f9); }
.hw-pf-indigo { background: linear-gradient(90deg, var(--hw-indigo), #818cf8); }
.hw-pf-purple { background: linear-gradient(90deg, var(--hw-purple), #c084fc); }
.hw-pf-green  { background: linear-gradient(90deg, #22c55e, #86efac); }
.hw-pf-amber  { background: linear-gradient(90deg, var(--hw-amber), #fbbf24); }
.hw-pf-rose   { background: linear-gradient(90deg, #f43f5e, #fb7185); }

/* ══════════════════════════════════════════════════════
   PROTOCOL CARD — Redesign (icon + meta side by side)
══════════════════════════════════════════════════════ */

/* Override card header to horizontal icon + meta layout */
.hw-protocol-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px 10px;
}

.hw-protocol-card-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Meta: badges + name + tagline stacked */
.hw-pc-meta {
    flex: 1;
    min-width: 0;
}

.hw-pc-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

/* Milestone dots inline */
.hw-pc-milestones {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.hw-pc-ms-dot {
    font-size: 0.85rem;
    opacity: 0.75;
    transition: opacity 0.2s;
}
.hw-pc-ms-dot:hover { opacity: 1; }

.hw-pc-ms-sep {
    color: var(--hw-border-light);
    font-size: 0.7rem;
}

/* Active card state */
.hw-pc-is-active {
    border-color: var(--pc, var(--hw-teal)) !important;
    box-shadow: 0 0 0 1px var(--pc, var(--hw-teal)), 0 4px 24px rgba(0,0,0,0.2) !important;
}

.hw-pc-active-state {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hw-pc-active-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.hw-pc-active-badge {
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--pc, var(--hw-teal));
    background: color-mix(in srgb, var(--pc, var(--hw-teal)) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--pc, var(--hw-teal)) 25%, transparent);
    border-radius: 20px;
    padding: 3px 10px;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) {
    .hw-pc-active-badge { background: rgba(13,217,192,0.1); border-color: rgba(13,217,192,0.25); color: var(--hw-teal); }
}

.hw-pc-today-pct {
    font-family: var(--hw-font);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hw-text-dim);
}
.hw-pc-today-pct.done { color: #22c55e; }

.hw-pc-mini-bar {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}

.hw-pc-mini-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.34,1.56,0.64,1);
}

.hw-protocol-view-btn {
    display: block;
    text-align: center;
    padding: 8px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--hw-border);
    border-radius: 8px;
    color: var(--hw-text-soft);
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--hw-transition);
}
.hw-protocol-view-btn:hover {
    background: rgba(255,255,255,0.07);
    color: var(--hw-text);
}

/* ══════════════════════════════════════════════════════
   ACTIVE PROTOCOLS SECTION — multi-accordion
══════════════════════════════════════════════════════ */

.hw-active-protocols-section {
    margin-bottom: 32px;
    animation: hw-fade-in 0.3s ease both;
}

.hw-aps-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.hw-aps-title {
    font-family: var(--hw-font);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--hw-text);
    letter-spacing: -0.02em;
    margin: 0;
}

.hw-aps-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: var(--hw-teal-glow2);
    border: 1px solid rgba(13,217,192,0.3);
    border-radius: 12px;
    font-family: var(--hw-font);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--hw-teal);
}

.hw-aps-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Accordion item ─────────────────────────────────── */
.hw-api-item {
    background: var(--hw-surface);
    border: 1px solid var(--hw-border);
    border-radius: var(--hw-radius);
    overflow: hidden;
    transition: border-color 0.2s;
}

.hw-api-item.expanded {
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* ── Accordion header ────────────────────────────────── */
.hw-api-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.hw-api-head:hover { background: rgba(255,255,255,0.02); }

.hw-api-head-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.hw-api-hicon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }

.hw-api-hnames {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hw-api-hname {
    font-family: var(--hw-font);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--hw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-api-hday {
    font-family: var(--hw-font);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--hw-text-dim);
    font-variant-numeric: tabular-nums;
}

.hw-api-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hw-api-today-tag {
    font-family: var(--hw-font);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--hw-text-soft);
    white-space: nowrap;
}
.hw-api-today-tag.all-done { color: #22c55e; }

.hw-api-days-lft {
    font-family: var(--hw-font);
    font-size: 0.72rem;
    color: var(--hw-text-dim);
    font-weight: 600;
    white-space: nowrap;
}

.hw-api-mini-bar {
    width: 64px;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.hw-api-mini-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.hw-api-chevron {
    width: 18px;
    height: 18px;
    color: var(--hw-text-dim);
    transition: transform 0.25s ease, color 0.2s;
    flex-shrink: 0;
}
.hw-api-item.expanded .hw-api-chevron {
    transform: rotate(180deg);
    color: var(--hw-text-soft);
}

/* ── Accordion body ──────────────────────────────────── */
.hw-api-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hw-api-item.expanded .hw-api-body {
    max-height: 4000px; /* large enough for any content */
}

.hw-api-body > * {
    margin-left: 18px;
    margin-right: 18px;
}

.hw-api-body .hw-protocol-stats-row { margin-top: 4px; margin-bottom: 12px; }
.hw-api-body .hw-roadmap-wrap       { margin-bottom: 12px; }
.hw-api-body .hw-protocol-ms-card   { margin-bottom: 10px; }
.hw-api-body .hw-protocol-next-ms   { margin-bottom: 10px; }
.hw-api-body .hw-protocol-today     { margin-bottom: 10px; }

/* ── Accordion footer ────────────────────────────────── */
.hw-api-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--hw-border);
    margin: 4px 0 0;
}

.hw-api-footer .hw-protocol-source {
    flex: 1;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
}

.hw-api-footer .hw-protocol-abandon-btn {
    flex-shrink: 0;
    margin-top: 0;
}

/* ── Protocol section header (subtitle line above grid) */
.hw-protocol-section-divider {
    font-family: var(--hw-font);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--hw-text-dim);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hw-border);
}

/* ── Responsive for new UI ───────────────────────────── */
@media (max-width: 768px) {
    .hw-api-mini-bar { width: 40px; }
    .hw-api-days-lft { display: none; }
    .hw-api-head { padding: 12px 14px; }
    .hw-api-body > * { margin-left: 12px; margin-right: 12px; }
    .hw-api-footer { flex-direction: column; }
    .hw-pc-badges { gap: 4px; }
    .hw-aps-title { font-size: 1rem; }
}

/* ══════════════════════════════════════════════════════
   ONBOARDING — Tutoriel première connexion
══════════════════════════════════════════════════════ */

/* ── Animation entrée du nuage de fond ── */
@keyframes hw-ob-bg-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes hw-ob-card-in {
    from { opacity: 0; transform: translateY(28px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes hw-ob-card-out {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.94) translateY(-16px); }
}
@keyframes hw-ob-visual-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-7px); }
}
@keyframes hw-ob-dot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(13,217,192,0.5); }
    50%       { box-shadow: 0 0 0 5px rgba(13,217,192,0); }
}

/* ── Overlay plein écran ── */
#hw-onboarding {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(ellipse 80% 60% at 30% 20%, rgba(13,217,192,0.08) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 75% 80%, rgba(168,85,247,0.08) 0%, transparent 70%),
        rgba(2, 8, 17, 0.88);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    opacity: 0;
    /* État de repos : JAMAIS bloquer les clics. Un overlay opacity:0 reste
       cliquable ; sans ceci, s'il persiste dans le DOM (erreur d'init avant
       ob.start()) il forme un mur invisible plein écran z-index 9999. */
    pointer-events: none;
    transition: opacity .45s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}
#hw-onboarding.hw-ob-active {
    opacity: 1;
    pointer-events: auto; /* cliquable uniquement quand l'onboarding est actif */
    animation: hw-ob-bg-in .45s ease-out forwards;
}
#hw-onboarding.hw-ob-closing {
    opacity: 0;
    transition: opacity .6s cubic-bezier(0.4, 0, 1, 1);
    pointer-events: none;
}

/* ── Carte centrale ── */
.hw-ob-card {
    position: relative;
    width: 100%;
    max-width: 540px;
    background:
        radial-gradient(ellipse 90% 60% at 20% 10%, rgba(255,255,255,0.05) 0%, transparent 70%),
        rgba(8, 16, 34, 0.92);
    border: 1px solid rgba(255,255,255,0.10);
    border-top-color: rgba(255,255,255,0.18);
    border-radius: 28px;
    padding: 36px 40px 28px;
    box-shadow:
        0 32px 80px rgba(0,0,0,0.55),
        0  8px 24px rgba(0,0,0,0.30),
        inset 0 1px 0 rgba(255,255,255,0.12);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    animation: hw-ob-card-in .55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
}

/* ── Étape équipement — accent ambré ── */
.hw-ob-card.hw-ob-highlight {
    border-color: rgba(245,158,11,0.22);
    border-top-color: rgba(245,158,11,0.38);
    background:
        radial-gradient(ellipse 80% 55% at 20% 10%, rgba(245,158,11,0.06) 0%, transparent 70%),
        rgba(8, 16, 34, 0.94);
    box-shadow:
        0 32px 80px rgba(0,0,0,0.55),
        0  0   40px rgba(245,158,11,0.06),
        inset 0 1px 0 rgba(245,158,11,0.14);
}

/* ── Visuel SVG ── */
.hw-ob-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px;
    animation: hw-ob-visual-float 4s ease-in-out infinite;
}
.hw-ob-visual svg {
    width: auto;
    height: 80px;
    max-width: 160px;
    filter: drop-shadow(0 4px 16px rgba(13,217,192,0.18));
}
.hw-ob-card.hw-ob-highlight .hw-ob-visual svg {
    filter: drop-shadow(0 4px 20px rgba(245,158,11,0.28));
}
.hw-ob-card-ready .hw-ob-visual svg {
    filter: drop-shadow(0 6px 24px rgba(99,102,241,0.30));
}

/* ── Contenu texte ── */
.hw-ob-content { display: flex; flex-direction: column; gap: 8px; }

.hw-ob-step-num {
    font-family: var(--hw-font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7dd3fc;
    opacity: 1;
}
.hw-ob-card.hw-ob-highlight .hw-ob-step-num { color: #fcd34d; }

.hw-ob-title {
    font-family: var(--hw-font);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.22;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
}

.hw-ob-sub {
    font-size: 0.938rem;
    font-weight: 500;
    color: #7dd3fc;
    margin: 0;
    opacity: 1;
}
.hw-ob-card.hw-ob-highlight .hw-ob-sub { color: #fcd34d; }

.hw-ob-body {
    font-family: var(--hw-font-body);
    font-size: 0.925rem;
    line-height: 1.68;
    color: #cbd5e1;
    margin: 0;
}

/* ── Grille des 5 espaces (step 'spaces') ── */
.hw-ob-sections-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 4px;
}
.hw-ob-si {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    text-align: center;
    transition: background .18s;
}
.hw-ob-si:hover { background: rgba(255,255,255,0.08); }
.hw-ob-si-icon { font-size: 1.3rem; line-height: 1; }
.hw-ob-si-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: #f1f5f9;
}
.hw-ob-si-desc {
    font-size: 0.64rem;
    color: #94a3b8;
    line-height: 1.2;
}

/* ── Tips équipement ── */
.hw-ob-tips {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 6px;
}
.hw-ob-tip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid;
}
.hw-ob-tip-required {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.22);
}
.hw-ob-tip-best {
    background: rgba(13,217,192,0.08);
    border-color: rgba(13,217,192,0.20);
}
.hw-ob-tip-ok {
    background: rgba(100,116,139,0.10);
    border-color: rgba(100,116,139,0.18);
}
.hw-ob-tip-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}
.hw-ob-tip-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hw-ob-tip-text strong {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f1f5f9;
    display: block;
}
.hw-ob-tip-required .hw-ob-tip-text strong { color: #fca5a5; }
.hw-ob-tip-best     .hw-ob-tip-text strong { color: #7dd3fc; }
.hw-ob-tip-text span {
    font-family: var(--hw-font-body);
    font-size: 0.80rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* ── Footer : dots + navigation ── */
.hw-ob-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.hw-ob-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}
.hw-ob-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s, width .2s;
}
.hw-ob-dot.active {
    background: var(--hw-teal);
    width: 22px;
    border-radius: 4px;
    animation: hw-ob-dot-pulse 2s ease-in-out infinite;
}
.hw-ob-card.hw-ob-highlight .hw-ob-dot.active {
    background: var(--hw-amber);
    animation: none;
}
.hw-ob-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hw-ob-prev {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--hw-text-soft);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background .18s, color .18s;
}
.hw-ob-prev:hover { background: rgba(255,255,255,0.10); color: var(--hw-text); }

.hw-ob-next {
    background: linear-gradient(135deg, var(--hw-teal-dark), var(--hw-teal));
    border: none;
    color: #fff;
    border-radius: 12px;
    padding: 11px 24px;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 18px rgba(13,217,192,0.30);
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.hw-ob-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(13,217,192,0.40);
    filter: brightness(1.08);
}
.hw-ob-next:active { transform: translateY(0); }

/* Bouton final — dégradé indigo/teal plus festif */
.hw-ob-finish {
    background: linear-gradient(135deg, #6366f1, var(--hw-teal));
    box-shadow: 0 4px 22px rgba(99,102,241,0.35);
    font-size: 1rem;
    padding: 13px 30px;
    border-radius: 14px;
}
.hw-ob-finish:hover {
    box-shadow: 0 8px 30px rgba(99,102,241,0.45);
}

/* ── Bouton passer ── */
.hw-ob-skip {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color .18s, background .18s;
}
.hw-ob-skip:hover {
    color: var(--hw-text-soft);
    background: rgba(255,255,255,0.06);
}

/* ── Anneau lumineux autour de l'élément cible ── */
@keyframes hw-ob-ring-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 0   rgba(13,217,192,0.55),
            0 0 0 6px rgba(13,217,192,0.18),
            inset 0 0 12px rgba(13,217,192,0.08);
    }
    50% {
        box-shadow:
            0 0 0 4px rgba(13,217,192,0.22),
            0 0 0 10px rgba(13,217,192,0.06),
            inset 0 0 18px rgba(13,217,192,0.12);
    }
}
@keyframes hw-ob-arr-bounce-up {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-7px); }
}
@keyframes hw-ob-arr-bounce-down {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(7px); }
}

.hw-ob-ptr-ring {
    border: 2px solid rgba(13,217,192,0.70);
    border-radius: 14px;
    background: rgba(13,217,192,0.06);
    opacity: 0;
    transition: opacity .38s cubic-bezier(0.22,1,0.36,1);
}
.hw-ob-ptr-ring.hw-ob-ptr-in {
    opacity: 1;
    animation: hw-ob-ring-pulse 2s ease-in-out infinite;
}

/* ── Pilule + flèche directionnelle ── */
.hw-ob-ptr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transform: scale(0.88);
    transition: opacity .38s .1s cubic-bezier(0.22,1,0.36,1),
                transform .38s .1s cubic-bezier(0.22,1,0.36,1);
}
.hw-ob-ptr.hw-ob-ptr-in {
    opacity: 1;
    transform: scale(1);
}

.hw-ob-ptr-lbl {
    background:
        radial-gradient(ellipse 80% 60% at 30% 30%, rgba(13,217,192,0.18) 0%, transparent 70%),
        rgba(8, 18, 38, 0.88);
    border: 1px solid rgba(13,217,192,0.45);
    border-top-color: rgba(13,217,192,0.65);
    color: #7dd3fc;
    padding: 6px 14px 7px;
    border-radius: 20px;
    font-family: var(--hw-font);
    font-size: 0.80rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 4px 16px rgba(0,0,0,0.40),
        0 0  12px rgba(13,217,192,0.18);
}

/* Flèche SVG — haut ou bas selon direction */
.hw-ob-ptr-svg {
    width: 20px;
    height: 24px;
    color: #0dd9c0;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(13,217,192,0.50));
}
.hw-ob-ptr-up   .hw-ob-ptr-svg { animation: hw-ob-arr-bounce-up   0.9s ease-in-out infinite; }
.hw-ob-ptr-down .hw-ob-ptr-svg { animation: hw-ob-arr-bounce-down 0.9s ease-in-out infinite; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .hw-ob-card {
        padding: 28px 22px 22px;
        border-radius: 22px;
        gap: 16px;
    }
    .hw-ob-title { font-size: 1.3rem; }
    .hw-ob-visual { height: 70px; }
    .hw-ob-visual svg { height: 62px; }
    .hw-ob-sections-grid { grid-template-columns: repeat(3, 1fr); }
    .hw-ob-sections-grid .hw-ob-si:nth-child(4),
    .hw-ob-sections-grid .hw-ob-si:nth-child(5) { grid-column: span 1; }
    .hw-ob-tip-text strong { font-size: 0.82rem; }
    .hw-ob-tip-text span   { font-size: 0.77rem; }
    .hw-ob-finish { padding: 11px 22px; font-size: 0.938rem; }
}
@media (max-width: 400px) {
    .hw-ob-card { padding: 22px 16px 18px; }
    .hw-ob-title { font-size: 1.18rem; }
    .hw-ob-sections-grid { grid-template-columns: repeat(2, 1fr); }
    .hw-ob-tip { padding: 10px 12px; gap: 10px; }
    .hw-ob-tip-icon { font-size: 1.25rem; }
}

/* ═══════════════════════════════════════════════════════════
   MUSICOTHÉRAPIE — Section, player, cards
═══════════════════════════════════════════════════════════ */

/* ── Nav music accent ── */
.hw-nav-music svg, .hw-mobile-nav-music svg { stroke: #a855f7; }
.hw-nav-music.active, .hw-mobile-nav-music.active { color: #a855f7; border-color: #a855f7; }

/* ── Mode selector ── */
.hw-music-modes {
    display: flex;
    gap: 10px;
    padding: 0 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.hw-music-modes::-webkit-scrollbar { display: none; }
.hw-music-mode-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.04);
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--hw-transition);
    flex-shrink: 0;
}
.hw-music-mode-btn svg { width: 16px; height: 16px; }
.hw-music-mode-btn:hover { color: var(--hw-text-soft); background: rgba(255,255,255,0.07); }
.hw-music-mode-btn.active {
    background: rgba(168,85,247,0.14);
    border-color: rgba(168,85,247,0.40);
    color: #c084fc;
}

/* ── Genre filter chips ── */
.hw-music-genres {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.hw-music-genres::-webkit-scrollbar { display: none; }
.hw-genre-chip {
    padding: 7px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.03);
    color: var(--hw-text-dim);
    font-family: var(--hw-font);
    font-size: 0.80rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--hw-transition);
    flex-shrink: 0;
}
.hw-genre-chip:hover { border-color: rgba(168,85,247,0.35); color: var(--hw-text-soft); }
.hw-genre-chip.active {
    background: rgba(168,85,247,0.16);
    border-color: rgba(168,85,247,0.50);
    color: #c084fc;
}

/* ── Track list ── */
.hw-music-list {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 180px; /* space for player bar */
}

/* ── Skeleton loading ── */
.hw-music-skel {
    height: 80px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: hw-skeleton-wave 1.4s infinite;
}
@keyframes hw-skeleton-wave {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Track card ── */
.hw-track-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--hw-transition);
    position: relative;
    overflow: hidden;
}
.hw-track-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--track-color, #a855f7);
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: opacity 0.2s;
}
.hw-track-card:hover, .hw-track-card.playing {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
    transform: translateX(2px);
}
.hw-track-card.playing::before { opacity: 1; }
.hw-track-card:hover::before { opacity: 0.5; }

.hw-track-thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(168,85,247,0.12);
    border: 1px solid rgba(168,85,247,0.20);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.hw-track-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hw-track-thumb svg { width: 22px; height: 22px; color: #c084fc; }
.hw-track-card.playing .hw-track-thumb {
    background: rgba(168,85,247,0.22);
}

/* Animated bars when playing */
.hw-playing-bars {
    display: none;
    position: absolute;
    inset: 0;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    background: rgba(168,85,247,0.35);
    padding: 8px;
}
.hw-track-card.playing .hw-playing-bars { display: flex; }
.hw-playing-bar {
    width: 4px;
    border-radius: 2px;
    background: #c084fc;
    animation: hw-bar-bounce 0.8s ease-in-out infinite;
}
.hw-playing-bar:nth-child(2) { animation-delay: 0.15s; height: 60%; }
.hw-playing-bar:nth-child(3) { animation-delay: 0.3s; }
.hw-playing-bar:nth-child(4) { animation-delay: 0.1s; height: 80%; }
@keyframes hw-bar-bounce {
    0%, 100% { height: 30%; }
    50%       { height: 90%; }
}

.hw-track-info { flex: 1; min-width: 0; }
.hw-track-title {
    font-family: var(--hw-font);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--hw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.hw-track-card.playing .hw-track-title { color: #c084fc; }
.hw-track-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--hw-text-dim);
}
.hw-track-genre-tag {
    padding: 2px 8px;
    border-radius: 50px;
    background: rgba(168,85,247,0.12);
    color: #c084fc;
    font-size: 0.72rem;
    font-weight: 500;
}
.hw-track-duration { display: flex; align-items: center; gap: 3px; }

.hw-track-actions { display: flex; align-items: center; gap: 6px; }
.hw-track-fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--hw-text-dim);
    transition: var(--hw-transition);
    display: flex;
    border-radius: 50%;
}
.hw-track-fav-btn:hover { color: #f43f5e; background: rgba(244,63,94,0.1); }
.hw-track-fav-btn.active { color: #f43f5e; }
.hw-track-fav-btn.active svg { fill: #f43f5e; }
.hw-track-fav-btn svg { width: 18px; height: 18px; transition: fill 0.2s; }
.hw-track-info-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--hw-text-dim);
    transition: var(--hw-transition);
    display: flex;
    border-radius: 50%;
}
.hw-track-info-btn:hover { color: var(--hw-teal); background: rgba(13,217,192,0.1); }
.hw-track-info-btn svg { width: 16px; height: 16px; }

/* Benefits tooltip panel */
.hw-track-benefits {
    display: none;
    padding: 12px 14px;
    margin-top: 10px;
    background: rgba(168,85,247,0.07);
    border-left: 2px solid #a855f7;
    border-radius: 0 10px 10px 0;
    font-size: 0.80rem;
    color: var(--hw-text-soft);
    line-height: 1.6;
}
.hw-track-card.benefits-open .hw-track-benefits { display: block; }
.hw-track-card.benefits-open { flex-wrap: wrap; }

/* Empty state */
.hw-music-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--hw-text-dim);
}
.hw-music-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
    margin-bottom: 12px;
}
.hw-music-empty p { font-size: 0.88rem; }

/* ── Persistent player bar ── */
.hw-music-player {
    position: sticky;
    bottom: 72px; /* above mobile nav */
    left: 0;
    right: 0;
    background: rgba(10,22,40,0.98);
    border-top: 1px solid rgba(168,85,247,0.20);
    padding: 10px 16px 12px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 -0px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
}
.hw-music-player[hidden] { display: none; }

.hw-player-cover {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(168,85,247,0.15);
    border: 1px solid rgba(168,85,247,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.hw-player-cover img { width: 100%; height: 100%; object-fit: cover; }
.hw-player-cover svg { width: 20px; height: 20px; color: #c084fc; }

.hw-player-info { flex: 1; min-width: 0; }
.hw-player-title {
    font-family: var(--hw-font);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--hw-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hw-player-genre {
    font-size: 0.74rem;
    color: #c084fc;
    margin-top: 1px;
}

.hw-player-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hw-player-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--hw-text-dim);
    transition: var(--hw-transition);
    display: flex;
    border-radius: 50%;
    line-height: 0;
}
.hw-player-btn:hover { color: var(--hw-text); background: rgba(255,255,255,0.08); }
.hw-player-btn svg { width: 20px; height: 20px; }

.hw-player-play-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--hw-transition);
    box-shadow: 0 4px 16px rgba(168,85,247,0.40);
    flex-shrink: 0;
    line-height: 0;
}
.hw-player-play-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(168,85,247,0.55); }
.hw-player-play-btn svg { width: 20px; height: 20px; }

.hw-player-progress-wrap {
    width: 100%;
    order: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hw-player-seek {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.12);
    outline: none;
    cursor: pointer;
}
.hw-player-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a855f7;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(168,85,247,0.6);
}
.hw-player-seek::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #a855f7;
    cursor: pointer;
    border: none;
}
.hw-player-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--hw-text-dim);
}

.hw-player-extras { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.hw-player-extra-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--hw-text-dim);
    transition: var(--hw-transition);
    display: flex;
    border-radius: 50%;
    line-height: 0;
}
.hw-player-extra-btn:hover { color: var(--hw-text-soft); }
.hw-player-extra-btn[aria-pressed="true"] { color: #a855f7; }
.hw-player-extra-btn svg { width: 18px; height: 18px; }

/* Responsive */
@media (max-width: 480px) {
    .hw-music-modes { padding: 0 12px 12px; }
    .hw-music-genres { padding: 0 12px 12px; }
    .hw-music-list { padding: 0 12px; padding-bottom: 160px; }
    .hw-music-player { padding: 10px 12px; gap: 10px; }
    .hw-track-card { padding: 12px; gap: 12px; }
    .hw-track-thumb { width: 46px; height: 46px; }
}

/* ═══════════════════════════════════════════════════════════
   BOUTON SIGNALEMENT FLOTTANT + MODAL
═══════════════════════════════════════════════════════════ */

.hw-report-fab {
    position: fixed;
    bottom: 88px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(239,68,68,0.10);
    border: 1px solid rgba(239,68,68,0.28);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    transition: opacity 0.2s, transform 0.2s, background 0.2s, box-shadow 0.2s;
    opacity: 0.45;
}
.hw-report-fab:hover {
    opacity: 1;
    background: rgba(239,68,68,0.18);
    border-color: rgba(239,68,68,0.55);
    transform: scale(1.08);
    box-shadow: 0 4px 18px rgba(239,68,68,0.28);
}
.hw-report-fab svg { width: 18px; height: 18px; }

/* ── Overlay ── */
.hw-report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,8,17,0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    padding: 16px;
}
.hw-report-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Modal ── */
.hw-report-modal {
    background: #0d1b2e;
    border: 1px solid rgba(239,68,68,0.22);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(239,68,68,0.08);
    overflow: hidden;
    max-height: 90vh;
}
.hw-report-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.hw-report-modal-header h3 {
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 600;
    color: var(--hw-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.hw-report-modal-header h3 svg { width: 18px; height: 18px; color: #ef4444; }
.hw-report-close {
    background: none;
    border: none;
    color: var(--hw-text-dim);
    cursor: pointer;
    padding: 5px;
    display: flex;
    border-radius: 7px;
    transition: var(--hw-transition);
    line-height: 0;
}
.hw-report-close:hover { color: var(--hw-text); background: rgba(255,255,255,0.07); }
.hw-report-close svg { width: 18px; height: 18px; }

.hw-report-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.hw-report-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--hw-text-soft);
    display: block;
    margin-bottom: 6px;
}
.hw-report-optional {
    font-weight: 400;
    color: var(--hw-text-dim);
    font-size: 0.76rem;
}
.hw-report-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--hw-text);
    font-family: var(--hw-font-body);
    font-size: 0.875rem;
    resize: vertical;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.6;
    min-height: 90px;
}
.hw-report-textarea:focus {
    outline: none;
    border-color: rgba(239,68,68,0.40);
    background: rgba(255,255,255,0.06);
}
.hw-report-drop {
    border: 2px dashed rgba(13,217,192,0.22);
    border-radius: 12px;
    background: rgba(13,217,192,0.03);
    min-height: 100px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}
.hw-report-drop:hover,
.hw-report-drop.drag-over {
    border-color: rgba(13,217,192,0.50);
    background: rgba(13,217,192,0.07);
}
.hw-report-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px;
    color: var(--hw-text-dim);
    font-size: 0.82rem;
    text-align: center;
    min-height: 100px;
    gap: 8px;
}
.hw-report-drop-inner svg { color: var(--hw-teal); }
.hw-report-preview {
    position: relative;
    padding: 8px;
}
.hw-report-preview img {
    width: 100%;
    border-radius: 8px;
    max-height: 180px;
    object-fit: contain;
    display: block;
}
.hw-report-preview-remove {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(239,68,68,0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.15s;
}
.hw-report-preview-remove:hover { background: #ef4444; }

.hw-report-modal-footer {
    padding: 14px 24px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
.hw-report-status {
    font-size: 0.80rem;
    color: var(--hw-text-dim);
    flex: 1;
    line-height: 1.4;
}
.hw-report-status.success { color: var(--hw-green, #22c55e); }
.hw-report-status.error   { color: var(--hw-red); }
.hw-report-actions { display: flex; gap: 10px; flex-shrink: 0; }
.hw-report-cancel {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 9px;
    padding: 9px 16px;
    color: var(--hw-text-soft);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--hw-font);
    transition: var(--hw-transition);
}
.hw-report-cancel:hover { background: rgba(255,255,255,0.11); }
.hw-report-submit {
    background: linear-gradient(135deg, rgba(239,68,68,0.80), rgba(185,28,28,0.70));
    border: 1px solid rgba(239,68,68,0.50);
    border-radius: 9px;
    padding: 9px 18px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--hw-font);
    display: flex;
    align-items: center;
    gap: 7px;
    transition: var(--hw-transition);
}
.hw-report-submit:hover {
    background: linear-gradient(135deg, rgba(239,68,68,0.95), rgba(185,28,28,0.88));
    box-shadow: 0 4px 16px rgba(239,68,68,0.32);
}
.hw-report-submit:disabled { opacity: 0.50; cursor: not-allowed; }
.hw-report-submit svg { width: 14px; height: 14px; }

@media (max-width: 480px) {
    .hw-report-modal-header { padding: 16px 18px 12px; }
    .hw-report-modal-body   { padding: 16px 18px; }
    .hw-report-modal-footer { padding: 12px 18px 16px; flex-direction: column; align-items: stretch; }
    .hw-report-actions { justify-content: flex-end; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE LAYOUT FIXES — empilement barre de nav + player bar
   ══════════════════════════════════════════════════════════
   Architecture verticale mobile (de bas en haut) :
     0 px           → Mobile nav (z 350) — toujours cliquable
     68 px          → Player bar (z 280) — compact, au-dessus de la nav
     68+60 = 128 px → FAB signalement (z 320) — au-dessus du player
     128+ px        → Contenu libre
═══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {

    /* 1 ── Mobile nav : z-index ROI, toujours accessible */
    .hw-mobile-nav {
        z-index: 350;
    }

    /* 2 ── Player bar : sort de sous la nav, layout compact */
    .hw-player {
        bottom: 68px;           /* juste au-dessus de la nav */
        z-index: 280;
        padding: 8px 12px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    /* Masque le curseur volume sur mobile (tactile inutilisable) */
    .hw-player .hw-volume-control {
        display: none;
    }

    /* Nom du protocole : tronque proprement */
    .hw-player-name {
        font-size: 0.82rem;
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .hw-player-freq { font-size: 0.70rem; }

    /* Bouton respiration : icône seule */
    .hw-breath-toggle-btn span { display: none; }
    .hw-breath-toggle-btn { padding: 9px 10px; }

    /* Timer compact */
    .hw-timer-display { padding: 6px 10px; }
    #hw-timer-text { font-size: 0.88rem; }

    /* Bouton Arrêter compact */
    .hw-stop-btn { padding: 8px 10px; font-size: 0.80rem; gap: 5px; }
    .hw-stop-btn svg { width: 12px; height: 12px; }

    /* 3 ── FAB signalement : au-dessus de player + nav */
    .hw-report-fab {
        bottom: 140px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    /* 4 ── Panneau respiration : modale plein écran, la sheet dégage la nav mobile
       via le padding-bottom (elle passe au-dessus du player, z-index 9000). */
    .hw-breath-panel {
        padding-bottom: 80px !important;
    }

    /* 5 ── Sections : padding-bottom pour ne pas cacher le contenu */
    .hw-section {
        padding-bottom: 160px;
    }

    /* 6 ── Modal signalement : bottom sheet sur mobile */
    .hw-report-overlay {
        align-items: flex-end;
        padding: 0;
        justify-content: stretch;
    }
    .hw-report-modal {
        max-height: calc(100dvh - 80px);
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        width: 100%;
    }
}

/* ══════════════════════════════════════════════════════════
   POPUPS MARKETING + MODAL UPGRADE PREMIUM
═══════════════════════════════════════════════════════════ */

/* ── Base overlay ── */
.hw-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2,8,17,0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    padding: 20px;
}
.hw-popup-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.hw-popup-overlay.open .hw-popup-card,
.hw-popup-overlay.open .hw-upgrade-modal {
    transform: translateY(0) scale(1);
}

/* ── Popup card (bienvenue / engagement / exit / session) ── */
.hw-popup-card {
    position: relative;
    background: linear-gradient(160deg, #0d1b2e 0%, #071422 100%);
    border: 1px solid rgba(13,217,192,0.18);
    border-radius: 24px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(13,217,192,0.06);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1);
}

.hw-popup-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hw-text-dim);
    cursor: pointer;
    transition: var(--hw-transition);
}
.hw-popup-close:hover { background: rgba(255,255,255,0.12); color: var(--hw-text); }
.hw-popup-close svg { width: 16px; height: 16px; }

.hw-popup-icon {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 16px;
    display: block;
}
.hw-popup-icon-success {
    font-style: normal;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(13,217,192,0.12);
    border: 2px solid rgba(13,217,192,0.35);
    color: var(--hw-teal);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.hw-popup-title {
    font-family: var(--hw-font);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hw-text);
    margin: 0 0 10px;
    text-wrap: balance;
}
.hw-popup-body {
    font-size: 0.90rem;
    color: var(--hw-text-soft);
    line-height: 1.65;
    margin: 0 0 24px;
}
.hw-popup-body strong { color: var(--hw-text); }

.hw-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hw-popup-btn-primary {
    background: linear-gradient(135deg, #0dd9c0, #09a896);
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    color: #020811;
    font-family: var(--hw-font);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
}
.hw-popup-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hw-popup-btn-ghost {
    background: transparent;
    border: none;
    color: var(--hw-text-dim);
    font-size: 0.82rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
    font-family: var(--hw-font);
}
.hw-popup-btn-ghost:hover { color: var(--hw-text-soft); }

/* ── Modal Upgrade Premium ── */
.hw-upgrade-overlay { padding: 16px; }

.hw-upgrade-modal {
    position: relative;
    background: linear-gradient(160deg, #0d1b2e 0%, #071422 100%);
    border: 1px solid rgba(13,217,192,0.22);
    border-radius: 24px;
    padding: 32px 28px 28px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 40px 100px rgba(0,0,0,0.7), 0 0 0 1px rgba(13,217,192,0.08);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.32s cubic-bezier(0.34,1.56,0.64,1);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
}

.hw-upgrade-header { text-align: center; margin-bottom: 24px; }
.hw-upgrade-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(13,217,192,0.18), rgba(13,217,192,0.06));
    border: 1px solid rgba(13,217,192,0.30);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--hw-teal);
    margin-bottom: 14px;
}
.hw-upgrade-title {
    font-family: var(--hw-font);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--hw-text);
    margin: 0 0 8px;
    text-wrap: balance;
}
.hw-upgrade-subtitle {
    font-size: 0.88rem;
    color: var(--hw-text-soft);
    margin: 0;
}

/* Features list */
.hw-upgrade-features {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 24px;
    text-align: left;
}
.hw-upgrade-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--hw-text-soft);
    line-height: 1.4;
}
.hw-upgrade-feature svg {
    width: 16px;
    height: 16px;
    color: var(--hw-teal);
    flex-shrink: 0;
    margin-top: 2px;
}
.hw-upgrade-feature strong { color: var(--hw-text); }

/* Pricing */
.hw-upgrade-pricing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--hw-border);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 20px;
}
.hw-upgrade-plan { text-align: center; }
.hw-upgrade-plan-annual {
    position: relative;
    background: rgba(13,217,192,0.05);
    border: 1px solid rgba(13,217,192,0.20);
    border-radius: 12px;
    padding: 12px 16px;
}
.hw-upgrade-plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hw-teal);
    color: #020811;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.hw-upgrade-plan-price {
    font-family: var(--hw-font);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--hw-text);
    line-height: 1;
}
.hw-upgrade-plan-price span { font-size: 1rem; font-weight: 600; }
.hw-upgrade-plan-period { font-size: 0.75rem; color: var(--hw-text-dim); margin-top: 4px; }
.hw-upgrade-plan-period em { color: var(--hw-teal); font-style: normal; }
.hw-upgrade-plan-sep { color: var(--hw-text-dim); font-size: 0.80rem; }

/* CTA button */
.hw-upgrade-cta-btn {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #0dd9c0, #09a896);
    border: none;
    border-radius: 14px;
    padding: 15px 20px;
    color: #020811;
    font-family: var(--hw-font);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.2s, transform 0.15s;
    letter-spacing: 0.01em;
}
.hw-upgrade-cta-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hw-upgrade-guarantee {
    text-align: center;
    font-size: 0.74rem;
    color: var(--hw-text-dim);
    margin: 12px 0 0;
}

/* ── Zone SVG verrouillée ── */
.hw-zone-gated {
    cursor: pointer !important;
    fill: rgba(239,68,68,0.06) !important;
    stroke: rgba(239,68,68,0.28) !important;
    stroke-dasharray: 4 2;
    transition: fill 0.2s, stroke 0.2s, filter 0.2s;
}
.hw-zone-gated:hover,
.hw-zone-gated.active {
    fill: rgba(239,68,68,0.16) !important;
    stroke: rgba(239,68,68,0.55) !important;
    filter: drop-shadow(0 0 8px rgba(239,68,68,0.35)) !important;
}

/* ── Carte de zone verrouillée dans la grille ── */
.hw-card[data-premium-gated] {
    position: relative;
    opacity: 0.75;
    border-style: dashed;
    border-color: rgba(239,68,68,0.22);
    cursor: pointer;
}
.hw-card[data-premium-gated]::after {
    content: '🔒 Premium';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239,68,68,0.15);
    border: 1px solid rgba(239,68,68,0.30);
    border-radius: 20px;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #f87171;
}
.hw-card[data-premium-gated]:hover {
    border-color: rgba(239,68,68,0.45);
    opacity: 0.95;
}
.hw-card[data-premium-gated]:hover::after {
    background: rgba(239,68,68,0.24);
}

/* ── Premium badge dans la nav ── */
.hw-nav-premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #0dd9c0, #09a896);
    border-radius: 50%;
    font-size: 0.55rem;
    color: #020811;
    font-weight: 900;
    line-height: 1;
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Responsive popups ── */
@media (max-width: 600px) {
    .hw-popup-card {
        padding: 28px 22px 24px;
        border-radius: 20px;
    }
    .hw-upgrade-modal {
        padding: 28px 20px 24px;
        border-radius: 20px;
    }
    .hw-upgrade-pricing {
        flex-direction: column;
        gap: 10px;
    }
    .hw-upgrade-plan-sep { display: none; }
    .hw-upgrade-plan-annual { width: 100%; }
    .hw-popup-overlay { padding: 12px; }
}

/* ══════════════════════════════════════════════════════════
   BADGE PREMIUM DORÉ — affiché dans le header pour les
   utilisateurs ayant un accès Premium actif.
═══════════════════════════════════════════════════════════ */
:root {
    --hw-gold:        #D4AF37;
    --hw-gold-light:  #FFD700;
    --hw-gold-glow:   rgba(212,175,55,0.35);
    --hw-gold-subtle: rgba(212,175,55,0.10);
}

.hw-premium-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 8px;
    background: linear-gradient(135deg, rgba(212,175,55,0.14) 0%, rgba(255,215,0,0.07) 100%);
    border: 1px solid rgba(212,175,55,0.45);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    cursor: default;
    user-select: none;
}

/* Reflet doré animé */
.hw-premium-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 30%,
        rgba(255,215,0,0.18) 50%,
        transparent 70%
    );
    animation: hw-gold-shimmer 3.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes hw-gold-shimmer {
    0%   { transform: translateX(-120%); }
    40%  { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

/* Couronne SVG */
.hw-premium-crown {
    display: inline-flex;
    width: 16px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 17' fill='none'%3E%3Cpath d='M2 14 L2 11 L5 5 L10 9 L15 5 L18 11 L18 14 Z' fill='%23D4AF37' opacity='0.9'/%3E%3Cpath d='M1 14 H19 V16 H1 Z' fill='%23D4AF37'/%3E%3Ccircle cx='10' cy='2.5' r='2' fill='%23FFD700'/%3E%3Ccircle cx='1.5' cy='10' r='1.5' fill='%23FFD700'/%3E%3Ccircle cx='18.5' cy='10' r='1.5' fill='%23FFD700'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.6));
}

.hw-premium-badge-label {
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: linear-gradient(90deg, #D4AF37 0%, #FFD700 50%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 100%;
    animation: hw-gold-text-shift 4s ease-in-out infinite;
}
@keyframes hw-gold-text-shift {
    0%, 100% { background-position: 0% 50%; }
    50%       { background-position: 100% 50%; }
}

/* ── Accents globaux pour les utilisateurs premium (charte teal) ── */
.hw-is-premium .hw-xp-bar-fill {
    background: linear-gradient(90deg, var(--hw-teal-dark) 0%, var(--hw-teal) 60%, #6ff5e6 100%) !important;
    box-shadow: 0 0 6px rgba(13,217,192,0.55) !important;
}

.hw-is-premium .hw-xp-level-badge {
    border-color: rgba(13,217,192,0.45);
    background: linear-gradient(135deg, rgba(13,217,192,0.18) 0%, rgba(13,217,192,0.05) 100%);
    box-shadow: 0 0 12px rgba(13,217,192,0.18);
}

.hw-is-premium .hw-nav-btn.active {
    color: var(--hw-gold);
    border-color: rgba(212,175,55,0.40);
    background: rgba(212,175,55,0.07);
}
.hw-is-premium .hw-nav-btn.active svg { color: var(--hw-gold); }

/* ── Badge ★ sur les onglets de section premium (non-premium) ── */
.hw-nav-premium-badge {
    font-size: 0.60rem;
    color: var(--hw-gold);
    margin-left: 3px;
    opacity: 0.75;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .hw-premium-badge {
        padding: 4px 9px 4px 6px;
    }
    .hw-premium-badge-label { font-size: 0.65rem; }
}

/* ── PWA Install Banner ─────────────────────────────────────────── */
#hw-install-banner {
    position: fixed;
    bottom: 84px; /* au-dessus du bottom tab bar ~68px */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9500;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--hw-surface);
    border: 1px solid rgba(13,217,192,0.32);
    border-radius: 18px;
    padding: 12px 12px 12px 14px;
    box-shadow: 0 4px 28px rgba(0,0,0,0.45), 0 0 0 1px rgba(13,217,192,0.12);
    max-width: 360px;
    width: calc(100% - 32px);
    animation: hw-banner-in 0.45s cubic-bezier(0.34, 1.3, 0.64, 1) both;
}
@keyframes hw-banner-in {
    from { opacity: 0; transform: translateX(-50%) translateY(24px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.hw-install-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.hw-install-icon {
    font-size: 1.55rem;
    flex-shrink: 0;
    line-height: 1;
}
.hw-install-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.hw-install-text strong {
    font-size: 0.88rem;
    color: var(--hw-text);
    font-weight: 700;
    line-height: 1.3;
}
.hw-install-desc {
    font-size: 0.76rem;
    color: var(--hw-text-soft);
    line-height: 1.4;
}
.hw-install-share-ic {
    display: inline-block;
    width: 13px;
    height: 13px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    color: var(--hw-teal);
}
.hw-install-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.hw-install-btn-main {
    background: linear-gradient(135deg, var(--hw-teal), var(--hw-indigo));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.18s;
    -webkit-font-smoothing: antialiased;
}
.hw-install-btn-main:hover,
.hw-install-btn-main:focus-visible { opacity: 0.82; }
.hw-install-btn-dismiss {
    background: none;
    border: none;
    color: var(--hw-text-soft);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px 7px;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.hw-install-btn-dismiss:hover,
.hw-install-btn-dismiss:focus-visible {
    background: rgba(255,255,255,0.08);
    color: var(--hw-text);
}

/* ══════════════════════════════════════════════════════════
   MOBILE — Désactivation des animations décoratives infinies
   Chaque animation avec transform sur mobile = GPU compositing layer.
   Plusieurs layers simultanés = saturation GPU = header ne repainte
   plus = logo invisible. On garde uniquement les animations fonctionnelles
   (modal-in, paywall, fade-in des cartes déjà corrigé).
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Status dot dans le header — CRITIQUE : transform:scale infini = layer GPU dans le header */
    .hw-status-dot.active,
    .hw-status-dot.emergency { animation: none !important; }

    /* Urgences */
    .hw-emergency-btn.running,
    .hw-emergency-btn.running .hw-emergency-icon-wrap { animation: none !important; }

    /* Barres wave du lecteur audio (5 éléments simultanés) */
    .hw-player-wave span { animation: none !important; }

    /* Bouton respiration + hint */
    .hw-breath-toggle-btn,
    .hw-breath-hint { animation: none !important; }

    /* Cercle de respiration — glows */
    .hw-breath-circle-glow,
    .hw-breath-arc-group circle { animation: none !important; }

    /* Encours / cercles animés */
    .hw-enc-ring,
    [class*="hw-enc-ring"] { animation: none !important; }

    /* XP gold shimmer (non bloquant mais consomme GPU) */
    [class*="hw-gold"],
    .hw-xp-level-badge-legendary * { animation: none !important; }

    /* Onboarding dots et flèches */
    .hw-ob-visual *,
    .hw-ob-dot,
    .hw-ob-ptr-svg { animation: none !important; }

    /* Skeleton loader */
    .hw-skeleton { animation: none !important; }

    /* Barre rebond */
    .hw-bar-bounce-el { animation: none !important; }

    /* Pulse notifications */
    [class*="-pulse"],
    [class*="-cursor"] { animation: none !important; }

    /* Reward system — conservé car UX fonctionnelle courte */

    /* Guide reco — transform:translateY dans keyframe hw-guide-fade */
    .hw-guide-reco { animation: none !important; opacity: 1 !important; }

    /* Cartes de section — fill-mode:both bloque à opacity:0 sur Android Chrome
       quand duration→0. Supprime l'animation et force la visibilité. */
    .hw-section.active .hw-card,
    .hw-section.active .hw-emergency-btn { animation: none !important; opacity: 1 !important; }
}
