/* ==========================================================================
   PIGMENTA — OUTIL D'ATELIER
   SYSTEME DE DESIGN ET STYLES CSS (VERSION CLAIRE & ERGONOMIQUE)
   ========================================================================== */

/* Variables & Tokens de Design (Inspirés d'Apple & Google Design) */
:root {
    /* Palette Neutre et Chaleureuse */
    --bg-main: #fcfaf7;          /* Fond toile de lin / papier chaud doux */
    --bg-surface: #ffffff;       /* Cartes et surfaces blanches */
    --bg-sidebar: #f7f5f0;       /* Menu latéral légèrement grisé chaud */
    --border-color: rgba(0, 0, 0, 0.05);   /* Bordures ultra-fines */
    --border-light: rgba(0, 0, 0, 0.03);
    
    /* Hauteur de la barre de navigation globale */
    --header-height: 76px;
    
    /* Typographie & Couleurs de Texte */
    --text-primary: #1c1917;     /* Stone 900 - Très lisible */
    --text-secondary: #57534e;   /* Stone 600 - Corps de texte */
    --text-muted: #78716c;       /* Stone 500 - Infos techniques */
    --text-inactive: #a8a29e;    /* Stone 400 - Iconographie */
    
    --accent-blue: #2563eb;      /* Bleu Material/iOS pour focus */
    --accent-gold: #b2832c;      /* Or pigmenté chaud pour le logo/accents */
    
    /* Typographie */
    --font-serif: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Coins Arrondis Modernes */
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    /* Transitions fluides */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Ombres Discrètes (Style Apple) */
    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 8px -1px rgba(0, 0, 0, 0.02);
    --shadow-hover: 0 12px 30px -4px rgba(28, 25, 23, 0.06), 0 4px 14px -2px rgba(28, 25, 23, 0.03);
    --shadow-active: 0 16px 36px -4px rgba(28, 25, 23, 0.1), 0 8px 20px -2px rgba(28, 25, 23, 0.05);
}

/* Reset de base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar épurée */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #e7e5e4;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d6d3d1;
}

/* Conteneur principal */
.app-container {
    display: block;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    padding-bottom: 2rem;
}

@media (min-width: 768px) {
    html, body {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .app-container {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .main-content {
        height: calc(100vh - var(--header-height));
        height: calc(100dvh - var(--header-height));
        min-height: 0;
        overflow: hidden;
        padding-bottom: 0;
    }
}

/* ==========================================================================
   HEADER GLOBAL DE L'APPLICATION
   ========================================================================== */
.global-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(252, 250, 247, 0.85); /* Fond toile chaud semi-transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: calc(0.75rem + env(safe-area-inset-top)) 1.5rem 0.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .global-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: calc(1rem + env(safe-area-inset-top)) 2rem 1rem 2rem;
        gap: 2rem;
    }
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.header-logo:hover {
    opacity: 0.8;
}

.header-logo .logo-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-gold);
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.logo-tagline {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.1rem;
}

.desktop-only {
    display: inline;
}
.mobile-only {
    display: none;
}

/* ==========================================================================
   BARRE DE NAVIGATION HORIZONTALE
   ========================================================================== */
.app-nav {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem 0;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -webkit-overflow-scrolling: touch;
}

.app-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.app-nav .nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    min-height: 40px; /* Cible tactile */
}

.app-nav .nav-item:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.02);
}

.app-nav .nav-item.active {
    color: var(--text-primary);
    background: var(--bg-surface);
    box-shadow: var(--shadow-subtle);
    border: 1px solid var(--border-color);
    font-weight: 600;
}

.app-nav .nav-item .nav-icon {
    width: 16px;
    height: 16px;
    color: var(--text-inactive);
    transition: color var(--transition-fast);
}

.app-nav .nav-item.active .nav-icon {
    color: var(--accent-gold);
}

/* Sections de Contenu */
.content-section {
    display: none;
    flex-grow: 1;
    padding: 1.5rem;
    animation: fadeIn var(--transition-slow);
}

.content-section.active {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .content-section {
        padding: 2.5rem;
    }
}

.section-header {
    margin-bottom: 2rem;
    max-width: 600px; /* Limite de ligne pour lisibilité */
}

.section-header h2 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   WORKSPACE GRID (DISPOSITION TABLETTE & ORDI)
   ========================================================================== */

