/* ===========================================================================
   Floating chat: a launcher in the corner and a panel above the page, on every public page.
   The panel keeps the chatbot's own parts (bar, log, input); these rules only place it and size it.
   =========================================================================== */

.chat-launch {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 60;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 28px rgba(20, 69, 111, .35);
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}
.chat-launch:hover { background: var(--accent-dark); transform: translateY(-2px); }
.chat-launch:focus-visible { outline: 3px solid #9cc9f0; outline-offset: 3px; }
.chat-launch[hidden] { display: none; }
.chat-launch svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.chat-launch[aria-expanded="true"] { background: var(--ink-soft); }

.chat-panel {
    position: fixed;
    right: 1.25rem;
    bottom: 5.5rem;
    z-index: 61;
    width: min(400px, calc(100vw - 2.5rem));
    height: min(620px, calc(100vh - 7.5rem));
    max-width: none;
    margin: 0;
    background: var(--paper);
    border: 1px solid #dbe4ee;
    box-shadow: 0 24px 60px rgba(28, 62, 110, .22);
}
.chat-panel[hidden] { display: none; }

.chat-panel .chatbot-headline { font-size: .8rem; line-height: 1.3; font-weight: 500; }
.chat-panel .chatbot-bar { flex-wrap: wrap; }

.chat-close {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-left: auto;
    padding: 0;
    border: 1px solid #d5dde6;
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
}
.chat-close:hover { background: #eef3f9; color: var(--accent); }
.chat-close svg { width: .9rem; height: .9rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@media (max-width: 560px) {
    .chat-panel {
        inset: 0;
        width: auto;
        height: auto;
        border: 0;
        border-radius: 0;
    }
    .chat-launch { right: 1rem; bottom: 1rem; }
}
