.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    border: 0;
}
body.menu-open .ie-chat {
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    z-index: 40;
}
.ie-chat {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 70;
    font-family: Inter, system-ui, sans-serif;
    color: #17202a;
}
.ie-chat-launcher {
    display: grid;
    justify-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: #10263b;
    font: 700 0.72rem/1 Inter, system-ui, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.ie-chat-launcher-avatar {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.ie-chat-launcher img {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 50%;
    background: #0b1220;
    border: 3px solid #ead9bd;
    box-shadow: 0 10px 28px rgba(16, 38, 59, .28);
    transition: transform .18s ease, box-shadow .18s ease;
}
.ie-chat-online {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(16, 38, 59, .18), 0 2px 6px rgba(34, 197, 94, .45);
    z-index: 1;
    pointer-events: none;
    animation: ieChatOnlinePulse 2.8s ease-in-out infinite;
}
@keyframes ieChatOnlinePulse {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(16, 38, 59, .18), 0 2px 6px rgba(34, 197, 94, .45);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(16, 38, 59, .18), 0 2px 8px rgba(34, 197, 94, .6), 0 0 0 3px rgba(34, 197, 94, .12);
    }
}
.ie-chat-launcher:hover img,
.ie-chat-launcher:focus-visible img {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 14px 32px rgba(125, 43, 35, .28);
    outline: 0;
}
.ie-chat-launcher-label {
    background: #10263b;
    color: #fbead8;
    padding: 4px 10px;
    border-radius: 999px;
}
.ie-chat.is-open .ie-chat-launcher { display: none; }
.ie-chat-panel[hidden] { display: none !important; }
.ie-chat-panel {
    width: min(400px, calc(100vw - 28px));
    height: min(620px, calc(100vh - 36px));
    background: #fbead8;
    border: 1px solid #e4d8c4;
    border-radius: 22px;
    box-shadow: 0 22px 60px rgba(16, 38, 59, .28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.ie-chat-head {
    display: grid;
    grid-template-columns: 44px 1fr 36px;
    gap: 10px;
    align-items: center;
    background: #10263b;
    color: #f8efe1;
    padding: 12px 12px 12px 14px;
}
.ie-chat-head img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 50%;
    background: #0b1220;
    border: 2px solid #c9a24a;
}
.ie-chat-head strong {
    display: block;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.05rem;
}
.ie-chat-head span {
    display: block;
    font-size: 0.72rem;
    letter-spacing: .04em;
    color: #ead9bd;
    margin-top: 2px;
}
.ie-chat-x {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fbead8;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.ie-chat-x:hover { background: rgba(255,255,255,.08); }
.ie-chat-thread {
    flex: 1;
    overflow: auto;
    padding: 14px 12px 8px;
    display: grid;
    align-content: start;
    gap: 12px;
    background:
        radial-gradient(circle at 90% 0, rgba(201,162,74,.12), transparent 40%),
        #f7f1e6;
}
.ie-chat-msg {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}
.ie-chat-msg.is-user {
    grid-template-columns: minmax(0, 1fr);
    justify-items: end;
}
.ie-chat-msg img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: #10263b;
}
.ie-chat-bubble {
    background: #fff;
    border: 1px solid #e4d8c4;
    border-radius: 4px 16px 16px 16px;
    padding: 10px 12px;
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 100%;
}
.ie-chat-msg.is-user .ie-chat-bubble {
    background: #10263b;
    color: #f8efe1;
    border-color: #10263b;
    border-radius: 16px 16px 4px 16px;
}
.ie-chat-bubble p { margin: 0 0 8px; }
.ie-chat-bubble p:last-child { margin-bottom: 0; }
.ie-chat-bubble ul { margin: 8px 0; padding-left: 1.1rem; }
.ie-chat-bubble li { margin: 0 0 6px; }
.ie-chat-meta { color: #5a564c; font-size: 0.84rem; }
.ie-chat-from { font-size: 0.78rem; color: #7d2b23; font-weight: 600; }
.ie-chat-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.ie-chat-sources a {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    background: #efe3cc;
    color: #10263b;
    font-size: 0.74rem;
    font-weight: 700;
    text-decoration: none;
}
.ie-chat-sources a:hover { background: #e4d4b0; }
.ie-chat-typing {
    display: flex;
    gap: 5px;
    padding: 10px 12px;
    width: fit-content;
}
.ie-chat-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #7d2b23;
    animation: ieChatDot 1s infinite ease-in-out;
}
.ie-chat-typing i:nth-child(2) { animation-delay: .15s; }
.ie-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ieChatDot {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}
.ie-chat-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 0;
}
.ie-chat-suggest button {
    border: 1px solid #d9cbb6;
    background: #fff;
    color: #10263b;
    border-radius: 999px;
    padding: 5px 10px;
    font: 600 0.76rem Inter, system-ui, sans-serif;
    cursor: pointer;
}
.ie-chat-suggest button:hover { border-color: #7d2b23; color: #7d2b23; }
.ie-chat-form {
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 8px;
    padding: 10px 12px 6px;
    align-items: end;
}
.ie-chat-form textarea {
    width: 100%;
    resize: none;
    min-height: 42px;
    max-height: 110px;
    border: 1px solid #d9cbb6;
    border-radius: 14px;
    padding: 10px 12px;
    font: inherit;
    background: #fff;
    color: #17202a;
}
.ie-chat-send {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #7d2b23;
    color: #fbead8;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.ie-chat-send:hover { background: #10263b; }
.ie-chat-send:disabled { opacity: .5; cursor: wait; }
.ie-chat-foot {
    margin: 0;
    padding: 0 14px 10px;
    font-size: 0.7rem;
    color: #5a564c;
    text-align: center;
}
.ie-chat-err { color: #7d2b23; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
    .ie-chat-launcher img, .ie-chat-typing i, .ie-chat-online { transition: none; animation: none; }
}
