.jet-chat {
    --jet-chat-primary: #ff6b2d;
    --jet-chat-ink: #102033;
    --jet-chat-muted: #627287;
    position: fixed;
    z-index: 1000;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.jet-chat *,
.jet-chat *::before,
.jet-chat *::after {
    box-sizing: border-box;
}

.jet-chat-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    padding: 0 19px;
    background: var(--jet-chat-primary);
    box-shadow: 0 8px 26px rgba(8, 20, 33, .24);
    color: #fff;
    font: inherit;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
}

.jet-chat-toggle span:first-child {
    font-size: 1.2rem;
}

.jet-chat-panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 24px));
    max-height: min(480px, calc(100dvh - 104px));
    overflow: hidden;
    border: 1px solid #dce5ed;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 52px rgba(8, 20, 33, .22);
    color: var(--jet-chat-ink);
}

.jet-chat-panel[hidden] {
    display: none;
}

.jet-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    padding: 13px 16px;
    background: #081421;
    color: #fff;
}

.jet-chat-header h2 {
    margin: 0;
    font-size: 1rem;
}

.jet-chat-header p {
    margin: 3px 0 0;
    color: #cbd5df;
    font-size: .78rem;
}

.jet-chat-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.jet-chat-messages {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 10px;
    min-height: 72px;
    max-height: 200px;
    overflow-y: auto;
    padding: 12px 14px;
}

.jet-chat-message {
    max-width: 92%;
    margin: 0;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: .9rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.jet-chat-bot {
    justify-self: start;
    background: #f0f4f8;
}

.jet-chat-user {
    justify-self: end;
    background: #fff0e9;
}

.jet-chat-message a {
    color: #a63b0d;
    font-weight: 700;
    text-decoration: underline;
}

.jet-chat-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 7px;
    padding: 0 14px 9px;
}

.jet-chat-actions button {
    border: 1px solid #dce5ed;
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff;
    color: var(--jet-chat-ink);
    font: inherit;
    font-size: .78rem;
    cursor: pointer;
}

.jet-chat-actions button:hover,
.jet-chat-actions button:focus-visible {
    border-color: var(--jet-chat-primary);
}

.jet-chat-form {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    border-top: 1px solid #edf1f5;
    padding: 12px 14px;
}

.jet-chat-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid #dce5ed;
    border-radius: 10px;
    padding: 10px 11px;
    color: var(--jet-chat-ink);
    font: inherit;
}

.jet-chat-form button {
    border: 0;
    border-radius: 10px;
    padding: 0 14px;
    background: var(--jet-chat-primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.jet-chat-disclaimer {
    flex: 0 0 auto;
    margin: 0;
    padding: 0 14px 10px;
    color: var(--jet-chat-muted);
    font-size: .72rem;
    line-height: 1.35;
}

.jet-chat-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.jet-chat :focus-visible {
    outline: 3px solid #2463eb;
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .jet-chat {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .jet-chat-panel {
        right: -16px;
        width: min(360px, calc(100vw - 24px));
        max-height: min(440px, calc(100dvh - 104px));
    }
}

@media (max-height: 640px) {
    .jet-chat-panel {
        max-height: calc(100dvh - 220px);
    }

    .jet-chat-header {
        padding: 10px 14px;
    }

    .jet-chat-form {
        padding: 9px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jet-chat *,
    .jet-chat *::before,
    .jet-chat *::after {
        scroll-behavior: auto !important;
    }
}
