#tm-community-assistant,
#tm-community-assistant * {
    box-sizing: border-box;
}

#tm-community-assistant {
    --tm-community-primary: #ec4899;
    --tm-community-secondary: #8b5cf6;
    --tm-community-panel: #180923;
    --tm-community-bottom: 768px;
    position: fixed;
    right: 24px;
    bottom: 0;
    width: 0;
    height: 0;
    color: #fff;
    font-family: Inter, ui-rounded, "Segoe UI", Arial, sans-serif;
    line-height: 1.45;
    pointer-events: none;
    isolation: isolate;
}

#tm-community-assistant.tm-community--left {
    right: auto;
    left: 24px;
}

#tm-community-assistant .tm-community__launcher {
    position: fixed !important;
    right: 24px !important;
    left: auto !important;
    bottom: min(var(--tm-community-bottom), calc(100vh - 112px)) !important;
    width: 94px !important;
    min-width: 94px !important;
    max-width: 94px !important;
    height: 94px !important;
    min-height: 94px !important;
    max-height: 94px !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    cursor: pointer;
    pointer-events: auto;
    overflow: visible !important;
    transition: transform .2s ease;
    filter: none !important;
    box-shadow: none !important;
}

#tm-community-assistant.tm-community--left .tm-community__launcher {
    right: auto !important;
    left: 24px !important;
}

.tm-community__launcher:hover,
.tm-community__launcher:focus-visible {
    transform: scale(1.03);
    box-shadow: none !important;
    outline: none;
}

.tm-community__launcher:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .88);
    outline-offset: 3px;
}

#tm-community-assistant .tm-community__launcher > img {
    display: block;
    width: 94px !important;
    min-width: 94px !important;
    max-width: 94px !important;
    height: 94px !important;
    min-height: 94px !important;
    max-height: 94px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: contain;
    filter: drop-shadow(-5px 0 10px rgba(236, 72, 153, .58)) drop-shadow(5px 0 10px rgba(84, 94, 255, .58));
    transition: filter .2s ease, transform .2s ease;
    user-select: none;
    pointer-events: none;
}

#tm-community-assistant .tm-community__launcher:hover > img,
#tm-community-assistant .tm-community__launcher:focus-visible > img {
    filter: drop-shadow(-6px 0 11px rgba(236, 72, 153, .66)) drop-shadow(6px 0 11px rgba(84, 94, 255, .66));
}

.tm-community__pulse {
    display: none;
}

