/* Kural tabanlı asistan (9 Kasım 2026). Davranış Leadoo/detectortesters'tan, görünüm bizim tasarım dilimizden (Kairoxx):
   Geist, nötr palet, 1 px çizgi, dik köşe kart, pill buton, tek sinyal kırmızısı yalnız durum noktasında. site.css tokenlarını kullanır. */

/* ---------- avatar ---------- */
.bot-av{flex:none;display:inline-grid;place-items:center;border-radius:100px;background:var(--ink);color:#fff;font-weight:500;overflow:hidden;letter-spacing:0}
.bot-av--m{width:40px;height:40px;font-size:16px}
.bot-av--s{width:28px;height:28px;font-size:12px}
.bot-av img{width:100%;height:100%;object-fit:cover}

/* ---------- pill düğmeler ---------- */
.bot-pill{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:9px 16px;border-radius:100px;font-size:14px;line-height:1.3;font-weight:500;text-align:left;
  border:1px solid var(--line-2);background:#fff;color:var(--ink);transition:background .25s,color .25s,border-color .25s,transform .4s var(--ease)}
.bot-pill:hover{border-color:var(--ink)}
.bot-pill--dark{background:var(--ink);border-color:var(--ink);color:#fff}
.bot-pill--dark:hover{background:#000}
.bot-pill--link::after{content:"↗";font-size:12px;opacity:.6}
.bot-pill--in::after{content:"→";font-size:13px;opacity:.6}
.bot-pill[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#fff}
.bot-pill[disabled]{opacity:.45;pointer-events:none}

/* ---------- karşılama balonu (masaüstü) ---------- */
.bot-cta{position:fixed;right:16px;bottom:76px;z-index:72;width:340px;display:flex;flex-direction:column;align-items:flex-end;gap:8px;animation:botUp .5s var(--ease)}
.bot-cta-card{position:relative;align-self:stretch;display:flex;gap:12px;align-items:flex-start;background:#fff;border:1px solid var(--line-2);box-shadow:0 16px 48px rgba(28,28,30,.12);padding:16px 40px 16px 16px}
.bot-cta-t{font-size:15px;line-height:1.35;font-weight:500;letter-spacing:-.015em}
.bot-cta-s{font-size:14px;color:var(--t2);margin-top:2px}
.bot-cta-x{position:absolute;right:8px;top:8px;width:28px;height:28px;border-radius:100px;display:grid;place-items:center;color:var(--t2)}
.bot-cta-x:hover{background:var(--soft);color:var(--ink)}
.bot-cta-q{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.bot-cta-q li{animation:botUp .5s var(--ease) both}
.bot-cta-q li:nth-child(2){animation-delay:.06s}.bot-cta-q li:nth-child(3){animation-delay:.12s}.bot-cta-q li:nth-child(4){animation-delay:.18s}
.bot-cta-q .bot-pill{box-shadow:0 8px 24px rgba(28,28,30,.12)}

/* ---------- panel ---------- */
.bot{position:fixed;right:16px;bottom:76px;z-index:73;width:400px;height:min(640px,calc(100vh - var(--hd,66px) - 92px));height:min(640px,calc(100dvh - var(--hd,66px) - 92px));display:flex;flex-direction:column;
  background:#fff;border:1px solid var(--line-2);box-shadow:0 24px 64px rgba(28,28,30,.16);animation:botUp .45s var(--ease)}
.bot-hd{display:flex;align-items:center;gap:12px;padding:14px 12px 14px 16px;background:var(--ink);color:#fff}
.bot-hd .bot-av{background:#fff;color:var(--ink)}
.bot-hd-tx{flex:1;min-width:0}
.bot-hd-t{font-size:16px;line-height:1.25;font-weight:500;letter-spacing:-.015em}
.bot-hd-s{font-size:12px;color:var(--inv-2);display:flex;align-items:center;gap:6px}
.bot-hd-s::before{content:"";width:6px;height:6px;border-radius:100px;background:var(--signal)}
.bot-ic{width:36px;height:36px;border-radius:100px;display:grid;place-items:center;color:#fff;transition:background .25s}
.bot-ic:hover{background:rgba(255,255,255,.12)}
.bot :focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.bot-hd :focus-visible{outline-color:#fff}

.bot-log{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px;display:flex;flex-direction:column;gap:8px;scroll-behavior:smooth}
.bot-log:focus{outline:none}
.bot-m{max-width:88%;font-size:14px;line-height:1.5;white-space:pre-line;overflow-wrap:anywhere;animation:botIn .35s var(--ease)}
.bot-m--bot{align-self:flex-start;background:var(--soft);padding:10px 14px}
.bot-m--user{align-self:flex-end;background:var(--ink);color:#fff;padding:10px 14px}
.bot-m--sys{align-self:center;max-width:100%;font-size:12px;color:var(--t3);text-align:center;padding:2px 8px}
.bot-m--agent{align-self:flex-start;background:#fff;border:1px solid var(--line-2);padding:10px 14px}
.bot-m--note{align-self:flex-start;font-size:13px;color:var(--t2);border-left:2px solid var(--line-2);padding:2px 0 2px 10px}
.bot-who{display:block;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--t3);margin-bottom:2px;white-space:normal}
.bot-step{display:block;font-size:11px;letter-spacing:.04em;text-transform:uppercase;font-weight:500;color:var(--t2);margin-bottom:4px}
.bot-help{display:block;font-size:13px;color:var(--t2);margin-top:4px}
.bot-links{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;white-space:normal}
.bot-links a{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.bot-links a:hover{text-decoration-thickness:2px}
.bot-links a[target]::after{content:"↗";font-size:11px;text-decoration:none}
.bot-sum{display:block;margin-top:6px;padding-top:6px;border-top:1px solid rgba(255,255,255,.18);font-size:12px;color:var(--inv-2);white-space:pre-line}

/* yazıyor */
.bot-typing{padding:0 16px 8px}
.bot-dots{display:inline-flex;gap:4px;background:var(--soft);padding:12px 14px}
.bot-dots i{width:6px;height:6px;border-radius:100px;background:var(--t3);animation:botDot 1.1s infinite ease-in-out}
.bot-dots i:nth-child(2){animation-delay:.15s}.bot-dots i:nth-child(3){animation-delay:.3s}

/* ---------- kartlar (karusel) ---------- */
.bot-cards{align-self:stretch;position:relative;animation:botIn .35s var(--ease)}
.bot-track{display:flex;gap:8px;overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:none;padding-bottom:2px;overscroll-behavior-x:contain}
.bot-track::-webkit-scrollbar{display:none}
.bot-card{flex:0 0 78%;scroll-snap-align:start;border:1px solid var(--line);background:#fff;display:flex;flex-direction:column}
.bot-card-img{aspect-ratio:4/3;background:var(--soft);display:grid;place-items:center;overflow:hidden}
.bot-card-img img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}
.bot-card-b{padding:12px;display:flex;flex-direction:column;gap:6px;flex:1}
.bot-card-role{font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--t2)}
.bot-card-t{font-size:14px;line-height:1.35;font-weight:500}
.bot-card-p{font-size:13px;color:var(--t2)}
.bot-card-r{font-size:12px;color:var(--t2);display:flex;flex-direction:column;gap:2px}
.bot-card-r li{padding-left:12px;position:relative}
.bot-card-r li::before{content:"";position:absolute;left:0;top:.6em;width:5px;height:1px;background:currentColor}
.bot-card-a{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto;padding-top:6px}
.bot-card-a .bot-pill{min-height:34px;padding:6px 12px;font-size:13px}
.bot-nav{display:flex;justify-content:flex-end;gap:6px;margin-top:6px}
.bot-nav button{width:32px;height:32px;border-radius:100px;border:1px solid var(--line-2);display:grid;place-items:center}
.bot-nav button:hover{border-color:var(--ink)}
.bot-nav button[disabled]{opacity:.35;pointer-events:none}

/* ---------- girdi alanı ---------- */
.bot-in{border-top:1px solid var(--line);padding:12px 16px;max-height:52%;overflow-y:auto;overscroll-behavior:contain}
.bot-in:empty{display:none}
.bot-opts{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
.bot-opts--sel .bot-pill{flex-direction:column;align-items:flex-start;gap:0}
.bot-opts small{font-size:12px;font-weight:400;opacity:.7}
.bot-form{display:grid;grid-template-columns:1fr 1fr;gap:10px 8px}
.bot-f{display:flex;flex-direction:column;gap:4px;grid-column:1/-1;min-width:0}
.bot-f--half{grid-column:auto}
.bot-f label{font-size:12px;font-weight:500;color:var(--t2)}
.bot-f label b{color:var(--signal);font-weight:500}
.bot-f input,.bot-f select,.bot-f textarea,.bot-txt textarea{width:100%;min-height:40px;border:1px solid var(--line-2);background:#fff;padding:8px 10px;font-size:16px;line-height:1.35;border-radius:0;transition:border-color .2s}
.bot-f textarea{min-height:64px;resize:vertical}
.bot-f input:focus,.bot-f select:focus,.bot-f textarea:focus,.bot-txt textarea:focus{outline:none;border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.bot-f [aria-invalid="true"]{border-color:var(--signal)}
.bot-err{font-size:12px;color:var(--signal)}
.bot-err:empty{display:none}
.bot-row{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;align-items:center;flex-wrap:wrap}
.bot-msg-err{font-size:13px;color:var(--signal);margin-right:auto}
.bot-msg-err:empty{display:none}
.bot-txt{display:flex;gap:8px;align-items:flex-end}
.bot-txt textarea{min-height:44px;max-height:140px;resize:none}
.bot-send{flex:none;width:44px;height:44px;border-radius:100px;background:var(--ink);color:#fff;display:grid;place-items:center}
.bot-send:hover{background:#000}
.bot-send[disabled]{opacity:.45}
.bot-file{display:flex;flex-direction:column;gap:8px}
.bot-drop{display:flex;flex-direction:column;align-items:center;gap:4px;border:1px dashed var(--line-2);padding:16px;text-align:center;font-size:13px;color:var(--t2);cursor:pointer}
.bot-drop:hover,.bot-drop:focus-within{border-color:var(--ink);color:var(--ink)}
.bot-drop b{font-weight:500;color:var(--ink)}
.bot-thumbs{display:flex;gap:6px;flex-wrap:wrap}
.bot-thumbs img{width:56px;height:56px;object-fit:cover;border:1px solid var(--line)}
.bot-consent{display:flex;flex-direction:column;gap:8px}

/* ---------- alt bilgi ---------- */
.bot-ft{display:flex;align-items:center;gap:8px;padding:8px 16px 10px;border-top:1px solid var(--line);font-size:12px;color:var(--t3)}
.bot-ft-b{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:500;color:var(--ink);padding:4px 8px 4px 4px;border-radius:100px}
.bot-ft-b:hover{background:var(--soft)}
.bot-ft-n{margin-left:auto;text-align:right}
.bot-ft-n a{text-decoration:underline;text-underline-offset:2px}

/* ---------- hareket ---------- */
@keyframes botUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes botIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes botDot{0%,80%,100%{opacity:.3;transform:none}40%{opacity:1;transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.bot,.bot-cta,.bot-cta-q li,.bot-m,.bot-cards{animation:none}.bot-dots i{animation:none;opacity:.6}.bot-log{scroll-behavior:auto}}

/* ---------- kısa ekran (ör. 800×600): panel açıkken yüzen WhatsApp/Asistan düğmeleri gizlenir, panel tabana iner (Tur 2 düzeltmesi).
   Kapatma panelin başlığındaki düğmeyle; kapanınca düğmeler geri gelir ve odak Asistan düğmesine döner. ---------- */
@media (max-height:720px) and (min-width:641px){
  html.bot-open .fab{display:none}
  .bot{bottom:16px;height:calc(100vh - var(--hd,66px) - 32px);height:calc(100dvh - var(--hd,66px) - 32px)}
}

/* ---------- mobil: tam ekran panel, karşılama balonu yok ---------- */
@media (max-width:640px){
  .bot-cta{display:none!important}
  .bot{inset:0;right:0;bottom:0;width:100%;height:100%;border:0;box-shadow:none;animation:none}
  .bot-hd{padding-top:max(14px,env(safe-area-inset-top))}
  .bot-ft{padding-bottom:max(10px,env(safe-area-inset-bottom))}
  .bot-card{flex-basis:82%}
  .bot-m{max-width:92%}
  html.bot-open{overflow:hidden}
  html.bot-open .fab{display:none}
}

/* ---------- Tur 4 (10 Kasım 2026): tek iletişim girişi. Sohbet paneli masaüstünde de sağdan tam boy yan panel (iletişim paneliyle aynı aile:
   beyaz, 1 px çizgi, köşesiz, gölgesiz); karşılama balonu kenar sekmesinin soluna, sekmeyle aynı hizaya oturur. Mobilde tam ekran (yukarıda). ---------- */
@media (min-width:641px){
  .bot{top:0;right:0;bottom:0;height:auto;width:min(420px,100vw);border:0;border-left:1px solid var(--line-2);box-shadow:none;animation:botSide .5s var(--ease)}
  .bot-hd{padding-top:max(14px,env(safe-area-inset-top))}
}
@media (min-width:810px){
  .bot-cta{right:80px;bottom:28px}
}
@media (min-width:641px) and (max-width:809px){.bot-cta{right:16px;bottom:auto;top:calc(var(--hd) + 12px)}}
@keyframes botSide{from{transform:translateX(100%)}to{transform:none}}
@media (prefers-reduced-motion:reduce){.bot{animation:none}}
/* çerez bandı açıkken (consent.css › html.scc-on) yan panel bandın üstünde biter; yüzen düğme payı (76 px) artık yok */
@media (min-width:641px){html.scc-on body .bot{bottom:var(--scc-h,0px)}}
