﻿/* Reset et Base */
* {
    box-sizing: border-box;
    user-select: none;
    /* Désactive la sélection de texte par défaut */
    -webkit-user-select: none;
    cursor: default;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Aucun scroll global */
    background-color: #000;
    color: var(--texte-principal);
}

/* Utilitaires */
.cache {
    display: none !important;
}

.flex {
    display: flex;
}

.center {
    align-items: center;
    justify-content: center;
}

.col {
    flex-direction: column;
}

/* Écran de Démarrage */
#ecran-demarrage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: opacity 1s ease-out;
}

.conteneur-boot {
    text-align: center;
}

.loader-boot {
    width: 40px;
    height: 40px;
    border: 4px solid #333;
    border-top: 4px solid #fff;
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Écran de Verrouillage */
#ecran-verrouillage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--fond-lock);
    background-size: cover;
    background-position: center;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    /* Effet frosted glass */
    transition: transform 0.5s ease-in-out, opacity 0.5s;
}

#heure-lock {
    font-size: 4rem;
    font-weight: 200;
}

#date-lock {
    font-size: 1.5rem;
    margin-bottom: 40px;
}

.login-box {
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.avatar-user {
    width: 80px;
    height: 80px;
    background-color: #ddd;
    border-radius: 50%;
    margin: 0 auto 10px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23555"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
    background-size: cover;
}

#btn-connexion {
    padding: 8px 16px;
    margin-top: 10px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    background: rgba(248, 250, 252, 0.95);
    color: #0f172a;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
}

#btn-connexion:hover {
    background: #e2e8f0;
    border-color: rgba(15, 23, 42, 0.35);
}

/* Interface Bureau */
#interface-bureau {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow: hidden;
}

#fond-ecran {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--img-bureau, none);
    background-color: var(--color-bureau, #000);
    background-size: cover;
    background-position: center;
    z-index: 0;
    transform-origin: center;
    transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
    will-change: opacity, transform, filter;
}

#myos-desktop-3d-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#myos-desktop-3d-layer .myos-desktop-3d-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    opacity: 0.92;
}

#myos-desktop-css3d-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#myos-desktop-css3d-layer .myos-desktop-css3d-renderer {
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    opacity: 0.92;
}

.desktop3d-css3d-plane {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transform-style: preserve-3d;
}

.desktop3d-icon-proxy {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: rgba(248, 250, 252, 0.9);
    text-align: center;
    text-shadow: 0 2px 8px rgba(2, 6, 23, 0.65);
    opacity: 0.52;
}

.desktop3d-icon-emoji {
    font-size: 34px;
    line-height: 1;
    margin-top: 4px;
}

.desktop3d-icon-label {
    font-size: 11px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 112px;
}

.desktop3d-window-proxy {
    position: absolute;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.26), rgba(30, 41, 59, 0.2));
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.34);
    overflow: hidden;
    opacity: 0.36;
}

.desktop3d-window-proxy.active {
    border-color: rgba(125, 211, 252, 0.6);
    opacity: 0.5;
}

.desktop3d-window-head {
    height: 28px;
    padding: 7px 10px 0;
    font-size: 10px;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.88);
    background: rgba(15, 23, 42, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop3d-window-body {
    height: calc(100% - 28px);
    background: repeating-linear-gradient(180deg,
            rgba(148, 163, 184, 0.14) 0,
            rgba(148, 163, 184, 0.14) 1px,
            rgba(30, 41, 59, 0.04) 1px,
            rgba(30, 41, 59, 0.04) 22px);
}

#interface-bureau.desktop-3d-css3d-active #myos-desktop-css3d-layer {
    opacity: 1;
}

#interface-bureau.desktop-3d-enabled {
    --desktop3d-window-border: rgba(148, 163, 184, 0.42);
    --desktop3d-window-border-active: rgba(125, 211, 252, 0.8);
    --desktop3d-window-shadow: 0 18px 46px rgba(2, 6, 23, 0.42);
    --desktop3d-window-shadow-active: 0 30px 72px rgba(2, 6, 23, 0.56);
    --desktop3d-window-focus-glow: 0 0 0 1px rgba(147, 197, 253, 0.46), 0 0 24px rgba(56, 189, 248, 0.2);
}

#interface-bureau.desktop-3d-enabled #fond-ecran {
    opacity: 0.62;
    transform: scale(1.03);
    filter: saturate(0.95);
}

#interface-bureau.desktop-3d-hybrid {
    --desktop3d-parallax-x: 0px;
    --desktop3d-parallax-y: 0px;
}

#interface-bureau.desktop-3d-hybrid #conteneur-icones {
    transform: translate3d(calc(var(--desktop3d-parallax-x) * 0.58),
            calc(var(--desktop3d-parallax-y) * 0.46),
            0);
    transition: transform 0.14s ease-out;
    will-change: transform;
}

#interface-bureau.desktop-3d-hybrid #zone-fenetres {
    transform: translate3d(calc(var(--desktop3d-parallax-x) * 0.94),
            calc(var(--desktop3d-parallax-y) * 0.82),
            0);
    transition: transform 0.14s ease-out;
    will-change: transform;
}

#interface-bureau.desktop-3d-hybrid #barre-taches {
    transform: translate3d(calc(var(--desktop3d-parallax-x) * 0.22), 0, 0);
    transition: transform 0.14s ease-out;
    will-change: transform;
}

#interface-bureau.desktop-3d-hybrid .fenetre.desktop3d-focus-window {
    box-shadow: var(--desktop3d-window-shadow-active), var(--desktop3d-window-focus-glow);
}

/* Zone Icônes */
#conteneur-icones {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--hauteur-barre);
    z-index: 1;
    /* Suppression du layout flex pour positionnement libre */
    /* pointer-events: none; -> On garde les events pour le drag */
}

.icone-bureau {
    position: absolute;
    /* Ajout pour drag & drop */
    width: 120px;
    min-height: 90px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: #fff;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

#interface-bureau.desktop-3d-enabled #conteneur-icones .icone-bureau {
    transition: transform 0.16s ease-out, box-shadow 0.2s ease-out, background-color 0.16s ease-out, border-color 0.16s ease-out;
}

#interface-bureau.desktop-3d-enabled #conteneur-icones .icone-bureau:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.38), 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.icone-bureau:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.icone-bureau.selectionnee {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.img-icone {
    width: auto;
    height: auto;
    font-size: var(--taille-icone, 48px);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nom-icone {
    font-size: var(--taille-police-icones, 12px);
    word-break: break-word;
    line-height: 1.2;
}

/* Zone Fenêtres */
#zone-fenetres {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--hauteur-barre);
    z-index: 10;
    pointer-events: none;
    /* Laisse passer les clics vers le bureau si pas sur une fenêtre */
}

/* Style de Base Fenêtre */
.fenetre {
    position: absolute;
    background-color: var(--bg-fenetre);
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    /* Réactive les clics */
    overflow: hidden;
    min-width: 200px;
    min-height: 150px;
    /* Animation style iOS/Win11 à l'ouverture */
    animation: fenetre-zoom-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: center center;
    transition: box-shadow 0.2s, transform 0.1s, width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), height 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), left 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes fenetre-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fenetre-zoom-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

@keyframes fenetre-minimize-out {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.94) translateY(18px);
    }
}

@keyframes fenetre-restore-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.fenetre.fenetre-closing {
    animation: fenetre-zoom-out 0.18s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    pointer-events: none;
}

.fenetre.fenetre-minimizing {
    animation: fenetre-minimize-out 0.18s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    pointer-events: none;
}

.fenetre.fenetre-restoring {
    animation: fenetre-restore-in 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {

    .fenetre.fenetre-closing,
    .fenetre.fenetre-minimizing,
    .fenetre.fenetre-restoring {
        animation-duration: 0.01ms !important;
    }

    #interface-bureau.desktop-3d-enabled .fenetre,
    #interface-bureau.desktop-3d-enabled #conteneur-icones .icone-bureau {
        transition-duration: 0.01ms !important;
    }
}

/* Désactiver la transition pendant le drag pour éviter la latence */
.fenetre.en-deplacement {
    transition: none !important;
}

.fenetre.active {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: var(--couleur-accent);
}

#interface-bureau.desktop-3d-enabled .fenetre {
    border-color: var(--desktop3d-window-border);
    box-shadow: var(--desktop3d-window-shadow);
}

#interface-bureau.desktop-3d-enabled .fenetre.active {
    border-color: var(--desktop3d-window-border-active);
    box-shadow: var(--desktop3d-window-shadow-active), var(--desktop3d-window-focus-glow);
}

.fenetre.maximisee {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    transition: all 0.2s ease-in-out;
}

/* Prévisualisation Snap (Windows 11 Style) */
#snap-preview {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    z-index: 9900;
    pointer-events: none;
    transition: all 0.15s ease-out;
    display: none;
}

.poignee-redim {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    z-index: 20;
    /* Indicateur visuel discret style mac/windows */
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
    border-bottom-right-radius: 6px;
}

.poignee-redim:hover {
    background: linear-gradient(135deg, transparent 50%, rgba(0, 0, 0, 0.3) 50%);
}

.fenetre-entete {
    height: 34px;
    background-color: #efefef;
    border-bottom: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 8px;
    user-select: none;
}

.fenetre.active .fenetre-entete {
    background-color: #f7f7f7;
}

#interface-bureau.desktop-3d-enabled .fenetre .fenetre-entete {
    background: linear-gradient(180deg, rgba(241, 245, 249, 0.92), rgba(226, 232, 240, 0.9));
}

#interface-bureau.desktop-3d-enabled .fenetre.active .fenetre-entete {
    background: linear-gradient(180deg, rgba(219, 234, 254, 0.95), rgba(191, 219, 254, 0.88));
}

.fenetre-entete-gauche {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-system-menu {
    width: 22px;
    height: 22px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.btn-system-menu:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(15, 23, 42, 0.14);
}

.fenetre-titre {
    font-size: 12px;
    font-weight: 500;
    color: #1f2937;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fenetre-controles {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.btn-fenetre {
    width: 46px;
    height: 34px;
    border-radius: 0;
    border: none;
    background: transparent;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.btn-fenetre span {
    pointer-events: none;
}

.btn-fermer {
    font-size: 13px;
}

.btn-reduire {
    font-size: 16px;
    padding-bottom: 4px;
}

.btn-agrandir {
    font-size: 11px;
    padding-top: 1px;
}

.btn-fenetre:hover {
    background-color: rgba(15, 23, 42, 0.12);
}

.btn-fenetre:active {
    background-color: rgba(15, 23, 42, 0.2);
}

.btn-fermer:hover {
    background-color: #e81123;
    color: #fff;
}

.btn-fermer:active {
    background-color: #c50f1f;
    color: #fff;
}

.btn-settings {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    width: 18px;
    height: 18px;
    margin-right: 2px;
    color: #666;
    transition: color 0.2s, transform 0.2s;
    width: 28px;
    height: 28px;
}

.btn-help {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    width: 18px;
    height: 18px;
    margin-right: 2px;
    color: #666;
    transition: color 0.2s, transform 0.2s;
    width: 28px;
    height: 28px;
}

.fenetre.active .btn-help:hover {
    color: var(--couleur-primaire);
}

.fenetre.active .btn-settings:hover {
    color: var(--couleur-primaire);
    transform: rotate(45deg);
}

/* Mode Fantôme (Transparent) */
.fenetre.fenetre-fantome {
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.fenetre.fenetre-fantome .fenetre-entete {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.fenetre.fenetre-fantome .poignee-redim {
    opacity: 0;
}

/* Réapparition au survol */
.fenetre.fenetre-fantome:hover {
    background-color: var(--bg-fenetre) !important;
    border-color: rgba(0, 0, 0, 0.2) !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3) !important;
}

.fenetre.fenetre-fantome:hover .fenetre-entete {
    opacity: 1;
    pointer-events: auto;
}

.fenetre.fenetre-fantome:hover .poignee-redim {
    opacity: 1;
}

.fenetre-contenu {
    flex: 1;
    background-color: transparent;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 0;
    /* Force le flex-grow à prendre le dessus sans pousser */
}

#messages-container {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: scroll !important;
    /* Force l'apparition de l'espace de scroll */
    min-height: 0 !important;
    height: 100% !important;
}

/* Scrollbars personnalisées pour le chat - Version Ultra Visible */
#messages-container::-webkit-scrollbar {
    width: 6px !important;
    display: block !important;
}

#messages-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#messages-container::-webkit-scrollbar-thumb {
    background: #6d28d9 !important;
    /* Violet Primaire pour être très visible */
    border-radius: 10px;
}

