/* Madad chatbot widget styles - scoped for embed isolation. */
:root {
    --primary: #0a3d78;
    --primary-dark: #062b55;
    --primary-soft: #eaf2fb;
    --accent: #c99b2e;
    --ink: #182536;
    --muted: #637083;
    --border: #d9e2ef;
    --surface: #ffffff;
    --soft: #f5f8fc;
    --shadow: 0 18px 45px rgba(10, 61, 120, 0.14);
    --shadow-strong: 0 30px 90px rgba(7, 29, 57, 0.28);
}

#madad-chatbot-root {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #182536;
    -webkit-text-size-adjust: 100%;
    /* Escape parent overflow/transform stacking contexts on host sites */
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    isolation: isolate;
    z-index: 999999;
}

#madad-chatbot-root *,
#madad-chatbot-root *::before,
#madad-chatbot-root *::after {
    box-sizing: border-box;
}

/* ===== Floating launcher: logo fills circle; thin blue outline unchanged ===== */
#madad-chatbot-root .ai-float-button, #madad-chatbot-root .chat-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    pointer-events: auto;
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    padding: 0;
    overflow: visible;
    background: transparent !important;
    color: #fff;
    cursor: pointer;
    isolation: isolate;
    /* Thin blue outline — keep as-is */
    box-shadow:
        0 0 0 1.5px #3d84ff,
        0 6px 16px rgba(10, 61, 120, 0.2);
    animation: madadFloat 3.2s ease-in-out infinite;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#madad-chatbot-root .ai-float-button::before, #madad-chatbot-root .chat-launcher::before {
    content: none;
    display: none;
}

#madad-chatbot-root .ai-float-button::after, #madad-chatbot-root .chat-launcher::after {
    content: "";
    display: block;
    position: absolute;
    inset: -10px;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(61, 132, 255, 0.26) 0%,
        rgba(61, 132, 255, 0.08) 50%,
        transparent 72%
    );
    filter: blur(8px);
    opacity: 0.7;
    pointer-events: none;
    animation: madadBreathGlow 3.4s ease-in-out infinite;
}

#madad-chatbot-root .ai-float-button img, #madad-chatbot-root .chat-launcher img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    object-fit: cover;
    object-position: center center;
    /* Fill button — button size unchanged; black ring removed from PNG */
    transform: scale(1.08);
    transform-origin: center center;
    border: 0;
    border-radius: 50%;
    clip-path: circle(50% at 50% 50%);
    pointer-events: none;
    background: transparent !important;
    box-shadow: none;
}

#madad-chatbot-root .ai-float-button:active, #madad-chatbot-root .chat-launcher:active {
    animation: none;
    transform: translateY(1px) scale(0.96);
    transition-duration: 120ms;
}

#madad-chatbot-root .ai-pulse {
    display: block;
    position: absolute;
    inset: -7px;
    z-index: -1;
    border: 1px solid rgba(61, 132, 255, 0.45);
    border-radius: 50%;
    box-shadow: 0 0 8px 1px rgba(61, 132, 255, 0.16);
    pointer-events: none;
    animation: pulseRing 2.8s ease-out infinite;
}

@keyframes madadFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes madadFloatHover {
    0%,
    100% {
        transform: translateY(-2px) scale(1.1);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
}

@keyframes madadBreathGlow {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 0.88;
    }
}

@keyframes pulseRing {
    0% {
        opacity: 0.65;
        transform: scale(0.92);
    }
    100% {
        opacity: 0;
        transform: scale(1.22);
    }
}

#madad-chatbot-root .chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 102px;
    z-index: 1000000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    width: 480px;
    max-width: 480px;
    min-width: 0;
    height: 730px;
    min-height: 0;
    max-height: 730px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: var(--shadow-strong);
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.24s ease, transform 0.24s ease;
}

#madad-chatbot-root .chatbot-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#madad-chatbot-root .chatbot-panel.minimized {
    height: 82px;
    min-height: 82px;
    max-height: 82px;
}

#madad-chatbot-root .chatbot-panel.minimized .chatbot-toolbar, #madad-chatbot-root .chatbot-panel.minimized .chatbot-messages, #madad-chatbot-root .chatbot-panel.minimized .chatbot-input-area {
    display: none;
}

#madad-chatbot-root .chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background:
        radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.18), transparent 28%),
        linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 1.05rem 1.1rem;
}

#madad-chatbot-root .chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#madad-chatbot-root .chatbot-title small {
    display: block;
    opacity: 0.78;
}

