/* Styles personnalisés pour Memora - Design type Google Photos */

/* ===== UX & Accessibilité : expérience fluide et intuitive ===== */
:root {
    --nav-height: 3.5rem;   /* 56px */
    --nav-height-md: 4rem;  /* 64px */
    --touch-min: 44px;
    --transition-ui: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cibles tactiles minimales (WCAG / Apple HIG) */
@media (pointer: coarse) {
    .btn,
    .memora-nav-link,
    .nav-link,
    button[type="button"],
    a[role="button"] {
        min-height: var(--touch-min);
        min-width: var(--touch-min);
    }
    .btn-sm { min-height: 40px; min-width: 40px; }
}

/* Focus visible cohérent (clavier / accessibilité) */
:focus {
    outline: none;
}
:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
    border-radius: 4px;
}
.memora-google-photos .memora-nav-link:focus-visible {
    outline-offset: 2px;
    border-radius: 1.25rem;
}
button:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Désactivation du surlignage tactile bleu sur mobile */
@media (hover: none) {
    * {
        -webkit-tap-highlight-color: transparent;
        tap-highlight-color: transparent;
    }
}

/* Transitions fluides sur les éléments interactifs */
a, button, .btn, .nav-link, .card, .timeline-item, .album-media-item,
select.form-input, input.form-input {
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Respect préférence "réduire les animations" */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Scroll fluide et ancres */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* Barre de sélection / sticky : position sous la nav */
.memora-google-photos #selectionBar {
    top: var(--nav-height);
}
@media (min-width: 768px) {
    .memora-google-photos #selectionBar {
        top: var(--nav-height-md);
    }
}

/* Boutons : état actif pour feedback tactile */
.memora-google-photos .btn:active {
    transform: scale(0.98);
}
.memora-google-photos .btn-primary:active {
    background: #1557b0;
}
.memora-google-photos .btn-secondary:active {
    background: #e8eaed;
}

/* Messages flash : animation d'entrée douce */
.message-alert {
    animation: fadeIn 0.3s ease-out;
}

/* Typographie : DM Sans — lisible et agréable */
body,
.memora-body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-optical-sizing: auto;
    line-height: 1.6;
    color: #374151;
}

/* ===== Thème Google Photos ===== */
.memora-google-photos {
    background: #fafafa;
}
body {
    overflow-x: hidden;
}

.memora-google-photos .memora-main-content {
    background: transparent;
}

/* Nav : liens en pill, texte lisible */
.memora-google-photos .memora-nav-link {
    padding: 0.5rem 0.875rem;
    min-height: 2.25rem;
    border-radius: 1.25rem;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9375rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.memora-google-photos .memora-nav-link:hover {
    color: #111827;
    background: rgba(0, 0, 0, 0.06);
}

.memora-google-photos .memora-nav-link.active {
    color: #111827;
    background: rgba(0, 0, 0, 0.08);
}

.memora-google-photos .memora-nav-link::after {
    display: none;
}

/* Logo discret */
.memora-google-photos .memora-logo-icon:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Cartes type Google Photos : fond blanc, ombre légère */
.memora-google-photos .card {
    background: #fff;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    border-radius: 8px;
}

.memora-google-photos .card::before {
    display: none;
}

.memora-google-photos .card:hover {
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    transform: none;
    border: none;
}

/* Boutons plats type Material / Google */
.memora-google-photos .btn-primary {
    background: #1a73e8;
    color: #fff;
    box-shadow: none;
    border-radius: 4px;
    text-transform: none;
    letter-spacing: 0;
}

.memora-google-photos .btn-primary:hover {
    background: #1765cc;
    box-shadow: none;
    transform: none;
}

.memora-google-photos .btn-secondary {
    background: #fff;
    border: 1px solid #dadce0;
    color: #3c4043;
    box-shadow: none;
    border-radius: 4px;
}

.memora-google-photos .btn-secondary:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    color: #202124;
    transform: none;
    box-shadow: none;
}

/* Titres de page : lisibles et doux */
.memora-google-photos .memora-title-page {
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.35;
    color: #111827;
}

.memora-google-photos .memora-subtitle,
.memora-google-photos .text-gray-600 {
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Formulaires */
.memora-google-photos .form-input {
    border-radius: 4px;
    border-color: #dadce0;
}

.memora-google-photos .form-input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 1px #1a73e8;
}
@media (pointer: coarse) {
    .memora-google-photos .form-input {
        min-height: var(--touch-min);
    }
}