/* Layout par défaut sur mobile (< 768px) */
@media (max-width: 767px) {
    #roue-harmonies-section.content-section.active {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    #roue-harmonies-section .column-left,
    #roue-harmonies-section .column-right {
        display: contents; /* Aplatit le DOM pour réordonner les enfants */
    }

    #roue-harmonies-section .section-header {
        order: 1;
        margin-bottom: 0.25rem;
        text-align: center;
    }

    #roue-harmonies-section .section-header h2 {
        font-size: 1.35rem !important;
        margin-bottom: 0.15rem;
    }

    #roue-harmonies-section .section-header .subtitle {
        font-size: 0.8rem !important;
        line-height: 1.3;
        margin-bottom: 0 !important;
    }

    #roue-harmonies-section .wheel-container-card {
        order: 2;
        padding: 1rem 0.5rem;
    }

    #roue-harmonies-section .wheel-wrapper {
        max-width: 285px;
        width: 82vw;
    }

    #roue-harmonies-section .color-info-card {
        order: 3;
    }

    #roue-harmonies-section .harmonies-container {
        order: 4;
    }
}

/* Layout sur Tablette et Ordinateur (>= 768px) */
@media (min-width: 768px) {
    #roue-harmonies-section.content-section.active {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr); /* Grille responsive stable */
        gap: 2rem;
        align-items: start;
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
        overflow: visible; /* Aucun bloc coupé */
        height: calc(100vh - var(--header-height) - 5rem); /* Hauteur sous le header avec marge */
    }

    #roue-harmonies-section .column-left {
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        height: 100%; /* prend toute la hauteur disponible du parent */
        overflow: hidden; /* plus de scrollbar sur la colonne elle-même */
    }

    #roue-harmonies-section .section-header {
        flex-shrink: 0; /* évite la compression du titre */
        margin-bottom: 0;
    }

    #roue-harmonies-section .harmonies-container {
        flex: 1;
        overflow-y: auto; /* le scroll interne se fait ici uniquement */
        min-height: 0;
        scrollbar-width: thin;
    }

    .harmony-groups-wrapper {
        padding-bottom: 3.5rem; /* padding de sécurité à l'intérieur du défilement */
    }

    #roue-harmonies-section .column-right {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        position: sticky;
        top: calc(var(--header-height) + 24px); /* sticky sous le header global */
        max-height: 100%; /* hauteur max calquée sur le parent */
        overflow-y: auto; /* pour pouvoir défiler si l'écran est petit en hauteur */
        scrollbar-width: none; /* cacher la scrollbar à droite */
    }

    #roue-harmonies-section .column-right::-webkit-scrollbar {
        display: none;
    }
}

@media (min-width: 1024px) {
    #roue-harmonies-section.content-section.active {
        gap: 3rem;
        height: calc(100vh - var(--header-height) - 6rem);
    }

    #roue-harmonies-section .column-left {
        gap: 1.5rem;
    }

    #roue-harmonies-section .column-right {
        gap: 2rem;
    }
}

/* Styles par défaut pour les colonnes en dehors de la page Roue & Harmonies */
.column-left, .column-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

/* Style de carte standard épuré (Material/Apple) */
.glass-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-subtle);
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
    box-shadow: var(--shadow-hover);
}

/* ==========================================================================
   LA ROUE CHROMATIQUE SVG
   ========================================================================== */
.wheel-container-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.25rem;
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .wheel-wrapper {
        max-width: 340px;
    }
}

#color-wheel-svg {
    display: block;
    overflow: visible;
}

/* Segments de la roue */
.wheel-segment {
    cursor: pointer;
    transition: filter var(--transition-fast), stroke var(--transition-fast), stroke-width var(--transition-fast), transform var(--transition-normal);
    transform-origin: 200px 200px;
}

.wheel-segment:hover {
    filter: brightness(1.03);
    transform: scale(1.015);
}

.wheel-segment.active-segment {
    stroke: var(--text-primary) !important;
    stroke-width: 3.5px !important;
    filter: drop-shadow(0 6px 14px rgba(28, 25, 23, 0.18)) !important;
    transform: scale(1.025);
}

/* Libellés de couleur arqués autour - Legibilité parfaite */
.segment-label {
    font-size: 8px;
    font-weight: 700;
    fill: var(--text-primary);
    paint-order: stroke fill;
    stroke: #ffffff;
    stroke-width: 2.5px;
    stroke-linejoin: round;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
    text-anchor: middle;
}

/* Centre de la roue */
#wheel-center {
    cursor: default;
    stroke: rgba(0, 0, 0, 0.05);
    stroke-width: 1px;
    transition: fill var(--transition-normal), transform var(--transition-normal);
    transform-origin: 200px 200px;
}