#madad-chatbot-root .chatbot-avatar {
    display: grid;
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    place-items: center;
    align-self: center;
    padding: 1px;
    border: 0;
    border-radius: 50%;
    /* Thin white outline only — logo fills almost all of the circle */
    background: #ffffff !important;
    box-shadow: 0 6px 16px rgba(3, 24, 48, 0.18);
    overflow: hidden;
}

#madad-chatbot-root .chatbot-avatar::before, #madad-chatbot-root .chatbot-avatar::after {
    content: none;
    display: none;
}

#madad-chatbot-root .chatbot-avatar img, #madad-chatbot-root .chatbot-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.08) !important;
    transform-origin: center center;
    border: 0;
    border-radius: 50%;
    background: transparent !important;
    clip-path: circle(50% at 50% 50%);
    box-shadow: none;
}

#madad-chatbot-root .chatbot-controls {
    display: flex;
    gap: 0.4rem;
}

#madad-chatbot-root .chatbot-controls button, #madad-chatbot-root .chatbot-toolbar button {
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    width: 34px;
    height: 34px;
}

#madad-chatbot-root .chatbot-controls button:hover, #madad-chatbot-root .chatbot-toolbar button:hover {
    background: rgba(255, 255, 255, 0.22);
}

#madad-chatbot-root .chatbot-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.84rem;
    padding: 0.72rem 1rem;
}

#madad-chatbot-root .chatbot-toolbar button {
    width: auto;
    height: auto;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    padding: 0.35rem 0.65rem;
}

#madad-chatbot-root .chatbot-messages {
    flex: 1;
    overflow-y: auto;
    background:
        radial-gradient(circle at 0 0, rgba(10, 61, 120, 0.06), transparent 24%),
        linear-gradient(180deg, #f8fbff, #fff);
    padding: 1.15rem 1rem 1.25rem;
    scroll-behavior: smooth;
}

#madad-chatbot-root .chatbot-messages::-webkit-scrollbar {
    width: 12px;
}

#madad-chatbot-root .chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#madad-chatbot-root .chatbot-messages::-webkit-scrollbar-thumb {
    background: #c8d8ea;
    border-radius: 999px;
}

#madad-chatbot-root .chat-message {
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
    animation: messageIn 0.22s ease both;
}

#madad-chatbot-root .chat-message.user {
    justify-content: flex-end;
}

#madad-chatbot-root .message-avatar {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    align-self: flex-start;
    background: transparent;
    border: 0;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(10, 61, 120, 0.16);
}

#madad-chatbot-root .message-avatar img, #madad-chatbot-root .message-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 50%;
    background: transparent;
}

#madad-chatbot-root .message-bubble {
    max-width: calc(100% - 48px);
    min-width: 0;
    border-radius: 22px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 10px 26px rgba(10, 61, 120, 0.09);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-x: hidden;
}

#madad-chatbot-root .chat-message.bot .message-bubble {
    background: #fff;
    border: 1px solid var(--border);
    color: var(--ink);
    border-top-left-radius: 8px;
}

#madad-chatbot-root .chat-message.user .message-bubble {
    background: linear-gradient(135deg, var(--primary), #176bb3);
    color: #fff;
    border-top-right-radius: 8px;
}

#madad-chatbot-root .chatbot-markdown > :first-child {
    margin-top: 0;
}

#madad-chatbot-root .chatbot-markdown > :last-child {
    margin-bottom: 0;
}

#madad-chatbot-root .chatbot-markdown {
    text-align: left;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}

#madad-chatbot-root .chatbot-markdown p, #madad-chatbot-root .chatbot-markdown li, #madad-chatbot-root .chatbot-markdown h1, #madad-chatbot-root .chatbot-markdown h2, #madad-chatbot-root .chatbot-markdown h3, #madad-chatbot-root .chatbot-markdown h4, #madad-chatbot-root .chatbot-markdown h5, #madad-chatbot-root .chatbot-markdown strong, #madad-chatbot-root .chatbot-markdown em, #madad-chatbot-root .chatbot-markdown a, #madad-chatbot-root .chatbot-markdown-link, #madad-chatbot-root .chatbot-markdown code, #madad-chatbot-root .chatbot-markdown pre, #madad-chatbot-root .chatbot-markdown .chat-section-label {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    max-width: 100%;
}

#madad-chatbot-root .chatbot-markdown pre, #madad-chatbot-root .chatbot-markdown code {
    white-space: pre-wrap;
}

#madad-chatbot-root .chatbot-markdown p {
    margin: 0 0 0.55rem;
    line-height: 1.5;
}

