/* ==========================================================================
   BuludHost — canlı çat pəncərəsi (sayt + müştəri paneli)
   Prefiks: bh-chat-  ·  Gecə rejimi: html[data-bs-theme=dark] (bu faylın sonunda)
   ========================================================================== */

.bh-chat {
    --bh-chat-brand: var(--bh-navy, #04497f);
    --c-navy: var(--bh-chat-brand);
    --c-blue: var(--bh-blue, #2e75f3);
    --c-grad: linear-gradient(135deg, var(--c-navy) 0%, #0a5ea3 55%, var(--c-blue) 100%);
    --c-bg: #ffffff;
    --c-bg-2: #f5f8fc;
    --c-surface: #ffffff;
    --c-ink: #1d2d3a;
    --c-text-2: #3d4f60;
    --c-muted: #6f7e8c;
    --c-line: #e1e9f2;
    --c-line-2: #cfdbe8;
    --c-soft: #eef4fb;
    --c-op-bubble: #eef2f7;
    --c-op-ink: #1d2d3a;
    --c-me-bubble: var(--c-navy);
    --c-green: #16a34a;
    --c-red: #dc2626;
    --c-amber: #f59e0b;
    --c-focus: rgba(46, 117, 243, .28);
    --c-shadow: 0 24px 64px -12px rgba(4, 38, 72, .32), 0 4px 16px rgba(4, 38, 72, .08);
    --bh-chat-bottom: 24px;
    --bh-chat-side: 24px;

    position: fixed;
    right: var(--bh-chat-side);
    bottom: var(--bh-chat-bottom);
    z-index: 1040; /* Bootstrap modallarından (1050+) aşağı */
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--c-ink);
    -webkit-font-smoothing: antialiased;
}
.bh-chat--left { right: auto; left: var(--bh-chat-side); }
.bh-chat *, .bh-chat *::before, .bh-chat *::after { box-sizing: border-box; }
.bh-chat [hidden] { display: none !important; }
.bh-chat button { font-family: inherit; cursor: pointer; }
.bh-chat button:disabled { cursor: not-allowed; }

/* PROTOTİP: build-in "☰ Prototip" düyməsi (right/bottom 12px) ilə toqquşmasın — realda 24px qalır */
body:has(> a[style*="z-index:99999"]) .bh-chat { --bh-chat-bottom: 60px; }

/* --------------------------------------------------------------------------
   Launcher
   -------------------------------------------------------------------------- */
.bh-chat-launcher {
    position: relative;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--c-grad);
    color: #fff;
    box-shadow: 0 10px 28px -6px rgba(4, 73, 127, .55), 0 2px 6px rgba(4, 73, 127, .2);
    transition: transform .2s ease, box-shadow .2s ease;
    margin-left: auto;
}
.bh-chat--left .bh-chat-launcher { margin-left: 0; }
.bh-chat-launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 14px 32px -6px rgba(4, 73, 127, .6), 0 2px 6px rgba(4, 73, 127, .2); }
.bh-chat-launcher:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.bh-chat-launcher i { position: absolute; font-size: 24px; line-height: 1; transition: transform .25s ease, opacity .2s ease; }
.bh-chat-launcher__i2 { font-size: 20px !important; opacity: 0; transform: rotate(-90deg) scale(.6); }
.bh-chat.is-open .bh-chat-launcher__i1 { opacity: 0; transform: rotate(90deg) scale(.6); }
.bh-chat.is-open .bh-chat-launcher__i2 { opacity: 1; transform: none; }
.bh-chat-launcher__dot {
    position: absolute; right: 3px; bottom: 3px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--c-green); border: 2.5px solid #fff;
}
.bh-chat-launcher__badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 21px; height: 21px; padding: 0 6px;
    border-radius: 11px; border: 2px solid #fff;
    background: var(--c-red); color: #fff;
    font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
    animation: bh-chat-pop .35s cubic-bezier(.3, 1.6, .5, 1) both .8s;
}
.bh-chat.is-open .bh-chat-launcher__badge { display: none; }

/* --------------------------------------------------------------------------
   Salamlama balonu
   -------------------------------------------------------------------------- */
