.at-sohbet {
    --at-sohbet-kenar: 16px;
    position: fixed;
    right: var(--at-sohbet-kenar);
    bottom: var(--at-sohbet-kenar);
    z-index: 1600;
    font-size: 14px;
    line-height: 1.5;
}

.at-sohbet--left {
    right: auto;
    left: var(--at-sohbet-kenar);
}

body:has(.at-sohbet--right:not([hidden])) .at-yukari {
    bottom: 86px;
}

body:has(.at-sohbet--left:not([hidden])) .at-hizli-iletisim {
    bottom: 86px;
}

.pc__launcher {
    position: relative;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--at-gradient);
    color: #fff;
    box-shadow: var(--at-glow), 0 12px 30px -10px rgba(10, 27, 61, .45);
    transition: transform .2s var(--at-ease);
}

.pc__launcher:hover {
    transform: translateY(-2px) scale(1.03);
}

.pc__launcher:focus-visible {
    outline: 3px solid var(--at-accent);
    outline-offset: 3px;
}

.pc__launcher-icon {
    position: absolute;
    display: grid;
    place-items: center;
    transition: opacity .2s var(--at-ease), transform .2s var(--at-ease);
}

.pc__launcher-icon--close {
    opacity: 0;
    transform: rotate(-90deg) scale(.6);
}

.pc__launcher.is-open .pc__launcher-icon--chat {
    opacity: 0;
    transform: rotate(90deg) scale(.6);
}

.pc__launcher.is-open .pc__launcher-icon--close {
    opacity: 1;
    transform: none;
}

.pc__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: var(--at-radius-pill);
    background: var(--at-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.pc__panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    flex-direction: column;
    width: min(370px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 110px));
    overflow: hidden;
    border: 1px solid var(--at-line);
    border-radius: var(--at-radius-lg);
    background: var(--at-surface);
    color: var(--at-text);
    box-shadow: var(--at-shadow-lg);
    animation: at-sohbet-ac .22s var(--at-ease);
}

.at-sohbet--left .pc__panel {
    right: auto;
    left: 0;
}

@keyframes at-sohbet-ac {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

.pc__head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px 14px 16px;
    background: var(--at-navy);
    background-image: radial-gradient(260px 120px at 100% 0%, color-mix(in srgb, var(--at-primary) 55%, transparent), transparent 70%);
    color: #fff;
}

.pc__avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--at-gradient);
    color: #fff;
}

.pc__head-text {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.3;
}

.pc__head-text strong {
    font-size: 15px;
}

.pc__status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--at-hero-muted);
    font-size: 12px;
}

.pc__dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #3EE38C;
    box-shadow: 0 0 0 3px rgba(62, 227, 140, .22);
}

.pc__head-actions {
    display: flex;
    gap: 2px;
}

.pc__hbtn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: var(--at-radius-sm);
    background: transparent;
    color: #fff;
}

.pc__hbtn:hover {
    background: rgba(255, 255, 255, .12);
}

.pc__menu {
    position: absolute;
    right: 12px;
    top: calc(100% - 6px);
    z-index: 3;
    display: grid;
    min-width: 180px;
    padding: 6px;
    border: 1px solid var(--at-line);
    border-radius: var(--at-radius);
    background: var(--at-surface);
    box-shadow: var(--at-shadow-lg);
}

.pc__menu button {
    padding: 9px 12px;
    border: 0;
    border-radius: var(--at-radius-sm);
    background: transparent;
    color: var(--at-text);
    font-size: 14px;
    text-align: left;
}

.pc__menu button:hover {
    background: var(--at-soft);
}

.pc__intro, .pc__rate {
    display: grid;
    gap: 12px;
    padding: 18px 16px;
    overflow-y: auto;
}

.pc__intro-text {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--at-radius);
    background: var(--at-soft);
    color: var(--at-text);
}

.pc__field {
    display: grid;
    gap: 5px;
}

.pc__field > span {
    font-size: 13px;
    font-weight: 600;
}

.pc__field input, .pc__field select, .pc__rate textarea, .pc__compose textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--at-line-strong);
    border-radius: var(--at-radius);
    background: var(--at-input-bg);
    color: var(--at-text);
    font-size: 14.5px;
}

.pc__field input:focus, .pc__field select:focus, .pc__rate textarea:focus, .pc__compose textarea:focus {
    outline: none;
    border-color: var(--at-primary);
    box-shadow: var(--at-focus);
}

.pc__error {
    margin: 0;
    padding: 8px 12px;
    border-left: 3px solid var(--at-danger);
    border-radius: var(--at-radius-sm);
    background: color-mix(in srgb, var(--at-danger) 9%, var(--at-surface));
    color: var(--at-danger);
    font-size: 13px;
}

