/* idealsunucu canlı destek penceresi (v9.7) */
.cd-pencere {
  --cd-lacivert: #121822; --cd-lacivert-2: #1B2436; --cd-turuncu: #F39C12; --cd-turuncu-2: #E08E0B; --cd-mavi: #1E5BFF;
  --cd-zemin: #F4F6FA; --cd-kart: #FFFFFF; --cd-yazi: #10131A; --cd-soluk: #5D6576; --cd-cizgi: #E3E7EE;
  position: fixed; right: 24px; bottom: 24px; z-index: 1200;
  width: 380px; height: min(620px, calc(100dvh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cd-zemin); color: var(--cd-yazi);
  border-radius: 20px; border: 1px solid rgba(16, 19, 26, .08);
  box-shadow: 0 30px 80px -20px rgba(10, 14, 30, .45), 0 8px 24px -8px rgba(10, 14, 30, .2);
  font-family: var(--f-body, "Poppins", system-ui, sans-serif); font-size: 14px;
  opacity: 0; transform: translateY(14px) scale(.98); transform-origin: bottom right;
  transition: opacity .2s ease, transform .2s ease;
}
.cd-pencere.cd-gorunur { opacity: 1; transform: none; }
.cd-pencere[hidden] { display: none; }

.cd-ust {
  display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px;
  background: linear-gradient(135deg, var(--cd-lacivert) 0%, var(--cd-lacivert-2) 100%); color: #fff;
  position: relative;
}
.cd-ust::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--cd-turuncu), #FFC15E 60%, transparent); }
.cd-avatar { position: relative; flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--cd-turuncu); color: #1F1300; }
.cd-avatar-led { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #2ECC71; border: 2px solid var(--cd-lacivert); }
.cd-ekipte .cd-avatar { background: #fff; color: var(--cd-lacivert); }
.cd-ust-yazi { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cd-ust-yazi b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-ust-yazi small { font-size: 12px; color: #AEB8CC; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-kapat { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; }
.cd-kapat:hover { background: rgba(255, 255, 255, .16); }

.cd-akis { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; overscroll-behavior: contain; }
.cd-m { display: flex; flex-direction: column; max-width: 86%; }
.cd-m small { font-size: 11px; color: var(--cd-soluk); margin: 4px 6px 0; }
.cd-balon { padding: 10px 14px; border-radius: 16px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.cd-balon a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cd-asistan, .cd-temsilci { align-self: flex-start; }
.cd-asistan .cd-balon, .cd-temsilci .cd-balon { background: var(--cd-kart); border: 1px solid var(--cd-cizgi); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(16, 19, 26, .04); }
.cd-temsilci .cd-balon { border-color: rgba(243, 156, 18, .45); }
.cd-ziyaretci { align-self: flex-end; align-items: flex-end; }
.cd-ziyaretci .cd-balon { background: var(--cd-lacivert); color: #fff; border-bottom-right-radius: 6px; }
.cd-sistem { align-self: center; max-width: 92%; }
.cd-sistem .cd-balon { background: rgba(243, 156, 18, .12); color: #6B4A08; font-size: 12.5px; text-align: center; border-radius: 12px; padding: 8px 12px; }
.cd-yaziyor .cd-balon { display: flex; gap: 4px; padding: 14px 16px; }
.cd-yaziyor i { width: 7px; height: 7px; border-radius: 50%; background: #9AA3B5; animation: cd-zipla 1.1s infinite ease-in-out; }
.cd-yaziyor i:nth-child(2) { animation-delay: .15s; } .cd-yaziyor i:nth-child(3) { animation-delay: .3s; }
@keyframes cd-zipla { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.cd-cipler { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; }
.cd-cipler[hidden] { display: none; }
.cd-cipler button { border: 1px solid var(--cd-cizgi); background: var(--cd-kart); color: var(--cd-yazi); font: inherit; font-size: 12.5px; padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s; }
.cd-cipler button:hover { border-color: var(--cd-turuncu); color: #8A5600; }
.cd-cipler [data-ekip] { border-color: rgba(243, 156, 18, .6); background: #FFF6E6; }

.cd-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 8px 8px 8px 14px; background: var(--cd-kart); border: 1px solid var(--cd-cizgi); border-radius: 16px; }
.cd-form:focus-within { border-color: var(--cd-turuncu); box-shadow: 0 0 0 3px rgba(243, 156, 18, .18); }
.cd-form textarea { flex: 1; border: 0; outline: 0; resize: none; background: none; font: inherit; color: inherit; line-height: 1.45; padding: 7px 0; max-height: 120px; min-height: 22px; }
.cd-gonder { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--cd-turuncu); color: #1F1300; cursor: pointer; transition: background .15s, transform .15s; }
.cd-gonder:hover { background: var(--cd-turuncu-2); } .cd-gonder:active { transform: scale(.94); }
.cd-not { margin: 0; padding: 8px 16px 12px; font-size: 11px; line-height: 1.45; color: var(--cd-soluk); text-align: center; }
.cd-not a { color: inherit; }

/* Dok içindeki düğme ve okunmamış rozeti */
.dok-canli .dok-ik { position: relative; color: #FFC15E; }
.cd-rozet { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #E74C3C; color: #fff; font: 600 11px/18px var(--f-body, sans-serif); font-style: normal; text-align: center; }
.cd-rozet[hidden] { display: none; }
.cd-baslatici { position: fixed; right: 24px; bottom: 24px; z-index: 1100; display: inline-flex; align-items: center; gap: 10px; padding: 14px 20px; border: 0; border-radius: 999px; background: var(--vt-turuncu, #F39C12); color: #1F1300; font: 600 15px var(--f-body, sans-serif); box-shadow: 0 14px 30px -10px rgba(243, 156, 18, .7); cursor: pointer; }

:root[data-theme="dark"] .cd-pencere { --cd-zemin: #0E131D; --cd-kart: #161D2B; --cd-yazi: #E8ECF4; --cd-soluk: #98A2B6; --cd-cizgi: #263044; }
:root[data-theme="dark"] .cd-sistem .cd-balon { color: #FFD38A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cd-pencere { --cd-zemin: #0E131D; --cd-kart: #161D2B; --cd-yazi: #E8ECF4; --cd-soluk: #98A2B6; --cd-cizgi: #263044; }
  :root:not([data-theme="light"]) .cd-sistem .cd-balon { color: #FFD38A; }
}

@media (max-width: 600px) {
  .cd-pencere { right: 0; left: 0; bottom: 0; width: auto; height: 88dvh; border-radius: 20px 20px 0 0; transform-origin: bottom center; }
  .cd-form { margin-bottom: max(0px, env(safe-area-inset-bottom)); }
  .cd-form textarea { font-size: 16px; }
  .cd-baslatici { right: 16px; bottom: 16px; padding: 14px; }
  .cd-baslatici span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cd-pencere { transition: none; } .cd-yaziyor i { animation: none; } }
.cd-acik .dok, .cd-acik .cd-baslatici { opacity: 0; pointer-events: none; transition: opacity .2s; }

/* v9.8 Robot maskot */
.cd-avatar { background: linear-gradient(145deg, #FFF6E6, #FFE2B3); overflow: visible; }
.cd-avatar .robot { width: 40px; height: 40px; }
.cd-ekipte .cd-avatar { background: #fff; }
.cd-dusunuyor .cd-avatar .robot { animation: rb-suz .7s ease-in-out infinite; }
.cd-dusunuyor .cd-avatar .rb-anten-isik { animation-duration: .5s; }
.dok-robot { background: linear-gradient(145deg, #FFF6E6, #FFD99A) !important; overflow: visible; }
.dok-robot .robot { width: 34px; height: 34px; }
.cd-baslatici .robot { width: 30px; height: 30px; }
.cd-karsila { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 4px 18px 10px; }
.cd-karsila .robot { width: 96px; height: 120px; margin-bottom: 2px; }
.cd-karsila b { font: 700 18px/1.3 var(--f-display, sans-serif); color: var(--cd-yazi); }
.cd-karsila span { font-size: 13px; color: var(--cd-soluk); max-width: 30ch; }

/* Davet: el sallayan robot + konuşma balonu */
.cd-davet { position: fixed; right: 24px; bottom: 20px; z-index: 1150; display: flex; align-items: flex-end; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit;
  opacity: 0; transform: translateY(20px) scale(.9); transform-origin: bottom right; transition: opacity .35s ease, transform .45s cubic-bezier(.2, 1.4, .4, 1); }
.cd-davet--gorunur { opacity: 1; transform: none; }
.cd-davet[hidden] { display: none; }
.cd-davet .robot { width: 70px; height: 88px; filter: drop-shadow(0 10px 14px rgba(18, 24, 34, .25)); }
.cd-davet .rb-el { animation-duration: 1.6s; }
.cd-davet-balon { position: relative; max-width: 220px; margin-bottom: 52px; padding: 12px 14px; border-radius: 16px 16px 4px 16px; background: #fff; color: #10131A; font-size: 13.5px; line-height: 1.45; text-align: left;
  box-shadow: 0 16px 36px -12px rgba(18, 24, 34, .35), 0 0 0 1px rgba(18, 24, 34, .06); }
.cd-davet-balon b { color: #C27400; }
.cd-acik .cd-davet { display: none; }
@media (max-width: 1199px) { .cd-davet { right: 86px; bottom: 16px; } }
@media (max-width: 600px) { .cd-davet-balon { max-width: 170px; font-size: 12.5px; } .cd-davet .robot { width: 58px; height: 72px; } }