.bh-chat-nudge {
    position: absolute; right: 0; bottom: 72px;
    width: 280px;
    animation: bh-chat-rise .35s cubic-bezier(.2, .9, .3, 1.2) both;
}
.bh-chat--left .bh-chat-nudge { right: auto; left: 0; }
.bh-chat-nudge__body {
    display: flex; align-items: flex-start; gap: 12px; width: 100%;
    padding: 14px 16px; border: 1px solid var(--c-line); border-radius: 16px 16px 4px 16px;
    background: var(--c-surface); color: var(--c-ink); text-align: left;
    box-shadow: 0 16px 40px -10px rgba(4, 38, 72, .28);
    transition: transform .15s ease, box-shadow .15s ease;
}
.bh-chat-nudge__body:hover { transform: translateY(-1px); box-shadow: 0 20px 44px -10px rgba(4, 38, 72, .34); }
.bh-chat-nudge__name { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--c-muted); }
.bh-chat-nudge__text { display: block; font-size: 13.5px; line-height: 1.45; color: var(--c-ink); }
.bh-chat-nudge__close {
    position: absolute; top: -10px; right: -6px; z-index: 1;
    display: grid; place-items: center; width: 26px; height: 26px; padding: 0;
    border: 1px solid var(--c-line); border-radius: 50%;
    background: var(--c-surface); color: var(--c-muted); font-size: 16px;
    box-shadow: 0 2px 8px rgba(4, 38, 72, .12);
}
.bh-chat-nudge__close:hover { color: var(--c-ink); }

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */
.bh-chat-av {
    --av: var(--c-blue);
    position: relative; flex: none;
    display: inline-grid; place-items: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--av); color: #fff;
    font-size: 12px; font-weight: 600; letter-spacing: .02em;
}
.bh-chat-av--sm { width: 28px; height: 28px; font-size: 10.5px; }
.bh-chat-av--brand { background: rgba(255, 255, 255, .18); font-size: 17px; }
.bh-chat-av.is-ghost { visibility: hidden; }
.bh-chat-av__dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--c-green); border: 2px solid var(--c-navy); }

/* --------------------------------------------------------------------------
   Pəncərə
   -------------------------------------------------------------------------- */
.bh-chat-win {
    position: absolute; right: 0; bottom: 72px;
    display: flex; flex-direction: column;
    width: 376px;
    height: min(640px, calc(100vh - var(--bh-chat-bottom) - 72px - 24px));
    min-height: 420px;
    border-radius: 18px;
    background: var(--c-bg);
    box-shadow: var(--c-shadow);
    overflow: hidden;
    transform-origin: bottom right;
    opacity: 0; transform: translateY(12px) scale(.97);
    transition: opacity .18s ease, transform .22s cubic-bezier(.2, .9, .3, 1.1);
}
.bh-chat--left .bh-chat-win { right: auto; left: 0; transform-origin: bottom left; }
.bh-chat.is-open .bh-chat-win { opacity: 1; transform: none; }