#messages-container::-webkit-scrollbar-thumb:hover {
    background: #5b21b6 !important;
}

/* Barre des Tâches */
#barre-taches {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Centrer le contenu globalement */
    padding: 0 10px;
    gap: 10px;
    z-index: 10000;
}

/* Menu Pied Actions */
.menu-pied {
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.btn-menu-action {
    flex: 1;
    padding: 8px;
    border-radius: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-menu-action:hover {
    background: rgba(255, 255, 255, 0.15);
}

#btn-arret:hover {
    background: #ef4444;
    /* Rouge pour l'arrêt */
}


#btn-menu-demarrer {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    padding: 0 10px;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.2s ease;
    order: 0;
    /* S'assurer qu'il est au début du groupe central */
}

.icone-start {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    position: relative;
    font-size: 1.5rem;
    border-radius: 10px;
    border: 1px solid rgba(162, 224, 255, 0.48);
    background:
        radial-gradient(circle at 28% 22%, rgba(143, 241, 255, 0.42) 0%, rgba(99, 168, 255, 0.22) 38%, rgba(11, 24, 45, 0.2) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 5px 12px rgba(16, 34, 70, 0.36),
        0 0 12px rgba(113, 199, 255, 0.2);
    line-height: 1;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.45), 0 0 18px rgba(120, 200, 255, 0.42);
    animation: diamond-glow 3.2s ease-in-out infinite;
}

.icone-start::before,
.icone-start::after {
    content: '✦';
    position: absolute;
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.9);
    opacity: 0;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
    animation: diamond-sparkle 3.8s ease-in-out infinite;
    pointer-events: none;
}

.icone-start::before {
    top: -5px;
    right: -3px;
    animation-delay: 0.3s;
}

.icone-start::after {
    bottom: -5px;
    left: -3px;
    animation-delay: 1.6s;
}

@keyframes diamond-glow {

    0%,
    100% {
        text-shadow: 0 0 6px rgba(255, 255, 255, 0.45), 0 0 18px rgba(120, 200, 255, 0.42);
        transform: translateZ(0) scale(1);
        filter: saturate(1);
    }

    50% {
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.65), 0 0 24px rgba(120, 200, 255, 0.54);
        transform: translateZ(0) scale(1.06);
        filter: saturate(1.2);
    }
}

@keyframes diamond-sparkle {

    0%,
    65% {
        opacity: 0;
        transform: scale(0.6) rotate(0deg);
    }

    72% {
        opacity: 0.9;
        transform: scale(1) rotate(6deg);
    }

    82% {
        opacity: 0;
        transform: scale(0.6) rotate(-6deg);
    }

    100% {
        opacity: 0;
        transform: scale(0.6);
    }
}

#btn-menu-demarrer:hover {
    transform: scale(1.1);
    filter: brightness(1.08) saturate(1.1);
}

#btn-menu-demarrer:active {
    transform: scale(0.95);
}

#zone-apps-actives {
    flex: 0 1 auto;
    /* Ne pas prendre toute la largeur */
    display: flex;
    gap: 5px;
    order: 2;
}

#zone-apps-epinglees {
    flex: 0 1 auto;
    display: flex;
    gap: 5px;
    order: 1;
    margin-right: 6px;
}

#zone-apps-epinglees:empty {
    display: none;
}

.item-barre-tache {
    height: 42px;
    width: 42px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, box-shadow 0.2s;
    margin: 0 2px;
    position: relative;
}

.taskbar-unread-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
    pointer-events: none;
}

.item-barre-tache.has-unread::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
    pointer-events: none;
}

.item-barre-tache:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.25) translateY(-6px);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.item-barre-tache.active {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.taskbar-window-preview {
    position: fixed;
    width: 240px;
    max-width: calc(100vw - 16px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    color: #e2e8f0;
    padding: 8px;
    box-shadow: 0 20px 32px rgba(2, 6, 23, 0.45);
    z-index: 12000;
    pointer-events: auto;
}

.taskbar-preview-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 7px;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-preview-body {
    min-height: 98px;
    max-height: 270px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.taskbar-preview-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.taskbar-preview-restore-all {
    border: 1px solid rgba(125, 211, 252, 0.45);
    border-radius: 6px;
    background: rgba(14, 116, 144, 0.28);
    color: #e0f2fe;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 8px;
    cursor: pointer;
}

.taskbar-preview-restore-all:hover {
    background: rgba(14, 116, 144, 0.45);
    border-color: rgba(125, 211, 252, 0.65);
}

.taskbar-preview-close-all {
    border: 1px solid rgba(252, 165, 165, 0.45);
    border-radius: 6px;
    background: rgba(127, 29, 29, 0.28);
    color: #fee2e2;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 8px;
    cursor: pointer;
}

.taskbar-preview-close-all:hover {
    background: rgba(127, 29, 29, 0.46);
    border-color: rgba(252, 165, 165, 0.65);
}

.taskbar-preview-card {
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.84));
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease;
}

.taskbar-preview-card:hover {
    border-color: rgba(191, 219, 254, 0.55);
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(2, 6, 23, 0.35);
}

.taskbar-preview-card.is-minimized {
    opacity: 0.88;
}

.taskbar-preview-card.empty {
    opacity: 0.95;
}

.taskbar-preview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 7px 9px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.65);
}

.taskbar-preview-head-main {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.taskbar-preview-icon {
    font-size: 16px;
    line-height: 1;
}

.taskbar-preview-window-title {
    min-width: 0;
    font-size: 11px;
    color: rgba(226, 232, 240, 0.98);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.taskbar-preview-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.taskbar-preview-state {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(147, 197, 253, 0.45);
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.taskbar-preview-card-close {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(248, 250, 252, 0.35);
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.5);
    color: #f8fafc;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.taskbar-preview-card-close:hover {
    background: #e81123;
    border-color: #e81123;
}

.taskbar-preview-card-body {
    padding: 8px 9px 10px;
    min-height: 70px;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(226, 232, 240, 0.95);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#zone-systeme {
    position: absolute;
    /* Position absolue pour ne pas gêner le centrage */
    right: 0;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 10px;
    color: #fff;
    font-size: 12px;
}

.sys-tray-btn {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 0 8px;
    transition: background-color 0.2s, transform 0.1s;
    cursor: pointer;
}

.sys-tray-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sys-tray-btn:active {
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(0.96);
}

#btn-desktop-3d {
    min-width: 36px;
    padding: 0 10px;
}

#btn-desktop-3d .sys-3d-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    min-width: 32px;
    text-align: center;
}

#btn-desktop-3d.active {
    background-color: rgba(59, 130, 246, 0.26);
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.45);
}

#btn-desktop-3d.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#btn-desktop-3d.disabled:hover,
#btn-desktop-3d.disabled:active {
    background-color: transparent;
    transform: none;
}

.desktop3d-quick-menu {
    position: fixed;
    min-width: 168px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.5);
    z-index: 14000;
}

.desktop3d-menu-item {
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.desktop3d-menu-item:hover {
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(59, 130, 246, 0.35);
}

.desktop3d-menu-item.selected {
    background: rgba(59, 130, 246, 0.32);
    border-color: rgba(147, 197, 253, 0.45);
}

.desktop3d-menu-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.sys-icons-group {
    display: flex;
    gap: 10px;
    font-size: 16px;
}

.sys-clock-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    line-height: 1.3;
    min-width: 60px;
    text-align: right;
}

#sys-time {
    font-weight: 600;
    font-size: 12px;
}

#sys-date {
    font-size: 11px;
    opacity: 0.9;
}

.sys-show-desktop {
    width: 4px;
    height: 100%;
    margin-left: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.sys-show-desktop:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sys-show-desktop.active {
    background-color: rgba(59, 130, 246, 0.45);
    border-left-color: rgba(255, 255, 255, 0.45);
}

/* Menu Démarrer */
#menu-demarrer {
    position: absolute;
    bottom: 60px;
    /* Flottant au-dessus de la barre */
    left: 50%;
    transform: translateX(-50%);
    width: 680px;
    height: 720px;
    max-height: 85vh;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(236, 241, 248, 0.88));
    backdrop-filter: blur(22px);
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    z-index: 9800;
    display: flex;
    flex-direction: column;
    padding: 0;
    color: #0f172a;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-origin: bottom center;
    font-family: "Segoe UI Variable", "Segoe UI", "Noto Sans", sans-serif;
}

/* Animation d'ouverture du menu démarrer */
#menu-demarrer:not(.cache) {
    animation: menu-pop-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes menu-pop-up {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.menu-header {
    padding: 18px 18px 10px;
}

.menu-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    padding: 10px 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.menu-search-icon {
    font-size: 14px;
    color: #64748b;
}

#menu-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    width: 100%;
    color: #0f172a;
}

#menu-search-input::placeholder {
    color: #94a3b8;
}

.menu-body {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 18px 18px;
    overflow: hidden;
    min-height: 0;
}

.menu-section {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.menu-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.menu-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.02em;
}

.menu-section-btn {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #334155;
    border-radius: 10px;
    padding: 4px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.menu-section-btn:hover {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.2);
}

.menu-pinned-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 10px;
}

.menu-pinned-item {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    color: inherit;
}

.menu-pinned-item:hover {
    background: rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}

.menu-pinned-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

.menu-pinned-label {
    font-size: 11px;
    text-align: center;
    color: #334155;
}

.menu-reco-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-reco-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.menu-reco-item:hover {
    background: rgba(148, 163, 184, 0.2);
    transform: translateX(2px);
}

.menu-reco-meta {
    font-size: 11px;
    color: #64748b;
}

.menu-empty {
    grid-column: 1 / -1;
    padding: 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.menu-all-apps {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    min-height: 0;
}

.menu-all-apps-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.menu-all-apps-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.menu-all-apps-tools-label {
    font-size: 0.75rem;
    color: #475569;
    font-weight: 600;
}

.menu-all-apps-tools-select {
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 10px;
    outline: none;
}

.menu-all-apps-tools-select:focus {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.menu-all-apps-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
    min-height: 0;
}

.menu-all-apps-list::-webkit-scrollbar {
    width: 4px;
}

.menu-all-apps-list::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.15);
    border-radius: 2px;
}

.menu-item-app {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    background: transparent;
}

.menu-item-app:hover {
    background: rgba(59, 130, 246, 0.12);
    transform: translateX(2px);
}

.menu-item-icon {
    font-size: 20px;
}

.menu-item-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-item-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #0f172a;
}

.menu-app-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.menu-app-group:last-child {
    margin-bottom: 0;
}

.menu-app-group-title {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
    padding: 2px 10px 4px;
}

.menu-pin-btn {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 6px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    opacity: 0;
}

.menu-item-app:hover .menu-pin-btn {
    opacity: 1;
}

.menu-pin-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
}

.menu-pin-btn.is-pinned {
    color: #eab308;
    opacity: 1;
}

.menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.85);
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0 0 18px 18px;
}

.menu-footer-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
}

.menu-footer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.menu-footer-name {
    max-width: 190px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    text-align: left;
}

.menu-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-footer-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    font-size: 0.9rem;
}

.menu-footer-btn:hover {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.2);
}

.menu-footer #btn-arret:hover {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.2);
}

@media (max-width: 720px) {
    #menu-demarrer {
        width: 92vw;
        height: 80vh;
    }

    .menu-pinned-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}

/* 🔔 NOTIFICATIONS SYSTÈME (TOASTS) */
:root {
    --toast-accent-default: #38bdf8;
}

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: 360px;
}

