/* Hallmark · component: chat widget · genre: modern-minimal · theme: project system · states: closed, open, hover, focus-visible, active, disabled, sending, success, error · contrast: pass · v2.0.0 */
/* Floating FAQ assistant: navy header, white bubbles on a pale canvas, one teal accent shared with the footer and buttons. */
/* Hallmark · dismissed 2a · the panel is a single surface, not a card inside a card; the message bubbles are content, not nested cards. */

:root {
    --chat-ink: #121c2e;
    --chat-muted: #56657a;
    --chat-on-navy: #ffffff;
    --chat-surface: #ffffff;
    --chat-canvas: #f3f6fa;
    --chat-navy: #0b1220;
    --chat-navy-soft: #16233a;
    --chat-accent: #50d9b0;
    --chat-accent-soft: rgba(80, 217, 176, 0.18);
    --chat-accent-strong: #2bbd93;
    --chat-accent-ink: #06382c;
    --chat-line: #d9e2ec;
    --chat-focus: #1e3a8a;
    --chat-focus-on-dark: #8ff3d8;
    --chat-danger: #b42318;
    --chat-success: #0f6b4f;
    --chat-shadow: 0 22px 60px rgba(11, 18, 32, 0.24);
    --chat-radius: 1rem;
    --chat-avatar-ring: rgba(80, 217, 176, 0.45);
    --chat-time-on-navy: rgba(255, 255, 255, 0.62);
    --chat-dot: #8a99ad;
}

.dverto-chat {
    font-family: var(--font-body);
    color: var(--chat-ink);
}

.dverto-chat__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Launcher */
.dverto-chat__launcher {
    position: fixed;
    right: 1.5rem;
    bottom: 5.5rem;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    padding: 0;
    border: 2px solid var(--chat-accent);
    border-radius: 999px;
    background: var(--chat-navy-soft);
    color: var(--chat-on-navy);
    box-shadow: var(--chat-shadow);
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 160ms ease, transform 160ms ease;
}

.dverto-chat__launcher:hover {
    border-color: var(--chat-focus-on-dark);
    transform: translateY(-1px);
}

.dverto-chat__launcher:active {
    transform: translateY(0);
}

.dverto-chat__launcher:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 3px;
}

.dverto-chat__launcher-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
}

.dverto-chat__launcher-badge {
    position: absolute;
    right: -0.3rem;
    bottom: -0.3rem;
    display: none;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border: 2px solid var(--chat-navy);
    border-radius: 999px;
    background: var(--chat-accent);
    color: var(--chat-accent-ink);
    box-sizing: border-box;
}

.dverto-chat__launcher-badge svg {
    width: 0.7rem;
    height: 0.7rem;
}

.dverto-chat[data-state="open"] .dverto-chat__launcher-badge {
    display: inline-flex;
}

/* Panel */
.dverto-chat__panel {
    position: fixed;
    right: 1.5rem;
    bottom: 9.75rem;
    z-index: 60;
    display: flex;
    flex-direction: column;
    width: min(23.5rem, calc(100vw - 2rem));
    height: min(34rem, calc(100dvh - 11rem));
    border-radius: var(--chat-radius);
    background: var(--chat-canvas);
    box-shadow: var(--chat-shadow);
    overflow: hidden;
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.dverto-chat[data-state="closed"] .dverto-chat__panel {
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.75rem);
    pointer-events: none;
}

.dverto-chat[data-state="open"] .dverto-chat__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Conversation */
.dverto-chat__log {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dverto-chat__row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    max-width: 100%;
}

.dverto-chat__row--bot {
    align-self: flex-start;
    max-width: 92%;
}

.dverto-chat__row--user {
    align-self: flex-end;
    max-width: 86%;
}

.dverto-chat__msg-avatar {
    display: block;
    flex: 0 0 auto;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    object-fit: cover;
    background: var(--chat-navy-soft);
    box-shadow: 0 0 0 1px var(--chat-avatar-ring);
}

.dverto-chat__msg {
    min-width: 0;
    max-width: 100%;
    padding: 0.6rem 0.8rem;
    border-radius: 0.9rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-line;
    overflow-wrap: anywhere;
    animation: dverto-chat-message-in 180ms ease both;
}