.pc__submit {
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: var(--at-radius);
    background: var(--at-gradient);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--at-glow);
}

.pc__submit[disabled] {
    opacity: .65;
}

.pc__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--at-muted);
    font-size: 12px;
    text-align: center;
}

.pc__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    background: var(--at-surface-2);
}

.pc__body[hidden] {
    display: none;
}

.pc__messages {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
    padding: 16px;
    overflow-y: auto;
}

.pc__sys {
    align-self: center;
    max-width: 90%;
    padding: 4px 12px;
    border-radius: var(--at-radius-pill);
    background: var(--at-soft);
    color: var(--at-muted);
    font-size: 12px;
    text-align: center;
}

.pc__msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 86%;
}

.pc__msg--me {
    align-self: flex-end;
}

.pc__msg-av {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--at-navy);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.pc__bubble {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--at-line);
    border-radius: 14px 14px 14px 4px;
    background: var(--at-surface);
}

.pc__msg--me .pc__bubble {
    border-color: transparent;
    border-radius: 14px 14px 4px 14px;
    background: var(--at-primary);
    color: #fff;
}

.pc__msg-name {
    color: var(--at-primary-ink);
    font-size: 12px;
    font-weight: 700;
}

.pc__msg-text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.pc__msg-time {
    justify-self: end;
    color: var(--at-muted);
    font-size: 11px;
}

.pc__msg--me .pc__msg-time {
    color: rgba(255, 255, 255, .75);
}

.pc__msg[data-pc-bekliyor] .pc__bubble {
    opacity: .7;
}

.pc__agent {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 0 16px 12px;
}

.pc__agent[hidden] {
    display: none;
}

.pc__agent-btn {
    padding: 7px 14px;
    border: 1px solid var(--at-primary);
    border-radius: var(--at-radius-pill);
    background: var(--at-surface);
    color: var(--at-primary-ink);
    font-size: 13px;
    font-weight: 700;
}

.pc__agent-btn:hover {
    background: var(--at-primary);
    color: #fff;
}

.pc__agent-note {
    color: var(--at-muted);
    font-size: 12.5px;
    text-align: center;
}

.pc__agent.is-done .pc__agent-note {
    color: var(--at-success);
}

.pc__typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px 10px;
    color: var(--at-muted);
    font-size: 12.5px;
}

.pc__typing[hidden] {
    display: none;
}

.pc__typing-dots {
    display: inline-flex;
    gap: 3px;
}

.pc__typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--at-muted);
    animation: at-sohbet-yaz 1s infinite ease-in-out;
}

.pc__typing-dots i:nth-child(2) { animation-delay: .15s; }
.pc__typing-dots i:nth-child(3) { animation-delay: .3s; }

@keyframes at-sohbet-yaz {
    0%, 80%, 100% { opacity: .3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.pc__compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--at-line);
    background: var(--at-surface);
}

.pc__compose[hidden] {
    display: none;
}

.pc__compose textarea {
    min-height: 42px;
    max-height: 120px;
    resize: none;
}

.pc__send {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: var(--at-radius);
    background: var(--at-primary);
    color: #fff;
}

.pc__send:hover {
    background: var(--at-primary-ink);
}

.pc__rate p {
    margin: 0;
    font-weight: 700;
    text-align: center;
}

.pc__stars {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.pc__star {
    padding: 2px;
    border: 0;
    background: transparent;
    color: var(--at-line-strong);
    transition: color .15s var(--at-ease), transform .15s var(--at-ease);
}

.pc__star:hover {
    transform: scale(1.1);
}

.pc__star.is-on {
    color: var(--at-accent);
}

.pc__closed {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin: 0;
    padding: 16px;
    border-top: 1px solid var(--at-line);
    color: var(--at-muted);
    text-align: center;
}

.pc__closed[hidden], .pc__intro[hidden], .pc__rate[hidden] {
    display: none;
}

.pc__closed button {
    padding: 8px 16px;
    border: 0;
    border-radius: var(--at-radius);
    background: var(--at-navy);
    color: #fff;
    font-weight: 700;
}

@media (max-width: 479px) {
    .at-sohbet {
        --at-sohbet-kenar: 12px;
    }

    .pc__launcher {
        width: 54px;
        height: 54px;
    }

    .pc__panel {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 78px;
        width: auto;
        max-height: calc(100vh - 96px);
        max-height: calc(100dvh - 96px);
    }

    .at-sohbet--left .pc__panel {
        left: 8px;
    }
}