.toast-notification {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 24px !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 20px 25px -5px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    display: flex !important;
    flex-direction: column !important;
    pointer-events: auto !important;
    font-family: 'Inter', system-ui, sans-serif !important;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    --accent: var(--toast-accent-color, var(--toast-accent-default));
    overflow: hidden !important;
    position: relative !important;
    width: 100% !important;
}

/* Effet de grain subtil */
.toast-notification::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

/* Pharmacien IA - mise en evidence des zones d'edition */
.meds-list-panel {
    background: rgba(251, 191, 36, 0.08);
    border-right: 2px solid rgba(251, 191, 36, 0.7);
    box-shadow: inset -1px 0 0 rgba(251, 191, 36, 0.35);
}

.meds-list-header {
    background: rgba(251, 191, 36, 0.18);
    border-bottom: 1px solid rgba(251, 191, 36, 0.55);
    color: #fef3c7;
}

.meds-editor-panel {
    background: rgba(34, 197, 94, 0.06);
    border-left: 2px solid rgba(34, 197, 94, 0.6);
    box-shadow: inset 1px 0 0 rgba(34, 197, 94, 0.25);
}

#medicaments-root.meds-arcade {
    font-size: 15px;
    line-height: 1.45;
    background: radial-gradient(circle at top, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 55%, rgba(10, 15, 25, 0.98) 100%);
}

#medicaments-root.meds-arcade .meds-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.9));
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

#medicaments-root.meds-arcade .meds-hero-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#medicaments-root.meds-arcade .meds-hero-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(147, 197, 253, 0.4);
    font-size: 22px;
}

#medicaments-root.meds-arcade .meds-hero-title {
    font-size: 1.35rem;
    font-weight: 800;
}

#medicaments-root.meds-arcade .meds-hero-sub {
    font-size: 0.9rem;
    opacity: 0.7;
}

#medicaments-root.meds-arcade .meds-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#medicaments-root.meds-arcade .meds-card {
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
    box-shadow:
        0 12px 30px rgba(15, 23, 42, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 16px;
    animation: meds-rise 0.35s ease;
}

#medicaments-root.meds-arcade .meds-card-title {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.75);
    margin-bottom: 8px;
}

#medicaments-root.meds-arcade .meds-section-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.8);
}

#medicaments-root.meds-arcade .meds-subtitle {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148, 163, 184, 0.9);
}

#medicaments-root.meds-arcade .meds-ai-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#medicaments-root.meds-arcade .meds-dashboard {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
}

#medicaments-root.meds-arcade .meds-dashboard-card {
    min-width: 240px;
    flex: 1;
}

#medicaments-root.meds-arcade .meds-dashboard-card .text-sm {
    font-size: 0.95rem;
}

#medicaments-root.meds-arcade .meds-main {
    gap: 0;
}

#medicaments-root.meds-arcade .meds-list-panel {
    flex: 0 0 38%;
    max-width: 38%;
    background: rgba(251, 191, 36, 0.1);
    border-right: 2px solid rgba(251, 191, 36, 0.65);
}

#medicaments-root.meds-arcade .meds-list-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.2);
}

#medicaments-root.meds-arcade .meds-list-title {
    font-size: 1rem;
    font-weight: 700;
}

#medicaments-root.meds-arcade .meds-list-sub {
    font-size: 0.85rem;
    opacity: 0.7;
}

#medicaments-root.meds-arcade .meds-list-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

#medicaments-root.meds-arcade .meds-list-item:hover {
    background: rgba(251, 191, 36, 0.18);
}

#medicaments-root.meds-arcade .meds-list-item.is-active {
    background: rgba(251, 191, 36, 0.28);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.5);
}

#medicaments-root.meds-arcade .meds-list-item-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

#medicaments-root.meds-arcade .meds-list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#medicaments-root.meds-arcade .meds-chip {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.55);
    color: rgba(226, 232, 240, 0.85);
}

#medicaments-root.meds-arcade .meds-chip.muted {
    opacity: 0.6;
}

#medicaments-root.meds-arcade .meds-editor-panel {
    background: rgba(34, 197, 94, 0.08);
    border-left: 2px solid rgba(34, 197, 94, 0.6);
    box-shadow: inset 1px 0 0 rgba(34, 197, 94, 0.25);
}

#medicaments-root.meds-arcade .meds-editor-header {
    margin-bottom: 14px;
}

#medicaments-root.meds-arcade .meds-editor-title {
    font-size: 1.1rem;
    font-weight: 800;
}

#medicaments-root.meds-arcade .meds-editor-sub {
    font-size: 0.9rem;
    opacity: 0.7;
}

#medicaments-root.meds-arcade .meds-empty {
    min-height: 220px;
}

#medicaments-root.meds-arcade .input,
#medicaments-root.meds-arcade .select,
#medicaments-root.meds-arcade .textarea {
    font-size: 0.95rem;
}

#medicaments-root.meds-arcade .input,
#medicaments-root.meds-arcade .select {
    min-height: 42px;
}

#medicaments-root.meds-arcade .textarea {
    min-height: 110px;
}

#medicaments-root.meds-arcade .btn:not(.btn-xs) {
    min-height: 40px;
    font-size: 0.9rem;
}

#medicaments-root.meds-arcade .toggle {
    transform: scale(1.05);
    transform-origin: left center;
}

@keyframes meds-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    #medicaments-root.meds-arcade .meds-main {
        flex-direction: column;
    }

    #medicaments-root.meds-arcade .meds-list-panel {
        max-width: 100%;
        width: 100%;
        border-right: none;
        border-bottom: 2px solid rgba(251, 191, 36, 0.65);
    }
}

/* Pharmacien IA - refonte arcade (sans barres de defilement) */
#medicaments-root.meds-arcade2 {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: "Comic Sans MS", "Trebuchet MS", "Verdana", sans-serif;
    color: #e2e8f0;
    background:
        radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 45%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 50%),
        radial-gradient(circle at bottom, rgba(249, 115, 22, 0.14), transparent 55%),
        #0b1220;
}

#medicaments-root.meds-arcade2 .hidden {
    display: none !important;
}

#medicaments-root.meds-arcade2 .meds-topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(120deg, rgba(30, 64, 175, 0.5), rgba(15, 23, 42, 0.9));
}

#medicaments-root.meds-arcade2 .meds-top-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

#medicaments-root.meds-arcade2 .meds-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(59, 130, 246, 0.3);
    border: 2px solid rgba(191, 219, 254, 0.45);
    font-size: 18px;
}

#medicaments-root.meds-arcade2 .meds-title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
}

#medicaments-root.meds-arcade2 .meds-tagline {
    font-size: 0.8rem;
    opacity: 0.75;
}

#medicaments-root.meds-arcade2 .meds-top-center {
    display: flex;
    justify-content: center;
}

#medicaments-root.meds-arcade2 .meds-person-pill {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.35);
    font-weight: 700;
}

#medicaments-root.meds-arcade2 .meds-top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

#medicaments-root.meds-arcade2 .meds-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

#medicaments-root.meds-arcade2 .meds-tab {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

#medicaments-root.meds-arcade2 .meds-tab.is-active {
    background: linear-gradient(120deg, rgba(34, 197, 94, 0.45), rgba(59, 130, 246, 0.45));
    border-color: rgba(148, 163, 184, 0.6);
    transform: translateY(-1px);
}

#medicaments-root.meds-arcade2 .meds-panels {
    flex: 1;
    min-height: 0;
    padding: 8px 10px 10px;
    overflow: hidden;
}

#medicaments-root.meds-arcade2 .meds-panel {
    display: none;
    height: 100%;
    min-height: 0;
}

#medicaments-root.meds-arcade2 .meds-panel.is-active {
    display: block;
}

#medicaments-root.meds-arcade2 .meds-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    height: 100%;
    grid-auto-rows: minmax(0, 1fr);
}

#medicaments-root.meds-arcade2 .meds-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#medicaments-root.meds-arcade2 .meds-ai-card {
    grid-column: 1 / -1;
}

#medicaments-root.meds-arcade2 .meds-card {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.75);
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.35);
    padding: 10px;
    overflow: hidden;
}

#medicaments-root.meds-arcade2 .meds-card-title {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.75);
    margin-bottom: 8px;
}

#medicaments-root.meds-arcade2 .meds-list-compact {
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#medicaments-root.meds-arcade2 .meds-ai-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

#medicaments-root.meds-arcade2 .meds-ai-buttons {
    display: flex;
    gap: 8px;
}

#medicaments-root.meds-arcade2 .meds-ai-card textarea {
    min-height: 80px;
    font-size: 0.9rem;
}

#medicaments-root.meds-arcade2 .meds-status-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

#medicaments-root.meds-arcade2 .meds-main {
    height: 100%;
    display: grid;
    grid-template-columns: 0.38fr 0.62fr;
    gap: 12px;
}

#medicaments-root.meds-arcade2 .meds-list-panel {
    background: rgba(251, 191, 36, 0.12);
    border: 2px solid rgba(251, 191, 36, 0.55);
    border-radius: 16px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#medicaments-root.meds-arcade2 .meds-list-header {
    padding: 12px 14px;
    background: rgba(251, 191, 36, 0.2);
    border-bottom: 1px solid rgba(251, 191, 36, 0.5);
    color: #fef3c7;
}

#medicaments-root.meds-arcade2 .meds-list-title {
    font-weight: 800;
    font-size: 1rem;
}

#medicaments-root.meds-arcade2 .meds-list-sub {
    font-size: 0.85rem;
    opacity: 0.7;
}

#medicaments-root.meds-arcade2 .meds-list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
}

#medicaments-root.meds-arcade2 .meds-list-hint {
    padding: 6px 12px;
    font-size: 0.8rem;
    color: #fde68a;
    background: rgba(120, 53, 15, 0.35);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
    min-height: 22px;
}

#medicaments-root.meds-arcade2 .meds-list-status {
    font-weight: 700;
}

#medicaments-root.meds-arcade2 .meds-list-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    overflow-y: auto;
}

#medicaments-root.meds-arcade2 .meds-list-item {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.2s ease;
}

#medicaments-root.meds-arcade2 .meds-list-item:hover {
    background: rgba(251, 191, 36, 0.2);
    transform: translateY(-1px);
}

#medicaments-root.meds-arcade2 .meds-list-item.is-active {
    background: rgba(251, 191, 36, 0.32);
    border-color: rgba(251, 191, 36, 0.55);
}

#medicaments-root.meds-arcade2 .meds-list-item-title {
    font-weight: 800;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

#medicaments-root.meds-arcade2 .meds-list-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#medicaments-root.meds-arcade2 .meds-chip {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.75rem;
    background: rgba(15, 23, 42, 0.55);
}

#medicaments-root.meds-arcade2 .meds-chip.muted {
    opacity: 0.6;
}

#medicaments-root.meds-arcade2 .meds-editor-panel {
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.4);
    border-radius: 16px;
    box-shadow: none;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#medicaments-root.meds-arcade2 .meds-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Aligné en haut */
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

#medicaments-root.meds-arcade2 .meds-editor-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

#medicaments-root.meds-arcade2 .meds-editor-sub {
    font-size: 0.8rem;
    opacity: 0.6;
    display: block;
    /* Force le passage à la ligne */
}

#medicaments-root.meds-arcade2 .meds-empty {
    flex: 1;
    display: grid;
    place-items: center;
    text-align: center;
}

#medicaments-root.meds-arcade2 .meds-empty-card {
    padding: 20px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed rgba(148, 163, 184, 0.45);
}

#medicaments-root.meds-arcade2 .meds-empty-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

#medicaments-root.meds-arcade2 .meds-empty-title {
    font-weight: 800;
    margin-bottom: 6px;
}

#medicaments-root.meds-arcade2 .meds-empty-sub {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 12px;
}

#medicaments-root.meds-arcade2 .meds-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow: hidden;
    /* Ne scrolle plus ici */
}

