:root {
    --shwsup-chat-primary: #dc5b12;
    --shwsup-chat-primary-dark: #a94107;
    --shwsup-chat-ink: #1f1b18;
    --shwsup-chat-muted: #766a63;
    --shwsup-chat-surface: rgba(255, 255, 255, 0.98);
    --shwsup-chat-surface-soft: #f7f1ec;
    --shwsup-chat-border: rgba(94, 66, 46, 0.12);
    --shwsup-chat-shadow: 0 28px 60px rgba(58, 31, 12, 0.16);
}

.shwsup-chat-root,
.shwsup-chat-root *,
.shwsup-chat-root *::before,
.shwsup-chat-root *::after {
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
}

.shwsup-chat-root {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    isolation: isolate;
    pointer-events: none;
    color: var(--shwsup-chat-ink);
}

.shwsup-chat-root a,
.shwsup-chat-root a:hover,
.shwsup-chat-root a:focus,
.shwsup-chat-root a:active {
    color: inherit !important;
    text-decoration: none !important;
}

.shwsup-chat-root button,
.shwsup-chat-root input {
    font: inherit;
}

.shwsup-chat-launcher__icon svg,
.shwsup-chat-form__field button svg {
    width: 18px;
    height: 18px;
    display: block;
}

.shwsup-chat-launcher {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--shwsup-chat-primary), #f08e3c);
    color: #fff;
    box-shadow: var(--shwsup-chat-shadow);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px 14px 14px;
    cursor: pointer;
    pointer-events: auto;
}

.shwsup-chat-root.is-open .shwsup-chat-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.shwsup-chat-launcher__ring {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.12);
}

.shwsup-chat-launcher__icon {
    font-size: 18px;
    line-height: 1;
}

.shwsup-chat-launcher__label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1;
}

.shwsup-chat-panel {
    position: absolute;
    right: 18px;
    bottom: 86px;
    z-index: 3;
    width: min(420px, calc(100vw - 24px));
    height: min(720px, calc(100vh - 112px));
    background: var(--shwsup-chat-surface);
    border: 1px solid var(--shwsup-chat-border);
    border-radius: 28px;
    box-shadow: var(--shwsup-chat-shadow);
    overflow: hidden;
    display: none;
    flex-direction: column;
    backdrop-filter: blur(18px);
    pointer-events: auto;
}

.shwsup-chat-root.is-open .shwsup-chat-panel {
    display: flex;
}

.shwsup-chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 16px;
    color: #fff;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(135deg, var(--shwsup-chat-primary-dark), var(--shwsup-chat-primary));
}

.shwsup-chat-panel__identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shwsup-chat-panel__identity h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
}

.shwsup-chat-panel__identity p {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.88;
    color: rgba(255, 255, 255, 0.92);
}

.shwsup-chat-panel__avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 800;
    color: #fff;
}

.shwsup-chat-panel__close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.shwsup-chat-thread {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background:
        radial-gradient(circle at top right, rgba(220, 91, 18, 0.05), transparent 28%),
        linear-gradient(180deg, #fff8f3, #fff 34%);
}

.shwsup-chat-row {
    display: flex;
    margin-bottom: 14px;
}

.shwsup-chat-row--user {
    justify-content: flex-end;
}

.shwsup-chat-bubble {
    max-width: 88%;
    padding: 14px 15px;
    border-radius: 20px;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 13px;
    color: var(--shwsup-chat-ink);
}

.shwsup-chat-row--bot .shwsup-chat-bubble {
    background: #fff;
    border: 1px solid var(--shwsup-chat-border);
    box-shadow: 0 10px 24px rgba(70, 46, 29, 0.05);
}

.shwsup-chat-row--user .shwsup-chat-bubble {
    background: linear-gradient(135deg, #ffe2c8, #ffd3a9);
    border: 1px solid rgba(220, 91, 18, 0.15);
}

.shwsup-chat-bubble--warning {
    background: #fff7ed !important;
    border-color: rgba(217, 119, 6, 0.22) !important;
}

.shwsup-chat-bubble--clarification {
    background: #f5f3ff !important;
    border-color: rgba(109, 40, 217, 0.14) !important;
}

.shwsup-chat-actions,
.shwsup-chat-feedback {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.shwsup-chat-action,
.shwsup-chat-feedback button,
.shwsup-chat-chip {
    border: 1px solid var(--shwsup-chat-border);
    background: #fff;
    color: var(--shwsup-chat-ink);
    border-radius: 999px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.shwsup-chat-action:hover,
.shwsup-chat-action:focus,
.shwsup-chat-chip:hover,
.shwsup-chat-chip:focus,
.shwsup-chat-feedback button:hover,
.shwsup-chat-feedback button:focus {
    color: inherit !important;
    text-decoration: none !important;
}

.shwsup-chat-action--primary {
    background: linear-gradient(135deg, var(--shwsup-chat-primary), #f08e3c);
    color: #fff !important;
    border-color: transparent;
}

.shwsup-chat-feedback button.is-selected {
    background: #fff3e8;
    border-color: rgba(220, 91, 18, 0.30);
    color: var(--shwsup-chat-primary-dark);
}

.shwsup-chat-suggestions {
    padding: 0 18px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
}

.shwsup-chat-form {
    border-top: 1px solid var(--shwsup-chat-border);
    background: #fff;
    padding: 16px 18px 18px;
}

.shwsup-chat-form__field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--shwsup-chat-surface-soft);
    border: 1px solid var(--shwsup-chat-border);
    border-radius: 18px;
    padding: 8px 10px 8px 14px;
}

.shwsup-chat-form__field input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 14px;
    color: var(--shwsup-chat-ink);
    padding: 0;
    margin: 0;
    line-height: 1.4;
}

.shwsup-chat-form__field button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--shwsup-chat-primary), #f08e3c);
    color: #fff;
    cursor: pointer;
}

.shwsup-chat-form__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
}

.shwsup-chat-form__meta button,
.shwsup-chat-form__hint {
    border: none;
    background: transparent;
    color: var(--shwsup-chat-muted);
    font-weight: 700;
}

.shwsup-chat-form__meta button {
    cursor: pointer;
}

.shwsup-chat-typing {
    display: inline-flex;
    gap: 5px;
    align-items: center;
}

.shwsup-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(130, 101, 79, 0.55);
    animation: shwsup-chat-bounce 1.2s infinite ease-in-out;
}

.shwsup-chat-typing span:nth-child(2) {
    animation-delay: 0.16s;
}

.shwsup-chat-typing span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes shwsup-chat-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.55; }
    40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 767px) {
    .shwsup-chat-launcher {
        right: 14px;
        bottom: 14px;
        padding-right: 16px;
    }

    .shwsup-chat-panel {
        right: 12px;
        left: 12px;
        bottom: 12px;
        width: auto;
        height: calc(100vh - 24px);
        max-height: none;
        border-radius: 26px;
    }
}
