/* AI Avatar Asistan - widget (Journal 3 uyumlu, tum siniflar aaw- onekli) */
#aaw-root, #aaw-root * { box-sizing: border-box; line-height: 1.35; letter-spacing: normal; text-transform: none; }
#aaw-root p, #aaw-root form { margin: 0; }
#aaw-root { position: fixed; z-index: 2147483000; bottom: var(--aaw-bottom, 20px); right: var(--aaw-side, 20px); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #1d2b27; -webkit-font-smoothing: antialiased; }
#aaw-root.aaw-left { right: auto; left: var(--aaw-side, 20px); }
#aaw-root button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; -webkit-tap-highlight-color: transparent; }
#aaw-root svg.aa-svg { width: 100%; height: 100%; display: block; }
#aaw-root .aa-head { animation: aaw-bob 7s ease-in-out infinite; transform-origin: 150px 330px; }
#aaw-root .aa-eyes { animation: aaw-blink 5.5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes aaw-bob { 0%,100% { transform: rotate(0deg) translateY(0); } 30% { transform: rotate(.8deg) translateY(1px); } 70% { transform: rotate(-.7deg) translateY(-1px); } }
@keyframes aaw-blink { 0%,95%,100% { transform: scaleY(1); } 97% { transform: scaleY(.08); } }

/* Baslatici */
.aaw-launcher { position: relative; display: flex; align-items: center; gap: 10px; }
#aaw-root.aaw-left .aaw-launcher { flex-direction: row-reverse; }
.aaw-launch-btn { width: 66px; height: 66px; border-radius: 50%; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.22); border: 3px solid #fff !important; position: relative; flex: none; }
.aaw-launch-btn::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 13px; height: 13px; border-radius: 50%; background: #2ecc71; border: 2px solid #fff; }
.aaw-launch-media { width: 100%; height: 100%; }
.aaw-launch-media img, .aaw-launch-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.aaw-teaser { background: #fff; padding: 10px 14px; border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.14); font-weight: 600; max-width: 220px; animation: aaw-in .4s ease both; }
.aaw-open .aaw-launcher { display: none; }

/* Panel */
.aaw-panel { display: none; position: relative; width: var(--aaw-w, 340px); height: var(--aaw-h, 540px); max-height: calc(100vh - 40px); border-radius: 28px; overflow: hidden; background: #6f7a77; box-shadow: 0 18px 50px rgba(0,0,0,.30); animation: aaw-in .28s ease both; }
.aaw-open .aaw-panel { display: block; }
@keyframes aaw-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.aaw-stage { position: absolute; inset: 0; }
.aaw-stage img, .aaw-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.aaw-stage .aaw-talk { opacity: 0; }
.aaw-speaking .aaw-stage .aaw-talk { opacity: 1; }
.aaw-stage.aaw-breathe canvas { animation: aaw-breathe 6s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes aaw-breathe { 0%,100% { transform: scale(1) translateY(0); } 50% { transform: scale(1.012) translateY(-1px); } }
.aaw-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 62%; background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.55)); pointer-events: none; }
.aaw-speaking .aaw-panel { box-shadow: 0 18px 50px rgba(0,0,0,.30), 0 0 0 3px var(--aaw-color); }

