/* ============================================================
   Shriram Hospital Chatbot — chatbot.css
   LOCATION: public/css/chatbot.css

   RULES:
   - No :root or body styles — only chatbot elements
   - All CSS variables defined on #sr-chat-toggle and #sr-chatbox
   - Mobile: true fullscreen, background completely hidden
   - Desktop: chatbot never gets cut from top

   FIX v3:
   - Desktop: top+bottom dono set — top-cut band
   - Mobile: keyboard ke peeche input field jaane ki problem FIXED
     Solution: 100dvh (dynamic viewport) + visualViewport JS API
   ============================================================ */

/* ============================================================
   CSS VARIABLES
   ============================================================ */
#sr-chat-toggle,
#sr-chatbox,
#sr-chatbox * {
    --cb-primary:   #f36f21;
    --cb-dark:      #f36f21;
    --cb-green:     #3e3eed;
    --cb-light:     #fff8f5;
    --cb-border:    #ffe4d0;
    --cb-radius:    18px;
    --cb-shadow:    0 20px 60px rgba(0,0,0,0.18);
    --cb-font:      "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================================
   FAB TOGGLE BUTTON
   ============================================================ */
#sr-chat-toggle {
    position: fixed;
    bottom: 133px;
    right: 45px;
    z-index: 99997;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-dark));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 28px rgba(232, 82, 10, 0.55);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    animation: cb-pulse-btn 2.5s infinite;
    border: 2px solid #fff;
}
#sr-chat-toggle:hover {
    transform: scale(1.12);
    box-shadow: 0 10px 36px rgba(232, 82, 10, 0.75);
}
#sr-chat-toggle svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#sr-chat-toggle.hide {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8);
}
#sr-chat-toggle .cb-notif {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    font-family: var(--cb-font);
}
@keyframes cb-pulse-btn {
    0%, 100% { box-shadow: 0 6px 28px rgba(232, 82, 10, 0.55); }
    50%       { box-shadow: 0 6px 44px rgba(232, 82, 10, 0.9);  }
}

/* ============================================================
   CHAT WINDOW — DESKTOP
   top + bottom dono set = chatbox kabhi top se cut nahi hoga
   ============================================================ */
#sr-chatbox {
    position: fixed;
    top: 80px;
    bottom: 166px;
    right: 24px;
    z-index: 99998;
    width: 390px;
    height: 500px;
    background: #fff;
    border-radius: var(--cb-radius);
    box-shadow: var(--cb-shadow);
    display: none;
    flex-direction: column;
    font-family: var(--cb-font);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.32s ease, transform 0.32s ease;
}
#sr-chatbox.active {
    opacity: 1;
    transform: scale(1);
}

/* Desktop fullscreen */
#sr-chatbox.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    border-radius: 0 !important;
}

/* ============================================================
   HEADER
   ============================================================ */
#sr-chatbox .cb-header {
    background: #f36f21;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
#sr-chatbox .cb-header::before {
    content: "";
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
}
#sr-chatbox .cb-hdr-left {
    display: flex;
    align-items: center;
    gap: 11px;
}
#sr-chatbox .cb-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 2px solid rgba(255,255,255,0.5);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
}
#sr-chatbox .cb-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
#sr-chatbox .cb-hdr-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
#sr-chatbox .cb-hdr-text span {
    font-size: 11.5px;
    color: rgba(255,255,255,0.88);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}
#sr-chatbox .cb-online {
    width: 8px;
    height: 8px;
    background: #3e3eed;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    animation: cb-blink 1.6s infinite;
}
@keyframes cb-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}
#sr-chatbox .cb-hdr-right {
    display: flex;
    gap: 5px;
    position: relative;
    z-index: 1;
}
#sr-chatbox .cb-hdr-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
#sr-chatbox .cb-hdr-btn:hover {
    background: rgba(255,255,255,0.32);
}
#sr-chatbox .cb-hdr-btn svg {
    width: 15px;
    height: 15px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   PROGRESS STEPS
   ============================================================ */
#sr-chatbox .cb-steps {
    background: var(--cb-light);
    border-bottom: 1px solid var(--cb-border);
    display: flex;
    padding: 8px 12px;
    flex-shrink: 0;
}
#sr-chatbox .cb-step {
    flex: 1;
    text-align: center;
    font-size: 10.5px;
    font-weight: 600;
    color: #bbb;
    position: relative;
    padding-bottom: 7px;
    transition: color 0.25s;
}
#sr-chatbox .cb-step::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2.5px;
    background: var(--cb-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}
