/* Exposio AI FAQ chat widget — self-contained, no framework. */
.exposio-chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #1c1c1c;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}
.exposio-chat-launcher:hover { transform: scale(1.06); }
.exposio-chat-launcher.is-open { opacity: 0.85; }
.exposio-chat-launcher:focus-visible { outline: 3px solid #e0a73a; outline-offset: 2px; }

.exposio-chat-panel {
    position: fixed;
    bottom: 88px;
    right: 20px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483000;
    font-family: -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a1a1a;
}
.exposio-chat-panel[hidden] { display: none; }

.exposio-chat-header {
    background: #1c1c1c;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
}
.exposio-chat-title { font-weight: 600; font-size: 15px; }
.exposio-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}
.exposio-chat-close:hover { opacity: 1; }

.exposio-chat-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f7f8;
}
.exposio-chat-msg {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.exposio-chat-msg--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e6e6e9;
    border-bottom-left-radius: 4px;
}
.exposio-chat-msg--user {
    align-self: flex-end;
    background: #e0a73a;
    color: #1a1a1a;
    border-bottom-right-radius: 4px;
}
/* A human agent's turn — deliberately distinct from the bot so the visitor can see
   who they are talking to. */
.exposio-chat-msg--agent {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e0a73a;
    border-left: 3px solid #e0a73a;
    border-bottom-left-radius: 4px;
}
/* Centered system line, e.g. "a member of our team has joined". */
.exposio-chat-notice {
    align-self: center;
    max-width: 90%;
    text-align: center;
    font-size: 12px;
    line-height: 1.4;
    color: #6b6b72;
    padding: 2px 8px;
}
/* Rendered Markdown inside assistant/agent bubbles. */
.exposio-chat-msg a { color: #b5791f; text-decoration: underline; word-break: break-word; }
.exposio-chat-ul { margin: 6px 0; padding-left: 20px; }
.exposio-chat-ul li { margin: 2px 0; }
.exposio-chat-h { font-weight: 700; margin: 6px 0 2px; }

.exposio-chat-typing { color: #8a8a90; letter-spacing: 2px; }

.exposio-chat-actions { align-self: flex-start; }
.exposio-chat-human {
    background: #fff;
    border: 1px solid #1c1c1c;
    color: #1c1c1c;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.exposio-chat-human:hover { background: #1c1c1c; color: #fff; }

.exposio-chat-humanform {
    align-self: stretch;
    background: #fff;
    border: 1px solid #e6e6e9;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.exposio-chat-humanintro { font-size: 13px; color: #444; }
.exposio-chat-formmsg { font-size: 13px; color: #444; }
.exposio-chat-textarea {
    border: 1px solid #d7d7db;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.exposio-chat-footer {
    flex: 0 0 auto;
    border-top: 1px solid #eaeaec;
    padding: 10px;
    background: #fff;
}
.exposio-chat-form { display: flex; gap: 8px; }
.exposio-chat-input {
    flex: 1 1 auto;
    border: 1px solid #d7d7db;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.exposio-chat-input:focus { border-color: #e0a73a; }
.exposio-chat-send {
    border: none;
    background: #1c1c1c;
    color: #fff;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.exposio-chat-send:hover { background: #333; }
.exposio-chat-send:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
    .exposio-chat-panel {
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;   /* fallback for older mobile browsers */
        height: 100dvh;  /* dynamic viewport: excludes the browser toolbar, so the input stays visible */
        max-height: none;
        border-radius: 0;
    }
    /* The floating launcher would sit on top of the full-screen panel (over the input);
       the panel has its own close button, so hide it while the panel is open. */
    .exposio-chat-launcher.is-open { display: none; }
    .exposio-chat-launcher { bottom: 16px; right: 16px; }
    /* Keep the input clear of the home indicator / gesture bar on notched phones. */
    .exposio-chat-footer { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    /* 16px input prevents iOS Safari from auto-zooming the page when it's focused. */
    .exposio-chat-input, .exposio-chat-textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .exposio-chat-launcher { transition: none; }
}