#wheel-center-text {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    pointer-events: none;
    user-select: none;
    transition: fill var(--transition-normal);
}

.wheel-instructions {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wheel-instructions::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-gold);
}

/* ==========================================================================
   FICHE TECHNIQUE COULEUR
   ========================================================================== */
.color-info-card {
    padding: 0; /* Pas de padding pour bandeau collé */
    border-top: none;
    scroll-margin-top: 90px;
}

.card-header-accent {
    height: 5px;
    width: 100%;
    background-color: var(--accent-gold);
    transition: background-color var(--transition-normal);
}

.color-info-body {
    padding: 1.75rem;
}

.color-title-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.color-name-french {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.color-type-badge {
    font-size: 0.75rem;
    background: #f5f5f4; /* Stone 100 */
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.color-preview-banner {
    height: 50px;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color var(--transition-normal);
}

.color-values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.value-item {
    background: #fafaf9; /* Stone 50 */
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-height: 48px; /* Cible tactile */
}

.value-item:hover {
    background: #f5f5f4;
    border-color: rgba(0, 0, 0, 0.1);
}

.value-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.15rem;
}

.value-text {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: monospace;
    font-weight: 600;
    word-break: break-all;
}

/* Tooltip Copier épuré */
.copy-tooltip {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 0.65rem;
    background: var(--text-primary);
    color: #ffffff;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
    font-weight: 600;
}

.value-item:hover .copy-tooltip {
    opacity: 0.9;
}

.value-item.copied .copy-tooltip {
    background: #16a34a;
    opacity: 1 !important;
}

/* ==========================================================================
   HARMONIES D'ARTISTE (NUANCIER EN CARTES RECTANGULAIRES)
   ========================================================================== */
.harmonies-container {
    padding: 2.25rem;
}

.harmony-card-header-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.harmony-card-header-main h3 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.harmony-icon-main {
    width: 26px;
    height: 26px;
    color: var(--accent-gold);
}

.harmony-groups-wrapper {
    display: flex;
    flex-direction: column;
}

.harmony-group {
    display: flex;
    flex-direction: column;
    padding-bottom: 2.25rem;
    margin-bottom: 2.25rem;
}

.harmony-group:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.harmony-group-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.group-num {
    background: var(--text-primary);
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.harmony-group-header h5 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.group-badge {
    font-size: 0.65rem;
    background: var(--bg-sidebar);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.harmony-group-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    max-width: 600px;
}

/* Grille réactive pour les fiches de couleurs */
.harmonies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .harmonies-grid {
        grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
        gap: 0.75rem;
    }
}

/* Fiche couleur rectangulaire compacte (Nuancier d'Atelier style) */
.color-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    user-select: none;
}

.color-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--text-secondary);
    z-index: 2;
}

.color-card:active {
    transform: translateY(-1px) scale(0.97);
}

/* Zone d'aperçu de couleur supérieure */
.color-card-preview {
    height: 48px;
    width: 100%;
    border-bottom: 1px solid var(--border-light);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: background-color var(--transition-normal);
}

/* Corps technique de la fiche */
.color-card-body {
    padding: 0.45rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    background: #ffffff;
}

.color-card-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    word-break: break-word;
}

.color-card-pigment {
    font-size: 0.6rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.15;
    word-break: break-word;
}

.color-card-index {
    font-size: 0.6rem;
    color: var(--accent-gold);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 0.15rem;
    word-break: break-word;
}

/* Codes techniques */
.color-card-technical {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.2rem;
}

.tech-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    line-height: 1.25;
    font-family: monospace;
    letter-spacing: -0.2px;
}

.tech-lbl {
    color: var(--text-muted);
    font-weight: 600;
}

.tech-val {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    word-break: break-all;
}

.tech-pantone {
    border-top: 1px dashed var(--border-light);
    margin-top: 0.1rem;
    padding-top: 0.1rem;
    font-weight: 600;
}

.tech-pantone .tech-val {
    color: var(--accent-gold);
}


/* ==========================================================================
   PLACEHOLDER PAGES (AUTRES PAGES DU MENU VIDES)
   ========================================================================== */
.placeholder-section {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.placeholder-content {
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1.5rem;
}

.placeholder-icon {
    width: 56px;
    height: 56px;
    color: var(--text-inactive);
    margin-bottom: 1.5rem;
}

.placeholder-content h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.placeholder-card {
    margin-top: 2rem;
    text-align: left;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-subtle);
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast-notification {
    position: fixed;
    bottom: 90px; /* Placé au-dessus de la bottom-nav */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary);
    color: #ffffff;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
}

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