#sr-chatbox .cb-step.active { color: var(--cb-primary); }
#sr-chatbox .cb-step.active::after { width: 65%; }
#sr-chatbox .cb-step.done { color: var(--cb-green); }
#sr-chatbox .cb-step.done::after { width: 65%; background: var(--cb-green); }
#sr-chatbox .cb-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #eee;
    font-size: 10px;
    font-weight: 800;
    margin-bottom: 3px;
    transition: background 0.25s, color 0.25s;
}
#sr-chatbox .cb-step.active .cb-step-num { background: var(--cb-primary); color: #fff; }
#sr-chatbox .cb-step.done   .cb-step-num { background: var(--cb-green);   color: #fff; }

/* ============================================================
   STATS BAR
   ============================================================ */
#sr-chatbox .cb-stats {
    display: flex;
    background: var(--cb-light);
    border-bottom: 1px solid var(--cb-border);
    flex-shrink: 0;
}
#sr-chatbox .cb-stat {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    border-right: 1px solid var(--cb-border);
}
#sr-chatbox .cb-stat:last-child { border-right: none; }
#sr-chatbox .cb-stat strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--cb-primary);
}
#sr-chatbox .cb-stat span { font-size: 10px; color: #999; }

/* ============================================================
   CHAT BODY
   ============================================================ */
#sr-chatbox .cb-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* iOS smooth scroll */
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #f8f8f8;
    min-height: 0;
    scroll-behavior: smooth;
}
#sr-chatbox .cb-body::-webkit-scrollbar { width: 4px; }
#sr-chatbox .cb-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
#sr-chatbox .cb-body::-webkit-scrollbar-track { background: transparent; }

#sr-chatbox .cb-date-div {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    margin: 8px 0;
    background: #eee;
    padding: 3px 12px;
    border-radius: 20px;
    align-self: center;
}

/* ============================================================
   MESSAGES
   ============================================================ */
#sr-chatbox .cb-bot-wrap {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 6px;
}
#sr-chatbox .cb-bot-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}
#sr-chatbox .cb-bot-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
#sr-chatbox .cb-msg-bot {
    background: #fff;
    color: #1a1a2e;
    border-radius: 16px 16px 16px 4px;
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1.55;
    max-width: 80%;
    border: 1px solid #eeeff1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    white-space: pre-wrap;
    word-break: break-word;
}
#sr-chatbox .cb-msg-user {
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-dark));
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1.55;
    max-width: 80%;
    margin-left: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
#sr-chatbox .cb-msg-urgent {
    background: #fff5f5;
    border: 1.5px solid #fca5a5;
    color: #991b1b;
    border-radius: 12px;
    padding: 10px 13px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
}
#sr-chatbox .cb-time {
    font-size: 10px;
    color: #bbb;
    margin-bottom: 4px;
}
#sr-chatbox .cb-time.left { margin-left: 40px; }

/* ============================================================
   TYPING INDICATOR
   ============================================================ */
#sr-chatbox .cb-typing {
    display: flex;
    gap: 4px;
    padding: 10px 13px;
    background: #fff;
    border-radius: 16px;
    width: fit-content;
    border: 1px solid #eee;
}
#sr-chatbox .cb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    animation: cb-bounce 0.85s ease-in-out infinite;
}
#sr-chatbox .cb-dot:nth-child(2) { animation-delay: 0.16s; }
#sr-chatbox .cb-dot:nth-child(3) { animation-delay: 0.32s; }
@keyframes cb-bounce {
    0%, 80%, 100% { transform: translateY(0);  background: #ccc; }
    40%            { transform: translateY(-7px); background: var(--cb-primary); }
}

/* ============================================================
   QUICK OPTIONS
   ============================================================ */
#sr-chatbox .cb-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 4px 0;
}
#sr-chatbox .cb-opt {
    border: 1.5px solid var(--cb-primary);
    color: var(--cb-primary);
    background: #fff8f5;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--cb-font);
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.4;
}
#sr-chatbox .cb-opt:hover {
    background: var(--cb-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(232,82,10,0.3);
}
#sr-chatbox .cb-opt:disabled {
    background: var(--cb-primary);
    color: #fff;
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   INFO CARD
   ============================================================ */