/* Başlıq */
.bh-chat-head {
    position: relative; flex: none;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "stack acts" "txt txt";
    align-items: center; row-gap: 10px;
    padding: 14px 10px 16px 18px;
    background: var(--c-grad); color: #fff;
}
.bh-chat-head::after { /* yumşaq işıq effekti */
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .16), transparent 55%);
}
.bh-chat-head > * { position: relative; z-index: 1; }
.bh-chat-head__stack { grid-area: stack; display: flex; }
.bh-chat-head__stack .bh-chat-av { width: 38px; height: 38px; border: 2px solid var(--c-navy); box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.bh-chat-head__stack .bh-chat-av + .bh-chat-av { margin-left: -10px; }
.bh-chat-head__stack .bh-chat-av:nth-child(1) { z-index: 3; }
.bh-chat-head__stack .bh-chat-av:nth-child(2) { z-index: 2; }
.bh-chat[data-mode="offline"] .bh-chat-head__stack .bh-chat-av { filter: grayscale(.85); opacity: .75; }
.bh-chat[data-mode="offline"] .bh-chat-av__dot,
.bh-chat[data-mode="offline"] .bh-chat-launcher__dot { display: none; }
.bh-chat-head__txt { grid-area: txt; min-width: 0; }
.bh-chat-head__title { margin: 0; font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.3; color: #fff; letter-spacing: -.005em; }
.bh-chat-head__status { display: flex; margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: rgba(255, 255, 255, .85); }
.bh-chat-head__status > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-chat[data-mode="online"] .bh-chat-head__off,
.bh-chat[data-mode="offline"] .bh-chat-head__on { display: none; }
.bh-chat-pulse { position: relative; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.bh-chat-pulse::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #4ade80; opacity: .5; animation: bh-chat-ping 1.8s ease-out infinite; }
.bh-chat-pulse--off { background: #cbd5e1; }
.bh-chat-pulse--off::after { display: none; }
.bh-chat-head__acts { grid-area: acts; display: flex; align-items: center; gap: 2px; margin-top: -4px; }
.bh-chat-hbtn {
    display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; color: #fff; font-size: 17px;
    transition: background .15s ease;
}
.bh-chat-hbtn:hover, .bh-chat-hbtn[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
.bh-chat-hbtn:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.bh-chat-hbtn--min i { font-size: 18px; }

/* Menyu */
.bh-chat-menu { position: relative; }
.bh-chat-menu__list {
    position: absolute; top: calc(100% + 6px); right: -76px; z-index: 5;
    width: 232px; padding: 6px;
    border: 1px solid var(--c-line); border-radius: 12px;
    background: var(--c-surface);
    box-shadow: 0 16px 40px -8px rgba(4, 38, 72, .25);
    animation: bh-chat-fade .15s ease both;
}
.bh-chat-menu__list button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
    background: transparent; color: var(--c-ink); font-size: 13.5px; font-weight: 500; text-align: left;
}
.bh-chat-menu__list button i { width: 18px; font-size: 16px; color: var(--c-muted); }
.bh-chat-menu__list button:hover, .bh-chat-menu__list button:focus-visible { background: var(--c-soft); outline: none; }
.bh-chat-menu__list button.is-danger, .bh-chat-menu__list button.is-danger i { color: var(--c-red); }

/* Toast */
.bh-chat-toast {
    position: absolute; left: 50%; top: calc(100% + 10px); z-index: 4;
    transform: translateX(-50%);
    padding: 8px 14px; border-radius: 99px;
    background: #10263b; color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
    animation: bh-chat-fade .2s ease both;
}

/* Gövdə / ekranlar */
.bh-chat-body { position: relative; flex: 1; min-height: 0; display: flex; background: var(--c-bg-2); }
.bh-chat-screen { display: none; flex: 1; min-width: 0; flex-direction: column; }
.bh-chat-screen.is-active { display: flex; animation: bh-chat-fade .2s ease both; }
.bh-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; scrollbar-width: thin; scrollbar-color: var(--c-line-2) transparent; }
.bh-chat-scroll::-webkit-scrollbar { width: 6px; }
.bh-chat-scroll::-webkit-scrollbar-thumb { background: var(--c-line-2); border-radius: 3px; }

/* --------------------------------------------------------------------------
   Formalar
   -------------------------------------------------------------------------- */
.bh-chat-hello { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.bh-chat-hello__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--c-soft); color: var(--c-blue); font-size: 18px; }
.bh-chat-hello__text {
    margin: 0; padding: 10px 14px; border-radius: 4px 14px 14px 14px;
    background: var(--c-surface); border: 1px solid var(--c-line);
    font-size: 13.5px; line-height: 1.5; color: var(--c-ink);
}
.bh-chat-form {
    display: flex; flex-direction: column; gap: 12px; margin: 0;
    padding: 16px; border: 1px solid var(--c-line); border-radius: 14px;
    background: var(--c-surface);
    box-shadow: 0 1px 2px rgba(16, 38, 61, .04);
}
.bh-chat-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; padding: 0; border: 0; }
.bh-chat-field > label, .bh-chat-field > legend {
    float: none; width: auto; margin: 0; padding: 0;
    font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--c-text-2);
}
.bh-chat-field > legend { margin-bottom: 5px; }
.bh-chat-req { color: var(--c-red); }
.bh-chat-opt { font-weight: 400; color: var(--c-muted); }
.bh-chat input[type="text"], .bh-chat input[type="email"], .bh-chat input[type="tel"], .bh-chat textarea {
    display: block; width: 100%; margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--c-line-2); border-radius: 10px;
    background: var(--c-bg); color: var(--c-ink);
    font: 400 14px/1.45 "Poppins", system-ui, sans-serif;
    box-shadow: none; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bh-chat input[type="text"], .bh-chat input[type="email"], .bh-chat input[type="tel"] { height: 40px; }