.tm-community__tooltip {
    position: absolute;
    top: 50%;
    right: calc(100% + 14px);
    width: max-content;
    max-width: min(430px, calc(100vw - 150px));
    padding: 9px 16px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: linear-gradient(#16081f, #16081f) padding-box, linear-gradient(90deg, var(--tm-community-primary), var(--tm-community-secondary)) border-box;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    transform: translate(8px, -50%);
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    box-shadow: 0 5px 14px rgba(0, 0, 0, .28), 0 0 4px rgba(236, 72, 153, .12);
}

.tm-community--left .tm-community__tooltip {
    right: auto;
    left: calc(100% + 14px);
}

.tm-community__launcher:hover .tm-community__tooltip,
.tm-community__launcher:focus-visible .tm-community__tooltip {
    opacity: 1;
    transform: translate(0, -50%);
    visibility: visible;
}

.tm-community__panel {
    position: absolute;
    right: 116px;
    bottom: 112px;
    display: flex;
    flex-direction: column;
    width: min(430px, calc(100vw - 166px));
    max-height: min(700px, calc(100vh - 142px));
    border: 2px solid transparent;
    border-radius: 28px;
    background: linear-gradient(var(--tm-community-panel), var(--tm-community-panel)) padding-box, linear-gradient(135deg, var(--tm-community-primary) 0%, #d946ef 48%, var(--tm-community-secondary) 100%) border-box;
    box-shadow: 0 30px 80px rgba(12, 1, 18, .58), -11px 0 34px color-mix(in srgb, var(--tm-community-primary) 32%, transparent), 11px 0 34px color-mix(in srgb, var(--tm-community-secondary) 34%, transparent);
    overflow: hidden;
    pointer-events: auto;
    animation: tm-community-open .22s ease-out;
}

.tm-community__panel[hidden] {
    display: none;
}

.tm-community--left .tm-community__panel {
    right: auto;
    left: 116px;
}

.tm-community__header {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border-bottom: 1px solid color-mix(in srgb, var(--tm-community-primary) 46%, transparent);
    background: linear-gradient(110deg, color-mix(in srgb, var(--tm-community-primary) 31%, #24102f), color-mix(in srgb, var(--tm-community-secondary) 28%, #24102f));
}

.tm-community__avatar-ring {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .11), transparent 70%) padding-box, conic-gradient(from 210deg, var(--tm-community-primary), #f0abfc, var(--tm-community-secondary), var(--tm-community-primary)) border-box;
    box-shadow: inset 0 0 14px rgba(217, 70, 239, .2), -7px 0 18px color-mix(in srgb, var(--tm-community-primary) 58%, transparent), 7px 0 18px color-mix(in srgb, var(--tm-community-secondary) 58%, transparent);
}

.tm-community__header-avatar {
    width: 56px;
    height: 56px;
    border-radius: 0;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(-2px 0 5px rgba(236, 72, 153, .42)) drop-shadow(2px 0 5px rgba(84, 94, 255, .42));
}

.tm-community__identity {
    min-width: 0;
}

.tm-community__identity strong,
.tm-community__identity span {
    display: block;
}

.tm-community__identity strong {
    margin-bottom: 2px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 23px;
    line-height: 1.08;
    color: #fff;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: #fff;
    text-shadow: 0 0 7px rgba(255, 255, 255, .08);
}

.tm-community__identity span {
    color: #f9ddf0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

#tm-community-assistant .tm-community__header .tm-community__close {
    display: grid !important;
    flex: 0 0 42px !important;
    place-items: center !important;
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin: 0 !important;
    padding: 0 !important;
    appearance: none !important;
    border: 1px solid var(--tm-community-secondary) !important;
    border-radius: 50% !important;
    background: rgba(139, 92, 246, .09) !important;
    box-shadow: 0 0 8px rgba(139, 92, 246, .2) !important;
    color: #fff !important;
    cursor: pointer;
}

#tm-community-assistant .tm-community__header .tm-community__close:hover,
#tm-community-assistant .tm-community__header .tm-community__close:focus-visible {
    border-color: var(--tm-community-primary) !important;
    background: rgba(236, 72, 153, .16) !important;
    box-shadow: 0 0 10px rgba(236, 72, 153, .28) !important;
    outline: none;
}

#tm-community-assistant .tm-community__header .tm-community__close svg,
.tm-community__privacy svg {
    width: 21px !important;
    height: 21px !important;
    fill: currentColor !important;
}

.tm-community__body {
    flex: 1;
    min-height: 0;
    padding: 16px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--tm-community-secondary) rgba(255, 255, 255, .07);
}

.tm-community__messages,
.tm-community__choices {
    display: grid;
    gap: 10px;
}

.tm-community__choices {
    margin-top: 12px;
}

.tm-community__message {
    width: fit-content;
    max-width: 94%;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 16px 16px 16px 5px;
    background: rgba(255, 255, 255, .10);
    color: #fff;
    font-size: 14px;
}

.tm-community__message--strong {
    border-color: transparent;
    background: linear-gradient(115deg, rgba(72, 16, 82, .96), rgba(39, 19, 79, .96)) padding-box,
        linear-gradient(115deg, var(--tm-community-primary), #ff89c7 42%, var(--tm-community-secondary)) border-box;
    color: #fff1fa;
    font-weight: 700;
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--tm-community-primary) 82%, white),
        inset -4px 0 0 color-mix(in srgb, var(--tm-community-secondary) 82%, white),
        0 0 18px rgba(139, 92, 246, .12);
}

.tm-community__choice {
    position: relative;
    display: block;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 11px 42px 11px 14px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: linear-gradient(color-mix(in srgb, var(--tm-community-panel) 93%, white), color-mix(in srgb, var(--tm-community-panel) 93%, white)) padding-box, linear-gradient(90deg, var(--tm-community-primary), var(--tm-community-secondary)) border-box;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.tm-community__choice::after {
    content: "›";
    position: absolute;
    top: 50%;
    right: 15px;
    font-size: 20px;
    transform: translateY(-52%);
}

.tm-community__choice:hover,
.tm-community__choice:focus-visible {
    color: #fff;
    outline: 2px solid rgba(255, 255, 255, .72);
    outline-offset: 2px;
    transform: translateY(-1px);
}

.tm-community__choice--pink {
    border-color: color-mix(in srgb, var(--tm-community-primary) 82%, white);
    color: #ff8fc9;
    background: linear-gradient(90deg, rgba(62, 13, 52, .96), rgba(31, 12, 43, .96));
    box-shadow: inset 4px 0 0 var(--tm-community-primary), 0 0 14px rgba(236, 72, 153, .11);
}

.tm-community__choice--violet {
    border-color: color-mix(in srgb, var(--tm-community-secondary) 82%, white);
    color: #c3a9ff;
    background: linear-gradient(90deg, rgba(31, 16, 62, .96), rgba(27, 11, 43, .96));
    box-shadow: inset 4px 0 0 var(--tm-community-secondary), 0 0 14px rgba(139, 92, 246, .13);
}

.tm-community__choice--pink::after {
    color: #ff8fc9;
}

.tm-community__choice--violet::after {
    color: #c3a9ff;
}

.tm-community__choice--back::before {
    content: "←";
    margin-right: 8px;
}

.tm-community__card {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 14px;
    background: rgba(255, 255, 255, .075);
    color: #fff;
    text-decoration: none;
}

.tm-community__card strong {
    color: #fff;
    font-size: 13px;
}

.tm-community__card span {
    color: #f5cce6;
    font-size: 12px;
    overflow-wrap: anywhere;
}

a.tm-community__card:hover,
a.tm-community__card:focus-visible {
    border-color: var(--tm-community-primary);
    color: #fff;
    outline: none;
    box-shadow: inset 3px 0 0 var(--tm-community-primary), inset -3px 0 0 var(--tm-community-secondary);
}

.tm-community__card.is-unconfigured {
    border-style: dashed;
    opacity: .68;
    cursor: default;
}

.tm-community__privacy {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 0;
    padding: 11px 16px 13px;
    border-top: 1px solid rgba(255, 255, 255, .09);
    color: #d9c7e1;
    font-size: 10px;
    line-height: 1.35;
}

.tm-community__privacy svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    color: var(--tm-community-secondary);
}