#medicaments-root.meds-arcade2 .meds-form-actions {
    display: flex;
    gap: 8px;
    margin-top: -2px;
    /* Remonte légèrement les boutons */
}

#medicaments-root.meds-arcade2 .meds-accordion {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    /* Scrolle uniquement l'accordéon */
    padding-right: 4px;
}

#medicaments-root.meds-arcade2 .meds-acc-trigger {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    font-weight: 700;
    cursor: pointer;
}

#medicaments-root.meds-arcade2 .meds-acc-trigger.is-open {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
}

#medicaments-root.meds-arcade2 .meds-acc-panel {
    display: none;
    padding: 8px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

#medicaments-root.meds-arcade2 .meds-acc-panel.is-open {
    display: block;
}

#medicaments-root.meds-arcade2 .meds-stats {
    display: grid;
    gap: 8px;
    font-size: 1rem;
}

#medicaments-root.meds-arcade2 .meds-stat {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

#medicaments-root.meds-arcade2 .meds-pharma-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#medicaments-root.meds-arcade2 .meds-panel[data-tab-panel="pharmacien"].is-active {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#medicaments-root.meds-arcade2 .meds-panel[data-tab-panel="pharmacien"] .meds-pharma-grid {
    flex: 1;
    min-height: 0;
    height: auto;
}

#medicaments-root.meds-arcade2 .meds-pharma-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

#medicaments-root.meds-arcade2 .meds-pharma-grid>.meds-card:not(.meds-pharma-log-card) {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#medicaments-root.meds-arcade2 .meds-pharma-grid>.meds-card:not(.meds-pharma-log-card) .meds-pharma-form {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    align-content: start;
}

#medicaments-root.meds-arcade2 .meds-pharma-grid>.meds-card:not(.meds-pharma-log-card) .meds-pharma-meta {
    flex-shrink: 0;
}

#medicaments-root.meds-arcade2 .meds-pharma-span-2 {
    grid-column: 1 / -1;
}

#medicaments-root.meds-arcade2 .meds-pharma-meta {
    margin-top: 8px;
    font-size: 0.82rem;
    opacity: 0.72;
}

#medicaments-root.meds-arcade2 .meds-pharma-log-card {
    grid-column: 1 / -1;
}

#medicaments-root.meds-arcade2 .meds-pharma-log-card .meds-list-compact {
    max-height: 160px;
    overflow-y: auto;
}

#medicaments-root.meds-arcade2 .meds-pharma-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#medicaments-root.meds-arcade2 .input,
#medicaments-root.meds-arcade2 .select,
#medicaments-root.meds-arcade2 .textarea {
    font-size: 0.95rem;
}

#medicaments-root.meds-arcade2 .btn:not(.btn-xs) {
    min-height: 38px;
    font-size: 0.9rem;
}

/* Scrollbars pour Arcade 2 */
#medicaments-root.meds-arcade2 *::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#medicaments-root.meds-arcade2 *::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.3);
}

#medicaments-root.meds-arcade2 *::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

#medicaments-root.meds-arcade2 *::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

@media (max-width: 980px) {
    #medicaments-root.meds-arcade2 .meds-panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #medicaments-root.meds-arcade2 .meds-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #medicaments-root.meds-arcade2 .meds-main {
        grid-template-columns: 1fr;
    }

    #medicaments-root.meds-arcade2 .meds-pharma-form {
        grid-template-columns: 1fr;
    }
}

/* Mes Medicaments (app simple vignettes) */
#mes-meds-root.mes-meds-root {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    position: relative;
    background:
        radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 45%),
        radial-gradient(circle at bottom, rgba(16, 185, 129, 0.12), transparent 55%),
        #0f172a;
    color: #e2e8f0;
}

#mes-meds-root .mes-meds-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#mes-meds-root .mes-meds-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#mes-meds-root .mes-meds-status {
    font-size: 0.8rem;
    opacity: 0.8;
}

#mes-meds-root .mes-meds-status[data-state="ok"] {
    color: #86efac;
}

#mes-meds-root .mes-meds-status[data-state="warn"] {
    color: #facc15;
}

#mes-meds-root .mes-meds-status[data-state="error"] {
    color: #f87171;
}

#mes-meds-root .mes-meds-title {
    font-size: 1.4rem;
    font-weight: 800;
}

#mes-meds-root .mes-meds-subtitle {
    font-size: 0.9rem;
    opacity: 0.75;
}

#mes-meds-root .mes-meds-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    align-content: start;
    overflow-y: auto;
    padding-right: 4px;
}

#mes-meds-root .mes-med-tile {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    padding: 16px 14px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 700;
    color: #e2e8f0;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

#mes-meds-root .mes-med-add {
    background: rgba(59, 130, 246, 0.15);
    border: 1px dashed rgba(148, 163, 184, 0.6);
}

#mes-meds-root .mes-med-tile:hover {
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.5);
}

#mes-meds-root .mes-med-add:hover {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(59, 130, 246, 0.7);
}

#mes-meds-root .mes-med-plus {
    font-size: 1.6rem;
    line-height: 1;
    margin-bottom: 6px;
}

#mes-meds-root .mes-med-name {
    font-size: 0.95rem;
}

#mes-meds-root .mes-meds-empty {
    opacity: 0.7;
    font-size: 0.95rem;
}

#mes-meds-root .mes-meds-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.6);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

#mes-meds-root .mes-meds-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.2);
}

#mes-meds-root .mes-meds-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#mes-meds-root .mes-meds-btn-outline {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.5);
    color: #e2e8f0;
}

#mes-meds-root .mes-meds-btn-ghost {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
    padding: 6px 10px;
}

#mes-meds-root .mes-meds-modal {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    padding: 16px;
    backdrop-filter: blur(6px);
}

#mes-meds-root .mes-meds-modal.is-hidden {
    display: none;
}

#mes-meds-root .mes-meds-modal-card {
    width: min(880px, 100%);
    max-height: 92%;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.6);
    overflow: hidden;
}

#mes-meds-root .mes-meds-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

#mes-meds-root .mes-meds-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

#mes-meds-root .mes-meds-modal-subtitle {
    font-size: 0.85rem;
    opacity: 0.7;
}

#mes-meds-root .mes-meds-modal-body {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 16px;
    padding: 16px;
    overflow: auto;
}

#mes-meds-root .mes-meds-modal-body .modal-step {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
}

#mes-meds-root .mes-meds-modal-panel {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

#mes-meds-root .mes-meds-section-title {
    font-weight: 700;
    font-size: 0.95rem;
}

#mes-meds-root .mes-meds-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
    margin: 4px 0;
}

#mes-meds-root .mes-meds-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#mes-meds-root .mes-meds-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

#mes-meds-root .mes-meds-input,
#mes-meds-root .mes-meds-textarea {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 8px 10px;
    color: #e2e8f0;
    font-size: 0.9rem;
}

#mes-meds-root .mes-meds-textarea {
    resize: vertical;
}

#mes-meds-root .mes-meds-input:focus,
#mes-meds-root .mes-meds-textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

#mes-meds-root .mes-meds-photo-preview {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.5);
}

#mes-meds-root .mes-meds-muted {
    font-size: 0.8rem;
    opacity: 0.7;
}

#mes-meds-root .mes-meds-validation {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(59, 130, 246, 0.08);
    font-size: 0.85rem;
}

#mes-meds-root .mes-meds-actions-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 860px) {
    #mes-meds-root .mes-meds-modal-body {
        grid-template-columns: 1fr;
    }
}

/* Tailles */
.toast-small {
    width: 260px !important;
    padding: 16px !important;
    gap: 8px !important;
}

.toast-normal {
    width: 340px !important;
    padding: 24px !important;
    gap: 12px !important;
}

.toast-large {
    width: 420px !important;
    padding: 32px !important;
    gap: 16px !important;
}

.toast-small .toast-body {
    font-size: 13px !important;
}

.toast-large .toast-body {
    font-size: 18px !important;
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0 24px;
}

.toast-icon-wrapper {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 0 20px var(--accent);
    flex-shrink: 0;
}

.toast-title-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    opacity: 0.9;
}

.toast-subtitle {
    font-size: 10px;
    opacity: 0.4;
    font-weight: 600;
}

.toast-body {
    padding: 16px 24px 20px 24px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
}

.toast-footer {
    padding: 0 24px 20px 24px;
    display: flex;
    justify-content: flex-end;
}

.toast-time-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.toast-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.toast-progress-bar {
    height: 100%;
    background: var(--accent);
    width: 100%;
    transform-origin: left;
}

.btn-close-toast {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    transition: all 0.2s;
    z-index: 10;
}

.btn-close-toast:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    transform: scale(1.1);
}

/* Animations */
.animate-slide-in {
    animation: toastIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-out {
    animation: toastOut 0.5s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes toastIn {
    from {
        transform: scale(0.6) translateY(40px);
        opacity: 0;
        filter: blur(10px);
    }

    to {
        transform: scale(var(--scale, 1)) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes toastOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(0.8);
        opacity: 0;
        filter: blur(10px);
    }
}

@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* 💎 GLASS MORPHISM FOR SETTINGS MODALS 💎 */
.glass-modal-container {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1000;
}

.glass-modal-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 24px;
    color: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.glass-modal-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.glass-modal-header h2,
.glass-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.6));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.glass-modal-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-modal-section-title {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-bottom: 1.2rem;
    color: var(--couleur-accent);
    opacity: 0.9;
}

.settings-accordion-item {
    padding: 1rem 1.15rem;
    border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.44), rgba(30, 41, 59, 0.22));
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.settings-accordion-item:hover {
    border-color: rgba(96, 165, 250, 0.36);
}

.settings-accordion-item.is-open {
    border-color: rgba(96, 165, 250, 0.5);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.56), rgba(30, 41, 59, 0.34));
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.2);
}

.settings-accordion-item.is-collapsed {
    box-shadow: none;
}

.settings-accordion-trigger.glass-modal-section-title {
    width: 100%;
    margin-bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.35rem 0.8rem;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0;
    cursor: grab;
    align-items: center;
}

.settings-accordion-trigger.glass-modal-section-title:active {
    cursor: grabbing;
}

.settings-accordion-title-main {
    grid-column: 1;
    line-height: 1.2;
}

.settings-accordion-title-sub {
    grid-column: 1;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    opacity: 0.62;
    text-transform: none;
    color: #dbeafe;
}

.settings-accordion-drag {
    grid-column: 2;
    grid-row: 1 / span 2;
    letter-spacing: -1px;
    color: rgba(191, 219, 254, 0.7);
    opacity: 0.8;
    cursor: grab;
    user-select: none;
    align-self: center;
}

.settings-accordion-trigger:active .settings-accordion-drag {
    cursor: grabbing;
}

.settings-accordion-chevron {
    grid-column: 3;
    grid-row: 1 / span 2;
    width: 12px;
    height: 12px;
    margin-top: 1px;
    border-right: 2px solid rgba(191, 219, 254, 0.72);
    border-bottom: 2px solid rgba(191, 219, 254, 0.72);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.settings-accordion-trigger[aria-expanded="true"] .settings-accordion-chevron {
    transform: rotate(225deg);
}

.settings-accordion-trigger:focus-visible {
    outline: 1px solid rgba(147, 197, 253, 0.9);
    outline-offset: 4px;
    border-radius: 10px;
}

.settings-accordion-item.settings-dragging {
    opacity: 0.55;
}

.settings-accordion-item.settings-drop-before {
    box-shadow: inset 0 3px 0 rgba(56, 189, 248, 0.95);
}

.settings-accordion-item.settings-drop-after {
    box-shadow: inset 0 -3px 0 rgba(56, 189, 248, 0.95);
}

.settings-accordion-content {
    margin-top: 0.9rem;
}

.settings-accordion-content[hidden] {
    display: none !important;
}

.settings-scrollable {
    scrollbar-width: thin;
    scrollbar-color: rgba(125, 211, 252, 0.65) rgba(15, 23, 42, 0.42);
}

.settings-scrollable::-webkit-scrollbar {
    width: 10px;
}

.settings-scrollable::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.42);
    border-radius: 999px;
}

