:root {
    --jon-chatkit-accent: #1f6feb;
}

.jon-chatkit-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147483000;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.jon-chatkit-launcher {
    min-width: 156px;
    height: 54px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #2145f3 0%, #08baf2 100%);
    box-shadow: 0 18px 42px rgba(20, 88, 220, 0.34);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px 0 17px;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.jon-chatkit-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 48px rgba(20, 88, 220, 0.42);
}

.jon-chatkit-launcher-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.jon-chatkit-launcher-icon span {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #ffffff;
}

.jon-chatkit-launcher-text {
    white-space: nowrap;
}

.jon-chatkit-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(390px, calc(100vw - 28px));
    height: min(690px, calc(100vh - 112px));
    min-height: 540px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.jon-chatkit-widget.is-open .jon-chatkit-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.jon-chatkit-widget.is-open .jon-chatkit-launcher {
    display: none;
}

.jon-chatkit-header {
    position: relative;
    min-height: 90px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 14px 18px 22px;
    color: #ffffff;
    background: linear-gradient(135deg, #2337e8 0%, #06bdf0 100%);
}

.jon-chatkit-header::after {
    content: "";
    position: absolute;
    left: -8%;
    right: -8%;
    bottom: -18px;
    height: 44px;
    background: #ffffff;
    border-radius: 0 0 50% 50%;
}

.jon-chatkit-person {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 13px;
}

.jon-chatkit-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    object-fit: cover;
    object-position: center 22%;
    border: 3px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 8px 18px rgba(16, 43, 118, 0.22);
    background: #ffffff;
}

.jon-chatkit-header strong,
.jon-chatkit-header span {
    display: block;
}

.jon-chatkit-header strong {
    font-size: 18px;
    line-height: 22px;
    font-weight: 800;
}

.jon-chatkit-header span {
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.90);
    font-size: 13px;
    line-height: 17px;
}

.jon-chatkit-header span i {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: 999px;
    background: #44d62c;
    box-shadow: 0 0 0 3px rgba(68, 214, 44, 0.16);
}

.jon-chatkit-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
}

.jon-chatkit-actions button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.10);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.jon-chatkit-actions button:hover {
    background: rgba(255, 255, 255, 0.18);
}

.jon-chatkit-intro {
    position: relative;
    z-index: 1;
    margin: 8px 18px 0;
    padding: 14px 16px;
    background: #f1f5f9;
    border-radius: 18px 18px 18px 6px;
    border-bottom: 0;
}

.jon-chatkit-intro strong {
    display: block;
    color: #111827;
    font-size: 16px;
    line-height: 21px;
}

.jon-chatkit-intro p {
    margin: 5px 0 0;
    color: #334155;
    font-size: 13px;
    line-height: 19px;
}

.jon-chatkit-mount {
    position: relative;
    height: calc(100% - 306px);
    min-height: 240px;
}

.jon-chatkit-widget.has-thread .jon-chatkit-intro {
    display: none;
}

.jon-chatkit-widget.has-thread .jon-chatkit-mount {
    height: calc(100% - 245px);
}

.jon-chatkit-mount openai-chatkit {
    display: block;
    width: 100%;
    height: 100%;
}

.jon-chatkit-mount:not(.has-thread)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 96px;
    background: #ffffff;
    pointer-events: none;
}

.jon-chatkit-brand {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.jon-chatkit-brand img {
    display: block;
    margin: 0 auto;
    width: 134px;
    max-height: 30px;
    object-fit: contain;
    object-position: center;
}

.jon-chatkit-unconfigured {
    display: none;
    padding: 18px;
    color: #6b7280;
    font-size: 14px;
    line-height: 20px;
}

.jon-chatkit-widget[data-configured="0"] .jon-chatkit-mount,
.jon-chatkit-widget[data-configured="0"] .jon-chatkit-brand {
    display: none;
}

.jon-chatkit-widget[data-configured="0"] .jon-chatkit-unconfigured {
    display: block;
}

.jon-chatkit-widget.is-expanded .jon-chatkit-panel {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: min(760px, calc(100vw - 44px));
    height: min(820px, calc(100vh - 44px));
}

@media (max-width: 520px) {
    .jon-chatkit-widget {
        right: 14px;
        bottom: 14px;
    }

    .jon-chatkit-launcher {
        min-width: 148px;
        height: 52px;
    }

    .jon-chatkit-panel,
    .jon-chatkit-widget.is-expanded .jon-chatkit-panel {
        position: fixed;
        inset: 10px;
        width: auto;
        height: auto;
        min-height: 0;
        border-radius: 14px;
    }
}
