/* Müşteri vitini — yüzen canlı destek */
.ls-widget {
    position: fixed;
    z-index: 9990;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(118px, calc(28px + env(safe-area-inset-bottom)));
    font-family: var(--font-base, system-ui, sans-serif);
    pointer-events: none;
}
.ls-widget__fab {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px 12px 16px;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #db2777 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    box-shadow:
        0 4px 14px rgba(37, 99, 235, 0.45),
        0 2px 6px rgba(15, 23, 42, 0.12);
    transition:
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease;
}
.ls-widget__fab:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 8px 28px rgba(124, 58, 237, 0.35),
        0 4px 12px rgba(15, 23, 42, 0.15);
}
.ls-widget__fab i {
    font-size: 22px;
    line-height: 1;
}
.ls-widget__fab-label {
    letter-spacing: 0.02em;
}
@media (max-width: 480px) {
    .ls-widget__fab-label {
        display: none;
    }
    .ls-widget__fab {
        width: 56px;
        height: 56px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}
.ls-widget__panel {
    pointer-events: auto;
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(400px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    background: var(--surface-card, #fff);
    border-radius: 18px;
    overflow: hidden;
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(15, 23, 42, 0.06);
    animation: ls-widget-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes ls-widget-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.ls-widget__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    background: linear-gradient(135deg, #1e3a8a 0%, #5b21b6 50%, #9d174d 100%);
    color: #fff;
}
.ls-widget__title {
    display: block;
    font-size: 17px;
    letter-spacing: 0.02em;
}
.ls-widget__subtitle {
    display: block;
    font-size: 12px;
    opacity: 0.88;
    margin-top: 4px;
    font-weight: 400;
}
.ls-widget__close {
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.ls-widget__close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.ls-widget__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    padding: 12px 14px 14px;
    overflow: hidden;
}
.ls-widget__step-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800, #1f2937);
    margin: 0 0 12px;
}
.ls-widget__field {
    display: block;
    margin-bottom: 10px;
}
.ls-widget__field span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    margin-bottom: 4px;
}
.ls-widget__field abbr {
    text-decoration: none;
    color: var(--danger, #dc2626);
}
.ls-widget__btn-next,
.ls-widget__btn-back,
.ls-widget__btn-connect {
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    padding: 12px 16px;
}
.ls-widget__btn-next {
    width: 100%;
    margin-top: 8px;
    background: var(--primary, #2563eb);
    color: #fff;
}
.ls-widget__step-actions {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 8px;
    margin-top: 12px;
}
.ls-widget__btn-back {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-800, #1f2937);
}
.ls-widget__btn-connect {
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    color: #fff;
}
.ls-widget__btn-connect:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.ls-widget__topics {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 2px;
}
.ls-widget__topic {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid var(--gray-200, #e5e7eb);
    cursor: pointer;
    font-size: 13px;
    line-height: 1.35;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.ls-widget__topic:has(input:checked) {
    border-color: var(--primary, #2563eb);
    background: #eff6ff;
}
.ls-widget__topic input {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--primary, #2563eb);
}
.ls-widget__cd {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.97);
    z-index: 6;
}
.ls-widget__cd-num {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ls-widget__cd-text {
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--gray-600, #4b5563);
}
.ls-widget__chip {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary, #2563eb);
    background: #eff6ff;
    padding: 6px 10px;
    border-radius: 8px;
    margin: 0 0 8px;
    border: 1px solid #bfdbfe;
}
.ls-widget__chat-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.ls-widget__input {
    width: 100%;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
}
.ls-widget__messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
    max-height: 340px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 35%);
}
.ls-widget__bubble {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 14px 14px 14px 4px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}
.ls-widget__bubble--staff {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--gray-200, #e5e7eb);
    color: var(--gray-800, #1f2937);
}
.ls-widget__bubble--visitor {
    align-self: flex-end;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #fff;
    border-radius: 14px 14px 4px 14px;
}
.ls-widget__bubble time {
    display: block;
    font-size: 10px;
    opacity: 0.72;
    margin-top: 6px;
}
.ls-widget__welcome {
    align-self: center;
    text-align: center;
    font-size: 12px;
    color: var(--gray-500, #6b7280);
    padding: 8px 12px;
    max-width: 95%;
    line-height: 1.4;
}
.ls-widget__closed {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--danger, #dc2626);
    background: #fef2f2;
    border-top: 1px solid #fecaca;
}
.ls-widget__closed--banner {
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #fecaca;
}
.ls-widget__form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    align-items: flex-end;
    background: #fff;
}
.ls-widget__form textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    min-height: 44px;
    max-height: 120px;
}
.ls-widget__form textarea:focus {
    outline: none;
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.ls-widget__send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--primary, #2563eb);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.15s,
        transform 0.15s;
}
.ls-widget__send:hover {
    background: var(--primary-dark, #1d4ed8);
    transform: scale(1.05);
}
.ls-widget__rating {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--gray-100, #f3f4f6);
    background: linear-gradient(180deg, #fafbff 0%, #fff 40%);
}
.ls-widget__rating-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800, #1f2937);
}
.ls-widget__stars {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}
.ls-widget__star {
    flex: 1;
    max-width: 44px;
    height: 40px;
    border: 2px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    background: #fff;
    font-size: 20px;
    line-height: 1;
    color: var(--gray-300, #d1d5db);
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s,
        transform 0.12s;
}
.ls-widget__star:hover {
    border-color: #fbbf24;
    color: #fbbf24;
}
.ls-widget__star.is-active {
    border-color: #f59e0b;
    color: #f59e0b;
    background: #fffbeb;
}
.ls-widget__rating-field {
    display: block;
    margin-bottom: 10px;
}
.ls-widget__rating-field span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    margin-bottom: 4px;
}
.ls-widget__rating-field textarea {
    width: 100%;
    resize: none;
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13px;
    min-height: 52px;
}
.ls-widget__rating-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.ls-widget__rating-submit {
    flex: 1;
    border: none;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, #059669 0%, #2563eb 100%);
    color: #fff;
}
.ls-widget__rating-skip {
    border: none;
    background: transparent;
    color: var(--gray-500, #6b7280);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 8px 6px;
}
.ls-widget__rating-done {
    text-align: center;
    padding: 16px 8px 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700, #374151);
}
.ls-widget__rating-done p {
    margin: 0;
}
@media (prefers-reduced-motion: reduce) {
    .ls-widget__panel {
        animation: none;
    }
    .ls-widget__fab:hover {
        transform: none;
    }
}