@media (min-width: 1024px) {
    .toast-notification {
        bottom: 2rem;
        left: auto;
        right: 2rem;
        transform: translateY(20px);
    }
    .toast-notification.show {
        transform: translateY(0);
    }
}

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

/* ==========================================================================
   BOUTONS & COMPOSANTS DE FORMULAIRE GENERAUX
   ========================================================================== */
.primary-btn {
    background: var(--accent-gold);
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    user-select: none;
}

.primary-btn:hover {
    background: #986d21;
    transform: translateY(-1px);
}

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

.primary-btn:disabled {
    background: var(--text-inactive);
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.secondary-btn {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    user-select: none;
}

.secondary-btn:hover {
    background: #fafaf9;
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

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

.secondary-btn.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.8rem;
    min-height: 32px;
    border-radius: var(--radius-sm);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.form-input {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
}

.form-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(178, 131, 44, 0.1);
}

.form-textarea {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%;
    resize: vertical;
}

.form-textarea:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(178, 131, 44, 0.1);
}

/* ==========================================================================
   LAYOUT MÉLANGEUR
   ========================================================================== */
.mixer-layout-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.mixer-column-left, .mixer-column-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    #melangeur-section.content-section.active {
        display: flex;
        flex-direction: column;
        height: calc(100vh - var(--header-height) - 5rem);
        height: calc(100dvh - var(--header-height) - 5rem);
        overflow: hidden;
    }

    #melangeur-section .section-header {
        flex-shrink: 0;
        margin-bottom: 1rem;
    }

    .mixer-layout-container {
        display: grid;
        grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
        gap: 2rem;
        flex: 1;
        min-height: 0;
        height: 100%;
    }

    .mixer-column-left {
        height: 100%;
        overflow-y: auto;
        padding-bottom: 160px;
        min-height: 0;
        scrollbar-width: thin;
    }

    .mixer-column-right {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        position: sticky;
        top: calc(var(--header-height) + 24px);
        align-self: start;
        max-height: 100%;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .mixer-column-right::-webkit-scrollbar {
        display: none;
    }

    /* Boutons de l'étiquette tactiles sur iPad/ordinateurs */
    #btn-print-label, #btn-download-label {
        min-height: 48px;
        font-size: 0.9rem;
    }
}

@media (min-width: 1024px) {
    #melangeur-section.content-section.active {
        height: calc(100vh - var(--header-height) - 6rem);
        height: calc(100dvh - var(--header-height) - 6rem);
    }
}

.mixer-card {
    padding: 1.5rem;
    height: auto;
    overflow: visible;
    flex-shrink: 0;
}

/* Slider Volume */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.volume-input-wrapper {
    display: inline-flex;
    align-items: center;
    background: #fafaf9;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
}

.volume-num-input {
    width: 50px;
    border: none;
    background: transparent;
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
    outline: none;
    color: var(--text-primary);
}

.volume-num-input::-webkit-outer-spin-button,
.volume-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.volume-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 2px;
}

.slider-container {
    padding: 0.5rem 0;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e7e5e4;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: transform var(--transition-fast);
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Sélection de pigments */
.card-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 0.75rem;
}

.card-header-with-action h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.add-pigment-wrapper {
    position: relative;
}

.pigments-select-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    max-height: 280px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    z-index: 500;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dropdown-pigment-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.dropdown-pigment-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.dropdown-pigment-swatch {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.dropdown-pigment-info {
    display: flex;
    flex-direction: column;
}

.dropdown-pigment-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dropdown-pigment-code {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.dropdown-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-gold);
    padding: 0.5rem 0.5rem 0.25rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
}