.bh-chat textarea { resize: none; }
.bh-chat input::placeholder, .bh-chat textarea::placeholder { color: #9aa9b7; opacity: 1; }
.bh-chat input:focus, .bh-chat textarea:focus { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-focus); }
.bh-chat .is-invalid { border-color: var(--c-red) !important; }
.bh-chat .is-invalid:focus { box-shadow: 0 0 0 3px rgba(220, 38, 38, .18) !important; }
.bh-chat-form__err { margin: -4px 0 0; font-size: 12.5px; color: var(--c-red); }

.bh-chat-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.bh-chat-topic { position: relative; margin: 0; cursor: pointer; }
.bh-chat-topic input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bh-chat-topic span {
    display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
    border: 1px solid var(--c-line-2); border-radius: 99px;
    background: var(--c-bg); color: var(--c-text-2); font-size: 13px; font-weight: 500;
    transition: all .15s ease;
}
.bh-chat-topic:hover span { border-color: var(--c-blue); color: var(--c-blue); }
.bh-chat-topic input:checked + span { border-color: var(--c-navy); background: var(--c-navy); color: #fff; }
.bh-chat-topic input:checked + span::before { content: "\F26E"; font-family: "bootstrap-icons"; margin: 0 4px 0 -4px; font-size: 15px; }
.bh-chat-topic input:focus-visible + span { box-shadow: 0 0 0 3px var(--c-focus); }

/* Düymələr */
.bh-chat-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 11px;
    font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none;
    transition: background .15s ease, box-shadow .15s ease, transform .1s ease, color .15s ease, border-color .15s ease;
}
.bh-chat-btn--block { width: 100%; }
.bh-chat-btn--primary { background: var(--c-navy); color: #fff; box-shadow: 0 6px 16px -6px rgba(4, 73, 127, .6); }
.bh-chat-btn--primary:hover { background: var(--c-blue); }
.bh-chat-btn--primary:active { transform: translateY(1px); }
.bh-chat-btn--primary:disabled { background: var(--c-line-2); color: var(--c-muted); box-shadow: none; }
.bh-chat-btn--ghost { border-color: var(--c-line-2); background: var(--c-surface); color: var(--c-ink); }
.bh-chat-btn--ghost:hover { border-color: var(--c-blue); color: var(--c-blue); }
.bh-chat-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-focus); }

/* --------------------------------------------------------------------------
   Söhbət
   -------------------------------------------------------------------------- */