#madad-chatbot-root .chatbot-markdown h1, #madad-chatbot-root .chatbot-markdown h2, #madad-chatbot-root .chatbot-markdown h3, #madad-chatbot-root .chatbot-markdown h4, #madad-chatbot-root .chatbot-markdown h5 {
    margin: 0 0 0.45rem;
    color: var(--primary-dark);
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

#madad-chatbot-root .chatbot-markdown h1, #madad-chatbot-root .chatbot-markdown h2, #madad-chatbot-root .chatbot-markdown h3, #madad-chatbot-root .chatbot-markdown h4 {
    font-size: 18px;
}

#madad-chatbot-root .chatbot-markdown h5 {
    font-size: 15px;
}

#madad-chatbot-root .chatbot-markdown ul, #madad-chatbot-root .chatbot-markdown ol {
    margin: 0.1rem 0 0.5rem;
    padding-left: 1.15rem;
}

#madad-chatbot-root .chatbot-markdown li {
    margin: 0.28rem 0;
    padding-left: 0.08rem;
    line-height: 1.5;
}

#madad-chatbot-root .chatbot-markdown strong {
    color: var(--primary-dark);
    font-weight: 650;
}

#madad-chatbot-root .chatbot-markdown em {
    color: #45566c;
}

#madad-chatbot-root .chatbot-markdown-link {
    color: var(--primary);
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

#madad-chatbot-root .chatbot-markdown-link:hover {
    color: var(--primary-dark);
}

#madad-chatbot-root .chatbot-markdown .chat-section-label {
    margin: 0.55rem 0 0.2rem;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
}

#madad-chatbot-root .chatbot-markdown .chat-section-label:first-child {
    margin-top: 0;
}

#madad-chatbot-root .chatbot-markdown .chat-section-label + p {
    margin-top: 0.08rem;
    margin-bottom: 0.35rem;
    color: #2b3b4f;
}

#madad-chatbot-root .chatbot-markdown .chat-section-divider {
    margin: 0.5rem 0 0.4rem;
    color: #c5d3e4;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}

#madad-chatbot-root .chat-message.bot .message-bubble.is-contact-card {
    padding: 12px 14px;
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #d7e4f4;
}

#madad-chatbot-root .chat-message.bot .message-bubble.is-contact-card .chatbot-markdown h4 {
    margin: 0 0 0.55rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #d9e5f2;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

#madad-chatbot-root .chat-message.bot .message-bubble.is-contact-card .chat-section-label {
    margin: 0.15rem 0 0.2rem;
    color: var(--primary-dark);
}

#madad-chatbot-root .chat-message.bot .message-bubble.is-contact-card .chat-section-label strong {
    font-weight: 650;
}

#madad-chatbot-root .chat-message.bot .message-bubble.is-contact-card .chat-section-label + p {
    margin: 0 0 0.12rem;
    color: #243447;
    font-size: 14px;
    line-height: 1.45;
}

#madad-chatbot-root .chat-message.bot .message-bubble.is-contact-card .chat-section-divider {
    margin: 0.5rem 0 0.45rem;
}

#madad-chatbot-root .chat-message.bot .message-bubble.is-contact-card .route-options {
    margin-top: 0.45rem;
}

#madad-chatbot-root .chat-message.user .chatbot-markdown h3, #madad-chatbot-root .chat-message.user .chatbot-markdown h4, #madad-chatbot-root .chat-message.user .chatbot-markdown h5, #madad-chatbot-root .chat-message.user .chatbot-markdown strong, #madad-chatbot-root .chat-message.user .chatbot-markdown em, #madad-chatbot-root .chat-message.user .chatbot-markdown-link {
    color: #fff;
}

#madad-chatbot-root .message-time {
    display: block;
    margin-top: 0.5rem;
    color: rgba(99, 112, 131, 0.82);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.01em;
}

#madad-chatbot-root .chat-message.user .message-time {
    color: rgba(255, 255, 255, 0.72);
}

#madad-chatbot-root .quick-actions, #madad-chatbot-root .route-options, #madad-chatbot-root .suggestion-chips {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

#madad-chatbot-root .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#madad-chatbot-root .quick-action, #madad-chatbot-root .route-option, #madad-chatbot-root .suggestion-chip, #madad-chatbot-root .redirect-link {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, var(--soft));
    color: var(--primary);
    font-weight: 650;
    font-size: 13px;
    line-height: 1.35;
    padding: 0.58rem 0.78rem;
    text-align: left;
    box-shadow: 0 8px 20px rgba(10, 61, 120, 0.06);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}

#madad-chatbot-root .quick-action:hover, #madad-chatbot-root .route-option:hover, #madad-chatbot-root .suggestion-chip:hover, #madad-chatbot-root .redirect-link:hover {
    background: var(--primary-soft);
    border-color: #bfd8f5;
    color: var(--primary-dark);
    box-shadow: 0 12px 26px rgba(10, 61, 120, 0.12);
    transform: translateY(-1px);
}