.dverto-chat__row[data-static="true"] .dverto-chat__msg {
    animation: none;
}

.dverto-chat__msg--bot {
    background: var(--chat-surface);
    border: 1px solid var(--chat-line);
    border-bottom-left-radius: 0.25rem;
    color: var(--chat-ink);
}

.dverto-chat__msg--user {
    background: var(--chat-navy);
    border-bottom-right-radius: 0.25rem;
    color: var(--chat-on-navy);
}

.dverto-chat__msg-text {
    margin: 0;
}

.dverto-chat__time {
    display: block;
    margin-top: 0.3rem;
    color: var(--chat-muted);
    font-size: 0.625rem;
    line-height: 1.2;
}

.dverto-chat__msg--user .dverto-chat__time {
    color: var(--chat-time-on-navy);
    text-align: right;
}

@keyframes dverto-chat-message-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Answer links */
.dverto-chat__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.dverto-chat__link {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--chat-line);
    border-radius: 999px;
    background: var(--chat-canvas);
    color: var(--chat-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.dverto-chat__link:hover {
    border-color: var(--chat-accent-strong);
    background: var(--chat-accent-soft);
}

.dverto-chat__link:active {
    background: var(--chat-accent);
    color: var(--chat-accent-ink);
}

.dverto-chat__link:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 2px;
}

/* Quick replies */
.dverto-chat__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: 2rem;
    padding-right: 0.25rem;
}

.dverto-chat__chip {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--chat-line);
    border-radius: 999px;
    background: var(--chat-surface);
    color: var(--chat-navy);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.dverto-chat__chip:hover {
    border-color: var(--chat-accent-strong);
    background: var(--chat-accent-soft);
}

.dverto-chat__chip:active {
    background: var(--chat-accent);
    color: var(--chat-accent-ink);
}

.dverto-chat__chip:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 2px;
}

/* Answer feedback */
.dverto-chat__feedback {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-left: 2rem;
    color: var(--chat-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.dverto-chat__feedback-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--chat-line);
    border-radius: 999px;
    background: var(--chat-surface);
    color: var(--chat-navy);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.dverto-chat__feedback-button:hover {
    border-color: var(--chat-accent-strong);
    background: var(--chat-accent-soft);
}

.dverto-chat__feedback-button:active {
    background: var(--chat-accent);
    color: var(--chat-accent-ink);
}

.dverto-chat__feedback-button:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 2px;
}

/* Typing */
.dverto-chat__typing {
    display: flex;
}

.dverto-chat__typing[hidden] {
    display: none;
}

.dverto-chat__msg--typing {
    padding: 0.75rem 0.85rem;
}

.dverto-chat__dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 0.9rem;
}

.dverto-chat__dots span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--chat-dot);
    animation: dverto-chat-dot 1.2s infinite ease-in-out;
}

.dverto-chat__dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.dverto-chat__dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dverto-chat-dot {
    0%,
    60%,
    100% {
        opacity: 0.45;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Quick actions */
.dverto-chat__quickbar {
    display: flex;
    gap: 0.5rem;
    flex: 0 0 auto;
    padding: 0.55rem 0.85rem 0.1rem;
    border-top: 1px solid var(--chat-line);
    background: var(--chat-surface);
}

.dverto-chat__quickaction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    flex: 1 1 0;
    min-width: 0;
    min-height: 2rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--chat-line);
    border-radius: 999px;
    background: var(--chat-canvas);
    color: var(--chat-navy);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease;
}

.dverto-chat__quickaction svg {
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
}

.dverto-chat__quickaction:hover {
    border-color: var(--chat-accent-strong);
    background: var(--chat-accent-soft);
}

.dverto-chat__quickaction:active {
    background: var(--chat-accent);
    color: var(--chat-accent-ink);
}

.dverto-chat__quickaction:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 2px;
}

.dverto-chat__quickaction--icon {
    flex: 0 0 auto;
    width: 2rem;
    padding: 0;
}

/* Composer */
.dverto-chat__composer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    padding: 0.45rem 0.85rem 0.7rem;
    background: var(--chat-surface);
}