.settings-scrollable::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.75), rgba(59, 130, 246, 0.62));
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.35);
}

.settings-scrollable::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(147, 197, 253, 0.9), rgba(59, 130, 246, 0.78));
}

.glass-tab-list {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.4rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.glass-tab {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.glass-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.glass-tab.tab-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.glass-input {
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px !important;
    color: #ffffff !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.95rem !important;
    transition: all 0.2s !important;
    min-height: 42px !important;
}

select.glass-input {
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, white 50%), linear-gradient(135deg, white 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.glass-input option {
    background-color: #1a202c !important;
    color: white !important;
}

.glass-input:focus {
    background: rgba(0, 0, 0, 0.3) !important;
    border-color: var(--couleur-accent) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

.glass-toggle {
    --tglbg: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.1);
}

.glass-footer {
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-premium {
    background: linear-gradient(135deg, var(--couleur-primaire) 0%, var(--couleur-accent) 100%);
    border: none;
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 120, 215, 0.3);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 120, 215, 0.5);
    filter: brightness(1.1);
}

.btn-premium:active {
    transform: translateY(0);
}

/* Glassmorphism for specific windows */
.fenetre[data-id-app="parametres"],
.fenetre[data-id-app="profil-user"] {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !important;
}

.fenetre[data-id-app="parametres"] .barre-titre,
.fenetre[data-id-app="profil-user"] .barre-titre {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.fenetre[data-id-app="parametres"] .barre-titre .titre,
.fenetre[data-id-app="profil-user"] .barre-titre .titre {
    font-weight: 800;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.fenetre[data-id-app="parametres"] .btn-fenetre,
.fenetre[data-id-app="profil-user"] .btn-fenetre {
    color: #334155 !important;
    font-weight: 700;
}

.fenetre[data-id-app="parametres"] .btn-reduire,
.fenetre[data-id-app="profil-user"] .btn-reduire {
    font-size: 18px;
    padding-bottom: 2px;
}

.fenetre[data-id-app="parametres"] .btn-agrandir,
.fenetre[data-id-app="profil-user"] .btn-agrandir {
    font-size: 12px;
    padding-top: 0;
}

.fenetre[data-id-app="parametres"] .btn-fenetre:hover,
.fenetre[data-id-app="profil-user"] .btn-fenetre:hover {
    background: rgba(15, 23, 42, 0.12) !important;
    color: #0f172a !important;
}

.fenetre[data-id-app="parametres"] .btn-fermer:hover,
.fenetre[data-id-app="profil-user"] .btn-fermer:hover {
    background-color: #e81123 !important;
    color: #fff !important;
}

/* Fix for background-clip lint error */
.glass-modal-header h2,
.glass-modal-header h3 {
    -webkit-background-clip: text;
    background-clip: text;
}

.btn-confirm-toast {
    margin: 0 24px 20px 24px;
    background: var(--toast-accent-color, #38bdf8);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    width: calc(100% - 48px);
}

.btn-confirm-toast:hover {
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-confirm-toast:active {
    transform: translateY(0) scale(0.98);
}

/* Glass List Items and Actions */
.glass-list-item {
    position: relative;
}

.glass-list-item:hover .glass-list-actions {
    opacity: 1 !important;
}

.glass-list-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* --- MENU CONTEXTUEL (Clic Droit) --- */
.menu-contextuel {
    position: absolute;
    min-width: 200px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: menu-fade-in 0.1s cubic-bezier(0, 0, 0.2, 1);
    transform-origin: top left;
}

@keyframes menu-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.item-menu-contextuel {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font-family: inherit;
    padding: 8px 12px;
    color: #fff;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
}

.item-menu-contextuel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.item-menu-contextuel.is-disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.menu-contextuel.postit-launcher-menu {
    min-width: 220px;
}

/* --- Sous-menu (style Windows 11) --- */
.menu-item-wrapper {
    position: relative;
}

.item-menu-contextuel.has-submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.item-menu-contextuel.has-submenu::after {
    content: ">";
    opacity: 0.6;
    font-size: 12px;
}

.menu-contextuel.submenu {
    position: absolute;
    top: 0;
    left: calc(100% + 6px);
    display: none;
    min-width: 200px;
}

.menu-item-wrapper:hover .menu-contextuel.submenu {
    display: flex;
}

/* --- ECRAN DE VEILLE (Galaxie) --- */
#ecran-veille {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 999999;
    /* Au-dessus de tout */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
    overflow: hidden;
}

#ecran-veille.actif {
    opacity: 1;
    pointer-events: auto;
    cursor: none;
    /* Cacher la souris */
}

/* --- GALAXY --- */
#ecran-veille.ss-galaxy {
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
}

.star-field {
    position: absolute;
    top: 0;
    left: 0;
    background: transparent;
}

@keyframes animStar {
    from {
        transform: translateY(0px);
    }

    to {
        transform: translateY(-2000px);
    }
}

/* --- MATRIX --- */
#ecran-veille.ss-matrix {
    background: #0D0208;
}

/* --- DVD --- */
#ecran-veille.ss-dvd {
    background: #000;
}

/* --- PARTICLES --- */
#ecran-veille.ss-particles {
    background: #0f172a;
}

/* --- AURORA --- */
#ecran-veille.ss-aurora {
    background: linear-gradient(180deg, #031525 0%, #020617 100%);
}

/* --- ORBITALS --- */
#ecran-veille.ss-orbitals {
    background: radial-gradient(circle at center, #101a34 0%, #020617 100%);
}

/* --- TUNNEL --- */
#ecran-veille.ss-tunnel {
    background: linear-gradient(180deg, #0b1020 0%, #020617 100%);
}

/* --- PING-PONG --- */
#ecran-veille.ss-pingpong {
    background: radial-gradient(circle at center, #111827 0%, #020617 100%);
}

/* --- ENGINE 3D --- */
#ecran-veille.ss-engine3d {
    background:
        radial-gradient(circle at 24% 18%, rgba(34, 211, 238, 0.18) 0%, rgba(34, 211, 238, 0) 46%),
        radial-gradient(circle at 76% 78%, rgba(96, 165, 250, 0.15) 0%, rgba(96, 165, 250, 0) 44%),
        linear-gradient(180deg, #041022 0%, #01060f 100%);
}

#ecran-veille.ss-aquarium {
    background: linear-gradient(to bottom, #001a33 0%, #003d5c 50%, #001a33 100%);
}

#ecran-veille.ss-engine3d .screensaver-3d-canvas,
#ecran-veille.ss-aquarium .myos-desktop-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- WIDGET METEO --- */
#widget-meteo {
    position: absolute;
    top: 24px;
    right: 24px;
    width: min(320px, calc(100vw - 36px));
    min-width: 240px;
    padding: 14px;
    background: linear-gradient(165deg, rgba(34, 38, 120, 0.72), rgba(24, 89, 170, 0.62));
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #fff;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    user-select: none;
}

#widget-meteo:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 26px 54px rgba(0, 0, 0, 0.3);
}

#widget-meteo.meteo-error {
    border-color: rgba(248, 113, 113, 0.65);
}

#widget-meteo.meteo-pulse {
    animation: meteo-pulse 0.65s ease-out;
}

@keyframes meteo-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.6);
    }

    100% {
        box-shadow: 0 0 0 16px rgba(148, 163, 184, 0);
    }
}

.meteo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.meteo-main {
    min-width: 0;
}

.meteo-temp {
    font-size: 2.2rem;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -1px;
}

.meteo-icon {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.meteo-city {
    font-size: 0.92rem;
    font-weight: 650;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.meteo-desc {
    font-size: 0.76rem;
    opacity: 0.8;
}

.meteo-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.meteo-mini-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.meteo-mini-card span {
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.72;
}

.meteo-mini-card strong {
    font-size: 0.84rem;
}

.meteo-toolbar {
    display: flex;
    gap: 6px;
}

.meteo-btn {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 0.73rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.meteo-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.meteo-btn.is-active {
    background: rgba(59, 130, 246, 0.45);
    border-color: rgba(191, 219, 254, 0.9);
}

.meteo-btn-small {
    flex: 0 0 auto;
    white-space: nowrap;
}

.meteo-expanded {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 2px;
}

.meteo-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.meteo-section-title {
    font-size: 0.66rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.72;
    font-weight: 700;
}

.meteo-forecast-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.meteo-forecast-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
}

.meteo-forecast-card span {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.meteo-forecast-card strong {
    font-size: 1rem;
    line-height: 1;
}

.meteo-forecast-card em {
    font-style: normal;
    font-size: 0.75rem;
    font-weight: 700;
}

.meteo-chart-wrap {
    height: 104px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    padding: 6px;
}

.meteo-setting-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meteo-city-input {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.35);
    color: #f8fafc;
    font-size: 0.78rem;
    padding: 7px 9px;
    outline: none;
}

.meteo-city-input::placeholder {
    color: rgba(248, 250, 252, 0.5);
}

.meteo-city-input:focus {
    border-color: rgba(191, 219, 254, 0.9);
}

.meteo-search-results {
    max-height: 130px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.3);
}

.meteo-city-option {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #f8fafc;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 9px;
    font-size: 0.76rem;
}

.meteo-city-option:last-child {
    border-bottom: none;
}

.meteo-city-option:hover {
    background: rgba(191, 219, 254, 0.2);
}

.meteo-city-option small {
    opacity: 0.7;
    font-size: 0.65rem;
}

.meteo-search-empty {
    padding: 8px 10px;
    font-size: 0.72rem;
    opacity: 0.7;
}

.meteo-checkline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    line-height: 1.2;
}

/* --- WIDGET ACTUALITES LOCALES --- */
#widget-actualites {
    position: absolute;
    top: 420px;
    /* Sous agenda */
    right: 24px;
    width: 280px;
    max-height: 360px;
    background: linear-gradient(135deg, rgba(20, 30, 48, 0.95), rgba(15, 23, 42, 0.88));
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 6;
}

#widget-actualites:hover {
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

#widget-actualites.actualites-pulse {
    animation: actualites-pulse 0.65s ease-out;
}

@keyframes actualites-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.6);
    }

    100% {
        box-shadow: 0 0 0 16px rgba(59, 130, 246, 0);
    }
}

#widget-actualites.actualites-error {
    border-color: rgba(248, 113, 113, 0.5);
}

.actualites-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.actualites-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #bae6fd;
}

.actualites-location {
    font-size: 0.7rem;
    opacity: 0.72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actualites-toolbar {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.actualites-btn {
    padding: 4px 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    background: rgba(30, 50, 80, 0.5);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.72rem;
    transition: background 0.2s ease;
}

.actualites-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(125, 211, 252, 0.5);
}

.actualites-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

.actualites-list::-webkit-scrollbar {
    width: 4px;
}

.actualites-list::-webkit-scrollbar-track {
    background: transparent;
}

.actualites-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 2px;
}

.actualites-list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

.actualites-placeholder {
    padding: 16px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
    color: #cbd5e1;
}

.actualites-empty {
    padding: 20px 12px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
    color: #cbd5e1;
}

