/* Sohbet asistanı balonu (app/chatbot_site.php → chatbot_widget_html). Sol altta; sağ alt WhatsApp/yorum düğmelerinin. */
#miray {
    --mr-ink: var(--primary-dark, #0a1429);
    --mr-accent: var(--accent-gold, #c9a961);
    --mr-bg: #ffffff;
    --mr-soft: #f4f2ec;
    --mr-text: #1e293b;
    --mr-muted: #64748b;
    --mr-line: #e8e6e0;
    font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}
#miray[hidden] { display: none; }

.mr-launch {
    position: fixed; left: 20px; bottom: 20px; z-index: 990;
    display: flex; align-items: center; gap: 10px;
    padding: 6px 18px 6px 6px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--mr-ink); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25);
    font: inherit; font-size: 14px; transition: transform .2s ease;
}
.mr-launch:hover { transform: translateY(-2px); }
.mr-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-weight: 700; font-size: 18px;
    background: var(--mr-accent); color: var(--mr-ink);
}
.mr-launch-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; }
.mr-launch-text small { opacity: .75; font-size: 11.5px; }
#miray.mr-open .mr-launch { display: none; }

.mr-panel {
    position: fixed; left: 20px; bottom: 20px; z-index: 991;
    width: 370px; height: min(600px, calc(100vh - 40px));
    display: none; flex-direction: column; overflow: hidden;
    background: var(--mr-bg); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.28);
}
#miray.mr-open .mr-panel { display: flex; }
.mr-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--mr-ink); color: #fff; }
.mr-head .mr-avatar { width: 38px; height: 38px; font-size: 16px; }
.mr-head-text { flex: 1; line-height: 1.25; }
.mr-head-text strong { display: block; font-size: 15px; }
.mr-head-text small { opacity: .75; font-size: 12px; }
.mr-close { border: 0; background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; opacity: .8; }
.mr-close:hover { opacity: 1; }

.mr-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--mr-soft); }
.mr-msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; color: var(--mr-text); }
.mr-user { align-self: flex-end; background: var(--mr-ink); color: #fff; border-bottom-right-radius: 4px; }
.mr-bot  { align-self: flex-start; background: #fff; border: 1px solid var(--mr-line); border-bottom-left-radius: 4px; }
.mr-bot a { color: var(--accent-gold-ink, #8a6e2f); text-decoration: underline; }
.mr-err  { align-self: stretch; background: #fff4f4; color: #9b1c1c; border: 1px solid #f5c2c2; font-size: 13px; }
.mr-err a { color: inherit; font-weight: 600; }
.mr-actions { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 6px; }
.mr-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.mr-btn-rez { background: var(--mr-accent); color: var(--mr-ink); }
.mr-btn-wa  { background: #25D366; color: #fff; }
.mr-btn-guide { background: #fff; color: var(--mr-ink); border: 1px solid var(--mr-line); }
.mr-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--mr-line); border-radius: 14px; }
.mr-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--mr-muted); animation: mr-dot 1.2s infinite; }
.mr-typing i:nth-child(2) { animation-delay: .2s; }
.mr-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes mr-dot { 0%, 60%, 100% { opacity: .25; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.mr-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--mr-line); background: #fff; }
.mr-input { flex: 1; resize: none; height: 42px; max-height: 96px; padding: 10px 12px; border: 1px solid var(--mr-line); border-radius: 12px; font: inherit; font-size: 14px; color: var(--mr-text); }
.mr-input:focus { outline: 2px solid var(--mr-accent); outline-offset: -1px; }
.mr-input:disabled { background: var(--mr-soft); cursor: not-allowed; }
.mr-new { cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 600; }
.mr-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--mr-ink); color: #fff; cursor: pointer; display: grid; place-items: center; }
.mr-send:disabled { opacity: .5; cursor: default; }
.mr-note { padding: 0 12px 10px; background: #fff; font-size: 11px; line-height: 1.4; color: var(--mr-muted); }
.mr-note a { color: inherit; }

.mr-panel { z-index: 10000; }
@media (max-width: 600px) {
    /* Pencere açıkken sağ alttaki WhatsApp/yorum/yukarı düğmeleri giriş kutusunun üstüne binmesin */
    body:has(#miray.mr-open) .fab-whatsapp,
    body:has(#miray.mr-open) .fab-review,
    body:has(#miray.mr-open) .back-to-top { display: none; }
    .mr-launch { left: 14px; bottom: 16px; padding: 5px; }
    .mr-launch-text { display: none; }
    .mr-panel { left: 0; right: 0; bottom: 0; width: auto; height: 85vh; height: 85dvh; border-radius: 18px 18px 0 0; }
    .mr-input { font-size: 16px; }   /* iOS'ta odaklanınca yakınlaşmasın */
}
@media (prefers-reduced-motion: reduce) {
    .mr-launch { transition: none; }
    .mr-typing i { animation: none; opacity: .6; }
}