#sr-chatbox .cb-info-card {
    background: #fff;
    border: 1.5px solid var(--cb-border);
    border-radius: 14px;
    padding: 14px;
    margin: 6px 0;
    box-shadow: 0 3px 14px rgba(0,0,0,0.07);
}
#sr-chatbox .cb-info-card h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--cb-primary);
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 6px;
}
#sr-chatbox .cb-info-card p {
    font-size: 12.5px;
    color: #444;
    line-height: 1.58;
    margin-bottom: 6px;
}
#sr-chatbox .cb-symp-tag {
    display: inline-block;
    background: #fff5f5;
    color: #c0392b;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 9px;
    margin: 2px;
}
#sr-chatbox .cb-cta {
    width: 100%;
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--cb-font);
    margin-top: 10px;
    transition: opacity 0.2s, transform 0.2s;
}
#sr-chatbox .cb-cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* ============================================================
   DOCTOR CARD
   ============================================================ */
#sr-chatbox .cb-doc-card {
    background: linear-gradient(135deg, #fff8f5, #fff);
    border: 1.5px solid var(--cb-border);
    border-radius: 14px;
    padding: 13px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(232,82,10,0.08);
}
#sr-chatbox .cb-doc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
#sr-chatbox .cb-doc-info { flex: 1; min-width: 0; }
#sr-chatbox .cb-doc-info strong { font-size: 13.5px; color: #1a1a2e; display: block; font-weight: 700; }
#sr-chatbox .cb-doc-info span   { font-size: 11.5px; color: #777; display: block; margin-top: 2px; }
#sr-chatbox .cb-stars { color: #f59e0b; font-size: 13px; margin-top: 3px; }
#sr-chatbox .cb-doc-badge {
    margin-left: auto;
    background: #dcfce7;
    color: #166534;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    flex-shrink: 0;
}

/* ============================================================
   LANGUAGE SELECT SCREEN
   ============================================================ */
#sr-chatbox .cb-lang-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 30px 20px;
    gap: 18px;
    background: linear-gradient(160deg, #fff8f5 0%, #fff 100%);
}
#sr-chatbox .cb-lang-screen h3 { font-size: 16px; font-weight: 700; color: #1a1a2e; text-align: center; line-height: 1.4; }
#sr-chatbox .cb-lang-screen p  { font-size: 13px; color: #777; text-align: center; line-height: 1.6; }
#sr-chatbox .cb-lang-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
#sr-chatbox .cb-lang-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    border: 2.5px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 26px;
    cursor: pointer;
    background: #fff;
    transition: all 0.25s ease;
    min-width: 120px;
    font-family: var(--cb-font);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
#sr-chatbox .cb-lang-btn:hover {
    border-color: var(--cb-primary);
    background: var(--cb-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(232,82,10,0.18);
}
#sr-chatbox .cb-lang-flag { font-size: 34px; }
#sr-chatbox .cb-lang-name { font-size: 15px; font-weight: 700; color: #1a1a2e; }
#sr-chatbox .cb-lang-sub  { font-size: 11px; color: #999; }

/* ============================================================
   APPOINTMENT FORM
   ============================================================ */
#sr-chatbox .cb-form-card {
    background: #fff;
    border: 1.5px solid var(--cb-border);
    border-radius: 14px;
    padding: 16px;
    margin: 6px 0;
    box-shadow: 0 3px 12px rgba(0,0,0,0.07);
}
#sr-chatbox .cb-form-card h4 { font-size: 13.5px; font-weight: 700; color: var(--cb-primary); margin-bottom: 13px; }
#sr-chatbox .cb-field { margin-bottom: 10px; }
#sr-chatbox .cb-field label { font-size: 11px; color: #777; font-weight: 600; display: block; margin-bottom: 4px; }
#sr-chatbox .cb-field input,
#sr-chatbox .cb-field select {
    width: 100%;
    border: 1.5px solid #e5e7eb;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
    font-family: var(--cb-font);
    color: #1a1a2e;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    background: #fff;
}
#sr-chatbox .cb-field input:focus,
#sr-chatbox .cb-field select:focus {
    border-color: var(--cb-primary);
    box-shadow: 0 0 0 3px rgba(232,82,10,0.1);
}
#sr-chatbox .cb-err {
    background: #fef2f2;
    color: #dc2626;
    font-size: 12px;
    padding: 7px 11px;
    border-radius: 8px;
    margin-bottom: 9px;
    display: none;
    border: 1px solid #fca5a5;
}
#sr-chatbox .cb-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--cb-font);
    transition: opacity 0.2s, transform 0.2s;
}
#sr-chatbox .cb-submit:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
#sr-chatbox .cb-submit:disabled             { opacity: 0.65; cursor: not-allowed; transform: none; }
#sr-chatbox .cb-privacy { font-size: 10.5px; color: #bbb; text-align: center; margin-top: 8px; }