.actualites-error {
    padding: 16px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.actualites-error-icon {
    font-size: 2rem;
}

.actualites-error-title {
    font-weight: 700;
    color: #fca5a5;
}

.actualites-error-message {
    font-size: 0.76rem;
    opacity: 0.8;
    margin: 0;
    word-break: break-word;
}

.actualites-error-retry {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fca5a5 !important;
}

.actualites-error-retry:hover {
    background: rgba(239, 68, 68, 0.35) !important;
}

.actualites-article {
    padding: 10px;
    border-radius: 10px;
    background: rgba(30, 50, 80, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.15);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.actualites-article:hover {
    background: rgba(30, 50, 80, 0.6);
    border-color: rgba(148, 163, 184, 0.3);
}

.actualites-article-title {
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    color: #e2e8f0;
    word-break: break-word;
}

.actualites-article-desc {
    font-size: 0.7rem;
    line-height: 1.3;
    margin: 0;
    opacity: 0.8;
    color: #cbd5e1;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.actualites-article-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.65rem;
    opacity: 0.7;
    align-items: center;
}

.actualites-article-source {
    background: rgba(59, 130, 246, 0.25);
    color: #93c5fd;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.actualites-article-date {
    opacity: 0.6;
}

.actualites-article-link {
    font-size: 0.7rem;
    color: #93c5fd;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.actualites-article-link:hover {
    color: #bfdbfe;
    text-decoration: underline;
}

.actualites-footer {
    font-size: 0.65rem;
    opacity: 0.6;
    text-align: right;
    padding-top: 4px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

/* --- WIDGET AGENDA --- */
#widget-agenda {
    position: absolute;
    top: 160px;
    /* Sous le widget météo */
    right: 24px;
    width: 240px;
    padding: 16px;
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: #fff;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    user-select: none;
}

#widget-agenda:hover {
    background: rgba(30, 30, 30, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.agenda-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.agenda-date {
    font-size: 0.75rem;
    opacity: 0.6;
    text-transform: capitalize;
}

.agenda-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.agenda-time {
    font-weight: 700;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
    min-width: 40px;
}

.agenda-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 8px;
    border-left: 3px solid #3b82f6;
    line-height: 1.2;
}

.agenda-empty {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.5;
    padding: 10px 0;
}

/* --- WIDGET HORLOGE --- */
#widget-horloge {
    position: absolute;
    top: 300px;
    right: 24px;
    width: min(308px, calc(100vw - 36px));
    min-width: 240px;
    min-height: 170px;
    padding: 14px;
    --horloge-bg-rgb: 4, 9, 28;
    background:
        radial-gradient(circle at 16% 18%, rgba(56, 189, 248, 0.16), transparent 44%),
        radial-gradient(circle at 84% 92%, rgba(99, 102, 241, 0.22), transparent 50%),
        linear-gradient(150deg,
            rgba(var(--horloge-bg-rgb), 0.9),
            rgba(var(--horloge-bg-rgb), 0.78),
            rgba(var(--horloge-bg-rgb), 0.62));
    backdrop-filter: blur(17px) saturate(165%);
    -webkit-backdrop-filter: blur(17px) saturate(165%);
    border: 1px solid rgba(191, 219, 254, 0.24);
    border-radius: 18px;
    color: #e6edf8;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow:
        0 18px 36px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    user-select: none;
    perspective: 920px;
    --clock-tilt-x: 0deg;
    --clock-tilt-y: 0deg;
    overflow: hidden;
}

#widget-horloge::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

#widget-horloge:hover {
    border-color: rgba(125, 211, 252, 0.48);
    box-shadow:
        0 24px 42px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(56, 189, 248, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.horloge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.horloge-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 800;
    opacity: 0.85;
    color: #e2e8f0;
}

.horloge-toggle-format {
    border: 1px solid rgba(191, 219, 254, 0.3);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.44);
    backdrop-filter: blur(4px);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.horloge-toggle-format:hover {
    background: rgba(30, 58, 138, 0.35);
    border-color: rgba(125, 211, 252, 0.56);
    transform: translateY(-1px);
}

.horloge-main {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    min-height: 112px;
    flex: 1;
    width: min(100%, 352px);
    margin: 0 auto;
    align-content: center;
    justify-items: center;
}

.horloge-stage {
    position: relative;
    width: 108px;
    height: 108px;
    margin-left: 0;
    display: grid;
    place-items: center;
    transform-style: preserve-3d;
    transform: rotateX(var(--clock-tilt-x)) rotateY(var(--clock-tilt-y));
    transition: transform 140ms linear;
    justify-self: center;
}

.horloge-shadow-ring {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    transform: translateZ(-16px) rotateX(82deg);
    background: radial-gradient(circle, rgba(5, 14, 36, 0.46) 0%, rgba(5, 14, 36, 0) 75%);
    filter: blur(2px);
}

.horloge-analog {
    position: relative;
    width: 98px;
    height: 98px;
    border-radius: 999px;
    border: 1px solid rgba(191, 219, 254, 0.24);
    background:
        radial-gradient(circle at 32% 30%, rgba(148, 163, 184, 0.28), rgba(10, 18, 39, 0.6) 60%, rgba(2, 6, 23, 0.95) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 -8px 18px rgba(2, 6, 23, 0.58),
        0 12px 24px rgba(0, 0, 0, 0.35);
    transform-style: preserve-3d;
    transform: translateZ(20px);
}

.horloge-face-core {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.16), rgba(148, 163, 184, 0.05) 42%, rgba(15, 23, 42, 0.2) 100%),
        radial-gradient(circle at 75% 78%, rgba(14, 116, 144, 0.15), transparent 55%);
    transform: translateZ(2px);
    z-index: 1;
}

.horloge-markers {
    position: absolute;
    inset: 0;
    transform: translateZ(10px);
    z-index: 2;
    pointer-events: none;
}

.horloge-marker {
    --marker-radius: var(--clock-marker-radius, 40px);
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1.8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.26);
    transform-origin: 50% 50%;
    transform: translate(-50%, -50%) rotate(var(--marker-angle)) translateY(calc(-1 * var(--marker-radius)));
}

.horloge-marker.major {
    --marker-radius: var(--clock-marker-major-radius, 37px);
    width: 2.4px;
    height: 12px;
    background: rgba(224, 242, 254, 0.72);
}

.horloge-hand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: 50% 100%;
    border-radius: 999px;
    z-index: 4;
    will-change: transform;
}

.horloge-hour {
    width: 4px;
    height: 23px;
    margin-left: -2px;
    margin-top: -23px;
    background: linear-gradient(180deg, rgba(250, 250, 255, 0.95), rgba(186, 230, 253, 0.92));
    box-shadow: 0 0 7px rgba(148, 163, 184, 0.4);
}

.horloge-minute {
    width: 3px;
    height: 32px;
    margin-left: -1.5px;
    margin-top: -32px;
    background: linear-gradient(180deg, rgba(191, 219, 254, 0.95), rgba(59, 130, 246, 0.92));
    box-shadow: 0 0 8px rgba(96, 165, 250, 0.48);
}

.horloge-second {
    width: 2px;
    height: 36px;
    margin-left: -1px;
    margin-top: -36px;
    background: linear-gradient(180deg, rgba(253, 164, 175, 0.98), rgba(239, 68, 68, 0.96));
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.52);
}

.horloge-center-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-left: -4.5px;
    margin-top: -4.5px;
    border-radius: 999px;
    background: #f8fafc;
    box-shadow:
        0 0 0 2px rgba(15, 23, 42, 0.9),
        0 0 12px rgba(191, 219, 254, 0.4);
    transform: translateZ(34px);
    z-index: 5;
}

.horloge-glass {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.04) 30%, rgba(255, 255, 255, 0) 68%),
        radial-gradient(circle at 68% 78%, rgba(56, 189, 248, 0.12), rgba(56, 189, 248, 0) 60%);
    transform: translateZ(36px);
    z-index: 6;
    pointer-events: none;
}

.horloge-digital-wrap {
    --flip-digit-width: 30px;
    --flip-digit-height: 44px;
    --flip-digit-font-size: 2rem;
    --flip-gap: 3px;
    --flip-sep-size: calc(var(--flip-digit-height) * 0.46);
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: relative;
    z-index: 2;
    align-self: center;
}

.horloge-digital-time-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
}

.horloge-digital-time {
    display: inline-flex;
    align-items: center;
    gap: var(--flip-gap);
    font-family: "JetBrains Mono", "Consolas", monospace;
    letter-spacing: 0;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.horloge-flip-sep {
    font-size: var(--flip-sep-size);
    font-weight: 800;
    line-height: 1;
    color: rgba(226, 232, 240, 0.86);
    transform: translateY(-1px);
    margin: 0 1px;
}

.horloge-flip-digit {
    position: relative;
    width: var(--flip-digit-width);
    height: var(--flip-digit-height);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(180deg, rgba(46, 54, 66, 0.92), rgba(15, 23, 42, 0.97));
    box-shadow:
        0 7px 12px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transform-style: preserve-3d;
}

.horloge-flip-digit::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(10, 16, 28, 0.7);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
    z-index: 8;
}

.horloge-flip-value {
    display: inline-block;
    font-size: var(--flip-digit-font-size);
    font-weight: 800;
    color: #f8fafc;
    line-height: var(--flip-digit-height);
    min-width: 0.62em;
    text-align: center;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.5),
        0 0 12px rgba(255, 255, 255, 0.15);
}

.horloge-flip-static,
.horloge-flip-flap {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.horloge-flip-static-top,
.horloge-flip-flap-front {
    top: 0;
    align-items: flex-start;
}

.horloge-flip-static-bottom,
.horloge-flip-flap-back {
    bottom: 0;
    align-items: flex-end;
}

.horloge-flip-static-top .horloge-flip-value,
.horloge-flip-flap-front .horloge-flip-value {
    transform: translateY(-22%);
}

.horloge-flip-static-bottom .horloge-flip-value,
.horloge-flip-flap-back .horloge-flip-value {
    transform: translateY(-72%);
}

.horloge-flip-flap {
    z-index: 10;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
}

.horloge-flip-flap-front {
    transform-origin: 50% 100%;
    background: linear-gradient(180deg, rgba(88, 99, 114, 0.5), rgba(33, 41, 55, 0.88));
}

.horloge-flip-flap-back {
    transform-origin: 50% 0%;
    transform: rotateX(90deg);
    background: linear-gradient(180deg, rgba(34, 43, 59, 0.94), rgba(66, 78, 94, 0.52));
}

.horloge-flip-digit.is-flipping .horloge-flip-flap-front {
    animation: horlogeFlipFront 0.24s cubic-bezier(0.4, 0.04, 0.82, 0.58) forwards;
}

.horloge-flip-digit.is-flipping .horloge-flip-flap-back {
    animation: horlogeFlipBack 0.26s cubic-bezier(0.17, 0.84, 0.44, 1) 0.22s forwards;
}

@keyframes horlogeFlipFront {
    0% {
        transform: rotateX(0deg);
    }

    100% {
        transform: rotateX(-92deg);
    }
}

@keyframes horlogeFlipBack {
    0% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0deg);
    }
}

.horloge-flip-tape {
    display: flex;
    gap: 2px;
    margin-top: 1px;
    opacity: 0.42;
    filter: saturate(82%) blur(0.2px);
}

.horloge-flip-tape-col {
    width: var(--flip-digit-width);
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.84));
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.5rem;
    line-height: 15px;
    letter-spacing: 0.05em;
    text-align: center;
    overflow: hidden;
}

.horloge-meridiem {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    padding: 2px 5px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.36);
    background: rgba(14, 116, 144, 0.24);
    color: #cffafe;
    margin-bottom: 2px;
}

#widget-horloge.is-24h .horloge-meridiem {
    display: none;
}

.horloge-digital-date {
    font-size: 0.74rem;
    opacity: 0.82;
    text-transform: capitalize;
    line-height: 1.3;
}

.horloge-zone {
    font-size: 0.63rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(186, 230, 253, 0.82);
}

#widget-horloge.horloge-hide-seconds .horloge-second {
    display: none;
}

#widget-horloge.horloge-hide-seconds .horloge-flip-sep-ms,
#widget-horloge.horloge-hide-seconds .horloge-flip-digit[data-part="s1"],
#widget-horloge.horloge-hide-seconds .horloge-flip-digit[data-part="s2"] {
    display: none;
}

#widget-horloge.horloge-hide-seconds .horloge-flip-tape-col.is-seconds {
    display: none;
}

#widget-horloge.horloge-mode-analog .horloge-digital-wrap {
    display: none;
}

#widget-horloge.horloge-mode-analog .horloge-toggle-format {
    display: none;
}

#widget-horloge.horloge-mode-analog .horloge-main {
    grid-template-columns: 1fr;
    width: min(100%, 132px);
}

#widget-horloge.horloge-mode-digital .horloge-stage {
    display: none;
}

#widget-horloge.horloge-mode-digital .horloge-main {
    grid-template-columns: 1fr;
    width: min(100%, 286px);
}

