/* Agent Gustave – widget flottant */
.gustave-agent {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 999;
    pointer-events: none;
}
.gustave-agent * {
    pointer-events: auto;
}
.gustave-agent__head {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    z-index: 2;
    cursor: pointer;
    transition: transform var(--ga-wake-speed, 0.25s) ease-out;
    transform-origin: bottom center;
}
.gustave-agent__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    user-select: none;
}
.gustave-agent.awake .gustave-agent__head {
    transform: translateY(0);
    /* Suit le recalcul JS (clavier) en douceur */
    transition:
        bottom 0.2s ease-out,
        transform var(--ga-wake-speed, 0.25s) ease-out;
}
.gustave-agent__bubble-wrap {
    position: fixed;
    /* Position : marges via variables (--ga-bubble-*) injectées depuis les paramètres Agent Gustave */
    left: var(--ga-bubble-left, auto);
    right: var(--ga-bubble-right, 50px);
    bottom: var(--ga-bubble-bottom, 100px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
}
.gustave-agent.awake .gustave-agent__bubble-wrap {
    opacity: 1;
    visibility: visible;
}
.gustave-agent__close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(53,39,26,0.15);
    color: var(--primary-brown, #35271A);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}
.gustave-agent__close:hover {
    background: rgba(53,39,26,0.25);
}
.gustave-agent__divider {
    width: 100%;
    height: 2px;
    background: rgba(53,39,26,0.15);
    flex-shrink: 0;
}
.gustave-agent__bubble {
    position: relative;
    width: var(--ga-bubble-w, 280px);
    min-height: var(--ga-bubble-min-height, var(--ga-bubble-height, 200px));
    max-height: var(--ga-bubble-max-height, min(60vh, 100dvh));
    padding: var(--ga-bubble-padding, 18px);
    background: var(--ga-bubble-bg, rgba(255,249,240,0.95));
    color: var(--ga-bubble-text, #35271A);
    font-family: var(--ga-bubble-font, 'Nunito', sans-serif);
    font-size: 0.95rem;
    border: var(--ga-bubble-border-width, 0) solid var(--ga-bubble-border-color, rgba(53,39,26,0.2));
    border-radius: 16px;
    box-shadow: 0 8px var(--ga-bubble-shadow-blur, 32px) var(--ga-bubble-shadow-spread, 0) rgba(53,39,26,var(--ga-bubble-shadow-opacity,0.15));
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.2s ease, visibility 0.2s, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}
.gustave-agent.awake .gustave-agent__bubble {
    opacity: var(--ga-bubble-opacity, 0.92);
    visibility: visible;
    transform: translateY(0) scale(1);
}
.gustave-agent__welcome {
    margin: 0;
    line-height: 1.4;
    color: inherit;
}
.gustave-agent__response {
    flex: 1 1 var(--ga-response-height, 60px);
    min-height: 0;
    min-width: var(--ga-response-width, 0);
    overflow-y: auto;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}
.gustave-agent__response:empty {
    display: none;
}
.gustave-agent__input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
    flex: 1;
    min-height: 0;
}
.gustave-agent__input {
    width: 100%;
    height: 100%;
    min-height: var(--ga-input-height, 60px);
    flex: 1;
    padding: var(--ga-input-padding, 14px);
    border: 1px solid rgba(53,39,26,0.2);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    background: rgba(255,255,255,0.95);
    resize: none;
    box-sizing: border-box;
}
.gustave-agent__input:focus {
    outline: none;
    border-color: rgba(53,39,26,0.4);
}
.gustave-agent__send {
    width: 100%;
    padding: 10px 14px;
    background: var(--primary-brown, #35271A);
    color: var(--cream, #FAF6EA);
    border: 0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.gustave-agent__send:hover {
    opacity: 0.9;
}
.gustave-agent__send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
