/* Sitedeki asistan balonu (Klinik Asistanı Aşama 2, 2026-10-21). Tüm sınıflar .dta- önekli; site.css'e dokunmaz.
   Yerleşim: masaüstünde sağ alt köşe (sağdaki sosyal şerit ekranın ortasında, çakışmaz);
   ≤1080px'te mobil alt barın (.mbar) ÜSTÜNDE sağda, açılınca tam ekran. */
.dta {
    --dta-teal: var(--c-primary-600, #1f7a7f);
    --dta-teal-deep: var(--c-primary-dark, #164a4d);
    --dta-grad: linear-gradient(135deg, var(--c-primary-500, #29999e), var(--c-secondary-600, #38729d));
    --dta-ink: var(--c-neutral-900, #11110d);
    --dta-muted: var(--c-neutral-600, #6b6b64);
    --dta-line: var(--c-neutral-200, #e8e8e5);
    --dta-soft: var(--c-neutral-100, #f3f3f1);
    font-family: var(--font, Inter, system-ui, sans-serif);
}

/* ---- Açma düğmesi ---- */
.dta-launcher {
    position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 85;
    display: inline-flex; align-items: center; gap: 9px; height: 52px; padding: 0 20px 0 16px;
    border: 0; border-radius: 9999px; cursor: pointer; color: #fff; background: var(--dta-grad);
    font: 700 14.5px/1 var(--font, Inter, sans-serif);
    box-shadow: 0 12px 28px -10px rgba(31, 122, 127, .75), 0 2px 6px rgba(17, 17, 13, .12);
    transition: transform .18s ease, box-shadow .18s ease;
}
.dta-launcher:hover { transform: translateY(-2px); }
.dta-launcher:focus-visible { outline: 3px solid var(--c-primary-200, #5ce1e6); outline-offset: 3px; }
.dta-launcher-ico { flex: none; }
.dta.is-open .dta-launcher { opacity: 0; pointer-events: none; transform: scale(.9); }

@media (max-width: 1080px) {
    /* Mobil alt barın (yükseklik ≈ 66px + 10px boşluk) üstünde, sadece ikon. */
    .dta-launcher { right: 14px; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); width: 52px; padding: 0; justify-content: center; }
    .dta-launcher-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---- Pencere ---- */
.dta-panel {
    position: fixed; right: 22px; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 96;
    width: 384px; max-width: calc(100vw - 28px); height: min(620px, calc(100vh - 44px)); height: min(620px, calc(100dvh - 44px));
    display: flex; flex-direction: column; overflow: hidden;
    background: #fff; color: var(--dta-ink); border-radius: 22px; border: 1px solid var(--dta-line);
    box-shadow: 0 30px 70px -20px rgba(17, 17, 13, .35), 0 4px 14px rgba(17, 17, 13, .08);
    transform-origin: bottom right; animation: dta-in .2s ease-out;
}
.dta-panel[hidden] { display: none; }
@keyframes dta-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 1080px) {
    .dta-panel { inset: 0; right: 0; bottom: 0; width: 100%; max-width: none; height: 100%; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .dta-panel { animation: none; }
    .dta-launcher { transition: none; }
}

.dta-head {
    flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    background: var(--dta-grad); color: #fff;
}
.dta-avatar { flex: none; width: 38px; height: 38px; border-radius: 9999px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.dta-head-txt { flex: 1; min-width: 0; }
.dta-title { margin: 0; font-size: 15.5px; font-weight: 800; line-height: 1.2; }
.dta-sub { margin: 2px 0 0; font-size: 12px; opacity: .88; line-height: 1.3; }
.dta-iconbtn {
    flex: none; width: 36px; height: 36px; border: 0; border-radius: 9999px; display: grid; place-items: center;
    background: transparent; color: #fff; cursor: pointer;
}
.dta-iconbtn:hover { background: rgba(255, 255, 255, .16); }
.dta-iconbtn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.dta-wa {
    flex: none; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px;
    font-size: 13px; font-weight: 700; color: #128c4a; background: #effaf3; border-bottom: 1px solid var(--dta-line); text-decoration: none;
}
.dta-wa:hover { background: #e2f6ea; }

.dta-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; background: #fff; }
.dta-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.dta-msg.bot { align-self: flex-start; background: var(--dta-soft); border-bottom-left-radius: 5px; }
.dta-msg.me { align-self: flex-end; background: var(--dta-teal); color: #fff; border-bottom-right-radius: 5px; }
.dta-msg.note { align-self: center; max-width: 92%; background: #fff7ed; color: #7c2d12; font-size: 13.5px; text-align: center; }
.dta-msg a { color: var(--dta-teal-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.dta-msg.me a { color: #fff; }
.dta-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 13px 14px; border-radius: 16px; border-bottom-left-radius: 5px; background: var(--dta-soft); }
.dta-typing i { width: 7px; height: 7px; border-radius: 9999px; background: var(--dta-muted); opacity: .4; animation: dta-dot 1s infinite ease-in-out; }
.dta-typing i:nth-child(2) { animation-delay: .15s; } .dta-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dta-dot { 0%, 100% { opacity: .3; transform: none; } 50% { opacity: .9; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .dta-typing i { animation: none; opacity: .6; } }

.dta-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0 4px; }
.dta-chip {
    border: 1.5px solid var(--c-primary-200, #5ce1e6); background: var(--c-primary-50, #f0feff); color: var(--dta-teal-deep);
    border-radius: 9999px; padding: 7px 12px; font: 600 13px/1.25 var(--font, Inter, sans-serif); cursor: pointer; text-align: left;
}
.dta-chip:hover { border-color: var(--dta-teal); }

.dta-foot { flex: none; border-top: 1px solid var(--dta-line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; }
.dta-form { display: flex; align-items: flex-end; gap: 8px; }
.dta-input {
    flex: 1; min-width: 0; resize: none; max-height: 120px; border: 1.5px solid var(--dta-line); border-radius: 14px;
    padding: 10px 12px; font: 400 15px/1.4 var(--font, Inter, sans-serif); color: var(--dta-ink); background: #fff;
}
.dta-input:focus { outline: none; border-color: var(--dta-teal); box-shadow: 0 0 0 3px rgba(41, 153, 158, .15); }
.dta-send {
    flex: none; width: 44px; height: 44px; border: 0; border-radius: 9999px; display: grid; place-items: center;
    color: #fff; background: var(--dta-grad); cursor: pointer;
}
.dta-send:disabled { opacity: .45; cursor: default; }
.dta-send:focus-visible { outline: 3px solid var(--c-primary-200, #5ce1e6); outline-offset: 2px; }
.dta-legal { margin: 8px 2px 0; font-size: 11.5px; line-height: 1.4; color: var(--dta-muted); }
.dta-legal a { color: inherit; text-decoration: underline; }

/* Mobilde pencere açıkken sayfa arkada kaymasın */
html.dta-lock, html.dta-lock body { overflow: hidden; }
@media (min-width: 1081px) { html.dta-lock, html.dta-lock body { overflow: auto; } }

/* ---- İletişim kartı (ad + WhatsApp + onay) ---- */
.dta-contact {
    align-self: stretch; margin: 2px 0; padding: 14px 14px 12px; border-radius: 16px;
    background: var(--c-primary-50, #f0feff); border: 1.5px solid var(--c-primary-200, #5ce1e6);
    display: flex; flex-direction: column; gap: 9px;
}
.dta-contact-title { margin: 0; font-size: 14.5px; font-weight: 800; line-height: 1.35; color: var(--dta-teal-deep); }
.dta-contact-text { margin: -4px 0 2px; font-size: 13px; line-height: 1.45; color: var(--dta-muted); }
.dta-field { display: flex; flex-direction: column; gap: 4px; }
.dta-field-lbl { font-size: 12.5px; font-weight: 700; color: var(--dta-ink); }
.dta-field-in {
    width: 100%; box-sizing: border-box; border: 1.5px solid var(--dta-line); border-radius: 11px; padding: 9px 11px;
    font: 400 15px/1.3 var(--font, Inter, sans-serif); color: var(--dta-ink); background: #fff;
}
.dta-field-in:focus { outline: none; border-color: var(--dta-teal); box-shadow: 0 0 0 3px rgba(41, 153, 158, .15); }
.dta-consent { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--dta-ink); cursor: pointer; }
.dta-consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--dta-teal); }
.dta-consent a { color: var(--dta-teal-deep); text-decoration: underline; }
.dta-err { font-size: 12.5px; color: #b42318; font-weight: 600; }
.dta-err:empty { display: none; }
.dta-contact-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.dta-btn {
    border: 0; border-radius: 9999px; padding: 10px 18px; cursor: pointer; color: #fff; background: var(--dta-grad);
    font: 700 14px/1 var(--font, Inter, sans-serif);
}
.dta-btn:disabled { opacity: .6; cursor: default; }
.dta-btn.ghost { background: transparent; color: var(--dta-muted); border: 1.5px solid var(--dta-line); }
.dta-btn:focus-visible { outline: 3px solid var(--c-primary-200, #5ce1e6); outline-offset: 2px; }
.dta-input:disabled { background: var(--dta-soft); }