.swatch-medium {
    background-color: #ffffff !important;
    background-image: linear-gradient(45deg, #e5e5e5 25%, transparent 25%),
                      linear-gradient(-45deg, #e5e5e5 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, #e5e5e5 75%),
                      linear-gradient(-45deg, transparent 75%, #e5e5e5 75%) !important;
    background-size: 8px 8px !important;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

/* Liste des Pigments composants */
.mixer-pigments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-pigments-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 2.5rem 1rem;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: #fafaf9;
}

.mixer-pigment-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #ffffff;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.mixer-pigment-row:hover {
    box-shadow: var(--shadow-subtle);
}

.pigment-row-swatch {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.pigment-row-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pigment-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pigment-title-input {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    border: 1px solid transparent;
    background: transparent;
    padding: 0 0.25rem;
    margin-left: -0.25rem;
    outline: none;
    border-radius: 4px;
    width: 100%;
}

.pigment-title-input:focus {
    background: #fafaf9;
    border-color: var(--border-color);
}

.pigment-row-code {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent-gold);
}

.pigment-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: all var(--transition-fast);
}

.qty-btn:hover {
    background: #fafaf9;
    border-color: var(--text-secondary);
}

.qty-input {
    width: 48px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
    outline: none;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pigment-percentage {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 42px;
    text-align: right;
}

.btn-delete-pigment {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-inactive);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-delete-pigment:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* Rendu théorique */
.mixer-render-container {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    position: relative;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: #eae6df; /* Fond de carton d'artiste */
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mixer-render-preview {
    width: 100%;
    height: 100%;
    transition: background-color 0.2s ease;
}

.mixer-render-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mixer-render-note {
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
    text-align: justify;
}

/* Résumé */
.summary-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    line-height: 1.4;
}

.summary-lbl {
    color: var(--text-secondary);
}

.summary-val {
    color: var(--text-primary);
    font-weight: 700;
}

.status-badge {
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

.badge-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #b45309;
}

.badge-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

.badge-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.mixer-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

/* ==========================================================================
   ÉTIQUETTE DU MÉLANGE
   ========================================================================== */
.pot-label-container {
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: var(--font-sans);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 2px;
    width: 100%;
    box-sizing: border-box;
    transition: all var(--transition-fast);
}

.pot-label-container.format-small {
    max-width: 250px;
    min-height: 150px;
}

.pot-label-container.format-medium {
    max-width: 320px;
    min-height: 180px;
}

.pot-label-container.format-large {
    max-width: 380px;
    min-height: 210px;
}

.pot-label-header {
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.pot-label-header .app-brand {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555555;
}

.pot-label-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.pot-label-main-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    gap: 0.75rem;
}

.pot-label-name-row {
    flex-grow: 1;
    display: flex;
    align-items: baseline;
    min-width: 0;
}

.pot-label-name-row .label-value {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pot-label-volume-row {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
}

.label-field {
    font-weight: 600;
    font-size: 0.7rem;
    color: #555555;
    margin-right: 0.25rem;
    flex-shrink: 0;
}

.label-value {
    font-size: 0.75rem;
    color: #000000;
}

.pot-label-render-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pot-label-color-render {
    width: 50px;
    height: 14px;
    border: 1px solid #000000;
    border-radius: 1px;
}

.pot-label-ingredients-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pot-label-ingredients-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0 0.5rem;
    font-size: 0.65rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.15rem 0.75rem;
}

.pot-label-ingredients-list li {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.pot-label-footer {
    border-top: 1px solid #e5e5e5;
    padding-top: 0.25rem;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.62rem;
    color: #555555;
}

.pot-label-date-row {
    display: flex;
    align-items: baseline;
}

.pot-label-notes-row {
    display: flex;
    align-items: baseline;
    max-width: 60%;
    min-width: 0;
}

.pot-label-notes-row .label-value {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom premium layouts for Suggested Harmonies and Detected Palette */
.harmony-subsections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.25rem;
}

.anal-harmony-row {
    background: rgba(178, 131, 44, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.anal-harmony-row:hover {
    background: rgba(178, 131, 44, 0.06);
    border-color: var(--accent-gold);
    transform: translateY(-2px);
}

.harmony-sub-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--accent-gold) !important;
}

.analysis-palette-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.palette-category-section {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow 0.2s ease;
}

.palette-category-section:hover {
    box-shadow: var(--shadow-sm);
    border-color: rgba(128, 128, 128, 0.3);
}

/* ==========================================================================
   IMPRESSION CSS (@media print)
   ========================================================================== */
@media print {
    /* Cacher tout l'interface */
    body * {
        visibility: hidden;
        background: transparent !important;
        box-shadow: none !important;
    }
    
    /* Afficher uniquement la boîte d'étiquette */
    #pot-label, #pot-label * {
        visibility: visible;
    }
    
    /* Forcer l'arrière-plan coloré du rendu à s'imprimer */
    #label-color-render {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    #pot-label {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        border: 1px solid #000000 !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 4mm !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
    
    /* Tailles d'impression strictes en mm */
    #pot-label.format-small {
        width: 50mm !important;
        height: 30mm !important;
        max-width: 50mm !important;
        min-height: 30mm !important;
    }
    
    #pot-label.format-medium {
        width: 70mm !important;
        height: 40mm !important;
        max-width: 70mm !important;
        min-height: 40mm !important;
    }
    
    #pot-label.format-large {
        width: 90mm !important;
        height: 50mm !important;
        max-width: 90mm !important;
        min-height: 50mm !important;
    }

    /* Polices d'impression ajustées en pt pour loger */
    #pot-label.format-small * {
        font-size: 7.5pt !important;
        line-height: 1.1 !important;
    }
    #pot-label.format-small .app-brand {
        font-size: 6pt !important;
    }
    #pot-label.format-small .pot-label-ingredients-list {
        grid-template-columns: 1fr !important;
        margin-left: 0.25rem !important;
        font-size: 5.5pt !important;
        gap: 0.1mm !important;
    }
    #pot-label.format-small .pot-label-color-render {
        width: 35px !important;
        height: 10px !important;
    }

    #pot-label.format-medium * {
        font-size: 9pt !important;
        line-height: 1.25 !important;
    }
    #pot-label.format-medium .app-brand {
        font-size: 7.5pt !important;
    }
    #pot-label.format-medium .pot-label-ingredients-list {
        font-size: 7pt !important;
    }

    #pot-label.format-large * {
        font-size: 11pt !important;
        line-height: 1.35 !important;
    }
    #pot-label.format-large .app-brand {
        font-size: 9pt !important;
    }
    #pot-label.format-large .pot-label-ingredients-list {
        font-size: 9pt !important;
    }
}

