/* ========================================
   📱 RESPONSIVE.CSS - VERSION OPTIMISÉE
   ======================================== */

/* ===== MOBILE (iPhone Portrait) ===== */
@media (max-width: 767px) {
    /* Grids universelles - FORCE 1 COLONNE */
    .grid-1,
    .grid-2,
    .grid-3, 
    .grid-4,
    .service-grid,
    .payment-grid,
    .faq-grid,
    [class*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    /* Layout général - OPTIMISATION MARGES */
    .main-wrapper {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .section-block {
        padding: 0 !important;
        margin: 1rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    /* Typography mobile */
    .logo-text {
        font-size: 1.8rem;
    }
    
    /* Cards communes */
    .monde-card,
    .plan-card,
    .content-card,
    .content-card-book,
    .content-enhanced {
        padding: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 1.2rem !important;
    }
    
    /* Grids sans marges externes */
    .grid-2,
    .grid-3,
    .grid-4 {
        padding: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Headers optimisés */
    .header-section-v1 {
        padding: 1.5rem 1rem !important;
        margin: 1rem 0 !important;
    }
    
    /* Désactiver hover sur mobile */
    .monde-card:hover,
    .content-card:hover,
    .content-card-book:hover,
    .plan-card:hover {
        transform: none !important;
    }
    
    /* CTAs responsive */
    .cta-elegant,
    .cta-zen {
        padding: 2rem 1.5rem;
        margin: 1.5rem 1rem;
        border-radius: 18px;
    }
    
    .cta-elegant h3,
    .cta-zen h3 {
        font-size: 1.4rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .btn-cta-primary,
    .btn-cta-secondary,
    .cta-zen-primary,
    .cta-zen-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    /* ========== SPÉCIFIQUE CALCULATEUR NUMÉROLOGIE ========== */
    
    .form-group-calcul {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .calculateur-container {
        padding: 2rem 1rem;
        margin: 1rem 0.5rem;
    }
    
    .calculateur-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .calculateur-subtitle {
        font-size: 1rem;
    }
    
    /* Croix des nombres responsive */
    .croix-layout {
        max-width: 300px;
        gap: 0.5rem;
    }
    
    .nombre-position {
        padding: 0.75rem 0.5rem;
        min-height: 80px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .nombre-value {
        font-size: 1.8rem;
        margin-bottom: 0.25rem;
    }
    
    .nombre-label {
        font-size: 0.7rem;
        margin-bottom: 0.125rem;
    }
    
    .nombre-description {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    /* Tableaux en cards sur mobile */
    .tableau-header {
        display: none;
    }
    
    .tableau-row {
        display: block;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1.5rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .tableau-row > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .tableau-row > div:last-child {
        border-bottom: none;
    }
    
    .col-nom::before { content: "Nombre: "; font-weight: 600; color: #6b7280; }
    .col-valeur::before { content: "Valeur: "; font-weight: 600; color: #6b7280; }
    .col-source::before { content: "Source: "; font-weight: 600; color: #6b7280; }
    .col-symbole::before { content: "Symbole: "; font-weight: 600; color: #6b7280; }
    .col-topo::before { content: "Topologie: "; font-weight: 600; color: #6b7280; }
    
    .analyse-grid-complete {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mini-croix {
        max-width: 120px;
        gap: 0.25rem;
    }
    
    .mini-position {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .symbole-detail {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .analyse-ligne {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.5rem 0;
    }
    
    .analyse-ligne strong {
        font-size: 0.75rem;
        color: #8b5cf6;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .calculate-button-main {
        padding: 1.25rem;
        font-size: 1.1rem;
    }
    
    .reset-calculator-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .resultats-tableau,
    .croix-container,
    .analyse-profil,
    .etapes-calcul {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .resultats-tableau h4,
    .croix-container h4,
    .etapes-calcul h4 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    /* ========== CORRECTIONS MATRICES NOMBRES ========== */
    
    .nombre,
    .number,
    .nombre-item,
    .number-box,
    .nombre-card,
    span.nombre,
    div.nombre {
        min-width: 60px !important;
        min-height: 60px !important;
        font-size: 1.2rem !important;
        margin: 0.5rem !important;
        padding: 0.5rem !important;
        border-radius: 12px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .matrix,
    .matrice,
    .matrix-container,
    .matrice-section,
    .archetype-matrix,
    .secret-matrix {
        display: block !important;
        grid-template-columns: none !important;
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    .grid-3x3,
    .matrix-3x3,
    .nombres-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        max-width: 100% !important;
    }
    
    .main-wrapper .grid-2,
    .section-block .grid-2,
    .section-block .grid-3 {
        display: block !important;
        grid-template-columns: none !important;
    }

    /* ========== MATRICE 3x3 MOBILE ========== */
    
    .matrice-container-principale {
        overflow-x: visible !important;
        padding: 0 !important;
    }

    .matrice-grid-principale {
        display: block !important;
        grid-template-columns: none !important;
    }

    .header-col,
    .grid-empty {
        display: none !important;
    }

    .header-row {
        display: block !important;
        color: white;
        padding: 1rem !important;
        margin: 1.5rem 0 0.5rem 0 !important;
        border-radius: 12px;
        text-align: center;
    }

    .header-row-etre {
        background: linear-gradient(135deg, #ffbd1b 0%, #ff9533 100%) !important;
    }

    .header-row-devenir {
        background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%) !important;
    }

    .header-row-exister {
        background: linear-gradient(135deg, #00bcd4 0%, #00acc1 100%) !important;
    }

    .header-row-title {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        margin-bottom: 0.25rem !important;
    }

    .header-row-subtitle {
        font-size: 0.9rem !important;
        opacity: 0.9;
        margin-bottom: 0.25rem !important;
    }

    .header-row-details {
        font-size: 0.75rem !important;
        opacity: 0.8;
    }

    .concept-cell {
        display: block !important;
        background: white !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    }

    .concept-cell:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.12) !important;
    }

    .cell-1, .cell-4, .cell-7 { border-left: 4px solid #ffbd1b !important; }
    .cell-2, .cell-5, .cell-8 { border-left: 4px solid #00bcd4 !important; }
    .cell-3, .cell-6, .cell-9 { border-left: 4px solid #e91e63 !important; }

    .concept-number {
        display: inline-block;
        background: linear-gradient(135deg, #8b5cf6, #7c3aed);
        color: white;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-weight: 700;
        font-size: 1rem;
        line-height: 32px;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .concept-title {
        font-size: 1.3rem !important;
        font-weight: 700 !important;
        color: #2d3748;
        margin-bottom: 0.5rem !important;
    }

    .concept-description {
        font-size: 0.95rem !important;
        color: #64748b;
        line-height: 1.5;
        margin-bottom: 0.75rem !important;
    }

    .concept-tags {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        margin-top: 0.75rem !important;
    }

    .concept-tag {
        display: inline-block !important;
        background: rgba(139, 92, 246, 0.1) !important;
        color: #8b5cf6 !important;
        padding: 0.4rem 0.8rem !important;
        border-radius: 6px !important;
        font-size: 0.8rem !important;
        text-decoration: none !important;
        border: 1px solid rgba(139, 92, 246, 0.2) !important;
        transition: all 0.2s ease !important;
    }

    .concept-tag:hover {
        background: rgba(139, 92, 246, 0.2) !important;
        transform: scale(1.05) !important;
    }

    .orientation-item,
    .niveau-item {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        margin-bottom: 0.75rem !important;
        padding: 0.5rem !important;
        background: rgba(0,0,0,0.02) !important;
        border-radius: 8px !important;
    }

    .color-indicator {
        width: 24px !important;
        height: 24px !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
    }

    .color-orange { background: #ffbd1b !important; }
    .color-cyan { background: #00bcd4 !important; }
    .color-fushia { background: #e91e63 !important; }
}

/* ===== RÉDUCTION LARGEUR MATRICE PORTRAIT ===== */
@media (max-width: 767px) and (orientation: portrait) {
    
    .header-row {
        width: calc(100% - 3rem) !important;
        max-width: 500px !important;
        margin-left: 1.5rem !important;
        margin-right: 1.5rem !important;
    }
    
    .concept-cell {
        width: calc(100% - 3rem) !important;
        max-width: 500px !important;
        margin-left: 1.5rem !important;
        margin-right: 1.5rem !important;
        padding: 1rem !important;
    }
    
    .concept-title {
        font-size: 1.1rem !important;
    }
    
    .concept-description {
        font-size: 0.85rem !important;
    }
    
    .concept-number {
        width: 26px !important;
        height: 26px !important;
        line-height: 26px !important;
        font-size: 0.8rem !important;
    }
    
    .concept-tag {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.7rem !important;
    }
}

/* ===== MOBILE (iPhone Paysage) ===== */
@media (max-width: 926px) and (orientation: landscape) {
    [class*="grid"] {
        grid-template-columns: 1fr !important;
    }
    
    .calculateur-container {
        padding: 1.5rem 1rem;
    }
    
    .croix-layout {
        max-width: 350px;
    }
    
    .nombre-position {
        padding: 0.5rem;
    }
    
    .nombre-value {
        font-size: 1.6rem;
    }
}

/* ===== TRÈS PETITS ÉCRANS ===== */
@media (max-width: 480px) {
    .croix-layout {
        max-width: 260px;
        gap: 0.375rem;
    }
    
    .nombre-position {
        padding: 0.5rem 0.25rem;
        min-height: 70px;
    }
    
    .nombre-value {
        font-size: 1.5rem;
    }
    
    .nombre-label {
        font-size: 0.6rem;
    }
    
    .nombre-description {
        font-size: 0.55rem;
    }
    
    .nombre,
    .number,
    .nombre-item {
        min-width: 50px !important;
        min-height: 50px !important;
        font-size: 1rem !important;
    }
}

/* ===== TABLETTE (iPad Portrait) ===== */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .grid-2, .grid-3, .grid-4 { 
        grid-template-columns: 1fr 1fr !important; 
    }
    
    .calculateur-container {
        max-width: 700px;
        margin: 0 auto;
        padding: 2.5rem 2rem;
    }
    
    .croix-layout {
        max-width: 450px;
    }
    
    .analyse-grid-complete {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .analyse-card-large {
        grid-column: 1 / -1;
    }
    
    .tableau-header {
        display: grid !important;
        font-size: 0.8rem;
    }
    
    .tableau-row {
        display: grid !important;
        font-size: 0.85rem;
    }
    
    .tableau-row > div::before {
        display: none;
    }
    
    /* Matrice iPad Portrait - Grid 2 colonnes */
    .matrice-grid-principale {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 1rem;
        min-width: auto !important;
    }
    
    .header-col,
    .grid-empty {
        display: none !important;
    }
    
    .header-row {
        grid-column: 1 / -1 !important;
        display: block !important;
    }
    
    .concept-cell {
        display: block !important;
    }
}

/* ===== TABLETTE (iPad Paysage) ===== */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: landscape) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .grid-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .analyse-grid-complete {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1.5rem;
    }
    
    .analyse-card-large {
        grid-column: 1 / -1;
    }
    
    /* Matrice iPad Paysage - Grid complet réduit */
    .matrice-grid-principale {
        grid-template-columns: 120px repeat(3, 1fr) !important;
        gap: 0.75rem;
        font-size: 0.9rem;
    }
    
    .header-row-title {
        font-size: 1rem;
    }
    
    .concept-title {
        font-size: 1.1rem;
    }
    
    .concept-description {
        font-size: 0.85rem;
    }
}

/* ===== BREAKPOINTS SPÉCIAUX ===== */
@media (max-width: 1200px) {
    .grid-3 .highlight-box {
        max-width: 100%;
    }
    
    .analyse-grid-complete {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analyse-card-large {
        order: 1;
    }
    
    .analyse-card:nth-child(2) {
        order: 2;
    }
    
    .analyse-card:nth-child(3) {
        order: 3;
    }
}
/* ===== DESKTOP - MATRICE 3x3 ===== */
@media (min-width: 768px) {
    .matrice-container-principale {
        overflow-x: auto;
        padding: 1rem 0;
    }

    .matrice-grid-principale {
        display: grid !important;
        grid-template-columns: 150px repeat(3, 1fr) !important;
        grid-template-rows: auto repeat(3, auto);
        gap: 1rem;
        min-width: 800px;
    }

    .grid-empty {
        display: block !important;
        grid-column: 1;
        grid-row: 1;
    }

    .header-col {
        display: block !important;
        padding: 1.5rem 1rem;
        border-radius: 12px;
        text-align: center;
        color: white;
        font-weight: 600;
    }

    .header-col-soi { 
        background: linear-gradient(135deg, #ffbd1b 0%, #ff9533 100%);
        grid-column: 2; 
        grid-row: 1; 
    }

    .header-col-autre { 
        background: linear-gradient(135deg, #00bcd4 0%, #00acc1 100%);
        grid-column: 3; 
        grid-row: 1; 
    }

    .header-col-idee { 
        background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
        grid-column: 4; 
        grid-row: 1; 
    }

    .header-title {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .header-subtitle {
        font-size: 0.85rem;
        opacity: 0.9;
    }

    .header-row {
        display: flex !important;
        grid-column: 1;
        padding: 1rem;
        border-radius: 12px;
        text-align: center;
        color: white;
        flex-direction: column;
        justify-content: center;
    }

    .header-row-etre { 
        background: linear-gradient(135deg, #ffbd1b 0%, #ff9533 100%);
        grid-row: 2; 
    }

    .header-row-devenir { 
        background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
        grid-row: 3; 
    }

    .header-row-exister { 
        background: linear-gradient(135deg, #00bcd4 0%, #00acc1 100%);
        grid-row: 4; 
    }

    .header-row-title {
        font-size: 1.1rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
    }

    .header-row-subtitle {
        font-size: 0.85rem;
        opacity: 0.9;
        margin-bottom: 0.25rem;
    }

    .header-row-details {
        font-size: 0.7rem;
        opacity: 0.8;
        line-height: 1.4;
    }

    .concept-cell {
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1.5rem;
        transition: all 0.3s ease;
    }

    .concept-cell:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    }

    .cell-1 { grid-column: 2; grid-row: 2; border-top: 4px solid #ffbd1b; }
    .cell-2 { grid-column: 3; grid-row: 2; border-top: 4px solid #00bcd4; }
    .cell-3 { grid-column: 4; grid-row: 2; border-top: 4px solid #e91e63; }
    .cell-4 { grid-column: 2; grid-row: 3; border-top: 4px solid #ffbd1b; }
    .cell-5 { grid-column: 3; grid-row: 3; border-top: 4px solid #00bcd4; }
    .cell-6 { grid-column: 4; grid-row: 3; border-top: 4px solid #e91e63; }
    .cell-7 { grid-column: 2; grid-row: 4; border-top: 4px solid #ffbd1b; }
    .cell-8 { grid-column: 3; grid-row: 4; border-top: 4px solid #00bcd4; }
    .cell-9 { grid-column: 4; grid-row: 4; border-top: 4px solid #e91e63; }
}

/* Styles communs (tous écrans) */
.concept-number {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    line-height: 32px;
    text-align: center;
    margin-bottom: 0.75rem;
}

.concept-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.concept-description {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.concept-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.concept-tag {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    border: 1px solid rgba(139, 92, 246, 0.2);
    transition: all 0.2s ease;
}

.concept-tag:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: scale(1.05);
}

/* ===== OPTIMISATIONS TOUCH ===== */
@media (pointer: coarse) {
    .nombre-position,
    .mini-position,
    .calculate-button-main,
    .nombre,
    .number {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .nombre-position {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
}


/* ====== SIGNATURE VIBRATOIRE — AJUSTEMENTS SPÉCIFIQUES ====== */

/* iPhone (portrait & paysage ≤ 767px) */
@media (max-width: 767px) {
  /* Forcer la grille du composant sans inline */
  .bovis-layout {
    display: grid !important;
    grid-template-columns: 1fr !important; /* 1 col sur mobile */
    gap: 1rem !important;
  }

  /* Bloc gauche (sélecteurs) */
  #bovis-cadran-app select {
    font-size: 14px;
  }

  #bovis-cadran-app button {
    width: 100%;
    margin-left: 0;
  }

  /* Cartouches d’infos sous le cadran */
  #bovis-cadran-app .zones-vibratoires,
  #bovis-cadran-app .details-frequence {
    margin-top: 1rem !important;
  }

  /* Héros & entêtes : resserrer un peu */
  .hero-banner .hero-content h1 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    line-height: 1.2;
  }
  .hero-banner .hero-content .hero-tagline {
    font-size: 0.95rem;
  }

  /* Fil d’Ariane : éviter le débordement */
  .breadcrumb-container ol {
    flex-wrap: wrap;
    row-gap: .25rem;
  }
}

/* iPad PORTRAIT (768–1024px) : 2 colonnes équilibrées */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .bovis-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem;
  }

  /* Sélecteurs plus confortables */
  #bovis-cadran-app select {
    font-size: 15px;
    padding: 12px;
  }
}

/* iPad PAYSAGE (≥1025px jusqu’à 1366px) : 60/40 pour confort de lecture */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: landscape) {
  .bovis-layout {
    display: grid !important;
    grid-template-columns: 1.2fr .8fr !important; /* gauche un peu plus large */
    gap: 2rem;
  }
}

/* Desktop large : on garde 2 colonnes 50/50 via .grid-2 existant */

/* ====== SIGNATURE VIBRATOIRE – AJUSTEMENTS SPÉCIFIQUES ====== */

/* iPhone (portrait & paysage ≤ 767px) */
@media (max-width: 767px) {
  /* Forcer la grille principale en 1 colonne */
  #signature-vibratoire-app > div > div > div:first-child {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Bloc signature principal */
  #signature-vibratoire-app canvas[width="500"] {
    width: 100% !important;
    height: auto !important;
    max-width: 400px;
    margin: 0 auto;
    display: block;
  }

  /* Container de la signature - passer en colonne unique */
  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:first-child > div:nth-child(2) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Aperçu des 5 calques - disposition horizontale sur mobile */
  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:first-child > div:nth-child(2) > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:first-child > div:nth-child(2) > div:last-child > div {
    flex-direction: column !important;
    align-items: center !important;
  }

  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:first-child > div:nth-child(2) > div:last-child canvas {
    width: 60px !important;
    height: 60px !important;
  }

  /* Titre "Aperçu Couches" */
  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:first-child > div:nth-child(2) > div:last-child > h3 {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Galerie des 29 symboles - adapter la grille */
  #signature-vibratoire-app > div > div > div:first-child > div:nth-child(2) > div:last-child {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 0.75rem !important;
    max-height: 600px !important;
  }

  /* Boutons d'action - empiler verticalement si nécessaire */
  #signature-vibratoire-app button {
    font-size: 0.8rem !important;
    padding: 0.6rem 0.75rem !important;
  }

  /* Stats - grid 1 colonne sur très petits écrans */
  #signature-vibratoire-app > div > div > div:last-child > div:last-child {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Mini calculateur */
  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:last-child {
    margin-top: 0 !important;
  }
}

/* Très petits écrans (≤ 480px) */
@media (max-width: 480px) {
  /* Galerie encore plus compacte */
  #signature-vibratoire-app > div > div > div:first-child > div:nth-child(2) > div:last-child {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* Canvas de galerie plus petits */
  #signature-vibratoire-app > div > div > div:first-child > div:nth-child(2) > div:last-child button canvas {
    width: 60px !important;
    height: 60px !important;
  }

  /* Aperçu calques encore plus compact */
  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:first-child > div:nth-child(2) > div:last-child canvas {
    width: 50px !important;
    height: 50px !important;
  }
}

/* iPad PORTRAIT (768–1024px) : 1 colonne équilibrée */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  /* Forcer 1 colonne pour iPad portrait */
  #signature-vibratoire-app > div > div > div:first-child {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Canvas signature - taille optimale pour iPad */
  #signature-vibratoire-app canvas[width="500"] {
    max-width: 500px;
    margin: 0 auto;
    display: block;
  }

  /* Aperçu calques - horizontal sur iPad */
  #signature-vibratoire-app > div > div > div:first-child > div:first-child > div:first-child > div:nth-child(2) > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }

  /* Galerie - 6 colonnes sur iPad portrait */
  #signature-vibratoire-app > div > div > div:first-child > div:nth-child(2) > div:last-child {
    grid-template-columns: repeat(6, 1fr) !important;
    max-height: 500px !important;
  }

  /* Stats - 2 colonnes sur iPad portrait */
  #signature-vibratoire-app > div > div > div:last-child > div:last-child {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* iPad PAYSAGE (≥1025px jusqu'à 1366px) : garder 2 colonnes mais optimiser */
@media (min-width: 1025px) and (max-width: 1366px) and (orientation: landscape) {
  /* Réduire légèrement les gaps */
  #signature-vibratoire-app > div > div > div:first-child {
    gap: 1.25rem !important;
  }

  /* Galerie - 5 colonnes en paysage */
  #signature-vibratoire-app > div > div > div:first-child > div:nth-child(2) > div:last-child {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

/* Optimisations touch pour tous les écrans tactiles */
@media (pointer: coarse) {
  /* Zones touch plus grandes */
  #signature-vibratoire-app button {
    min-height: 44px;
    touch-action: manipulation;
  }

  #signature-vibratoire-app > div > div > div:first-child > div:nth-child(2) > div:last-child button {
    min-height: 100px;
    padding: 10px !important;
  }

  /* Feedback tactile */
  #signature-vibratoire-app button:active {
    transform: scale(0.95);
  }
}

/* ====== MESSAGE D'ORIENTATION FORCÉE ====== */
.orientation-message {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #2d1b69, #1a0f3d);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 2rem;
    text-align: center;
    color: white;
    flex-direction: column;
}

.orientation-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: rotate-phone 2s ease-in-out infinite;
}

.orientation-message h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 600;
}

.orientation-message p {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 300px;
    color: #e5e7eb;
}

@keyframes rotate-phone {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}


/* ====== SCOPE CLEANUP (additif, non destructif) ====== */
/* 1) Empêcher les règles flex/grid génériques d’impacter les TABLES
      dans le Monde spirituel */
.spiritual-tableau .header-row {
  display: table-row !important;
}
.spiritual-tableau .header-cell {
  display: table-cell !important;
  vertical-align: middle;
}

/* 2) Préparer le scoping propre de la grille :
      si, à l’avenir, tu veux activer les styles « header-row » de la grille
      SEULEMENT dans un conteneur, ajoute la classe .matrice-grid-principale
      au wrapper ou au <body>. Les règles ci-dessous renforcent ce cas. */
.matrice-grid-principale .header-row {
  /* Ces 3 lignes suffisent pour neutraliser les conflits d’affichage */
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
}
/* Si tu utilises aussi .header-col pour la grille : */
.matrice-grid-principale .header-col {
  display: block !important;
}