/* Skeleton / placeholder */
.memora-google-photos .skeleton {
    background: linear-gradient(90deg, #f1f3f4 25%, #e8eaed 50%, #f1f3f4 75%);
}

/* Stat cards type Google Photos */
.memora-google-photos .stat-card {
    background: #fff;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    border-radius: 8px;
}

.memora-google-photos .stat-card::before {
    display: none;
}

.memora-google-photos .stat-card:hover {
    box-shadow: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
    transform: none;
}

.memora-google-photos .stat-icon {
    border-radius: 8px;
    box-shadow: none;
}

.memora-google-photos .stat-value {
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.02em;
}

.memora-google-photos .stat-label {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Safe area pour encoche / barre de statut */
.safe-area-padding {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}

main.memora-main {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
}
.pb-safe {
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

/* Variables CSS pour le thème amélioré - Teal / Émeraude (Memora) */
:root {
    /* Couleurs primaires avec dégradés */
    --primary-color: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #2dd4bf;
    --primary-dark: #115e59;
    --primary-gradient: linear-gradient(135deg, #0d9488 0%, #059669 50%, #047857 100%);
    --primary-gradient-hover: linear-gradient(135deg, #059669 0%, #0d9488 100%);
    
    /* Couleurs secondaires */
    --secondary-color: #64748b;
    --secondary-light: #94a3b8;
    --secondary-dark: #475569;
    
    /* Couleurs de statut */
    --success-color: #10b981;
    --success-light: #34d399;
    --error-color: #ef4444;
    --error-light: #f87171;
    --warning-color: #f59e0b;
    --warning-light: #fbbf24;
    --info-color: #3b82f6;
    --info-light: #60a5fa;
    
    /* Arrière-plans */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #0d9488 0%, #059669 100%);
    --bg-gradient-light: linear-gradient(135deg, #ecfdf5 0%, #ccfbf1 100%);
    
    /* Texte */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-inverse: #ffffff;
    
    /* Bordures */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Ombres améliorées */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-primary: 0 10px 15px -3px rgba(13, 148, 136, 0.35), 0 4px 6px -2px rgba(5, 150, 105, 0.25);
    
    /* Rayons */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Typographie fluide (clamp) */
    --text-hero: clamp(1.75rem, 4vw + 1rem, 2.5rem);
    --text-h1: clamp(1.5rem, 3vw + 0.75rem, 2.25rem);
    --text-h2: clamp(1.25rem, 2.5vw + 0.5rem, 1.875rem);
    --text-body: clamp(0.875rem, 0.5vw + 0.8rem, 1rem);
    --text-small: clamp(0.75rem, 0.25vw + 0.7rem, 0.875rem);
    
    /* Espacements fluides */
    --space-page-y: clamp(1rem, 2vw, 1.5rem);
    --space-page-x: clamp(1rem, 4vw, 2rem);
    
    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

/* Animations améliorées */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Classes utilitaires améliorées */
.fade-in {
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-down {
    animation: fadeInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Cards premium améliorées */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid var(--border-light);
    position: relative;
    backdrop-filter: blur(10px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.card:hover {
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(13, 148, 136, 0.15);
    transform: translateY(-4px) scale(1.01);
    border-color: var(--primary-light);
}

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

@media (max-width: 768px) {
    .card:hover {
        transform: translateY(-2px) scale(1);
    }
}

.card-premium {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-gradient {
    background: var(--primary-gradient);
    color: var(--text-inverse);
}

.card-gradient:hover {
    background: var(--primary-gradient-hover);
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Boutons premium améliorés */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-gradient, #2563EB);
    color: var(--text-inverse, #fff);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: var(--primary-gradient-hover, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

.btn-icon {
    padding: 0.75rem;
    border-radius: var(--radius-full);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Image placeholders améliorés */
.image-placeholder {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    position: relative;
    overflow: hidden;
}

.image-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.image-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    background: var(--bg-secondary);
}

.image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
    pointer-events: none;
}

.image-container img {
    transition: var(--transition-slow);
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-container:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.image-container:hover img {
    transform: scale(1.1);
}

.image-container:hover::before {
    opacity: 0.1;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: var(--spacing-lg);
    color: var(--text-inverse);
    transform: translateY(100%);
    transition: var(--transition);
    z-index: 2;
}

.image-container:hover .image-overlay {
    transform: translateY(0);
}

/* Loading spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--error-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* Formulaires premium améliorés */
.form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-body);
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
}
@media (max-width: 640px) {
    .form-input {
        min-height: 2.875rem; /* ~46px pour zone tactile confortable */
        padding: 0.75rem 1rem;
    }
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:hover {
    border-color: var(--border-dark);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
    background: var(--bg-primary);
}

.form-input.is-error,
.form-input.border-error {
    border-color: var(--error-color);
}
.form-input.is-error:focus,
.form-input.border-error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.form-input:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-error {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.form-error::before {
    content: '⚠';
    font-size: 0.875rem;
}

.form-success {
    color: var(--success-color);
    font-size: 0.75rem;
    margin-top: var(--spacing-xs);
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group .form-input {
    padding-left: 2.5rem;
}

.input-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* Grid premium amélioré et fluide */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: clamp(var(--spacing-sm), 2vw, var(--spacing-lg));
    padding: var(--space-page-x);
}

.photo-grid-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.photo-grid-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

@media (max-width: 1024px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
        gap: var(--spacing-md);
    }
}

@media (max-width: 640px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr));
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--text-primary);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 0.5rem;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Utilitaires typographie fluide */
.memora-title-page {
    font-size: var(--text-h1);
    font-weight: 700;
    line-height: 1.2;
}
.memora-subtitle {
    font-size: var(--text-body);
    color: var(--text-secondary);
}
.memora-hero {
    font-size: var(--text-hero);
    font-weight: 700;
}

/* Amélioration de la responsivité globale */
@media (max-width: 640px) {
    .stat-card {
        padding: var(--spacing-md);
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .card {
        border-radius: var(--radius-md);
    }
}

@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.8125rem;
    }
    
    .stat-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Amélioration des transitions pour mobile */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Menu déroulant nav : ouvert au clavier/focus */
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Amélioration de l'accessibilité - Mode sombre optionnel */
@media (prefers-color-scheme: dark) {
    .memora-body {
        background: linear-gradient(to bottom right, #1e293b 0%, #0f172a 50%, #1e293b 100%);
    }
    .memora-nav.sticky,
    nav.memora-nav {
        background: rgba(15, 23, 42, 0.9);
        border-color: rgba(255, 255, 255, 0.08);
    }
    .card,
    .stat-card {
        background: rgba(30, 41, 59, 0.8);
        border-color: rgba(255, 255, 255, 0.08);
    }
    .memora-title-page,
    .stat-value { color: #f1f5f9; }
    .memora-subtitle,
    .stat-label,
    .text-gray-600,
    .text-gray-700 { color: #cbd5e1; }
    .nav-link { color: #94a3b8; }
    .nav-link:hover,
    .nav-link.active { color: #2dd4bf; }
    .nav-dropdown.open .nav-dropdown-menu {
        background: rgba(30, 41, 59, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    .nav-dropdown-menu a { color: #e2e8f0; }
    .nav-dropdown-menu a:hover { background: rgba(45, 212, 191, 0.2); color: #99f6e4; }
}

/* Will-change uniquement au survol/focus pour limiter les couches GPU */
@media (hover: hover) {
    .card:hover,
    .stat-card:hover,
    .nav-link:hover,
    .btn:hover {
        will-change: transform;
    }
}

/* Optimisation des images */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Amélioration du focus pour l'accessibilité */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Amélioration des tableaux pour mobile */
@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    thead {
        display: none;
    }
    
    tbody tr {
        display: block;
        margin-bottom: var(--spacing-md);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        padding: var(--spacing-md);
    }
    
    tbody td {
        display: flex;
        justify-content: space-between;
        padding: var(--spacing-sm) 0;
        border: none;
    }
    
    tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        margin-right: var(--spacing-md);
    }
}

/* Focus visible amélioré */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Amélioration des transitions */
a, button {
    transition: var(--transition);
}

/* Badge premium amélioré */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-xs);
    transition: var(--transition);
}

.badge:hover {
    transform: scale(1.05);
}

.badge-primary {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    box-shadow: var(--shadow-primary);
}

.badge-success {
    background: linear-gradient(135deg, var(--success-color) 0%, var(--success-light) 100%);
    color: var(--text-inverse);
}

.badge-error {
    background: linear-gradient(135deg, var(--error-color) 0%, var(--error-light) 100%);
    color: var(--text-inverse);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, var(--warning-light) 100%);
    color: var(--text-inverse);
}

.badge-info {
    background: linear-gradient(135deg, var(--info-color) 0%, var(--info-light) 100%);
    color: var(--text-inverse);
}

/* ===== Menu principal : toujours au premier plan ===== */
nav[class*="sticky"] {
    position: sticky;
    top: 0;
    z-index: 9999;
    isolation: isolate;
    background: rgba(255, 255, 255, 0.95);
}

/* Bouton hamburger : toujours visible sur téléphone/tablette (< 1024px) */
@media (max-width: 1023px) {
    #mobileMenuButton {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: var(--touch-min, 44px);
        min-height: var(--touch-min, 44px);
        visibility: visible !important;
        opacity: 1 !important;
    }
}
@media (min-width: 1024px) {
    #mobileMenuButton {
        display: none !important;
    }
}

/* Timeline : bouton Sélectionner visible sur mobile (sous le titre) */
.memora-timeline-mobile-select-wrap {
    display: block;
}
@media (min-width: 1024px) {
    .memora-timeline-mobile-select-wrap {
        display: none !important;
    }
}
@media (max-width: 1023px) {
    #selectionModeBtn {
        min-height: var(--touch-min, 44px);
        min-width: var(--touch-min, 44px);
        flex-shrink: 0;
    }
}

/* Menu mobile : drawer en dehors de la nav, affiché en JS (display + class) */
#mobileMenu {
    /* État fermé géré par display:none en inline */
}

#mobileMenu.mobile-menu-open {
    display: block !important;
    position: fixed !important;
    top: calc(var(--topbar-height, 64px) + env(safe-area-inset-top, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483647 !important;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    animation: mobileMenuSlide 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes mobileMenuSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empêcher le tap "fantôme" de fermer le menu juste après l'ouverture (téléphone/tablette) */
#mobileMenu.mobile-menu-just-opened > * {
    pointer-events: none;
}

/* Contenu du drawer menu mobile */
.memora-mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.memora-mobile-menu-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text, #111827);
}
.memora-mobile-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.memora-mobile-menu-close:hover {
    background: #F3F4F6;
    color: #111827;
}
.memora-mobile-menu-nav {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.memora-mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.memora-mobile-menu-link:hover {
    background: #F3F4F6;
    color: #111827;
}
.memora-mobile-menu-link-active {
    background: #EFF6FF;
    color: #2563EB;
}
.memora-mobile-menu-link svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.memora-mobile-menu-group {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #9CA3AF;
    text-transform: uppercase;
    padding: 1rem 1rem 0.375rem;
    margin-top: 0.25rem;
}

/* Contenu principal sous le menu */
main {
    position: relative;
    z-index: 0;
}

/* Modales et popups toujours visibles au-dessus de la sidebar (1050) et topbar (1040) */
[id$="Modal"],
div[id$="Modal"] {
    z-index: 11000 !important;
}
/* Contenu des modales : rester dans le viewport et scrollable si besoin */
[id$="Modal"]:not(.hidden) [role="dialog"],
[id$="Modal"]:not(.hidden) > div.bg-white {
    max-height: min(90vh, 100%);
    overflow-y: auto;
}

/* Navigation améliorée */
.nav-link {
    position: relative;
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 2.75rem;
    min-width: 2.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
@media (max-width: 1023px) {
    .memora-nav .nav-link {
        min-height: 2.75rem;
    }
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: translateX(-50%);
    transition: var(--transition);
    border-radius: var(--radius-full);
}

.nav-link:hover {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.12) 0%, rgba(5, 150, 105, 0.12) 100%);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.18) 0%, rgba(5, 150, 105, 0.18) 100%);
    font-weight: 600;
}

.nav-link.active::after {
    width: 80%;
}

/* Statistiques améliorées */
.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.stat-card:hover::before {
    transform: scaleY(1);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--spacing-sm) 0;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* ===== Onglets "Ajouter des médias" : moderne et responsive ===== */
.add-media-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
}
.add-media-tabs::-webkit-scrollbar {
    height: 4px;
}
.add-media-tab {
    padding: 0.75rem clamp(1rem, 2vw, 1.25rem);
    font-weight: 500;
    font-size: var(--text-small);
    color: var(--text-tertiary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 2.75rem;
    display: inline-flex;
    align-items: center;
}
.add-media-tab:hover {
    color: var(--text-primary);
}
.add-media-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}
.add-media-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}
.add-media-panel.active {
    display: block;
}

/* ===== Modales Memora : design unifié, lisible et responsive ===== */
.memora-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 4vw, 1.5rem);
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    animation: memoraModalFadeIn 0.2s ease-out;
}
/* Quand .hidden est présent, la modale doit être vraiment masquée (évite conflit avec display: flex) */
.memora-modal-overlay.hidden {
    display: none !important;
    pointer-events: none !important;
}
@keyframes memoraModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.memora-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 28rem;
    max-height: min(90vh, 32rem);
    display: flex;
    flex-direction: column;
    background: var(--color-surface, #fff);
    border-radius: var(--radius-card, 16px);
    box-shadow: var(--shadow-floating, 0 10px 40px rgba(0, 0, 0, 0.15));
    border: 1px solid var(--color-border, #E5E7EB);
    animation: memoraModalSlideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes memoraModalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (min-width: 640px) {
    .memora-modal-dialog {
        max-width: 32rem;
        max-height: min(88vh, 36rem);
    }
}

/* Modales larges (détail album, formulaires longs) : bien visibles et scrollables */
.memora-modal-dialog--large {
    max-width: 42rem;
    max-height: min(90vh, 40rem);
}
@media (min-width: 640px) {
    .memora-modal-dialog--large {
        max-height: min(88vh, 44rem);
    }
}


.memora-modal-dialog[role="dialog"] {
    outline: none;
}

.memora-modal-header {
    flex-shrink: 0;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border, #E5E7EB);
}
.memora-modal-title {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    font-weight: 600;
    color: var(--color-text, #111827);
    line-height: 1.35;
    margin: 0 0 0.25rem 0;
}
.memora-modal-subtitle {
    font-size: 0.9375rem;
    color: var(--color-text-secondary, #6B7280);
    line-height: 1.5;
    margin: 0;
}

.memora-modal-body {
    flex: 1 1 auto;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.memora-modal-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border, #E5E7EB);
    background: #F3F4F6;
    border-radius: 0 0 var(--radius-card, 16px) var(--radius-card, 16px);
}

/* Champs dans les modales : cohérents avec le design system (toutes modales overlay/dialog) */
.memora-modal-overlay .memora-modal-field label,
.memora-modal-dialog .memora-modal-field label,
.memora-modal .memora-modal-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text, #374151);
    margin-bottom: 0.375rem;
}
.memora-modal-overlay input[type="text"],
.memora-modal-overlay input[type="email"],
.memora-modal-overlay input[type="number"],
.memora-modal-overlay input[type="datetime-local"],
.memora-modal-overlay select,
.memora-modal-overlay textarea,
.memora-modal-dialog input[type="text"],
.memora-modal-dialog input[type="email"],
.memora-modal-dialog input[type="number"],
.memora-modal-dialog input[type="datetime-local"],
.memora-modal-dialog select,
.memora-modal-dialog textarea,
.memora-modal input[type="text"],
.memora-modal input[type="email"],
.memora-modal input[type="number"],
.memora-modal select,
.memora-modal textarea {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border, #E5E7EB);
    border-radius: var(--radius-button, 12px);
    font-size: 0.9375rem;
    color: var(--color-text, #111827);
    background: var(--color-surface, #fff);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}
.memora-modal-overlay textarea,
.memora-modal-dialog textarea,
.memora-modal textarea {
    min-height: 4.5rem;
    resize: vertical;
}
.memora-modal-overlay input:focus,
.memora-modal-overlay select:focus,
.memora-modal-overlay textarea:focus,
.memora-modal-dialog input:focus,
.memora-modal-dialog select:focus,
.memora-modal-dialog textarea:focus,
.memora-modal input:focus,
.memora-modal select:focus,
.memora-modal textarea:focus {
    outline: none;
    border-color: var(--color-primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
@media (pointer: coarse) {
    .memora-modal-overlay input,
    .memora-modal-overlay select,
    .memora-modal-dialog input,
    .memora-modal-dialog select,
    .memora-modal input,
    .memora-modal select,
    .memora-modal textarea {
        min-height: 2.875rem;
    }
    .memora-modal-overlay textarea,
    .memora-modal-dialog textarea,
    .memora-modal textarea {
        min-height: 5rem;
    }
}

/* Bouton fermer (X) dans l’en-tête des modales */
.memora-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-button, 12px);
    background: transparent;
    color: var(--color-text-secondary, #6B7280);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.memora-modal-close:hover {
    background: #F3F4F6;
    color: var(--color-text, #111827);
}
.memora-modal-close:focus-visible {
    outline: 2px solid var(--color-primary, #2563EB);
    outline-offset: 2px;
}

/* Boutons dans le footer des modales — toujours visibles et contrastés */
.memora-modal-btn-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text, #374151);
    background: #FFFFFF;
    border: 1px solid var(--color-border, #D1D5DB);
    border-radius: var(--radius-button, 12px);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    text-decoration: none;
}
.memora-modal-btn-cancel:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
    color: var(--color-text, #111827);
}
.memora-modal-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #FFFFFF !important;
    background: var(--color-primary, #2563EB) !important;
    border: none;
    border-radius: var(--radius-button, 12px);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    text-decoration: none;
}
.memora-modal-btn-primary:hover {
    background: var(--color-primary-hover, #1d4ed8) !important;
}
.memora-modal-btn-primary:active {
    transform: scale(0.98);
}

/* Bouton primaire visible partout (évite blanc sur blanc) */
.memora-btn-primary {
    color: #fff !important;
    background: var(--color-primary, #2563EB) !important;
}
.memora-btn-primary:hover {
    background: var(--color-primary-hover, #1d4ed8) !important;
}

/* Page Partage : titres et onglets cohérents */
.memora-sharing-page-title {
    font-size: clamp(1.375rem, 3vw, 1.875rem);
    font-weight: 700;
    color: var(--color-text, #111827);
    line-height: 1.3;
    margin: 0;
}
.memora-sharing-page-subtitle {
    font-size: 0.9375rem;
    color: var(--color-text-secondary, #6B7280);
    margin: 0.25rem 0 0 0;
}
.memora-sharing-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border, #E5E7EB);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
}
.memora-sharing-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary, #6B7280);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 2.75rem;
    transition: color 0.2s, border-color 0.2s;
}
.memora-sharing-tab:hover {
    color: var(--color-text, #111827);
}
.memora-sharing-tab.active {
    color: var(--color-primary, #2563EB);
    border-bottom-color: var(--color-primary, #2563EB);
}
.memora-sharing-btn-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #fff;
    background: var(--color-primary, #2563EB);
    border: none;
    border-radius: var(--radius-button, 12px);
    cursor: pointer;
    transition: background 0.2s;
    min-height: 2.75rem;
}
.memora-sharing-btn-create:hover {
    background: var(--color-primary-hover, #1d4ed8);
}
.memora-sharing-card {
    background: var(--color-surface, #fff);
    border-radius: var(--radius-card, 16px);
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0, 0, 0, 0.08));
    border: 1px solid var(--color-border, #E5E7EB);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.memora-sharing-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ===== Responsive global : site entièrement responsive ===== */
html {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
body.memora-body,
body.memora-saas {
    overflow-x: hidden;
    min-width: 0;
    width: 100%;
}
.memora-content-wrap,
.memora-main,
main.memora-main-content {
    min-width: 0;
    overflow-x: hidden;
}
/* Priorité de certaines modales imbriquées (par ex. création de source + choix de chemin) */
/* La modale de parcours de chemin doit toujours passer au-dessus de la modale de création de source */
#browsePathModal {
    z-index: 12000 !important;
}
#browsePathModalBackdrop {
    z-index: 11999 !important;
}
/* Tablettes et mobile : tableaux (éviter débordement; préférer wrapper .overflow-x-auto) */
@media (max-width: 767px) {
    table thead th { white-space: nowrap; }
    .memora-content-wrap .overflow-x-auto,
    main .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
}
/* Médias fluides */
img, video, iframe, object, embed {
    max-width: 100%;
    height: auto;
}
img[width][height] { height: auto; }
