.gsef-chat {
    --gsef-ink: #17354d;
    --gsef-ink-soft: #587086;
    --gsef-paper: #fffdf7;
    --gsef-accent: #ef7d57;
    --gsef-accent-deep: #cf5a37;
    --gsef-border: rgba(23, 53, 77, 0.12);
    --gsef-shadow: 0 24px 55px rgba(20, 38, 56, 0.18);
    --gsef-radius: 28px;
    color: var(--gsef-ink);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.gsef-chat,
.gsef-chat * {
    box-sizing: border-box;
}

.gsef-chat__panel {
    display: flex;
    flex-direction: column;
    width: clamp(320px, calc(100vw - 40px), 420px);
    min-width: 300px;
    min-height: 360px;
    max-width: calc(100vw - 40px);
    max-height: min(720px, calc(100vh - 120px));
    border: 1px solid var(--gsef-border);
    border-radius: var(--gsef-radius);
    background:
        radial-gradient(circle at top right, rgba(239, 125, 87, 0.18) 0%, rgba(239, 125, 87, 0) 32%),
        linear-gradient(180deg, #fffefc 0%, var(--gsef-paper) 100%);
    box-shadow: var(--gsef-shadow);
    resize: both;
    overflow: hidden;
}

.gsef-chat.is-floating {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 9999;
}

.gsef-chat.is-dragging,
.gsef-chat.is-dragging * {
    cursor: grabbing !important;
}

.gsef-chat.is-floating .gsef-chat__panel {
    display: none;
    margin-top: 14px;
}

.gsef-chat.is-floating .gsef-chat__state:checked ~ .gsef-chat__panel {
    display: flex;
}

.gsef-chat__state {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.gsef-chat__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 76px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gsef-accent) 0%, #f4ab63 100%);
    box-shadow: 0 18px 40px rgba(207, 90, 55, 0.32);
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    touch-action: none;
    user-select: none;
}

.gsef-chat__toggle-label {
    display: block;
    white-space: nowrap;
}

.gsef-chat__header {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 22px 22px 14px;
    border-bottom: 1px solid var(--gsef-border);
}

.gsef-chat.is-floating .gsef-chat__header {
    cursor: grab;
    touch-action: none;
}

.gsef-chat__eyebrow {
    margin: 0 0 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gsef-accent-deep);
}

.gsef-chat__title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.1;
}

.gsef-chat__subtitle {
    margin: 8px 0 0;
    color: var(--gsef-ink-soft);
    line-height: 1.5;
}

.gsef-chat__close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(23, 53, 77, 0.08);
    color: var(--gsef-ink);
    cursor: pointer;
    font: inherit;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
    touch-action: manipulation;
    user-select: none;
}

.gsef-chat__close:hover,
.gsef-chat__close:focus-visible {
    background: rgba(23, 53, 77, 0.14);
    outline: none;
}

.gsef-chat__messages {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-height: 130px;
    max-height: min(360px, 38vh);
    padding: 18px 18px 8px;
    overflow-y: auto;
}

.gsef-chat__message {
    max-width: 88%;
    padding: 14px 16px;
    border-radius: 18px;
    line-height: 1.55;
}

.gsef-chat__message p {
    margin: 0;
    white-space: pre-line;
}

.gsef-chat__message--bot {
    align-self: flex-start;
    background: #f6efe5;
}

.gsef-chat__message--user {
    align-self: flex-end;
    background: #dff1ff;
}

.gsef-chat__speaker {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gsef-accent-deep);
}

.gsef-chat__suggestions {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 10px;
    max-height: 170px;
    padding: 8px 18px 0;
    overflow-y: auto;
}

.gsef-chat__suggestion {
    width: 100%;
    max-width: 100%;
    border: 1px solid rgba(23, 53, 77, 0.14);
    border-radius: 14px;
    background: #fff;
    color: var(--gsef-ink);
    cursor: pointer;
    font: inherit;
    line-height: 1.35;
    overflow-wrap: anywhere;
    padding: 8px 12px;
    text-align: left;
    white-space: normal;
}

.gsef-chat__form {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 18px;
}

.gsef-chat__input {
    min-width: 0;
    border: 1px solid var(--gsef-border);
    border-radius: 999px;
    background: #fff;
    color: var(--gsef-ink);
    font: inherit;
    padding: 13px 16px;
}

.gsef-chat__send {
    border: 0;
    border-radius: 999px;
    background: var(--gsef-ink);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 13px 18px;
}

@media (max-width: 767px) {
    .gsef-chat.is-floating {
        right: 12px;
        bottom: 12px;
        left: auto;
    }

    .gsef-chat__toggle {
        min-width: 104px;
        min-height: 56px;
        padding: 0 18px;
        font-size: 0.95rem;
    }

    .gsef-chat.is-floating .gsef-chat__panel {
        width: min(360px, calc(100vw - 24px));
        min-width: 0;
        min-height: 0;
        max-width: calc(100vw - 24px);
        max-height: min(70vh, 560px);
        border-radius: 22px;
        resize: none;
    }

    .gsef-chat__header {
        padding: 16px 16px 12px;
    }

    .gsef-chat__close {
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }

    .gsef-chat__eyebrow {
        font-size: 0.66rem;
        letter-spacing: 0.12em;
    }

    .gsef-chat__title {
        font-size: 1.25rem;
    }

    .gsef-chat__subtitle {
        font-size: 0.92rem;
        line-height: 1.35;
    }

    .gsef-chat__messages {
        gap: 10px;
        min-height: 112px;
        max-height: 30vh;
        padding: 14px 14px 6px;
    }

    .gsef-chat__message {
        max-width: 100%;
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .gsef-chat__suggestions {
        gap: 8px;
        max-height: 22vh;
        padding: 8px 14px 0;
    }

    .gsef-chat__suggestion {
        padding: 9px 11px;
        font-size: 0.9rem;
    }

    .gsef-chat__form {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 14px;
    }

    .gsef-chat__input {
        padding: 11px 13px;
        font-size: 16px;
    }

    .gsef-chat__send {
        padding: 11px 14px;
    }
}

@media (max-width: 380px) {
    .gsef-chat__form {
        grid-template-columns: 1fr;
    }

    .gsef-chat__send {
        width: 100%;
    }
}
