/* =========================================================================
   Elk AI — sesli / yazılı asistan (tasarım 07 "Toast stack")
   Sağ altta logo düğmesi · logonun üstünde GEÇİCİ konuşma balonu (dinlerken canlı kelimeler, düşünürken durum,
   kısa cevaplar) ya da ÇIPLAK KART (onay / soru / seçenekler / hata / cevap kartı) · sonuçlar sağ üst bildirim yığını.
   Kalıcı sohbet kutusu yok; klavye satırı yalnız istenince (⌨ / Ctrl+/ / "let me type") ya da mikrofon yokken.
   Yalnız .elk-* sınıfları (izole). Renkler variables.css'ten (açık/koyu tema otomatik).
   Kurallar: kutu içinde kutu yok · parlak/degrade buton yok · butonlar hap (999px).
   ========================================================================= */
.elk { position: fixed; inset: auto 0 0 auto; z-index: 9000; font-family: var(--font); color: var(--text); pointer-events: none; }
.elk * { box-sizing: border-box; }
.elk button { font-family: inherit; }

/* ---- logo düğmesi (FAB) ---- */
.elk-fab { pointer-events: auto; position: fixed; right: 22px; bottom: 22px; width: 70px; height: 70px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-card); box-shadow: 0 10px 28px rgba(0,0,0,.18); display: grid;
  place-items: center; cursor: pointer; padding: 0; transition: transform .16s cubic-bezier(.2,.8,.2,1), box-shadow .18s, border-color .18s;
  view-transition-name: elk-fab; }