/* Multi-Agent AI suggestions bullet list styling */
.ai-suggestion-item {
    position: relative;
    padding-left: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.ai-suggestion-item::before {
    content: "✦";
    position: absolute;
    left: 0;
    color: var(--accent-gold);
    font-weight: bold;
}

/* ==========================================================================
   PAGE ANALYSE D'ŒUVRE
   ========================================================================== */
.analysis-layout-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.analysis-column-left, .analysis-column-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.analysis-card {
    padding: 1.75rem;
    height: auto;
    overflow: visible;
}

/* Zone de Drop d'images */
.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.4);
    transition: all var(--transition-normal);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent-gold);
    background: rgba(178, 131, 44, 0.04);
}

.upload-icon {
    width: 44px;
    height: 44px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.upload-dropzone:hover .upload-icon {
    color: var(--accent-gold);
}

.upload-dropzone h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-dropzone p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 320px;
    line-height: 1.4;
}

/* Bouton reset image absolute */
.btn-reset-image {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    transition: all var(--transition-fast);
    z-index: 10;
}

.btn-reset-image:hover {
    background: #ffffff;
    color: #c21820;
    transform: scale(1.05);
}

/* Palette d'analyse */
.analysis-palette-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fafaf9;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
    user-select: none;
}

.analysis-palette-item:hover {
    transform: translateX(4px);
    border-color: var(--accent-gold);
}

.analysis-palette-item.active-recipe-selection {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
    background: var(--bg-sidebar);
}

