.oph-chat {
    position: fixed;
    inset-inline-end: max(16px, env(safe-area-inset-right));
    inset-block-end: max(16px, env(safe-area-inset-bottom));
    z-index: 9000;
    font: 400 16px/1.5 system-ui, sans-serif;
    color: #2d2442;
}
.oph-chat [hidden] { display: none !important; }
.oph-chat button { font: inherit; cursor: pointer; }
.oph-chat :is(button, input, a):focus-visible { outline: 3px solid #ad3983; outline-offset: 3px; }
.oph-chat-launch,
.oph-chat form button {
    border: 0;
    border-radius: 9px;
    background: #79235b;
    color: #fff;
    min-height: 44px;
    padding: 8px 14px;
}
.oph-chat-launch { box-shadow: 0 4px 20px #23183b40; font-weight: 650 !important; }
.oph-chat-panel {
    position: absolute;
    inset-inline-end: 0;
    inset-block-end: 56px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(390px, calc(100vw - 32px));
    height: min(475px, calc(100dvh - 90px));
    border: 1px solid #e4dbe9;
    border-radius: 14px;
    background: white;
    box-shadow: 0 12px 40px #23183b40;
    overflow: hidden;
}
.oph-chat header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #342755;
    color: white;
}
.oph-chat header h2 { margin: 0; color: inherit; font: 650 17px/1.3 system-ui, sans-serif; }
.oph-chat-close { display: grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; color: white; font-size: 24px !important; }
.oph-chat-log { overflow-y: auto; overscroll-behavior: contain; padding: 14px; }
.oph-chat-message { margin: 0 14px 9px 0; padding: 9px 11px; border-radius: 10px; background: #f3edf6; overflow-wrap: anywhere; }
.oph-chat-visitor { margin-inline: 14px 0; background: #e8e0f1; }
.oph-chat-sources { margin: 0 0 12px; padding-inline-start: 20px; font-size: .875em; }
.oph-chat-sources a { color: #79235b; text-decoration: underline; }
.oph-chat form { margin: 0; padding: 11px 14px 14px; border-top: 1px solid #e4dbe9; }
.oph-chat form div { display: flex; gap: 6px; }
.oph-chat label { display: block; margin: 0 0 4px; font-size: .875em; }
.oph-chat input { font: inherit; color: inherit; border: 1px solid #b9abca; border-radius: 8px; padding: 8px; flex: 1; min-width: 0; }
.oph-chat button:disabled { opacity: .7; cursor: wait; }
@media print { .oph-chat { display: none; } }

.oph-chat-typing { display: flex; align-items: center; gap: 5px; width: fit-content; min-height: 36px; }
.oph-chat-typing-label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.oph-chat-typing-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: oph-chat-typing-bounce 1s ease-in-out infinite; }
.oph-chat-typing-dot:nth-of-type(3) { animation-delay: .13s; }
.oph-chat-typing-dot:nth-of-type(4) { animation-delay: .26s; }
@keyframes oph-chat-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .55; }
    30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .oph-chat-typing-dot { animation: none; }
}
