/* Sohbet asistanı — "Dört Şerit" */
.cs-chat { --c-ink: #1B1230; --c-muted: #5B5470; --c-soft: #F6F4FA; --c-line: #E4DEEE; --c-magenta: #D60F58; --c-purple: #5B2A9E;
    font-family: 'Open Sans', 'Open Sans Fallback', sans-serif; color: var(--c-ink); }
.cs-chat *, .cs-chat *::before, .cs-chat *::after { box-sizing: border-box; }
.cs-chat [hidden] { display: none !important; }

/* Açma düğmesi: WhatsApp düğmesinin üstünde */
.cs-chat-launcher {
    position: fixed; right: 20px; bottom: 172px; z-index: 101; width: 60px; height: 60px; border: 0; border-radius: 50%;
    background: var(--c-magenta); color: #fff; font-size: 26px; cursor: pointer; display: grid; place-items: center;
    box-shadow: 0 14px 28px -10px rgba(214, 15, 88, .7); transition: transform .15s ease, background .15s ease;
}
.cs-chat-launcher:hover { background: #A80B45; transform: translateY(-2px); }
.cs-chat-launcher:focus-visible, .cs-chat button:focus-visible, .cs-chat a:focus-visible { outline: 3px solid rgba(91, 42, 158, .45); outline-offset: 2px; }
.cs-chat-launcher .fa-times { display: none; }
.cs-chat[data-open="true"] .cs-chat-launcher { display: none; }
.cs-chat-launcher::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--c-magenta); opacity: 0; animation: csChatPulse 2.6s ease-out 2; }
@keyframes csChatPulse { 0% { transform: scale(.9); opacity: .6; } 100% { transform: scale(1.35); opacity: 0; } }

/* Davet balonu */
.cs-chat-teaser { position: fixed; right: 92px; bottom: 182px; z-index: 101; max-width: 250px; padding: 14px 34px 14px 16px; border-radius: 18px 18px 4px 18px;
    background: #fff; border: 1px solid var(--c-line); box-shadow: 0 20px 36px -22px rgba(42, 15, 77, .5); font-size: 14.5px; line-height: 1.45; font-weight: 600; animation: csChatIn .25s ease; }
.cs-chat-teaser span { cursor: pointer; }
.cs-chat-teaser-x { position: absolute; right: 8px; top: 6px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--c-muted); cursor: pointer; }
@keyframes csChatIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Panel */
.cs-chat-panel { position: fixed; right: 20px; bottom: 20px; z-index: 1100; width: 380px; max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 40px));
    display: flex; flex-direction: column; overflow: hidden; border-radius: 24px; background: #fff; border: 1px solid var(--c-line);
    box-shadow: 0 40px 70px -28px rgba(27, 18, 48, .55); animation: csChatIn .22s ease; }
.cs-chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; background: #fff; }
.cs-chat-head > div { flex: 1; min-width: 0; }
.cs-chat-head strong { display: block; font-family: 'Montserrat', sans-serif; font-size: 16px; font-weight: 800; line-height: 1.2; }
.cs-chat-head small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--c-muted); }
.cs-chat-dot { width: 8px; height: 8px; border-radius: 50%; background: #3E9E2E; display: inline-block; }
.cs-chat-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: #FDE6EE; color: var(--c-magenta); font-size: 18px; flex: none; }
.cs-chat-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--c-soft); color: var(--c-ink); cursor: pointer; font-size: 15px; }
.cs-chat-close:hover { background: #ECE7F5; }
.cs-chat-band { display: flex; height: 5px; flex: none; }
.cs-chat-band span { flex: 1; }
.cs-chat-band span:nth-child(1) { background: #F5A00F; } .cs-chat-band span:nth-child(2) { background: #B8D014; }
.cs-chat-band span:nth-child(3) { background: #3FA9E0; } .cs-chat-band span:nth-child(4) { background: #E0105C; }

.cs-chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 8px; background: var(--c-soft); display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.cs-chat-msg { max-width: 86%; padding: 11px 15px; border-radius: 18px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; animation: csChatIn .2s ease; }
.cs-chat-msg--bot { align-self: flex-start; background: #fff; border: 1px solid var(--c-line); border-bottom-left-radius: 5px; color: var(--c-ink); }
.cs-chat-msg--user { align-self: flex-end; background: var(--c-magenta); color: #fff; border-bottom-right-radius: 5px; }
.cs-chat-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.cs-chat-typing i { width: 7px; height: 7px; border-radius: 50%; background: #B3AAC7; animation: csChatDot 1s infinite ease-in-out; }
.cs-chat-typing i:nth-child(2) { animation-delay: .15s; } .cs-chat-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes csChatDot { 0%, 80%, 100% { transform: scale(.7); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
.cs-chat-links { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.cs-chat-links a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--c-line); font-family: 'Montserrat', sans-serif; font-size: 13.5px; font-weight: 700; color: var(--c-purple); }
.cs-chat-links a:hover { border-color: var(--c-magenta); color: var(--c-magenta); text-decoration: none; }

.cs-chat-replies { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 12px; background: var(--c-soft); max-height: 170px; overflow-y: auto; }
.cs-chat-replies:empty { display: none; }
.cs-chat-replies button { padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--c-magenta); background: #fff; color: var(--c-magenta); font-family: 'Montserrat', sans-serif; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.cs-chat-replies button:hover { background: var(--c-magenta); color: #fff; }
.cs-chat-replies button.is-ghost { border-color: var(--c-line); color: var(--c-muted); }
.cs-chat-replies button.is-ghost:hover { background: var(--c-soft); color: var(--c-ink); border-color: var(--c-muted); }

.cs-chat-input { flex: none; display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--c-line); }
.cs-chat-input input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid #DDD8E8; border-radius: 14px; font-size: 15px; color: var(--c-ink); outline: none; }
.cs-chat-input input:focus { border-color: var(--c-purple); box-shadow: 0 0 0 3px rgba(91, 42, 158, .12); }
.cs-chat-input button { width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--c-magenta); color: #fff; cursor: pointer; }
.cs-chat-input button:hover { background: #A80B45; }

.cs-chat-foot { flex: none; display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; padding: 10px 16px; background: #fff; border-top: 1px solid var(--c-line); font-size: 13px; }
.cs-chat-foot a { color: var(--c-ink); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.cs-chat-foot a:hover { color: var(--c-magenta); text-decoration: none; }
.cs-chat-foot .fa-whatsapp { color: #1FA855; }
.cs-chat-restart { margin-left: auto; border: 0; background: none; color: var(--c-muted); font-size: 13px; cursor: pointer; text-decoration: underline; }
.cs-chat-restart:hover { color: var(--c-ink); }

@media (max-width: 575px) {
    .cs-chat-panel { right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
    .cs-chat-launcher { right: 14px; bottom: 164px; }
    .cs-chat-teaser { right: 84px; bottom: 172px; max-width: calc(100vw - 110px); }
}
@media (prefers-reduced-motion: reduce) { .cs-chat * { animation: none !important; scroll-behavior: auto !important; } }
@media print { .cs-chat { display: none; } }