.bh-chat-log { display: flex; flex-direction: column; padding: 16px 16px 8px; background: var(--c-bg-2); }
.bh-chat-welcome { padding: 4px 4px 4px; text-align: center; }
.bh-chat-welcome__hi { margin: 0; font-size: 17px; font-weight: 600; color: var(--c-ink); }
.bh-chat-welcome__id {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
    margin: 6px 0 0; padding: 4px 10px; border-radius: 99px;
    background: rgba(22, 163, 74, .1); color: #15803d;
    font-size: 12px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bh-chat-welcome__id--guest { background: var(--c-soft); color: var(--c-text-2); }
.bh-chat-day { display: flex; align-items: center; gap: 10px; margin: 16px 0 8px; font-size: 11.5px; font-weight: 600; color: var(--c-muted); text-transform: uppercase; letter-spacing: .06em; }
.bh-chat-day::before, .bh-chat-day::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
.bh-chat-sys { align-self: center; max-width: 90%; margin: 8px 0; padding: 3px 10px; border-radius: 99px; background: var(--c-soft); font-size: 11.5px; color: var(--c-muted); text-align: center; }

.bh-chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; margin-top: 3px; }
.bh-chat-msg.is-first { margin-top: 12px; }
.bh-chat-msg--me { align-self: flex-end; flex-direction: row-reverse; }
.bh-chat-msg--op { align-self: flex-start; }
.bh-chat-msg.is-new { animation: bh-chat-rise .25s ease both; }
.bh-chat-msg--op > .bh-chat-av { margin-bottom: 19px; }
.bh-chat-msg__col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bh-chat-msg--me .bh-chat-msg__col { align-items: flex-end; }
.bh-chat-msg--op .bh-chat-msg__col { align-items: flex-start; }
.bh-chat-msg__name { padding: 0 4px; font-size: 11.5px; font-weight: 600; color: var(--c-muted); }
.bh-chat-bubble {
    padding: 9px 13px; border-radius: 16px;
    font-size: 13.5px; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; white-space: pre-line;
}
.bh-chat-msg--op .bh-chat-bubble { background: var(--c-op-bubble); color: var(--c-op-ink); border-bottom-left-radius: 5px; }
.bh-chat-msg--me .bh-chat-bubble { background: var(--c-me-bubble); color: #fff; border-bottom-right-radius: 5px; }
.bh-chat-msg__meta { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; font-size: 10.5px; color: var(--c-muted); }
.bh-chat-msg__meta i { font-size: 14px; line-height: 1; }
.bh-chat-msg__meta i.is-read { color: var(--c-blue); }
.bh-chat-typing .bh-chat-msg__meta { font-style: italic; }

/* Fayl kartı */
.bh-chat-file {
    display: block; width: 220px; max-width: 100%;
    border: 1px solid var(--c-line); border-radius: 14px;
    background: var(--c-surface); color: var(--c-ink); text-decoration: none; overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bh-chat-file:hover { border-color: var(--c-blue); color: var(--c-ink); box-shadow: 0 4px 12px rgba(4, 38, 72, .08); }
.bh-chat-file__thumb {
    display: grid; place-items: center; height: 110px;
    background: linear-gradient(135deg, #dfe9f6, #eef4fb 60%, #e3edf9);
    color: #8fa6bf; font-size: 30px;
}
.bh-chat-file__row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.bh-chat-file__row > .bi:first-child { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--c-soft); color: var(--c-blue); font-size: 17px; }
.bh-chat-file__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bh-chat-file__meta b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-chat-file__meta small { font-size: 11px; color: var(--c-muted); }
.bh-chat-file__dl { color: var(--c-muted); font-size: 16px; }
.bh-chat-file:hover .bh-chat-file__dl { color: var(--c-blue); }

/* Yazır... */
.bh-chat-dots { display: inline-flex; align-items: center; gap: 4px; height: 21px; }
.bh-chat-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); opacity: .5; animation: bh-chat-dot 1.2s ease-in-out infinite; }
.bh-chat-dots i:nth-child(2) { animation-delay: .15s; }
.bh-chat-dots i:nth-child(3) { animation-delay: .3s; }

/* Tez cavablar */
.bh-chat-quick {
    flex: none; display: flex; gap: 8px; padding: 8px 16px 10px;
    overflow-x: auto; scrollbar-width: none;
    background: var(--c-bg-2);
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent);
            mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.bh-chat-quick::-webkit-scrollbar { display: none; }
.bh-chat-quick button {
    flex: none; height: 32px; padding: 0 12px;
    border: 1px solid rgba(46, 117, 243, .35); border-radius: 99px;
    background: var(--c-surface); color: var(--c-blue);
    font-size: 12.5px; font-weight: 500; white-space: nowrap;
    transition: all .15s ease;
}
.bh-chat-quick button:hover { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }
.bh-chat-quick button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-focus); }