#widget-horloge.horloge-mode-digital .horloge-digital-wrap {
    align-items: center;
    text-align: center;
}

#widget-horloge.horloge-size-small {
    width: min(252px, calc(100vw - 36px));
    min-height: 144px;
    min-width: 214px;
    padding: 11px;
}

#widget-horloge.horloge-size-small .horloge-main {
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 96px;
    gap: 10px;
    width: min(100%, 292px);
}

#widget-horloge.horloge-size-small .horloge-stage {
    width: 92px;
    height: 92px;
}

#widget-horloge.horloge-size-small .horloge-analog {
    width: 84px;
    height: 84px;
}

#widget-horloge.horloge-size-small .horloge-stage {
    --clock-marker-radius: 34px;
    --clock-marker-major-radius: 31px;
}

#widget-horloge.horloge-size-small .horloge-digital-wrap {
    --flip-digit-width: 24px;
    --flip-digit-height: 36px;
    --flip-digit-font-size: 1.58rem;
    --flip-gap: 2px;
}

#widget-horloge.horloge-size-small .horloge-digital-date {
    font-size: 0.69rem;
}

#widget-horloge.horloge-size-large {
    width: min(388px, calc(100vw - 36px));
    min-height: 214px;
    min-width: 272px;
    padding: 16px;
}

#widget-horloge.horloge-size-large .horloge-main {
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 132px;
    gap: 14px;
    width: min(100%, 412px);
}

#widget-horloge.horloge-size-large .horloge-stage {
    width: 128px;
    height: 128px;
    --clock-marker-radius: 48px;
    --clock-marker-major-radius: 44px;
}

#widget-horloge.horloge-size-large .horloge-analog {
    width: 118px;
    height: 118px;
}

#widget-horloge.horloge-size-large .horloge-digital-wrap {
    --flip-digit-width: 36px;
    --flip-digit-height: 52px;
    --flip-digit-font-size: 2.28rem;
    --flip-gap: 4px;
}

#widget-horloge.horloge-size-large .horloge-digital-date {
    font-size: 0.8rem;
}

#widget-horloge.horloge-mode-analog.horloge-size-small .horloge-main,
#widget-horloge.horloge-mode-analog.horloge-size-medium .horloge-main,
#widget-horloge.horloge-mode-analog.horloge-size-large .horloge-main {
    grid-template-columns: 1fr;
    width: min(100%, 152px);
}

#widget-horloge.horloge-mode-digital.horloge-size-small .horloge-main,
#widget-horloge.horloge-mode-digital.horloge-size-medium .horloge-main,
#widget-horloge.horloge-mode-digital.horloge-size-large .horloge-main {
    grid-template-columns: 1fr;
    width: min(100%, 300px);
}

#widget-horloge.horloge-no-chrome {
    border: 0;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 0;
    min-width: 0;
    min-height: 0;
    width: auto;
    gap: 0;
    overflow: visible;
}

#widget-horloge.horloge-no-chrome::before {
    display: none;
}

#widget-horloge.horloge-no-chrome:hover {
    border-color: transparent;
    box-shadow: none;
}

#widget-horloge.horloge-no-chrome .horloge-header {
    display: none;
}

#widget-horloge.horloge-no-chrome .horloge-main {
    width: auto;
    margin: 0;
}

#widget-horloge.horloge-no-chrome.horloge-mode-analog .horloge-main {
    width: auto;
}

#widget-horloge.horloge-no-chrome.horloge-mode-digital .horloge-main {
    width: auto;
}

#widget-horloge.horloge-transparent-bg {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#widget-horloge.horloge-transparent-bg::before {
    border-color: rgba(191, 219, 254, 0.17);
}

#widget-horloge.horloge-transparent-bg:hover {
    border-color: rgba(125, 211, 252, 0.3);
}

@media (max-width: 580px) {
    #widget-horloge {
        right: 12px;
    }

    #widget-horloge.horloge-size-large,
    #widget-horloge.horloge-size-medium,
    #widget-horloge.horloge-size-small {
        width: min(calc(100vw - 24px), 344px);
    }
}

#widget-horloge.horloge-pulse {
    animation: horloge-pulse 0.65s ease-out;
}

@keyframes horloge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(191, 219, 254, 0.5);
    }

    100% {
        box-shadow: 0 0 0 16px rgba(191, 219, 254, 0);
    }
}

/* --- WIDGET YOUTUBE --- */
#widget-youtube {
    position: absolute;
    top: 520px;
    right: 24px;
    width: min(356px, calc(100vw - 36px));
    min-width: 280px;
    min-height: 260px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(251, 191, 36, 0.28);
    background:
        radial-gradient(circle at 14% 10%, rgba(251, 191, 36, 0.2), transparent 34%),
        radial-gradient(circle at 88% 88%, rgba(220, 38, 38, 0.2), transparent 40%),
        linear-gradient(155deg, rgba(24, 9, 9, 0.88), rgba(43, 16, 16, 0.82), rgba(17, 17, 17, 0.78));
    backdrop-filter: blur(14px) saturate(158%);
    -webkit-backdrop-filter: blur(14px) saturate(158%);
    box-shadow:
        0 20px 34px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: #fff7ed;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
    overflow: hidden;
}

#widget-youtube:hover {
    border-color: rgba(253, 186, 116, 0.6);
    box-shadow:
        0 26px 40px rgba(0, 0, 0, 0.42),
        0 0 0 1px rgba(251, 191, 36, 0.24);
}

.youtube-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.youtube-title-wrap {
    min-width: 0;
}

.youtube-title {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-weight: 800;
    color: #fef3c7;
}

.youtube-subtitle {
    margin-top: 2px;
    font-size: 0.66rem;
    opacity: 0.8;
}

.youtube-cloud-badge {
    align-self: center;
    border: 1px solid rgba(253, 186, 116, 0.44);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    background: rgba(251, 191, 36, 0.16);
    color: #fde68a;
    white-space: nowrap;
}

.youtube-library-row,
.youtube-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.youtube-url-input,
.youtube-list-name-input,
.youtube-list-select {
    height: 34px;
    border: 1px solid rgba(253, 186, 116, 0.28);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.44);
    color: #fffbeb;
    font-size: 0.76rem;
    padding: 0 10px;
    outline: none;
}

.youtube-list-select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #fef3c7 50%),
        linear-gradient(135deg, #fef3c7 50%, transparent 50%);
    background-position:
        calc(100% - 16px) calc(50% - 3px),
        calc(100% - 11px) calc(50% - 3px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 24px;
    cursor: pointer;
}

.youtube-url-input::placeholder,
.youtube-list-name-input::placeholder {
    color: rgba(255, 251, 235, 0.48);
}

.youtube-url-input:focus,
.youtube-list-name-input:focus,
.youtube-list-select:focus {
    border-color: rgba(253, 186, 116, 0.8);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.youtube-btn {
    border: 1px solid rgba(253, 186, 116, 0.35);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fef3c7;
    background: rgba(120, 53, 15, 0.4);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.youtube-btn:hover:enabled {
    background: rgba(146, 64, 14, 0.58);
    border-color: rgba(253, 186, 116, 0.64);
}

.youtube-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.youtube-btn.danger {
    border-color: rgba(248, 113, 113, 0.4);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.36);
}

.youtube-btn.danger:hover:enabled {
    background: rgba(153, 27, 27, 0.56);
    border-color: rgba(248, 113, 113, 0.66);
}

.youtube-status {
    min-height: 18px;
    font-size: 0.68rem;
    opacity: 0.88;
    color: rgba(255, 251, 235, 0.88);
}

.youtube-status[data-state="success"] {
    color: #bbf7d0;
}

.youtube-status[data-state="warning"] {
    color: #fde68a;
}

.youtube-status[data-state="error"] {
    color: #fecaca;
}

.youtube-player-shell {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(253, 186, 116, 0.24);
    background: rgba(2, 6, 23, 0.48);
    aspect-ratio: 16 / 9;
}

.youtube-player-host,
.youtube-player-host iframe {
    width: 100%;
    height: 100%;
}

.youtube-player-host iframe {
    border: none;
    display: block;
    background: #000;
}

.youtube-player-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 12px;
    font-size: 0.72rem;
    color: rgba(255, 251, 235, 0.78);
    background:
        linear-gradient(165deg, rgba(120, 53, 15, 0.28), rgba(127, 29, 29, 0.22)),
        rgba(2, 6, 23, 0.7);
}

.youtube-toolbar {
    display: grid;
    gap: 6px;
}

.youtube-toolbar-main {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.youtube-toolbar-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.youtube-playlist {
    flex: 1;
    min-height: 94px;
    max-height: 170px;
    overflow-y: auto;
    border: 1px solid rgba(253, 186, 116, 0.2);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.38);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.youtube-empty {
    padding: 8px;
    text-align: center;
    font-size: 0.72rem;
    opacity: 0.75;
}

.youtube-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    align-items: stretch;
}

.youtube-item-main {
    border: 1px solid rgba(253, 186, 116, 0.22);
    border-radius: 9px;
    background: rgba(2, 6, 23, 0.42);
    color: #fffbeb;
    cursor: pointer;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    text-align: left;
}

.youtube-item-main:hover {
    border-color: rgba(253, 186, 116, 0.5);
    background: rgba(120, 53, 15, 0.26);
}

.youtube-item.is-active .youtube-item-main {
    border-color: rgba(253, 186, 116, 0.74);
    background: rgba(146, 64, 14, 0.36);
    box-shadow: 0 0 0 1px rgba(253, 186, 116, 0.26);
}

.youtube-item-index {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 0.66rem;
    font-weight: 800;
    background: rgba(251, 191, 36, 0.22);
    color: #fde68a;
}

.youtube-item-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.youtube-item-text strong {
    font-size: 0.72rem;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.youtube-item-text small {
    font-size: 0.62rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.youtube-item-remove {
    border: 1px solid rgba(248, 113, 113, 0.4);
    border-radius: 8px;
    background: rgba(127, 29, 29, 0.4);
    color: #fecaca;
    width: 28px;
    min-width: 28px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.youtube-item-remove:hover {
    border-color: rgba(248, 113, 113, 0.66);
    background: rgba(153, 27, 27, 0.62);
}

#widget-youtube.youtube-pulse {
    animation: youtube-pulse 0.65s ease-out;
}

@keyframes youtube-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.45);
    }

    100% {
        box-shadow: 0 0 0 18px rgba(251, 191, 36, 0);
    }
}

@media (max-width: 620px) {
    #widget-youtube {
        right: 12px;
        width: min(calc(100vw - 24px), 360px);
    }
}

/* --- WIDGET MENDELEIEV --- */
#widget-mendeleiev {
    position: absolute;
    left: 24px;
    bottom: 74px;
    width: min(840px, calc(100vw - 48px));
    min-width: 520px;
    min-height: 320px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    background:
        radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.2), transparent 32%),
        radial-gradient(circle at 88% 86%, rgba(168, 85, 247, 0.16), transparent 38%),
        linear-gradient(155deg, rgba(5, 9, 27, 0.9), rgba(9, 25, 48, 0.82), rgba(8, 27, 51, 0.74));
    backdrop-filter: blur(16px) saturate(158%);
    -webkit-backdrop-filter: blur(16px) saturate(158%);
    box-shadow:
        0 24px 42px rgba(2, 6, 23, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    user-select: none;
    overflow: hidden;
    --mende-tilt-x: 0deg;
    --mende-tilt-y: 0deg;
}

#widget-mendeleiev::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

#widget-mendeleiev:hover {
    border-color: rgba(125, 211, 252, 0.56);
    box-shadow:
        0 28px 46px rgba(2, 6, 23, 0.5),
        0 0 0 1px rgba(56, 189, 248, 0.16);
}

.mendeleiev-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.mendeleiev-title-wrap {
    min-width: 0;
}

.mendeleiev-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 800;
    color: #bfdbfe;
}

.mendeleiev-subtitle {
    margin-top: 3px;
    font-size: 0.68rem;
    opacity: 0.76;
}

