/* oberon.ie — chat widget styles (design-system palette, self-contained) */

.ob-chat-trigger {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 160;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    background: var(--brand, #B44593);
    color: #fff;
    box-shadow: 0 12px 30px -8px rgba(10, 22, 40, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s ease, background-color .18s ease;
}
.ob-chat-trigger svg { width: 26px; height: 26px; }
.ob-chat-trigger:hover { background: var(--brand-deep, #8E3574); transform: translateY(-2px); }
.ob-chat-trigger.hidden { display: none; }

.ob-chat-window {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 170;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 90px));
    display: none;
    flex-direction: column;
    background: var(--paper, #FAFAF8);
    border: 1px solid var(--ledger, #DDE1E9);
    border-radius: 14px;
    box-shadow: 0 30px 70px -20px rgba(10, 22, 40, .5);
    overflow: hidden;
    font-family: var(--sans, system-ui, sans-serif);
}
.ob-chat-window.open { display: flex; }

.ob-chat-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .95rem 1.1rem;
    background: var(--navy, #0A1628);
    color: #fff;
}
.ob-chat-header-info { flex: 1; min-width: 0; }
.ob-chat-header-title {
    font-family: var(--serif, Georgia, serif);
    font-size: 1.05rem;
}
.ob-chat-header-subtitle {
    font-size: .74rem;
    color: rgba(255, 255, 255, .6);
    margin-top: .1rem;
}
.ob-chat-close {
    background: none;
    border: 0;
    color: rgba(255, 255, 255, .7);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: .2rem .4rem;
}
.ob-chat-close:hover { color: #fff; }

.ob-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.ob-chat-msg {
    max-width: 86%;
    padding: .6rem .85rem;
    border-radius: 12px;
    font-size: .92rem;
    line-height: 1.5;
    overflow-wrap: break-word;
}
.ob-chat-msg-user {
    align-self: flex-end;
    background: var(--brand, #B44593);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ob-chat-msg-bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--ledger, #DDE1E9);
    color: var(--ink, #131C2E);
    border-bottom-left-radius: 4px;
}
.ob-chat-msg-bot a { color: var(--brand-deep, #8E3574); }
.ob-chat-msg-bot strong { color: var(--ink, #131C2E); }

.ob-chat-typing { display: flex; gap: 5px; padding: .8rem .95rem; }
.ob-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-soft, #4C566B);
    opacity: .4;
    animation: ob-typing 1.2s infinite;
}
.ob-chat-typing span:nth-child(2) { animation-delay: .2s; }
.ob-chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ob-typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.ob-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: .5rem;
    padding: .7rem;
    background: #fff;
    border-top: 1px solid var(--ledger, #DDE1E9);
}
.ob-chat-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--ledger, #DDE1E9);
    border-radius: 10px;
    font-family: inherit;
    font-size: .92rem;
    line-height: 1.4;
    padding: .55rem .75rem;
    max-height: 90px;
    color: var(--ink, #131C2E);
    background: var(--paper, #FAFAF8);
}
.ob-chat-input:focus {
    outline: none;
    border-color: var(--brand, #B44593);
    box-shadow: 0 0 0 3px rgba(180, 69, 147, .15);
}
.ob-chat-send {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--brand, #B44593);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ob-chat-send svg { width: 18px; height: 18px; }
.ob-chat-send:hover { background: var(--brand-deep, #8E3574); }
.ob-chat-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
    .ob-chat-window { right: 16px; bottom: 16px; }
    .ob-chat-trigger { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .ob-chat-typing span { animation: none; }
    .ob-chat-trigger { transition: none; }
}