/* Yazma sahəsi */
.bh-chat-compose { position: relative; flex: none; margin: 0; padding: 0 12px 12px; background: var(--c-bg-2); }
.bh-chat-compose__box {
    border: 1px solid var(--c-line-2); border-radius: 14px; background: var(--c-surface);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.bh-chat-compose__box:focus-within { border-color: var(--c-blue); box-shadow: 0 0 0 3px var(--c-focus); }
.bh-chat .bh-chat-compose__box textarea {
    min-height: 44px; max-height: 120px; padding: 12px 14px 4px;
    border: 0; border-radius: 14px 14px 0 0; background: transparent; box-shadow: none !important;
}
.bh-chat-compose__bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px 6px 8px; }
.bh-chat-compose__hint { flex: 1; min-width: 0; padding: 0 6px; font-size: 10.5px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-chat-ibtn {
    display: grid; place-items: center; width: 32px; height: 32px; margin: 0; padding: 0;
    border: 0; border-radius: 9px; background: transparent; color: var(--c-muted); font-size: 18px; cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.bh-chat-ibtn:hover, .bh-chat-ibtn[aria-expanded="true"] { background: var(--c-soft); color: var(--c-blue); }
.bh-chat-ibtn:focus-within, .bh-chat-ibtn:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 0; }
.bh-chat-send {
    flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 10px; background: var(--c-navy); color: #fff; font-size: 15px;
    transition: background .15s ease, transform .1s ease, opacity .15s ease;
}
.bh-chat-send:hover:not(:disabled) { background: var(--c-blue); }
.bh-chat-send:active:not(:disabled) { transform: scale(.94); }
.bh-chat-send:disabled { background: var(--c-line); color: var(--c-muted); }
.bh-chat-send:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-focus); }
.bh-chat-send i { margin-left: 1px; }

/* Emoji paneli */
.bh-chat-emoji {
    position: absolute; left: 12px; bottom: calc(100% + 4px); z-index: 3;
    display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
    padding: 8px; border: 1px solid var(--c-line); border-radius: 14px;
    background: var(--c-surface); box-shadow: 0 12px 32px -6px rgba(4, 38, 72, .22);
    animation: bh-chat-rise .15s ease both;
}
.bh-chat-emoji button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 20px; line-height: 1; }
.bh-chat-emoji button:hover, .bh-chat-emoji button:focus-visible { background: var(--c-soft); outline: none; }

/* --------------------------------------------------------------------------
   Oflayn / uğur / qiymətləndirmə
   -------------------------------------------------------------------------- */
.bh-chat-off { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.bh-chat-off__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(245, 158, 11, .14); color: #b45309; font-size: 19px; }
.bh-chat-off p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--c-ink); }
.bh-chat-hours { margin-bottom: 14px; padding: 10px 14px; border: 1px dashed var(--c-line-2); border-radius: 12px; }
.bh-chat-hours__title { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--c-text-2); }
.bh-chat-hours ul { margin: 0; padding: 0; list-style: none; }
.bh-chat-hours li { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; font-size: 12.5px; color: var(--c-muted); }
.bh-chat-hours li b { font-weight: 600; color: var(--c-ink); white-space: nowrap; }

.bh-chat-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.bh-chat-center--top { margin: 8px 0 20px; }
.bh-chat-done__icon {
    display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 16px;
    border-radius: 50%; background: rgba(22, 163, 74, .12); color: var(--c-green); font-size: 32px;
    box-shadow: 0 0 0 8px rgba(22, 163, 74, .06);
    animation: bh-chat-pop .4s cubic-bezier(.3, 1.6, .5, 1) both;
}
.bh-chat-done__icon--soft { background: var(--c-soft); color: var(--c-blue); font-size: 28px; box-shadow: 0 0 0 8px rgba(46, 117, 243, .06); }
.bh-chat-done__title { margin: 0 0 6px; font-family: inherit; font-size: 18px; font-weight: 600; color: var(--c-ink); }
.bh-chat-done__text { max-width: 280px; margin: 0 0 20px; font-size: 13.5px; line-height: 1.55; color: var(--c-muted); }
.bh-chat-center--top .bh-chat-done__text { margin-bottom: 0; }
.bh-chat-done__text b { color: var(--c-ink); }
.bh-chat-screen--done .bh-chat-scroll { display: flex; }

