.ysc-root {
    direction: rtl;
    font-family: Arial, Helvetica, sans-serif;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999998;
}

.ysc-bubble {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: linear-gradient(160deg, var(--ysc-primary, #DDB913), var(--ysc-dark, #1a2744));
    padding: 0;
    line-height: 1;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}

.ysc-bubble-dot {
    position: absolute;
    bottom: 1px;
    left: 1px;
    width: 13px;
    height: 13px;
    background: #3ddc74;
    border: 2px solid #fff;
    border-radius: 50%;
}

.ysc-teaser {
    position: fixed;
    right: 20px;
    bottom: 90px;
    max-width: 220px;
    background: var(--ysc-dark, #1a2744);
    color: #fff;
    padding: 10px 14px;
    border-radius: 14px 14px 3px 14px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
    cursor: pointer;
}

.ysc-teaser[hidden] {
    display: none;
}

.ysc-teaser-close {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background: var(--ysc-secondary, #6EC1E4);
    border: none;
    border-radius: 50%;
    color: #fff;
    opacity: 1;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}

.ysc-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: min(360px, calc(100vw - 40px));
    max-height: min(560px, 75vh);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.ysc-header {
    background: var(--ysc-dark, #1a2744);
    color: #fff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.ysc-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ysc-header-logo {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--ysc-primary, #DDB913);
    color: var(--ysc-dark, #1a2744);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
}

.ysc-header-title {
    font-size: 12.5px;
    line-height: 1.3;
}

.ysc-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

.ysc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 180px;
}

.ysc-msg {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ysc-msg-bot {
    align-self: flex-start;
    background: #f0f2f5;
    color: var(--ysc-dark, #1a2744);
    border-bottom-left-radius: 3px;
}

.ysc-msg-user {
    align-self: flex-end;
    background: var(--ysc-secondary, #6EC1E4);
    color: #fff;
    border-bottom-right-radius: 3px;
}

.ysc-msg a {
    color: inherit;
    text-decoration: underline;
}

.ysc-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
}

.ysc-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ysc-dark, #1a2744);
    opacity: .5;
    animation: ysc-typing-bounce 1.2s infinite ease-in-out;
}

.ysc-typing-dot:nth-child(2) {
    animation-delay: .15s;
}

.ysc-typing-dot:nth-child(3) {
    animation-delay: .3s;
}

@keyframes ysc-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: .5;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.ysc-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 8px;
}

.ysc-quick-reply-btn {
    background: #fff;
    border: 1px solid var(--ysc-secondary, #6EC1E4);
    color: var(--ysc-dark, #1a2744);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
}

.ysc-quick-reply-btn:hover {
    background: var(--ysc-secondary, #6EC1E4);
    color: #fff;
}

.ysc-input-row {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #eee;
}

.ysc-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.ysc-send {
    background: var(--ysc-primary, #DDB913);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
}

.ysc-disclaimer {
    font-size: 10.5px;
    line-height: 1.5;
    color: #888;
    background: #fafafa;
    border-top: 1px solid #eee;
    padding: 8px 12px;
    margin: 0;
    text-align: center;
}

.ysc-footer {
    text-align: center;
    padding: 6px 10px 10px;
}

.ysc-lead-link {
    font-size: 11px;
    color: var(--ysc-dark, #1a2744);
    text-decoration: underline;
    cursor: pointer;
}

.ysc-lead-form {
    padding: 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ysc-lead-form[hidden] {
    display: none;
}

.ysc-lead-disclosure {
    font-size: 11px;
    color: #666;
    margin: 0;
}

.ysc-lead-form input[type="text"],
.ysc-lead-form input[type="tel"] {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
}

.ysc-lead-submit {
    background: var(--ysc-dark, #1a2744);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-size: 13px;
}

.ysc-lead-result {
    font-size: 12px;
    color: var(--ysc-dark, #1a2744);
}

@media (max-width: 480px) {
    .ysc-root {
        right: 10px;
        bottom: 10px;
    }
    .ysc-panel {
        right: 10px;
        bottom: 10px;
    }
    .ysc-teaser {
        right: 10px;
        bottom: 80px;
    }
}