.dverto-chat__input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 2.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--chat-line);
    border-radius: 999px;
    background: var(--chat-canvas);
    color: var(--chat-ink);
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.dverto-chat__input::placeholder {
    color: var(--chat-muted);
    opacity: 1;
}

.dverto-chat__input:focus {
    outline: none;
    border-color: var(--chat-focus);
    box-shadow: 0 0 0 2px var(--chat-accent-soft);
}

.dverto-chat__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 999px;
    background: var(--chat-navy);
    color: var(--chat-on-navy);
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.dverto-chat__send svg {
    width: 1.15rem;
    height: 1.15rem;
}

.dverto-chat__send:hover {
    background: var(--chat-accent);
    color: var(--chat-accent-ink);
}

.dverto-chat__send:active {
    background: var(--chat-accent-strong);
}

.dverto-chat__send:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 2px;
}

.dverto-chat__send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.dverto-chat__note {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 0.85rem 0.75rem;
    background: var(--chat-surface);
    color: var(--chat-muted);
    font-size: 0.6875rem;
    line-height: 1.45;
    text-align: center;
}

.dverto-chat__note-link {
    color: var(--chat-focus);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dverto-chat__note-link:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 2px;
}

/* Lead capture card */
.dverto-chat__lead {
    align-self: stretch;
    max-width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--chat-line);
    border-radius: 0.8rem;
    background: var(--chat-surface);
}

.dverto-chat__lead-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
}

.dverto-chat__lead-copy {
    margin: 0.2rem 0 0.7rem;
    color: var(--chat-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.dverto-chat__field {
    margin-bottom: 0.55rem;
}

.dverto-chat__field label {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--chat-ink);
    font-size: 0.75rem;
    font-weight: 600;
}

.dverto-chat__field input,
.dverto-chat__field textarea {
    display: block;
    width: 100%;
    min-height: 2.4rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--chat-line);
    border-radius: 0.5rem;
    background: var(--chat-canvas);
    color: var(--chat-ink);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.dverto-chat__field textarea {
    min-height: 4.5rem;
    resize: vertical;
}

.dverto-chat__field input:focus,
.dverto-chat__field textarea:focus {
    outline: none;
    border-color: var(--chat-focus);
    box-shadow: 0 0 0 2px var(--chat-accent-soft);
}

.dverto-chat__field input[aria-invalid="true"],
.dverto-chat__field textarea[aria-invalid="true"] {
    border-color: var(--chat-danger);
}

.dverto-chat__status {
    min-height: 1.25rem;
    margin: 0 0 0.35rem;
    color: var(--chat-danger);
    font-size: 0.75rem;
    line-height: 1.4;
}

.dverto-chat__status[data-kind="success"] {
    color: var(--chat-success);
}

.dverto-chat__submit {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    padding: 0.6rem 0.8rem;
    border: 0;
    border-radius: 0.6rem;
    background: var(--chat-navy);
    color: var(--chat-on-navy);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease;
}

.dverto-chat__submit:hover {
    background: var(--chat-navy-soft);
}

.dverto-chat__submit:active {
    background: var(--chat-accent);
    color: var(--chat-accent-ink);
}

.dverto-chat__submit:focus-visible {
    outline: 2px solid var(--chat-focus);
    outline-offset: 2px;
}

.dverto-chat__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dverto-chat__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Small screens */
@media (max-width: 520px) {
    .dverto-chat__launcher {
        right: 1rem;
        bottom: 5.25rem;
        width: 3.25rem;
        height: 3.25rem;
    }

    .dverto-chat__panel {
        right: 0.75rem;
        left: 0.75rem;
        bottom: 9.25rem;
        width: auto;
        height: min(32rem, calc(100dvh - 10.5rem));
    }
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
    .dverto-chat__launcher,
    .dverto-chat__panel,
    .dverto-chat__quickaction,
    .dverto-chat__link,
    .dverto-chat__chip,
    .dverto-chat__feedback-button,
    .dverto-chat__send,
    .dverto-chat__submit {
        transition: none;
    }

    .dverto-chat__launcher:hover {
        transform: none;
    }

    .dverto-chat__msg {
        animation: none;
    }

    .dverto-chat__dots span {
        animation: none;
        opacity: 0.7;
    }
}