@keyframes tm-community-pulse {
    0%, 100% { transform: scale(.92); opacity: .66; }
    50% { transform: scale(1.1); opacity: .22; }
}

@keyframes tm-community-open {
    from { opacity: 0; transform: translateX(16px) scale(.97); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 720px) {
    #tm-community-assistant {
        right: 10px;
    }

    #tm-community-assistant.tm-community--left {
        right: auto;
        left: 10px;
    }

    #tm-community-assistant .tm-community__launcher {
        right: 10px !important;
        width: 78px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        height: 78px !important;
        min-height: 78px !important;
        max-height: 78px !important;
    }

    #tm-community-assistant.tm-community--left .tm-community__launcher {
        right: auto !important;
        left: 10px !important;
    }

    #tm-community-assistant .tm-community__launcher > img {
        width: 78px !important;
        min-width: 78px !important;
        max-width: 78px !important;
        height: 78px !important;
        min-height: 78px !important;
        max-height: 78px !important;
    }

    .tm-community__panel,
    .tm-community--left .tm-community__panel {
        right: 90px;
        left: auto;
        bottom: 12px;
        width: calc(100vw - 112px);
        min-width: 270px;
        max-height: calc(100vh - 24px);
        border-radius: 23px;
    }

    .tm-community--left .tm-community__panel {
        right: auto;
        left: 90px;
    }

    .tm-community__tooltip {
        display: none;
    }

    .tm-community__header {
        grid-template-columns: 56px minmax(0, 1fr) 40px;
        gap: 9px;
        padding: 12px;
    }

    .tm-community__avatar-ring {
        width: 54px;
        height: 54px;
    }

    .tm-community__header-avatar {
        width: 48px;
        height: 48px;
    }

    .tm-community__identity strong {
        font-size: 20px;
    }

    .tm-community__body {
        padding: 13px;
    }
}

@media (max-width: 430px) {
    .tm-community__panel,
    .tm-community--left .tm-community__panel {
        right: 8px;
        left: auto;
        bottom: 102px;
        width: calc(100vw - 16px);
        min-width: 0;
        max-height: calc(100vh - 120px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-community__launcher,
    .tm-community__tooltip,
    .tm-community__panel {
        transition: none;
        animation: none;
    }
}

/*
 * 1.0.6 - Transparence stricte du lanceur.
 * Le panneau ouvert conserve son fond afin de garantir la lisibilité.
 */
#tm-community-assistant,
#tm-community-assistant .tm-community__launcher,
#tm-community-assistant .tm-community__launcher:hover,
#tm-community-assistant .tm-community__launcher:focus,
#tm-community-assistant .tm-community__launcher:focus-visible,
#tm-community-assistant .tm-community__launcher:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

#tm-community-assistant .tm-community__launcher::before,
#tm-community-assistant .tm-community__launcher::after,
#tm-community-assistant .tm-community__launcher > img {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    mix-blend-mode: normal !important;
    opacity: 1 !important;
}

#tm-community-assistant .tm-community__pulse {
    display: none !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    opacity: 0 !important;
    animation: none !important;
}

/* 1.1.0 - Aucun lanceur incomplet avant le décodage des WebP. */
#tm-community-assistant:not(.tm-assets-ready) .tm-community__launcher {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

#tm-community-assistant.tm-assets-ready .tm-community__launcher {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