.mendeleiev-search {
    width: min(280px, 100%);
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    font-size: 0.75rem;
    padding: 0 12px;
}

.mendeleiev-search::placeholder {
    color: rgba(203, 213, 225, 0.6);
}

.mendeleiev-search:focus {
    outline: none;
    border-color: rgba(56, 189, 248, 0.72);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.mendeleiev-stage {
    flex: 1;
    min-height: 190px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(2, 6, 23, 0.43);
    overflow: auto;
    padding: 10px;
    perspective: 1200px;
}

.mendeleiev-board {
    width: max-content;
    margin: 0 auto;
    transform-style: preserve-3d;
    transform: rotateX(var(--mende-tilt-x)) rotateY(var(--mende-tilt-y));
    transition: transform 130ms linear;
}

.mendeleiev-grid {
    --m-cell-size: 42px;
    --m-row-size: 54px;
    display: grid;
    grid-template-columns: repeat(18, var(--m-cell-size));
    grid-template-rows: repeat(9, var(--m-row-size));
    gap: 4px;
}

.mendeleiev-card,
.mendeleiev-series-tag {
    grid-column: var(--m-col);
    grid-row: var(--m-row);
}

.mendeleiev-card {
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 8px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.72)),
        linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.95));
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow:
        0 7px 12px rgba(2, 6, 23, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease,
        filter 0.2s ease;
    transform-style: preserve-3d;
    transform: translateZ(0);
    overflow: hidden;
}

.mendeleiev-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--m-accent, #38bdf8);
    opacity: 0.9;
}

.mendeleiev-card:hover {
    transform: translateY(-2px) translateZ(16px);
    border-color: rgba(186, 230, 253, 0.75);
    box-shadow:
        0 16px 24px rgba(2, 6, 23, 0.5),
        0 0 0 1px color-mix(in srgb, var(--m-accent, #38bdf8) 65%, transparent);
}

.mendeleiev-card.is-active {
    border-color: color-mix(in srgb, var(--m-accent, #38bdf8) 84%, #ffffff 16%);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--m-accent, #38bdf8) 72%, transparent),
        0 16px 24px rgba(2, 6, 23, 0.42);
}

.mendeleiev-card.is-muted {
    opacity: 0.22;
    filter: grayscale(0.7);
}

.mendeleiev-card.is-match {
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.55),
        0 12px 22px rgba(2, 6, 23, 0.35);
}

.mendeleiev-num {
    font-size: 0.53rem;
    font-weight: 700;
    opacity: 0.82;
}

.mendeleiev-sym {
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.mendeleiev-name {
    max-width: 100%;
    font-size: 0.44rem;
    opacity: 0.74;
    padding: 0 4px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.mendeleiev-series-tag {
    border: 1px dashed rgba(148, 163, 184, 0.4);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.67rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.72);
    background: rgba(15, 23, 42, 0.4);
}

.mendeleiev-series-tag.is-lan {
    grid-column: 1 / span 3;
}

.mendeleiev-series-tag.is-act {
    grid-column: 1 / span 3;
}

.mendeleiev-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.mendeleiev-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.mendeleiev-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 2px 8px 2px 6px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.28);
    white-space: nowrap;
}

.mendeleiev-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--m-accent, #38bdf8);
    box-shadow: 0 0 8px color-mix(in srgb, var(--m-accent, #38bdf8) 65%, transparent);
}

.mendeleiev-details {
    min-width: 220px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    padding: 7px 10px;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    gap: 10px;
}

.mendeleiev-details-symbol {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(125, 211, 252, 0.5);
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: #e0f2fe;
    background: radial-gradient(circle at 28% 22%, rgba(56, 189, 248, 0.24), rgba(15, 23, 42, 0.72));
}

.mendeleiev-details-main {
    min-width: 0;
}

.mendeleiev-details-name {
    font-size: 0.83rem;
    font-weight: 800;
    line-height: 1.2;
}

.mendeleiev-details-meta {
    margin-top: 2px;
    font-size: 0.63rem;
    opacity: 0.8;
    line-height: 1.25;
}

#widget-mendeleiev.mendeleiev-pulse {
    animation: mendeleiev-pulse 0.68s ease-out;
}

@keyframes mendeleiev-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.45);
    }

    100% {
        box-shadow: 0 0 0 20px rgba(56, 189, 248, 0);
    }
}

@media (max-width: 920px) {
    #widget-mendeleiev {
        left: 12px;
        width: min(calc(100vw - 24px), 820px);
        min-width: 360px;
    }

    .mendeleiev-grid {
        --m-cell-size: 38px;
        --m-row-size: 50px;
    }
}

@media (max-width: 640px) {
    .mendeleiev-footer {
        grid-template-columns: 1fr;
    }

    .mendeleiev-details {
        min-width: 0;
    }

    .mendeleiev-grid {
        --m-cell-size: 34px;
        --m-row-size: 46px;
    }

    .mendeleiev-sym {
        font-size: 0.82rem;
    }

    .mendeleiev-name {
        display: none;
    }
}

.widget-managed-hidden {
    display: none !important;
}

.widget-managed-focus {
    animation: widgetManagedFocusPulse 0.72s ease-out;
}

@keyframes widgetManagedFocusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.6);
    }

    100% {
        box-shadow: 0 0 0 18px rgba(56, 189, 248, 0);
    }
}

/* --- WIDGET VERSION --- */
#widget-version {
    position: absolute;
    bottom: 74px;
    right: 24px;
    width: min(240px, calc(100vw - 36px));
    min-height: 110px;
    padding: 12px 14px;
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.78));
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
    color: #e2e8f0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: none;
}

#widget-version:hover {
    border-color: rgba(147, 197, 253, 0.62);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
}

.version-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.version-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.75;
    font-weight: 800;
}

.version-copy-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.version-copy-btn:hover {
    background: rgba(148, 163, 184, 0.24);
    border-color: rgba(191, 219, 254, 0.62);
}

.version-number {
    font-size: 1.02rem;
    line-height: 1.2;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.01em;
}

.version-meta {
    font-size: 0.72rem;
    opacity: 0.76;
}

/* --- WIDGET POST-IT --- */
.widget-postit {
    position: absolute;
    top: 420px;
    /* Sous l'agenda */
    right: 24px;
    width: 240px;
    height: 240px;
    --postit-bg: #fef9c3;
    --postit-text: #713f12;
    --postit-border: rgba(113, 63, 18, 0.18);
    --postit-placeholder: rgba(113, 63, 18, 0.35);
    --postit-line: rgba(113, 63, 18, 0.18);
    --postit-font-size: 15px;
    background: var(--postit-bg);
    color: var(--postit-text);
    border-radius: 8px 4px 10px 6px;
    box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    z-index: 5;
    display: flex;
    flex-direction: column;
    transform: rotate(-1.1deg);
    transition: all 0.2s ease;
    border: 1px solid var(--postit-border);
    overflow: hidden;
}

.widget-postit:hover {
    transform: rotate(0deg) scale(1.015);
    box-shadow: 0 20px 26px -10px rgba(0, 0, 0, 0.35), 0 12px 14px -10px rgba(0, 0, 0, 0.25);
    z-index: 6;
}

.postit-hidden {
    display: none !important;
}

.postit-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 2px 14px;
}

.postit-header {
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.56;
    cursor: default;
}

.postit-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.postit-btn {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    background: rgba(255, 255, 255, 0.34);
    border-radius: 7px;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.postit-btn:hover,
.postit-btn.is-active {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.24);
}

.postit-settings {
    margin: 4px 10px 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.postit-setting-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    opacity: 0.7;
    letter-spacing: 0.8px;
}

.postit-colors {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.postit-color-btn {
    height: 18px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    cursor: pointer;
}

.postit-color-btn.is-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.35);
}

.postit-setting-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

.postit-range {
    width: 100%;
}

.postit-range-value {
    font-size: 0.66rem;
    opacity: 0.75;
}

.postit-check-row {
    grid-template-columns: 1fr auto;
}

.postit-delete-btn {
    border: 1px solid rgba(127, 29, 29, 0.25);
    background: rgba(255, 255, 255, 0.55);
    color: #7f1d1d;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.postit-delete-btn:hover {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(127, 29, 29, 0.4);
}

.postit-content {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    resize: none;
    padding: 6px 14px 8px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    font-size: var(--postit-font-size);
    line-height: 1.5;
    color: inherit;
    outline: none;
}

.postit-content::placeholder {
    color: var(--postit-placeholder);
}

.widget-postit.postit-lined .postit-content {
    background-image: repeating-linear-gradient(to bottom,
            transparent,
            transparent 25px,
            var(--postit-line) 25px,
            var(--postit-line) 26px);
    background-attachment: local;
}

.postit-footer {
    padding: 3px 10px 8px 12px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.63rem;
    opacity: 0.66;
}

.postit-font-label strong {
    font-weight: 800;
}

#widget-postit-launcher {
    position: absolute;
    right: 24px;
    top: 420px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background:
        radial-gradient(circle at 26% 22%, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0) 52%),
        linear-gradient(155deg, rgba(15, 23, 42, 0.78), rgba(30, 41, 59, 0.72));
    backdrop-filter: blur(14px) saturate(155%);
    -webkit-backdrop-filter: blur(14px) saturate(155%);
    color: #fff;
    box-shadow:
        0 12px 24px rgba(2, 6, 23, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    z-index: 5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    touch-action: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#widget-postit-launcher .postit-launcher-icon {
    font-size: 1.28rem;
    line-height: 1;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

#widget-postit-launcher:focus-visible {
    outline: 2px solid rgba(125, 211, 252, 0.72);
    outline-offset: 2px;
}

#widget-postit-launcher.has-hidden {
    border-color: rgba(251, 113, 133, 0.55);
    box-shadow:
        0 14px 26px rgba(127, 29, 29, 0.22),
        0 0 0 1px rgba(251, 113, 133, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#widget-postit-launcher[data-hidden-count]::after {
    content: attr(data-hidden-count);
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 19px;
    height: 19px;
    border-radius: 999px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    font-size: 0.64rem;
    font-weight: 800;
    color: #fff;
    background: #ef4444;
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
}

#widget-postit-launcher:hover {
    transform: translateY(-2px);
    border-color: rgba(147, 197, 253, 0.52);
    box-shadow:
        0 16px 30px rgba(2, 6, 23, 0.4),
        0 0 0 1px rgba(147, 197, 253, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

#widget-postit-launcher.is-dragging {
    cursor: grabbing;
    transform: none;
}

.widget-postit.postit-pulse {
    animation: postitPulse 0.65s ease-out;
}

@keyframes postitPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.55);
    }

    100% {
        box-shadow: 0 0 0 16px rgba(250, 204, 21, 0);
    }
}

/* --- LECTEUR MUSIQUE --- */
/* Styles spécifiques si nécessaire, mais la plupart sont injectés via JS */
.fenetre[data-id-app="lecteur_musique"] .fenetre-contenu {
    background: #16213e;
    color: white;
}

/* --- WIDGETS INTERACTIFS --- */
.widget-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    z-index: 20;
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.2) 50%);
    border-bottom-right-radius: 18px;
}

.widget-resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.5) 50%);
}

.is-dragging {
    transition: none !important;
    transform: scale(1.02) !important;
    z-index: 100 !important;
    cursor: grabbing !important;
}

.is-resizing {
    transition: none !important;
}

.settings-section-focus {
    outline: 1px solid rgba(96, 165, 250, 0.7);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
    transition: box-shadow 0.25s ease, outline-color 0.25s ease;
}

/* --- CENTRE DE NOTIFICATIONS --- */
#centre-notifications {
    position: absolute;
    bottom: 60px;
    right: 12px;
    width: 320px;
    max-height: calc(100% - 80px);
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

#centre-notifications.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.notif-center-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-center-title {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.notif-center-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    position: relative;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notif-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.notif-item-app {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.notif-item-body {
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
}

.notif-empty {
    text-align: center;
    padding: 40px 0;
    opacity: 0.5;
    font-size: 13px;
    color: #fff;
}