#madad-chatbot-root .redirect-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.7rem;
}

#madad-chatbot-root .typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

#madad-chatbot-root .typing-bubble {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: auto;
    min-height: 38px;
    padding-block: 0.65rem;
}

#madad-chatbot-root .typing-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

#madad-chatbot-root .typing-indicator span {
    display: block;
    width: 7px;
    height: 7px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingDot 1s infinite ease-in-out;
}

#madad-chatbot-root .typing-indicator span:nth-child(2) {
    animation-delay: 0.14s;
}

#madad-chatbot-root .typing-indicator span:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes typingDot {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#madad-chatbot-root .chatbot-input-area {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    background: #fff;
    padding: 1rem;
}

#madad-chatbot-root .chatbot-input-area input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    outline: 0;
    padding: 0.78rem 0.95rem;
    font-size: 14px;
}

#madad-chatbot-root .chatbot-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(10, 61, 120, 0.1);
}

#madad-chatbot-root .chatbot-input-area button {
    display: grid;
    width: 50px;
    place-items: center;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #1972bf);
    color: #fff;
    box-shadow: 0 10px 20px rgba(10, 61, 120, 0.18);
}

#madad-chatbot-root .chatbot-input-area button:disabled {
    cursor: wait;
    opacity: 0.68;
    box-shadow: none;
}

@media (max-width: 767px) {
    #madad-chatbot-root .top-strip .container {
        justify-content: center !important;
        text-align: center;
    }

    #madad-chatbot-root .brand-block {
        align-items: flex-start;
    }

    #madad-chatbot-root .brand-emblem {
        width: 50px;
        height: 50px;
        font-size: 1.45rem;
    }

    #madad-chatbot-root .hero-actions .btn {
        width: 100%;
    }

    #madad-chatbot-root .notice-list li {
        align-items: flex-start;
        flex-direction: column;
    }

    #madad-chatbot-root .ai-float-button, #madad-chatbot-root .chat-launcher {
        right: 14px;
        bottom: 14px;
        width: 84px;
        height: 84px;
        background: transparent !important;
        box-shadow:
            0 0 0 1.5px #3d84ff,
            0 6px 16px rgba(10, 61, 120, 0.2);
        overflow: visible;
    }

    #madad-chatbot-root .ai-float-button img, #madad-chatbot-root .chat-launcher img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: scale(1.08);
    }

    #madad-chatbot-root .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* Conversation-first Madad redesign */
#madad-chatbot-root .chatbot-panel {
    width: 480px;
    max-width: 480px;
    min-width: 0;
    height: 730px;
    min-height: 0;
    max-height: 730px;
    background: #f8fbff;
    border-radius: 30px;
}

#madad-chatbot-root .chatbot-header {
    flex: 0 0 auto;
    min-height: 74px;
    padding: 0.78rem 1.15rem;
}

#madad-chatbot-root .chatbot-title {
    min-width: 0;
}

#madad-chatbot-root .chatbot-title > span:last-child {
    min-width: 0;
}

#madad-chatbot-root .chatbot-title strong {
    display: block;
    font-size: 1rem;
    line-height: 1.1;
}

#madad-chatbot-root .chatbot-title small {
    font-size: 0.76rem;
    line-height: 1.25;
    white-space: nowrap;
}

#madad-chatbot-root .chatbot-avatar {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 0;
    padding: 1px;
    background: #ffffff !important;
    box-shadow: 0 6px 16px rgba(3, 24, 48, 0.18);
    overflow: hidden;
}

#madad-chatbot-root .chatbot-avatar img, #madad-chatbot-root .chatbot-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: scale(1.08) !important;
    transform-origin: center center;
    border: 0;
    border-radius: 50%;
    background: transparent !important;
    box-shadow: none;
    clip-path: circle(50% at 50% 50%);
}

#madad-chatbot-root .chatbot-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    margin-top: 0.22rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.72rem;
    font-weight: 700;
}

#madad-chatbot-root .status-dot {
    width: 7px;
    height: 7px;
    background: #52e18b;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(82, 225, 139, 0.18);
}

#madad-chatbot-root .chatbot-controls button {
    width: 32px;
    height: 32px;
}

#madad-chatbot-root .chatbot-panel.minimized {
    height: 74px;
    min-height: 74px;
    max-height: 74px;
}

#madad-chatbot-root .chatbot-panel.minimized .chatbot-messages, #madad-chatbot-root .chatbot-panel.minimized .chatbot-input-area {
    display: none;
}