/* ============================================================
   SATISFACTION BUTTONS
   ============================================================ */
#sr-chatbox .cb-sat-row { display: flex; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
#sr-chatbox .cb-sat-btn {
    border: 1.5px solid #e5e7eb;
    background: #fff;
    border-radius: 20px;
    padding: 7px 15px;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--cb-font);
    transition: all 0.2s ease;
}
#sr-chatbox .cb-sat-btn:hover,
#sr-chatbox .cb-sat-btn.sel {
    background: var(--cb-primary);
    color: #fff;
    border-color: var(--cb-primary);
}
#sr-chatbox .cb-sat-btn:disabled { cursor: not-allowed; }

/* ============================================================
   INPUT AREA
   ============================================================ */
#sr-chatbox .cb-input-area {
    border-top: 1px solid #f0f0f0;
    padding: 10px 12px 12px;
    background: #fff;
    flex-shrink: 0;
    /* ✅ KEY FIX: position relative so JS can adjust it */
    position: relative;
}
#sr-chatbox .cb-input-row {
    display: flex;
    gap: 7px;
    align-items: center;
}
#sr-chatbox .cb-input-row input {
    flex: 1;
    border: 1.5px solid #e5e7eb;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 16px; /* ✅ iOS zoom prevent: font-size ≥ 16px */
    outline: none;
    font-family: var(--cb-font);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f9f9f9;
    color: #1a1a2e;
    /* ✅ iOS ke liye appearance fix */
    -webkit-appearance: none;
    appearance: none;
}
#sr-chatbox .cb-input-row input:focus {
    border-color: var(--cb-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(232,82,10,0.08);
}
#sr-chatbox .cb-voice-btn,
#sr-chatbox .cb-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
#sr-chatbox .cb-voice-btn { background: #f3f4f6; }
#sr-chatbox .cb-voice-btn svg {
    width: 16px;
    height: 16px;
    stroke: #666;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#sr-chatbox .cb-voice-btn.listening { background: #fee2e2; animation: cb-pulse-btn 1s infinite; }
#sr-chatbox .cb-voice-btn.listening svg { stroke: #dc2626; }
#sr-chatbox .cb-voice-btn:hover { background: #e5e7eb; }
#sr-chatbox .cb-send-btn {
    background: #3e3eed;
    box-shadow: 0 3px 10px rgba(62, 62, 237, 0.35);
}
#sr-chatbox .cb-send-btn:hover { opacity: 0.9; transform: scale(1.05); }
#sr-chatbox .cb-send-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#sr-chatbox .cb-footer-hint {
    font-size: 10px;
    color: #bbb;
    text-align: center;
    margin-top: 5px;
}

/* ============================================================
   TABLET (481px – 768px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 768px) {
    #sr-chatbox {
        width: 340px;
        top: 70px;
        bottom: 160px;
        right: 16px;
    }
}

/* ============================================================
   MOBILE — FULLSCREEN + KEYBOARD FIX
   ============================================================ */
@media (max-width: 480px) {

    #sr-chat-toggle {
        bottom: 110px;
        right: 16px;
        width: 62px;
        height: 62px;
    }

    /* ✅ CORE MOBILE FIX:
       - 100dvh = dynamic viewport height (keyboard ke saath shrinks)
       - Fallback: 100vh for older browsers
       - top:0 aur height set — chatbox kabhi keyboard ke peeche nahi jayega
    */
    #sr-chatbox {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;

        /* dvh support check:
           Modern browsers: 100dvh adjusts when keyboard opens
           Old browsers fallback: 100vh */
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;

        border-radius: 0 !important;
        z-index: 999999 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* ✅ Input font size 16px on mobile — iOS auto-zoom band */
    #sr-chatbox .cb-input-row input {
        font-size: 16px !important;
    }

    /* Hide everything behind chatbox when open */
    #sr-chatbox.active ~ *,
    body.chatbot-open > *:not(#sr-chatbox):not(#sr-chat-toggle) {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Language buttons smaller on mobile */
    #sr-chatbox .cb-lang-btns { gap: 10px; }
    #sr-chatbox .cb-lang-btn  { padding: 16px 20px; min-width: 110px; }
    #sr-chatbox .cb-lang-flag { font-size: 28px; }
    #sr-chatbox .cb-lang-name { font-size: 13px; }
}

@media (max-width: 380px) {
    #sr-chatbox .cb-lang-btn  { padding: 14px 16px; min-width: 100px; }
    #sr-chatbox .cb-lang-flag { font-size: 26px; }
    #sr-chatbox .cb-lang-name { font-size: 12px; }
}