.aaw-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; gap: 10px; z-index: 3; }
.aaw-mic { width: 58px; height: 58px; border-radius: 50%; background: var(--aaw-color) !important; color: #fff !important; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 5px rgba(255,255,255,.35); flex: none; position: relative; }
.aaw-mic svg { width: 26px; height: 26px; }
.aaw-listening .aaw-mic { background: #c0392b !important; animation: aaw-pulse 1.2s infinite; }
.aaw-thinking .aaw-mic::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid transparent; border-top-color: #fff; animation: aaw-spin .8s linear infinite; }
@keyframes aaw-pulse { 0% { box-shadow: 0 0 0 0 rgba(231,76,60,.7); } 100% { box-shadow: 0 0 0 16px rgba(231,76,60,0); } }
@keyframes aaw-spin { to { transform: rotate(360deg); } }
.aaw-lang { appearance: none; -webkit-appearance: none; background: rgba(20,30,28,.82) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='white' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center !important; color: #fff !important; border: 0 !important; border-radius: 22px !important; padding: 9px 32px 9px 14px !important; font-size: 14px !important; height: auto !important; width: auto !important; max-width: 150px; box-shadow: none !important; outline: none; }
.aaw-lang option { color: #111; }
.aaw-spacer { flex: 1; }
.aaw-close { width: 42px; height: 42px; border-radius: 50%; background: rgba(20,30,28,.82) !important; color: #fff !important; border: 2px solid rgba(255,255,255,.75) !important; display: flex; align-items: center; justify-content: center; flex: none; }
.aaw-close svg { width: 16px; height: 16px; }

.aaw-clear { height: 42px; min-width: 42px; border-radius: 21px; background: rgba(20,30,28,.82) !important; color: #fff !important; border: 2px solid rgba(255,255,255,.75) !important; display: none; align-items: center; justify-content: center; gap: 6px; padding: 0 10px !important; flex: none; transition: background .2s; }
.aaw-has-chat .aaw-clear { display: flex; }
.aaw-clear svg { width: 18px; height: 18px; }
.aaw-clear span { display: none; font-size: 13px; font-weight: 700; }
.aaw-clear.aaw-confirm { background: #c0392b !important; }
.aaw-clear.aaw-confirm span { display: inline; }
.aaw-hint { position: absolute; top: 84px; left: 14px; max-width: 64%; background: #fff; border-radius: 16px; padding: 10px 14px; font-weight: 700; font-size: 14px; z-index: 3; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.aaw-hint::before { content: ""; position: absolute; top: -7px; left: 22px; border: 8px solid transparent; border-top: 0; border-bottom-color: #fff; }
.aaw-hint.aaw-hide { display: none; }

.aaw-bottom { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.aaw-msgs { position: relative; max-height: min(190px, 30vh); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 2px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; padding-right: 14px; }
.aaw-msgs::-webkit-scrollbar { display: none; }
.aaw-msgwrap { position: relative; }
.aaw-track { position: absolute; top: 2px; bottom: 2px; right: 0; width: 6px; border-radius: 6px; background: rgba(255,255,255,.25); display: none; touch-action: none; cursor: pointer; }
.aaw-track::before { content: ""; position: absolute; top: 0; bottom: 0; left: -10px; right: -6px; }
.aaw-scrollable .aaw-track { display: block; }
.aaw-thumb { position: absolute; left: 0; right: 0; min-height: 24px; border-radius: 6px; background: rgba(255,255,255,.9); box-shadow: 0 0 4px rgba(0,0,0,.35); touch-action: none; cursor: grab; }
.aaw-thumb:active { cursor: grabbing; }
.aaw-up { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: rgba(255,255,255,.94) !important; color: #1d2b27 !important; font-size: 12px !important; font-weight: 600; border-radius: 14px; padding: 4px 12px !important; box-shadow: 0 2px 8px rgba(0,0,0,.2); display: none; white-space: nowrap; }
.aaw-more ~ .aaw-up { display: block; }
.aaw-msgs.aaw-more { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px); }
.aaw-msgs > :first-child { margin-top: auto; }
.aaw-expanded .aaw-msgs { max-height: calc(var(--aaw-ph, 540px) - 230px); background: rgba(10,20,18,.6); border-radius: 16px; padding: 8px; }
.aaw-expanded .aaw-hist { background: var(--aaw-color) !important; color: #fff !important; }
.aaw-panel { overscroll-behavior: contain; }
.aaw-products { overscroll-behavior-x: contain; }
.aaw-msg { max-width: 92%; padding: 8px 12px; border-radius: 16px; font-size: 14px; word-wrap: break-word; white-space: pre-wrap; }
.aaw-msg a { color: inherit; text-decoration: underline; }
.aaw-bot { align-self: flex-start; background: rgba(28,58,50,.88); color: #fff; border-bottom-left-radius: 6px; }
.aaw-user { align-self: flex-end; background: rgba(255,255,255,.94); color: #1d2b27; border-bottom-right-radius: 6px; }
.aaw-err { background: rgba(160,40,30,.9); color: #fff; }
.aaw-typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: #fff; animation: aaw-dot 1s infinite; }
.aaw-typing span:nth-child(2) { animation-delay: .15s; } .aaw-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes aaw-dot { 0%,80%,100% { opacity: .3; } 40% { opacity: 1; } }

.aaw-products { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.aaw-products::-webkit-scrollbar { display: none; }
.aaw-card { flex: none; width: 118px; background: #fff; border-radius: 14px; overflow: hidden; text-decoration: none !important; color: #1d2b27 !important; box-shadow: 0 4px 12px rgba(0,0,0,.18); display: block; }
.aaw-card img { width: 100%; height: 64px; object-fit: cover; display: block; background: #f1f1f1; }
.aaw-card b { display: block; font-size: 12px; font-weight: 600; padding: 6px 8px 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 36px; }
.aaw-card i { display: block; font-style: normal; font-size: 13px; font-weight: 700; color: var(--aaw-color); padding: 2px 8px 8px; }
.aaw-card s { display: block; color: #999; font-weight: 400; font-size: 11px; margin-right: 4px; }

.aaw-links { display: flex; gap: 6px; flex-wrap: wrap; }
.aaw-link { background: rgba(255,255,255,.94); color: #1d2b27 !important; text-decoration: none !important; border-radius: 14px; padding: 5px 10px; font-size: 12px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.aaw-row { display: flex; align-items: center; gap: 8px; }
.aaw-hist { width: 46px; height: 46px; border-radius: 50%; background: #fff !important; color: #1d2b27 !important; display: flex; align-items: center; justify-content: center; flex: none; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.aaw-hist svg { width: 22px; height: 22px; }
.aaw-form { flex: 1; display: flex; align-items: center; background: #fff; border-radius: 26px; padding: 4px 4px 4px 16px; box-shadow: 0 4px 12px rgba(0,0,0,.18); min-width: 0; }
.aaw-input { flex: 1; min-width: 0; border: 0 !important; outline: none !important; background: transparent !important; font-size: 16px !important; color: #1d2b27 !important; padding: 8px 0 !important; height: auto !important; box-shadow: none !important; }
.aaw-send { width: 40px; height: 40px; border-radius: 50%; background: var(--aaw-color) !important; color: #fff !important; display: flex; align-items: center; justify-content: center; flex: none; }
.aaw-send svg { width: 18px; height: 18px; }
.aaw-send[disabled] { opacity: .55; }

.aaw-note { display: flex; align-items: center; gap: 8px; background: rgba(15,25,23,.85); color: #fff; border-radius: 14px; padding: 7px 10px; font-size: 12px; }
.aaw-note .aaw-note-t { flex: 1; font-weight: 600; }
.aaw-note a { color: #e7c983 !important; text-decoration: underline; }
.aaw-note .aaw-note-x { color: #fff !important; font-size: 16px; padding: 0 4px; }
.aaw-note.aaw-hide { display: none; }

@media (max-width: 600px) {
  .aaw-panel { width: min(86vw, var(--aaw-w, 340px)); height: min(var(--aaw-mh, 68vh), var(--aaw-h, 540px)); border-radius: 24px; }
  .aaw-launch-btn { width: 58px; height: 58px; }
  .aaw-teaser { display: none; }
  #aaw-root.aaw-nomobile { display: none !important; }
}
[dir="rtl"].aaw-msg { text-align: right; }