.bh-chat-rate { align-items: stretch; }
.bh-chat-rate__q { margin: 0; font-size: 14px; font-weight: 600; text-align: center; color: var(--c-ink); }
.bh-chat-stars { display: flex; justify-content: center; gap: 6px; margin-top: -4px; }
.bh-chat-stars button {
    width: 42px; height: 42px; padding: 0; border: 0; border-radius: 10px;
    background: transparent; color: var(--c-line-2); font-size: 30px; line-height: 1;
    transition: transform .12s ease, color .12s ease;
}
.bh-chat-stars button:hover { transform: scale(1.12); }
.bh-chat-stars button.is-on { color: var(--c-amber); }
.bh-chat-stars button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--c-focus); }
.bh-chat-stars__label { min-height: 18px; margin: -10px 0 0; font-size: 12.5px; font-weight: 600; text-align: center; color: #b45309; }
.bh-chat-check { position: relative; display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--c-text-2); cursor: pointer; }
.bh-chat-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bh-chat-check__box {
    flex: none; display: grid; place-items: center; width: 20px; height: 20px;
    border: 1.5px solid var(--c-line-2); border-radius: 6px; background: var(--c-bg); color: transparent; font-size: 16px;
    transition: all .15s ease;
}
.bh-chat-check input:checked + .bh-chat-check__box { border-color: var(--c-navy); background: var(--c-navy); color: #fff; }
.bh-chat-check input:focus-visible + .bh-chat-check__box { box-shadow: 0 0 0 3px var(--c-focus); }
.bh-chat-rate__thanks { margin: 0; padding: 10px; border-radius: 10px; background: rgba(22, 163, 74, .1); color: #15803d; font-size: 13px; font-weight: 500; text-align: center; }
.bh-chat-new { margin-top: 12px; }

/* --------------------------------------------------------------------------
   PROTOTİP ekran seçicisi (real saytda silinəcək)
   -------------------------------------------------------------------------- */
.bh-chat-proto {
    flex: none; display: flex; align-items: center; justify-content: center; gap: 4px;
    padding: 6px 8px; border-top: 1px dashed var(--c-line-2);
    background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(245, 158, 11, .06) 8px 16px), var(--c-bg);
    font-size: 11px; color: var(--c-muted);
}
.bh-chat-proto span { margin-right: 2px; font-weight: 600; }
.bh-chat-proto button { height: 22px; padding: 0 8px; border: 1px solid var(--c-line-2); border-radius: 6px; background: var(--c-surface); color: var(--c-text-2); font-size: 11px; font-weight: 500; }
.bh-chat-proto button:hover { border-color: var(--c-blue); color: var(--c-blue); }

/* --------------------------------------------------------------------------
   Mobil (≤575px): tam ekran
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .bh-chat { --bh-chat-side: 16px; --bh-chat-bottom: 16px; }
    body:has(> a[style*="z-index:99999"]) .bh-chat { --bh-chat-bottom: 56px; }
    .bh-chat-nudge { width: min(280px, calc(100vw - 32px)); }
    .bh-chat-win {
        position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; min-height: 0;
        border-radius: 0; transform: translateY(24px);
    }
    .bh-chat.is-open .bh-chat-launcher { display: none; }
    .bh-chat-head { padding: 12px 8px 14px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
    .bh-chat-hbtn--min { display: none; }
    .bh-chat-menu__list { right: -36px; }
    .bh-chat-msg { max-width: 88%; }
    .bh-chat-compose { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
    .bh-chat input[type="text"], .bh-chat input[type="email"], .bh-chat input[type="tel"], .bh-chat textarea { font-size: 16px; } /* iOS zoom olmasın */
    .bh-chat-compose__hint { visibility: hidden; }
    body:has(> a[style*="z-index:99999"]) .bh-chat-proto { justify-content: flex-start; padding-right: 112px; } /* PROTOTİP */
    .bh-chat-proto span { display: none; }
}
html.bh-chat-lock, html.bh-chat-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .bh-chat *, .bh-chat *::before, .bh-chat *::after { animation: none !important; transition: none !important; }
}

/* --------------------------------------------------------------------------
   Animasiyalar
   -------------------------------------------------------------------------- */