.palette-swatch-large {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.palette-meta-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.palette-color-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.palette-color-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.palette-role-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-dominante { background: #fee2e2; color: #991b1b; }
.role-secondaire { background: #fef3c7; color: #92400e; }
.role-accent { background: #dcfce7; color: #166534; }
.role-ombre { background: #f3f4f6; color: #374151; }
.role-lumiere { background: #e0f2fe; color: #075985; }

.palette-technical-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.palette-pigment-name {
    font-style: italic;
    color: var(--text-muted);
}

/* Swatches compacts pour harmonies d'analyse */
.swatch-row-compact {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.swatch-compact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    width: 68px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.swatch-compact-color {
    width: 100%;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: var(--shadow-subtle);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.swatch-compact-color:hover {
    transform: scale(1.08);
}

.swatch-compact-color.active-harmony-selection {
    transform: scale(1.08);
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px var(--accent-gold);
}

.swatch-compact-hex {
    font-family: monospace;
    font-size: 0.65rem;
}

/* Blocs de contrastes */
.contrast-block {
    border-left: 4px solid var(--accent-gold);
    background: #fafaf9;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contrast-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.95rem;
}

.contrast-level-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.level-faible { background: #eae6df; color: #6b6b6b; }
.level-moyen { background: #fef3c7; color: #b45309; }
.level-fort { background: #fee2e2; color: #b91c1c; }

.contrast-desc {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.contrast-action-tip {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 600;
    background: rgba(178, 131, 44, 0.06);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(178, 131, 44, 0.2);
}

.contrast-color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.contrast-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: inline-block;
}

/* Suggestions d'atelier */
.suggestion-atelier-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.suggestion-atelier-item::before {
    content: "•";
    color: var(--accent-gold);
    font-weight: bold;
    font-size: 1.25rem;
    line-height: 1.1;
    margin-right: 0.25rem;
}

/* Grille d'analyses sauvegardées (historique) */
.saved-analysis-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-subtle);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.saved-analysis-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    cursor: pointer;
}

.saved-analysis-thumb-wrapper {
    position: relative;
    width: 100%;
    height: 140px;
    background: #eae6df;
    overflow: hidden;
}

.saved-analysis-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-analysis-date-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.saved-analysis-btn-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-subtle);
    color: var(--text-muted);
    transition: all var(--transition-fast);
    z-index: 5;
}

.saved-analysis-btn-delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.saved-analysis-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.saved-analysis-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.saved-analysis-mini-palette {
    display: flex;
    gap: 4px;
    margin-top: 0.25rem;
}

.saved-analysis-mini-swatch {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

#analyse-section.content-section {
    padding-bottom: 120px;
}

/* Styles Desktop (min-width: 768px) */
@media (min-width: 768px) {
    #analyse-section.content-section.active {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
        padding-bottom: 160px;
        box-sizing: border-box;
    }

    .analysis-layout-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }

    .analysis-column-left {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .analysis-column-right {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* ==========================================================================
   PAGE RECETTES SAUVEGARDÉES (AFFICHAGE MINIMAL)
   ========================================================================== */
.recipes-layout-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.recipes-column-left, .recipes-column-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.recipes-card {
    padding: 1.75rem;
    height: auto;
    overflow: visible;
}

.recipes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipe-item-card {
    display: flex;
    align-items: center;
    background: #fafaf9;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
    user-select: none;
}

.recipe-item-card:hover {
    transform: translateX(4px);
    border-color: var(--accent-gold);
}

.recipe-item-card.active {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 1px var(--accent-gold);
    background: var(--bg-sidebar);
}

@media (min-width: 768px) {
    .recipes-layout-container {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
        gap: 2rem;
        align-items: start;
    }
}

/* Styles pour la prévisualisation d'étiquette */
.printed-pot-label {
    background: #ffffff;
    color: #000000;
    border: 1.5px solid #000000;
    padding: 2.5mm;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: var(--font-sans);
    text-align: left;
    line-height: 1.25;
    border-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.printed-pot-label.label-format-petit {
    width: 50mm;
    height: 30mm;
}

.printed-pot-label.label-format-moyen {
    width: 70mm;
    height: 40mm;
}

.printed-pot-label.label-format-grand {
    width: 90mm;
    height: 50mm;
}

/* Polices ajustées en fonction de la taille */
.printed-pot-label.label-format-petit * {
    font-size: 7.5pt !important;
    line-height: 1.15 !important;
}
.printed-pot-label.label-format-petit .label-title {
    font-size: 9pt !important;
}

.printed-pot-label.label-format-moyen * {
    font-size: 9pt !important;
    line-height: 1.25 !important;
}
.printed-pot-label.label-format-moyen .label-title {
    font-size: 11pt !important;
}

.printed-pot-label.label-format-grand * {
    font-size: 10.5pt !important;
    line-height: 1.35 !important;
}
.printed-pot-label.label-format-grand .label-title {
    font-size: 13pt !important;
}

/* Styles d'impression pour l'étiquette de mélange */
@media print {
    /* Masquer l'ensemble de l'interface et du document */
    html, body {
        height: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    body * {
        visibility: hidden !important;
    }

    /* Rendre visible uniquement l'étiquette à imprimer et son contenu */
    .printable-label,
    .printable-label * {
        visibility: visible !important;
    }

    /* Positionner l'étiquette au centre exact de la page d'impression */
    .printable-label {
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        border: 1.5px solid #000000 !important;
        background: #ffffff !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    /* Assurer le rendu des couleurs de fond (par exemple la pastille colorée) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ==========================================================================
   OPTIMISATIONS POUR IPAD ET TABLETTES (PORTRAIT)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* 1. Ajustement global des sections */
    .content-section {
        padding: 1.5rem;
    }

    /* 2. Roue Chromatique */
    #roue-harmonies-section.content-section.active {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        height: calc(100vh - var(--header-height) - 3.5rem);
        height: calc(100dvh - var(--header-height) - 3.5rem);
    }
    
    #roue-harmonies-section .column-left {
        gap: 0.75rem;
    }
    
    #roue-harmonies-section .column-right {
        gap: 1.25rem;
    }
    
    .wheel-container-card {
        padding: 1.5rem;
    }
    
    .wheel-wrapper {
        max-width: 250px;
    }
    
    .color-info-body {
        padding: 1.25rem;
    }

    /* 3. Mélangeur */
    #melangeur-section.content-section.active {
        height: calc(100vh - var(--header-height) - 3.5rem);
        height: calc(100dvh - var(--header-height) - 3.5rem);
    }
    
    .mixer-layout-container {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .mixer-column-right {
        gap: 1.25rem;
    }

    /* 4. Navigation & Boutons tactiles */
    .app-nav {
        gap: 0.75rem;
    }
    
    .nav-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Retours tactiles premium (effet de pression natif sur iPad & mobile) */
@media (hover: none) {
    .primary-btn:active, 
    .secondary-btn:active, 
    .nav-item:active,
    .value-item:active,
    .harmony-group:active {
        transform: scale(0.97);
        opacity: 0.9;
        transition: transform 0.1s ease;
    }
}

/* ==========================================================================
   OPTIMISATIONS RESPONSIVES POUR MOBILES / SMARTPHONES (RWD PREMIUM)
   ========================================================================== */
@media (max-width: 767px) {
    /* 1. Reculer le contenu pour ne pas être caché par la Tab Bar collée en bas */
    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom) + 1rem);
    }

    .content-section {
        padding: 1.25rem;
    }

    .section-header {
        margin-bottom: 1.25rem;
    }
    
    .section-header h2 {
        font-size: 1.85rem;
    }

    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: inline !important;
    }

    /* 2. Épurer le header du haut (logo + profil utilisateur) */
    .global-header {
        padding: calc(0.75rem + env(safe-area-inset-top)) 1.25rem 0.75rem 1.25rem;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    /* 3. Transformer la navigation en barre d'onglets (Tab Bar) collée au bas de l'écran */
    .app-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(72px + env(safe-area-inset-bottom));
        padding: 6px 0.25rem calc(6px + env(safe-area-inset-bottom)) 0.25rem;
        background: rgba(252, 250, 247, 0.96); /* Fond toile légèrement transparent */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        z-index: 9999; /* Devant tous les autres éléments */
        display: flex;
        justify-content: space-around;
        align-items: center;
        gap: 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
    }
    
    .app-nav .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 4px 0 2px 0;
        flex: 1;
        align-items: center;
        justify-content: flex-start;
        min-height: auto;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        color: var(--text-secondary);
        border-radius: var(--radius-sm);
        transition: transform var(--transition-fast);
    }
    
    .app-nav .nav-item .nav-label {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        height: 24px;
        font-size: 0.62rem;
        letter-spacing: -0.01em;
        line-height: 1.1;
        font-weight: 500;
        text-align: center;
        white-space: normal;
        word-break: break-word;
        width: 100%;
    }
    
    .app-nav .nav-item.active {
        color: var(--accent-gold) !important;
        font-weight: 600;
    }
    
    .app-nav .nav-item.active .nav-icon {
        color: var(--accent-gold) !important;
        transform: scale(1.08);
    }
    
    .app-nav .nav-item .nav-icon {
        width: 18px;
        height: 18px;
        color: var(--text-inactive);
        transition: transform var(--transition-fast), color var(--transition-fast);
    }

    .harmony-group-header h5 {
        font-size: 0.95rem;
    }
    .harmony-group-desc {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   AUTHENTIFICATION & SYNCHRONISATION (STYLE CSS)
   ========================================================================== */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-profile-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-subtle);
    padding: 0;
    flex-shrink: 0;
}

.nav-profile-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-inactive);
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.nav-profile-btn:active {
    transform: scale(0.95);
}

.nav-profile-btn .profile-icon-svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.nav-profile-btn #profile-initials {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
}

/* Bandeau de Synchronisation */
.sync-banner {
    background: rgba(178, 131, 44, 0.05); /* Fond or très dilué */
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.sync-banner.connected {
    background: rgba(34, 197, 94, 0.05); /* Fond vert dilué */
}

.sync-icon.pulse {
    animation: sync-pulse 2s infinite ease-in-out;
}

@keyframes sync-pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; color: var(--accent-gold); }
    100% { transform: scale(1); opacity: 0.8; }
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.auth-form .form-input {
    width: 100%;
    min-height: 40px;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-form .form-input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(178, 131, 44, 0.15);
}

.btn-google-auth {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    transition: all var(--transition-fast) !important;
}

.btn-google-auth:hover {
    background: #f7f5f0 !important;
    border-color: var(--text-inactive) !important;
    box-shadow: var(--shadow-subtle) !important;
}