#madad-chatbot-root .chatbot-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 0.75rem 0.85rem 0.7rem;
    background:
        radial-gradient(circle at 10% 0, rgba(10, 61, 120, 0.05), transparent 24%),
        linear-gradient(180deg, #f9fcff 0%, #f4f8fd 100%);
}

#madad-chatbot-root .chat-message {
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.7rem;
    animation: messageFadeIn 0.26s ease both;
    min-width: 0;
    max-width: 100%;
}

#madad-chatbot-root .chat-message.user {
    align-items: flex-start;
}

#madad-chatbot-root .message-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 50%;
    background: transparent;
    border: 0;
}

#madad-chatbot-root .message-avatar img, #madad-chatbot-root .message-avatar .madad-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

#madad-chatbot-root .message-bubble {
    max-width: 90%;
    min-width: 0;
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.005em;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-x: hidden;
}

#madad-chatbot-root .chat-message.bot .message-bubble {
    max-width: 90%;
    border-color: #dce8f5;
    border-top-left-radius: 10px;
}

#madad-chatbot-root .chat-message.user .message-bubble {
    max-width: 90%;
    border-top-right-radius: 10px;
}

#madad-chatbot-root .message-time {
    margin-top: 0.4rem;
    font-size: 0.68rem;
    opacity: 0.78;
}

#madad-chatbot-root .route-options, #madad-chatbot-root .suggestion-chips {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.42rem;
}

#madad-chatbot-root .route-option, #madad-chatbot-root .suggestion-chip, #madad-chatbot-root .redirect-link {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    padding: 0.55rem 0.8rem;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

#madad-chatbot-root .chatbot-input-area {
    flex: 0 0 auto;
    align-items: center;
    background: #fff;
    padding: 0.7rem 0.85rem 0.8rem;
}

#madad-chatbot-root .chatbot-input-area input {
    border-radius: 999px;
    background: #f7fafd;
    min-height: 44px;
    padding: 0.75rem 1rem;
    font-size: 14px;
}

#madad-chatbot-root .chatbot-input-area button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;

}

#madad-chatbot-root .typing-bubble {
    width: auto;
    min-height: 38px;
    padding-block: 0.65rem;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Laptop: 992px–1200px */
@media (max-width: 1200px) and (min-width: 992px) {
    #madad-chatbot-root .chatbot-panel {
        right: 20px;
        bottom: 96px;
        width: 450px;
        max-width: 450px;
        min-width: 0;
        height: 700px;
        min-height: 0;
        max-height: 700px;
    }
}

/* Tablet: 768px–991px */
@media (max-width: 991px) and (min-width: 768px) {
    #madad-chatbot-root .chatbot-panel {
        right: 16px;
        bottom: 90px;
        width: 420px;
        max-width: 420px;
        min-width: 0;
        height: 75vh;
        min-height: 0;
        max-height: 75vh;
    }
}

/* Mobile: <768px */
@media (max-width: 767px) {
    #madad-chatbot-root .chatbot-panel {
        right: 0;
        bottom: 0;
        left: 0;
        top: 0;
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }

    #madad-chatbot-root .chatbot-panel.minimized {
        top: auto;
        left: auto;
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 74px;
        min-height: 74px;
        max-height: 74px;
        border-radius: 0;
    }

    #madad-chatbot-root .chatbot-header {
        min-height: 70px;
        padding: 0.72rem 0.9rem;
    }

    #madad-chatbot-root .chatbot-title small {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #madad-chatbot-root .chatbot-messages {
        padding: 0.7rem 0.75rem 0.65rem;
    }

    #madad-chatbot-root .message-bubble, #madad-chatbot-root .chat-message.bot .message-bubble, #madad-chatbot-root .chat-message.user .message-bubble {
        max-width: 90%;
        font-size: 14px;
        padding: 12px 14px;
        line-height: 1.5;
    }

    #madad-chatbot-root .route-option, #madad-chatbot-root .suggestion-chip, #madad-chatbot-root .redirect-link {
        font-size: 13px;
        padding: 0.55rem 0.8rem;
    }

    #madad-chatbot-root .chatbot-input-area input {
        font-size: 14px;
    }
}

/* Ensure in-panel controls stay above message content */
#madad-chatbot-root .chatbot-header,
#madad-chatbot-root .chatbot-controls,
#madad-chatbot-root .chatbot-input-area {
    position: relative;
    z-index: 3;
}

#madad-chatbot-root .route-options,
#madad-chatbot-root .suggestion-chips,
#madad-chatbot-root .quick-actions {
    position: relative;
    z-index: 2;
}