@keyframes bh-chat-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bh-chat-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bh-chat-pop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: none; } }
@keyframes bh-chat-ping { 0% { transform: scale(.8); opacity: .6; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes bh-chat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ==========================================================================
   Gecə rejimi
   ========================================================================== */
html[data-bs-theme=dark] .bh-chat {
    --c-grad: linear-gradient(135deg, #033a66 0%, #0a4f8c 55%, #2466d6 100%);
    --c-bg: #0f1c2a;
    --c-bg-2: #0b1622;
    --c-surface: #132436;
    --c-ink: #e3ecf5;
    --c-text-2: #b7c7d7;
    --c-muted: #8ea3b8;
    --c-line: #22374c;
    --c-line-2: #2d4660;
    --c-soft: #1a2e43;
    --c-op-bubble: #1a2e43;
    --c-op-ink: #e3ecf5;
    --c-me-bubble: #1f62d0;
    --c-blue: #5b95f7;
    --c-focus: rgba(91, 149, 247, .35);
    --c-shadow: 0 24px 64px -12px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .09);
    --c-red: #f87171;
}
html[data-bs-theme=dark] .bh-chat-launcher { background: linear-gradient(135deg, #04497f, #2e75f3); box-shadow: 0 10px 28px -6px rgba(0, 0, 0, .6); }
html[data-bs-theme=dark] .bh-chat-launcher__dot, html[data-bs-theme=dark] .bh-chat-launcher__badge { border-color: #0b1622; }
html[data-bs-theme=dark] .bh-chat-av__dot, html[data-bs-theme=dark] .bh-chat-head__stack .bh-chat-av { border-color: #073f70; }
html[data-bs-theme=dark] .bh-chat-nudge__body,
html[data-bs-theme=dark] .bh-chat-menu__list,
html[data-bs-theme=dark] .bh-chat-emoji { box-shadow: 0 16px 40px -8px rgba(0, 0, 0, .6); }
html[data-bs-theme=dark] .bh-chat input::placeholder, html[data-bs-theme=dark] .bh-chat textarea::placeholder { color: #647d95; }
html[data-bs-theme=dark] .bh-chat-topic input:checked + span,
html[data-bs-theme=dark] .bh-chat-check input:checked + .bh-chat-check__box { border-color: #2e75f3; background: #2e75f3; }
html[data-bs-theme=dark] .bh-chat-btn--primary { background: #2e75f3; box-shadow: 0 6px 16px -6px rgba(46, 117, 243, .5); }
html[data-bs-theme=dark] .bh-chat-btn--primary:hover { background: #4b8af6; }
html[data-bs-theme=dark] .bh-chat-btn--primary:disabled { background: var(--c-soft); color: var(--c-muted); box-shadow: none; }
html[data-bs-theme=dark] .bh-chat-send { background: #2e75f3; }
html[data-bs-theme=dark] .bh-chat-send:hover:not(:disabled) { background: #4b8af6; }
html[data-bs-theme=dark] .bh-chat-send:disabled { background: var(--c-soft); color: var(--c-muted); }
html[data-bs-theme=dark] .bh-chat-quick button { border-color: rgba(91, 149, 247, .4); }
html[data-bs-theme=dark] .bh-chat-quick button:hover { color: #fff; }
html[data-bs-theme=dark] .bh-chat-welcome__id { background: rgba(34, 197, 94, .14); color: #4ade80; }
html[data-bs-theme=dark] .bh-chat-welcome__id--guest { background: var(--c-soft); color: var(--c-text-2); }
html[data-bs-theme=dark] .bh-chat-file__thumb { background: linear-gradient(135deg, #1a2e43, #20374f 60%, #1a2e43); color: #5f7b97; }
html[data-bs-theme=dark] .bh-chat-off__icon { background: rgba(245, 158, 11, .16); color: #fbbf24; }
html[data-bs-theme=dark] .bh-chat-stars__label { color: #fbbf24; }
html[data-bs-theme=dark] .bh-chat-done__icon { background: rgba(34, 197, 94, .14); color: #4ade80; }
html[data-bs-theme=dark] .bh-chat-done__icon--soft { background: var(--c-soft); color: var(--c-blue); }
html[data-bs-theme=dark] .bh-chat-rate__thanks { background: rgba(34, 197, 94, .14); color: #4ade80; }
html[data-bs-theme=dark] .bh-chat-toast { background: #e3ecf5; color: #0b1622; }
html[data-bs-theme=dark] .bh-chat-proto { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(245, 158, 11, .035) 8px 16px), var(--c-bg); }
