.gr-ai-root,
.gr-ai-root *,
.gr-ai-root *::before,
.gr-ai-root *::after { box-sizing: border-box; }

.gr-ai-root .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.gr-ai-root {
    position: fixed;
    z-index: 2147482000;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.gr-ai-pos-right { right: 20px; bottom: 20px; }
.gr-ai-pos-left { left: 20px; bottom: 20px; }

.gr-ai-launcher {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--gr-ai-primary,#173b6b);
    color: #fff;
    box-shadow: 0 10px 30px rgba(23,59,107,.28);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.gr-ai-size-small .gr-ai-launcher { width: 50px; height: 50px; }
.gr-ai-size-large .gr-ai-launcher { width: 66px; height: 66px; }

.gr-ai-launcher:hover,
.gr-ai-launcher:focus {
    transform: translateY(-2px);
    background: var(--gr-ai-secondary,#11658b);
    box-shadow: 0 12px 34px rgba(23,59,107,.34);
    outline: 2px solid transparent;
}

.gr-ai-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}
.gr-ai-size-small .gr-ai-launcher-icon { width: 24px; height: 24px; }
.gr-ai-size-large .gr-ai-launcher-icon { width: 31px; height: 31px; }
.gr-ai-launcher-icon svg,
.gr-ai-brand-mark svg,
.gr-ai-send svg { display:block; width:100%; height:100%; }

.gr-ai-launcher-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #38a169;
}

.gr-ai-panel {
    position: absolute;
    bottom: 74px;
    width: var(--gr-ai-panel-width,390px);
    max-width: calc(100vw - 24px);
    height: min(660px,calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(23,59,107,.11);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15,23,42,.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(.985);
    transform-origin: bottom right;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}
.gr-ai-pos-right .gr-ai-panel { right: 0; }
.gr-ai-pos-left .gr-ai-panel { left: 0; transform-origin: bottom left; }
.gr-ai-root.is-open .gr-ai-panel { opacity: 1; visibility: visible; transform: none; }
.gr-ai-root.is-open .gr-ai-launcher { opacity: 0; visibility: hidden; pointer-events: none; }

.gr-ai-panel-header {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 68px;
    padding: 14px 14px 14px 16px;
    background: var(--gr-ai-primary,#173b6b);
    color: #fff;
}

.gr-ai-brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255,255,255,.13);
}

.gr-ai-panel-heading { display:flex; min-width:0; flex:1; flex-direction:column; }
.gr-ai-panel-heading strong { overflow:hidden; color:#fff; font-size:15px; line-height:1.3; text-overflow:ellipsis; white-space:nowrap; }
.gr-ai-panel-heading span { margin-top:2px; overflow:hidden; color:rgba(255,255,255,.75); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }

/* SVG instead of a text × so the cross is truly centered in the circle. */
.gr-ai-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0 !important;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    line-height: 0;
}
.gr-ai-close svg { display:block; width:16px; height:16px; margin:0; padding:0; }
.gr-ai-close:hover,
.gr-ai-close:focus { background:rgba(255,255,255,.18); outline:2px solid transparent; }

.gr-ai-prechat {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
}
.gr-ai-prechat-copy { margin-bottom: 16px; }
.gr-ai-prechat-title { margin:0 0 6px !important; padding:0 !important; color:#1f3554; font-size:18px !important; line-height:1.3 !important; font-weight:700 !important; }
.gr-ai-prechat-intro { margin:0 !important; color:#667085; font-size:13px; line-height:1.55; }
.gr-ai-prechat-form { display:flex; flex-direction:column; gap:12px; }
.gr-ai-field { display:block; margin:0; }
.gr-ai-field > span { display:block; margin:0 0 5px; color:#344054; font-size:12px; font-weight:700; }
.gr-ai-field input,
.gr-ai-field textarea {
    display:block;
    width:100%;
    margin:0 !important;
    padding:10px 11px !important;
    border:1px solid #d7e0e9 !important;
    border-radius:10px !important;
    background:#fff !important;
    color:#1f2937 !important;
    box-shadow:none !important;
    font:inherit !important;
    font-size:14px !important;
    line-height:1.4 !important;
    outline:none;
}
.gr-ai-field textarea { resize:vertical; min-height:92px; max-height:170px; }
.gr-ai-field input:focus,
.gr-ai-field textarea:focus { border-color:var(--gr-ai-secondary,#11658b) !important; box-shadow:0 0 0 3px rgba(17,101,139,.10) !important; }

.gr-ai-consent-row { display:flex; gap:8px; align-items:flex-start; color:#5f6c7b; font-size:11.5px; line-height:1.45; }
.gr-ai-consent-row input { margin:2px 0 0; flex:0 0 auto; }
.gr-ai-prechat-error { padding:9px 10px; border:1px solid #f1b5b5; border-radius:9px; background:#fff4f4; color:#a12525; font-size:12px; line-height:1.4; }
.gr-ai-start-chat {
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:43px;
    width:100%;
    padding:10px 14px;
    border:0;
    border-radius:11px;
    background:var(--gr-ai-primary,#173b6b);
    color:#fff;
    font:inherit;
    font-size:14px;
    font-weight:700;
    cursor:pointer;
}
.gr-ai-start-chat:hover,
.gr-ai-start-chat:focus { background:var(--gr-ai-secondary,#11658b); outline:2px solid transparent; }
.gr-ai-start-chat:disabled { opacity:.6; cursor:wait; }

.gr-ai-chat-stage { display:flex; flex:1; min-height:0; flex-direction:column; }
.gr-ai-chat-stage[hidden], .gr-ai-prechat[hidden] { display:none !important; }

.gr-ai-messages { flex:1; min-height:0; overflow-y:auto; padding:16px; background:#f8fafc; overscroll-behavior:contain; scrollbar-width:thin; }
.gr-ai-message { display:flex; margin:0 0 12px; }
.gr-ai-message.is-user { justify-content:flex-end; }
.gr-ai-bubble { max-width:86%; padding:10px 12px; border-radius:14px; font-size:14px; line-height:1.52; white-space:pre-wrap; word-break:break-word; }
.gr-ai-message.is-assistant .gr-ai-bubble { border:1px solid #e3e9ef; border-top-left-radius:5px; background:#fff; color:#273548; }
.gr-ai-message.is-user .gr-ai-bubble { border-top-right-radius:5px; background:var(--gr-ai-primary,#173b6b); color:#fff; }
.gr-ai-message.is-status .gr-ai-bubble { color:#667085; font-size:12px; font-style:italic; }

.gr-ai-root[dir="rtl"] .gr-ai-message.is-user { justify-content:flex-start; }
.gr-ai-root[dir="rtl"] .gr-ai-message.is-assistant { justify-content:flex-end; }
.gr-ai-root[dir="rtl"] .gr-ai-message.is-assistant .gr-ai-bubble { border-top-left-radius:14px; border-top-right-radius:5px; }
.gr-ai-root[dir="rtl"] .gr-ai-message.is-user .gr-ai-bubble { border-top-right-radius:14px; border-top-left-radius:5px; }

.gr-ai-quick-wrap { display:flex; gap:7px; overflow-x:auto; padding:10px 12px 7px; border-top:1px solid #edf1f5; background:#fff; scrollbar-width:none; }
.gr-ai-quick-wrap::-webkit-scrollbar { display:none; }
.gr-ai-quick { flex:0 0 auto; max-width:260px; padding:8px 10px; border:1px solid #d7e1eb; border-radius:999px; background:#f7fafc; color:#244663; font-size:12px; line-height:1.25; cursor:pointer; }
.gr-ai-quick:hover,.gr-ai-quick:focus { border-color:var(--gr-ai-secondary,#11658b); background:#eef6fa; outline:2px solid transparent; }

.gr-ai-recommendations { padding:9px 12px; border-top:1px solid #edf1f5; background:#fff; }
.gr-ai-recommendations-title { display:block; margin-bottom:7px; color:#667085; font-size:11px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; }
.gr-ai-source { display:block; padding:7px 9px; border-radius:9px; color:#173b6b !important; font-size:12px; font-weight:600; line-height:1.35; text-decoration:none !important; }
.gr-ai-source:hover,.gr-ai-source:focus { background:#eef5f9; color:#11658b !important; outline:2px solid transparent; }

.gr-ai-compose { display:flex; align-items:flex-end; gap:8px; padding:11px 11px 9px; border-top:1px solid #e6ebf0; background:#fff; }
.gr-ai-input { display:block; min-width:0; max-height:110px; flex:1; resize:none; overflow-y:auto; margin:0 !important; padding:10px 12px !important; border:1px solid #d8e0e8 !important; border-radius:12px !important; background:#fff !important; color:#1f2937 !important; box-shadow:none !important; font:inherit !important; font-size:14px !important; line-height:1.4 !important; outline:none; }
.gr-ai-input:focus { border-color:var(--gr-ai-secondary,#11658b) !important; box-shadow:0 0 0 3px rgba(17,101,139,.10) !important; }
.gr-ai-send { display:flex; align-items:center; justify-content:center; width:40px; height:40px; flex:0 0 40px; padding:9px; border:0; border-radius:11px; background:var(--gr-ai-primary,#173b6b); color:#fff; cursor:pointer; }
.gr-ai-send:hover,.gr-ai-send:focus { background:var(--gr-ai-secondary,#11658b); outline:2px solid transparent; }
.gr-ai-send:disabled { opacity:.55; cursor:not-allowed; }

.gr-ai-powered { padding:6px 12px 9px; border-top:1px solid #f1f3f5; background:#fff; color:#98a2b3; text-align:center; font-size:10px; }
.gr-ai-powered a { color:#667085 !important; text-decoration:none !important; }
.gr-ai-powered a:hover { text-decoration:underline !important; }

.gr-ai-root[dir="rtl"] .gr-ai-panel-heading,
.gr-ai-root[dir="rtl"] .gr-ai-prechat,
.gr-ai-root[dir="rtl"] .gr-ai-field,
.gr-ai-root[dir="rtl"] .gr-ai-bubble { text-align:right; }
.gr-ai-root[dir="rtl"] .gr-ai-consent-row { flex-direction:row-reverse; justify-content:flex-end; }

@media (max-width:600px) {
    .gr-ai-pos-right,.gr-ai-pos-left { right:12px; bottom:12px; left:auto; }
    .gr-ai-pos-left { left:12px; right:auto; }
    .gr-ai-panel { position:fixed; right:8px !important; bottom:8px; left:8px !important; width:auto; max-width:none; height:min(82vh,650px); border-radius:17px; transform-origin:bottom center; }
    .gr-ai-messages { padding:13px; }
    .gr-ai-bubble { max-width:90%; font-size:14px; }
    .gr-ai-prechat { padding:17px 15px; }
}

@media (prefers-reduced-motion:reduce) {
    .gr-ai-launcher,.gr-ai-panel { transition:none; }
}