.elk-fab img { width: 42px; height: 42px; display: block; pointer-events: none; user-select: none; }   /* (2026-11-06) yeni logo kutuyu doldurur: 50 px'te boynuz uçları dairenin kenarına değiyordu */
.elk-fab:hover { transform: translateY(-2px) scale(1.05); border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent), 0 10px 28px rgba(0,0,0,.2); }
.elk-fab:active { transform: scale(.93); border-color: var(--brand); box-shadow: 0 0 0 7px color-mix(in srgb, var(--brand) 26%, transparent), 0 6px 16px rgba(0,0,0,.18); }
.elk-fab:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.elk-fab.is-live::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--brand); animation: elkPulse 1.6s ease-out infinite; pointer-events: none; }
.elk-fab.is-busy::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--brand); animation: elkSpin .8s linear infinite; pointer-events: none; }
.elk-fab .elk-dot { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; background: #2FB36B; border: 2px solid var(--bg-card); display: none; }
.elk-fab.has-dot .elk-dot { display: block; animation: elkBlink 1.2s ease-in-out infinite; }
/* ilk ziyaret: logonun üstünde 8 sn kalan dikdörtgen ipucu (yalnız bir kez; localStorage elk:intro) */
.elk-callout { pointer-events: auto; position: fixed; right: 22px; bottom: 104px; max-width: 250px; padding: 10px 14px; border-radius: 12px; background: var(--bg-card); color: var(--text); border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0,0,0,.18); opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .35s ease; z-index: 9000; }
.elk-callout.is-in { opacity: 1; transform: none; }
.elk-callout::after { content: ""; position: absolute; right: 22px; bottom: -6px; width: 12px; height: 12px; background: var(--bg-card); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.elk-callout strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.elk-callout span { display: block; font-size: 12.5px; color: var(--text-mute); line-height: 1.35; }
.elk-tip { position: fixed; right: 104px; bottom: 42px; padding: 7px 12px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 600; white-space: nowrap; opacity: 0; transform: translateX(6px); transition: opacity .18s, transform .18s; pointer-events: none; }
.elk-fab:hover + .elk-tip { opacity: 1; transform: none; }
.elk.is-open .elk-tip { display: none; }

/* ---- balon / çıplak kart (logonun üstünde, geçici) ---- */
.elk-bubble { pointer-events: auto; position: fixed; right: 26px; bottom: 106px; width: max-content; min-width: 200px; max-width: min(340px, calc(100vw - 40px));
  max-height: min(70vh, 620px); display: flex; flex-direction: column; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 18px 48px rgba(0,0,0,.22); overflow: hidden; view-transition-name: elk-bubble; animation: elkUp .22s cubic-bezier(.2,.9,.25,1) both; }
.elk-bubble[hidden] { display: none; }
/* sayfa geçişi: yeni sayfada balon YERİNDE durur (giriş animasyonu yok) — 2026-09-29 */
.elk-bubble.is-still { animation: none; }
.elk-bubble.is-bub { border-radius: 18px 18px 6px 18px; }
.elk-bubble.is-card { border-radius: 14px; width: min(340px, calc(100vw - 40px)); }
.elk-scroll { overflow-y: auto; overflow-x: hidden; padding: 12px 14px 4px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.elk-bubble.is-card .elk-scroll { padding: 14px 14px 6px; }

/* alt satır: durum + ⌨ + kapat */
.elk-foot { display: flex; align-items: center; gap: 2px; padding: 4px 6px 6px 14px; }
.elk-status { display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 0; font-size: 11.5px; font-weight: 700; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.elk-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.elk-status.is-think i, .elk-status.is-wait i, .elk-status.is-err i { background: currentColor; }
.elk-status.is-live { color: var(--green); }
.elk-status.is-live i { animation: elkBlink 1.2s ease-in-out infinite; }
.elk-status.is-think { color: var(--text-mute); }
.elk-status.is-think i { animation: elkBlink .8s ease-in-out infinite; }
.elk-status.is-wait { color: var(--orange); }
.elk-status.is-err { color: var(--red); }
.elk-ib { width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: var(--text-dim); display: grid; place-items: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.elk-ib:hover { background: var(--bg-elev); color: var(--text); }
.elk-ib.is-on { color: var(--brand); }
.elk-ib[hidden] { display: none; }
.elk-ib svg { width: 17px; height: 17px; }
/* mikrofon (alt satırda klavyenin yanında): açıkken neon yeşil parlar, kapanınca normale döner — 2026-09-29 */
.elk-micbtn { border-radius: 50%; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.elk-micbtn.is-on { background: #3df28b; color: #053a1c; box-shadow: 0 0 0 3px rgba(61, 242, 139, .26), 0 0 14px 3px rgba(61, 242, 139, .7);
  animation: elkMicGlow 1.8s ease-in-out infinite; }
.elk-micbtn.is-on:hover { background: #5ff5a2; color: #053a1c; }
@keyframes elkMicGlow { 0%, 100% { box-shadow: 0 0 0 3px rgba(61, 242, 139, .2), 0 0 9px 1px rgba(61, 242, 139, .5); }
  50% { box-shadow: 0 0 0 4px rgba(61, 242, 139, .32), 0 0 18px 5px rgba(61, 242, 139, .85); } }

/* içerik: söylenen (soluk), canlı kelimeler, boşta metni */
.elk-heard { font-size: 12.5px; line-height: 1.4; color: var(--text-dim); overflow-wrap: anywhere; }
.elk-heard::before { content: "“"; } .elk-heard::after { content: "”"; }
.elk-next { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--text-mute); }
.elk-next em { font-style: normal; font-weight: 700; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.elk-next span { overflow-wrap: anywhere; }
.elk-next span::before { content: "→ "; color: var(--brand); font-weight: 700; }
.elk-idle { font-size: 15px; font-weight: 600; color: var(--text-dim); }
.elk-hint { font-size: 12.5px; color: var(--text-mute); margin-top: 4px; }
.elk-done { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--green); }
.elk-done i { width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #fff; font-style: normal; font-size: 12px; line-height: 18px; text-align: center; animation: elkPop .25s ease-out; }
@keyframes elkPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* canlı söylenenler: “kelime kelime▌” — yeni kelime tek tek belirir; son iki kelime soluk (henüz kesinleşmedi) */
.elk-words { display: block; font-size: 15px; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.elk-word { display: inline-block; animation: elkWord .3s ease-out both; }
.elk-word.is-seen { animation: none; }
.elk-words.is-live .elk-word.is-int { color: var(--text-mute); }
.elk-q { color: var(--text-dim); }
.elk-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; border-radius: 1px; background: currentColor; vertical-align: -0.16em; animation: elkCaret 1s steps(1) infinite; }
.elk-msg { font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.elk-msg.me { align-self: flex-end; max-width: 88%; padding: 7px 12px; border-radius: 14px 14px 4px 14px; background: var(--bg-elev); color: var(--text); }
.elk-msg.me.is-interim { color: var(--text-mute); }
.elk-msg.elk-say { color: var(--text); font-weight: 600; }
.elk-msg.elk-say.is-error { color: var(--red); }
.elk-thinking { display: inline-flex; gap: 5px; align-items: center; color: var(--text-mute); font-size: 13px; min-height: 20px; }
.elk-thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: elkDot 1s ease-in-out infinite; }
.elk-thinking i:nth-child(2) { animation-delay: .15s; } .elk-thinking i:nth-child(3) { animation-delay: .3s; }

/* cevap / onay kartı — balon zaten kart olduğunda kenarlıksız (kutu içinde kutu yok) */
.elk-card { border: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; animation: elkPop .22s ease-out both; }
.elk-card h4 { margin: 0; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.elk-card p { margin: 0; font-size: 13px; color: var(--text-mute); line-height: 1.45; white-space: pre-line; }
.elk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
.elk-stat b { display: block; font-size: 18px; font-weight: 700; }
.elk-stat span { font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.elk-rows { display: flex; flex-direction: column; }
.elk-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.elk-row:first-child { border-top: 0; }
/* etiket sıkışıp harf harf alt alta düşmesin, uzun değer dışarı taşmasın (2026-09-27: 5 videolu silme kartı) —
   etiket en az %40, değer en çok %60 ve gerekirse sarar */
.elk-row .l { flex: 1 1 40%; min-width: 0; }
.elk-row .l b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.elk-row .l small { display: block; color: var(--text-dim); font-size: 12px; margin-top: 1px; overflow-wrap: anywhere; }
.elk-row .v { flex: 0 1 auto; min-width: 0; max-width: 60%; font-weight: 700; text-align: right; white-space: normal; overflow-wrap: anywhere; }
.elk-row.is-dim { opacity: .7; }
.elk-row .tag { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--text-dim); }
.elk-row .tag.error { background: var(--red); } .elk-row .tag.warning { background: var(--orange); } .elk-row .tag.success { background: var(--green); }
.elk-row button.elk-rowbtn { border: 0; background: none; padding: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.elk-row button.elk-rowbtn:hover b { text-decoration: underline; text-underline-offset: 3px; }
.elk-thumbs { display: flex; gap: 6px; }
.elk-thumbs img { width: 44px; height: 78px; border-radius: 8px; object-fit: cover; background: var(--bg-elev); }
.elk-card.is-settled { opacity: .62; }

/* düğmeler — düz zemin + kenarlık, hap (07: 44 px dokunma yüksekliği) */
.elk-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.elk-btn { font-size: 13.5px; font-weight: 700; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-lt);
  background: var(--bg-card); color: var(--text); cursor: pointer; transition: background .14s, transform .1s; white-space: nowrap; }
.elk-btn:hover { background: var(--bg-elev); }
.elk-btn:active { transform: scale(.97); }
.elk-btn.is-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.elk-btn.is-primary:hover { background: var(--violet-dark); }
.elk-btn.is-danger { background: var(--red-btn); border-color: var(--red-btn); color: var(--red-fg); }
.elk-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.elk-hint { font-size: 12px; color: var(--text-dim); }
.elk-link { border: 0; background: none; padding: 0; color: var(--link); font-weight: 700; font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.elk-opts { display: flex; flex-direction: column; gap: 6px; }
.elk-opt { text-align: left; font-size: 13px; font-weight: 600; min-height: 38px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.elk-opt:hover { border-color: var(--brand); background: var(--tint); }
.elk-opt em { font-style: normal; color: var(--text-dim); font-weight: 700; font-size: 11.5px; min-width: 14px; }
.elk-sugs { display: flex; flex-wrap: wrap; gap: 6px; }
.elk-sug { font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.elk-sug:hover { border-color: var(--brand); }

/* klavye satırı (yalnız istenince ya da mikrofon yokken) */
.elk-input { display: flex; align-items: center; gap: 6px; padding: 6px 8px 8px 14px; border-top: 1px solid var(--border); }
.elk-input[hidden] { display: none; }
.elk-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; padding: 8px 0; }
.elk-input input::placeholder { color: var(--text-dim); }
.elk-mic { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-mute); display: grid; place-items: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.elk-mic:hover { border-color: var(--brand); color: var(--text); }
.elk-mic.is-on { background: var(--brand); border-color: var(--brand); color: var(--brand-fg); }
.elk-mic[hidden] { display: none; }
.elk-mic svg, .elk-send svg { width: 17px; height: 17px; }
.elk-send { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-fg); display: grid; place-items: center; cursor: pointer; padding: 0; flex-shrink: 0; }
.elk-send:disabled { background: var(--bg-elev); color: var(--text-dim); cursor: default; }
.elk-bubble.is-bub .elk-input { min-width: 280px; }

/* ---- sağ üst bildirim yığını (yalnız önemli sonuçlar) ---- */
.elk-toasts { position: fixed; top: 16px; right: 18px; width: min(300px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 9001; view-transition-name: elk-toasts; }
.elk-toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 12px 10px 12px 14px; border-radius: 14px; background: var(--bg-card);
  border: 1px solid var(--border); box-shadow: 0 12px 32px rgba(0,0,0,.2); animation: elkIn .35s cubic-bezier(.2,.9,.25,1) both; }
.elk-toast .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--brand); color: var(--brand-fg); }
.elk-toast.is-error .ic { background: var(--red-btn); color: var(--red-fg); }
.elk-toast.is-info .ic { background: var(--bg-elev); color: var(--text); }
.elk-toast .ic svg { width: 16px; height: 16px; }
.elk-toast .c { flex: 1; min-width: 0; }
.elk-toast b { display: block; font-size: 14px; font-weight: 700; }
.elk-toast span { display: block; font-size: 12.5px; color: var(--text-mute); margin-top: 2px; overflow-wrap: anywhere; }
.elk-toast .elk-btns { margin-top: 8px; }
.elk-toast .elk-btn { min-height: 30px; padding: 0 12px; font-size: 12.5px; }
.elk-toast .elk-ib { width: 28px; height: 28px; }

/* ---- vurgu (ui.highlight / tık gereken işler) ---- */
.elk-hl { outline: 3px solid var(--brand) !important; outline-offset: 3px !important; border-radius: 10px; animation: elkHl 1.2s ease-in-out 3; }
.elk-needclick { pointer-events: auto; position: fixed; z-index: 9002; padding: 8px 12px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 700; box-shadow: 0 10px 28px rgba(0,0,0,.25); animation: elkPop .2s both; }

/* ---- mobil: balon alttan çekmece, bildirimler üstte ---- */
@media (max-width: 640px) {
  .elk-fab { right: 14px; bottom: 14px; width: 62px; height: 62px; }
  .elk-fab img { width: 38px; height: 38px; }
  .elk-callout { right: 14px; bottom: 86px; max-width: calc(100vw - 28px); }
  .elk-tip { display: none; }
  .elk-bubble, .elk-bubble.is-card { right: 8px; left: 8px; width: auto; max-width: none; bottom: 86px; border-radius: 18px; max-height: 64vh; }
  .elk-toasts { top: 8px; right: 8px; left: 8px; width: auto; }
}

@keyframes elkPulse { 0% { transform: scale(.94); opacity: .85 } 100% { transform: scale(1.3); opacity: 0 } }
@keyframes elkSpin { to { transform: rotate(360deg) } }
@keyframes elkBlink { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes elkCaret { 0% { opacity: 1 } 50% { opacity: 0 } }
@keyframes elkUp { from { opacity: 0; transform: translateY(10px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes elkPop { from { opacity: 0; transform: translateY(4px) scale(.97) } to { opacity: 1; transform: none } }
@keyframes elkIn { from { opacity: 0; transform: translateX(24px) } to { opacity: 1; transform: none } }
@keyframes elkWord { from { opacity: 0; transform: translateY(6px); filter: blur(3px) } to { opacity: 1; transform: none; filter: none } }
@keyframes elkDot { 0%,80%,100% { transform: translateY(0); opacity: .45 } 40% { transform: translateY(-4px); opacity: 1 } }
@keyframes elkHl { 0%,100% { outline-color: var(--brand) } 50% { outline-color: transparent } }
@media (prefers-reduced-motion: reduce) {
  .elk *, .elk-hl { animation: none !important; transition: none !important; }
}
