/* Elegan Asistan: sağ altta düğme, sohbet baloncuğu ve sohbet kutusu.
   Renk ve yazı tipleri Elegan temasının değişkenlerinden gelir (açık / koyu tema); başka temada yedek değerler kullanılır.
   Telefonda kutu alttan açılan tam genişlik penceredir; temanın mobil menüsü açıkken asistan gizlenir. */
.asst {
  --asst-bg: var(--navy-950, #2D3035);
  --asst-bg-2: var(--navy-900, #33363C);
  --asst-line: var(--navy-700, #4A4F57);
  --asst-ink: var(--ivory-100, #F4F2EE);
  --asst-mute: var(--mist-400, #A9AEB5);
  --asst-accent: var(--accent-500, #D59F45);
  --asst-gold: #D59F45;
  --asst-dark: #24272B;
  --asst-sans: var(--sans, system-ui, -apple-system, 'Segoe UI', sans-serif);
  --asst-ease: var(--ease-out, cubic-bezier(0.23, 1, 0.32, 1));
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  display: grid; justify-items: end; gap: 12px; font-family: var(--asst-sans); font-size: 14px; line-height: 1.5; color: var(--asst-ink);
}
:where(.asst) *, :where(.asst) *::before, :where(.asst) *::after { box-sizing: border-box; }
:where(.asst) :is(p, ul, h2) { margin: 0; padding: 0; }
:where(.asst) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
:where(.asst) a { color: inherit; text-decoration: none; }
html:has(.mnav.is-open) .asst { display: none; }
.asst__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.asst__icon { display: block; width: 18px; height: 18px; flex: none; }
.asst__mark { display: block; fill: currentColor; }

/* Düğme */
.asst__toggle { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 8px; border-radius: 999px; color: #F4F2EE; background: var(--asst-dark); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.08); font: 500 14px/1 var(--asst-sans); transition: transform 300ms var(--asst-ease), background-color 300ms; }
.asst__toggle-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--asst-gold); }
.asst__toggle-icon .asst__mark { width: 20px; fill: var(--asst-dark); }
.asst__toggle-close { display: none; }
.asst.is-open .asst__toggle { padding: 0; width: 52px; justify-content: center; }
.asst.is-open .asst__toggle-icon, .asst.is-open .asst__toggle-label { display: none; }
.asst.is-open .asst__toggle-close { display: grid; }
@media (hover: hover) and (pointer: fine) { .asst__toggle:hover { transform: translateY(-2px); } }
.asst__toggle:focus-visible, .asst__panel :focus-visible, .asst__bubble :focus-visible { outline: 2px solid var(--asst-gold); outline-offset: 2px; }

/* Sohbet baloncuğu: düğmenin üstünde, kuyruğu düğmenin ikonuna bakar */
.asst__bubble { position: relative; display: flex; align-items: flex-start; gap: 4px; max-width: min(280px, calc(100vw - 32px)); margin-right: 6px; padding: 12px 8px 12px 16px; border-radius: 18px 18px 6px 18px; color: var(--asst-dark); background: #F7F5F1; box-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(36, 39, 43, 0.08);
  opacity: 0; transform: translateY(10px) scale(0.94); transform-origin: 100% 100%; transition: opacity 260ms var(--asst-ease), transform 420ms var(--asst-ease); }
.asst__bubble.is-in { opacity: 1; transform: none; }
.asst__bubble[hidden] { display: none; }
.asst__bubble::after { content: ''; position: absolute; right: 18px; bottom: -7px; width: 14px; height: 14px; background: inherit; border-radius: 0 0 4px 0; transform: rotate(45deg); box-shadow: 1px 1px 0 rgba(36, 39, 43, 0.06); }
.asst__bubble-text { text-align: left; font: 500 14px/1.4 var(--asst-sans); color: inherit; }
.asst__bubble-close { flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: -4px; border-radius: 50%; color: #6B7077; }
.asst__bubble-close .asst__icon { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .asst__bubble-close:hover { color: var(--asst-dark); background: rgba(36, 39, 43, 0.07); } }
.asst.is-open .asst__bubble { display: none; }

/* Sohbet kutusu */
.asst__panel { width: min(380px, calc(100vw - 32px)); height: min(600px, calc(100svh - 120px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; color: var(--asst-ink); background: var(--asst-bg); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--asst-line); }
.asst__panel[hidden] { display: none; }
.asst__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; border-bottom: 1px solid var(--asst-line); }
.asst__avatar { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--asst-dark); }
.asst__avatar .asst__mark { width: 20px; fill: var(--asst-gold); }
.asst__title { font: 500 16px/1.2 var(--display, var(--asst-sans)); letter-spacing: -0.01em; color: inherit; }
.asst__close { margin-left: auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--asst-mute); }
.asst__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: grid; align-content: start; gap: 10px; }
.asst__msg { max-width: 92%; padding: 11px 14px; border-radius: 16px; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.asst__msg p + p, .asst__msg p + .asst__cards, .asst__cards + p, .asst__msg p + .asst__list, .asst__list + p, .asst__msg p + .asst__wa, .asst__list + .asst__wa { margin-top: 8px; }
.asst__msg--bot { justify-self: start; background: var(--asst-bg-2); border-bottom-left-radius: 6px; }
.asst__msg--user { justify-self: end; color: var(--asst-dark); background: #E8C27F; border-bottom-right-radius: 6px; }
.asst__cards { display: grid; gap: 8px; }
.asst__card { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px; border-radius: 12px; background: var(--asst-bg); box-shadow: inset 0 0 0 1px var(--asst-line); }
.asst__card img { width: 64px; height: 50px; object-fit: contain; border-radius: 8px; background: var(--paper, #E6E1D9); mix-blend-mode: multiply; }
.asst__card b { display: block; font-weight: 500; }
.asst__card em { display: block; font-style: normal; font-size: 12px; color: var(--asst-mute); }
.asst__dims { display: grid; gap: 2px; margin-top: 4px; font: 500 12px/1.35 var(--mono, ui-monospace, Consolas, monospace); }
.asst__dims small { font-family: var(--asst-sans); color: var(--asst-mute); }
.asst__list { list-style: none; display: grid; gap: 8px; }
.asst__list li { display: grid; gap: 2px; }
.asst__list small { color: var(--asst-mute); font-size: 12px; }
.asst__link { display: inline-flex; align-items: center; gap: 4px; color: var(--asst-accent); font-weight: 500; }
.asst__link .asst__icon { width: 13px; height: 13px; }
.asst__msg a:not(.asst__link):not(.asst__wa):not(.asst__card) { color: var(--asst-accent); }
.asst__more { font-size: 13px; }
.asst__wa { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; color: #fff; background: #1FA855; font-weight: 500; font-size: 13.5px; }
.asst__typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.asst__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--asst-mute); animation: asst-dot 1s infinite ease-in-out; }
.asst__typing i:nth-child(2) { animation-delay: 0.15s; }
.asst__typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes asst-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.asst__quick { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.asst__quick::-webkit-scrollbar { display: none; }
.asst__chip { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; color: var(--asst-ink); box-shadow: inset 0 0 0 1px var(--asst-line); white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .asst__chip:hover { box-shadow: inset 0 0 0 1px var(--asst-accent); } }
.asst__form { display: flex; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--asst-line); }
.asst__form input { flex: 1; min-width: 0; height: 44px; margin: 0; padding: 0 14px; border-radius: 999px; border: 1px solid var(--asst-line); background: var(--asst-bg-2); color: var(--asst-ink); font: 400 15px/1 var(--asst-sans); box-shadow: none; }
.asst__form input:focus { outline: none; border-color: var(--asst-accent); }
.asst__form button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--asst-dark); background: var(--asst-gold); }
@media (max-width: 599px) {
  .asst__toggle-label { display: none; }
  .asst__toggle { width: 52px; padding: 0; justify-content: center; }
  .asst__bubble { max-width: min(240px, calc(100vw - 32px)); margin-right: 4px; }
  .asst__bubble::after { right: 14px; }
  .asst__bubble-text { font-size: 13.5px; }
  .asst.is-open { left: 0; right: 0; bottom: 0; gap: 0; }
  .asst.is-open .asst__toggle { display: none; }
  .asst__panel { width: 100%; height: min(86svh, 680px); border-radius: 20px 20px 0 0; }
  .asst__form input { font-size: 16px; } /* iOS yakınlaştırmasın */
}
@media (prefers-reduced-motion: reduce) {
  .asst__typing i { animation: none; }
  .asst__bubble { transition: opacity 200ms; transform: none; }
}
