/* =========================================================
   XPERT AI CHATBOT DESIGN SYSTEM (From bot.html)
   MicroMerger / XpertERP
========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root {
    --blue-900: #082e70;
    --blue-800: #083b8c;
    --blue-700: #0756b8;
    --blue-600: #1769e8;
    --blue-500: #2584f4;

    --cyan: #45e5fb;
    --violet: #6549e8;

    --text: #17233d;
    --text-soft: #405473;
    --muted: #748297;

    --border: #dce5f0;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;

    --user-bg: #e3f8ef;
    --user-border: #c9ecdf;

    --green: #16b876;
    --green-soft: #ebf9f3;

    --red: #d94a56;
    --red-soft: #fff1f2;

    --shadow:
        0 22px 60px rgba(14, 40, 85, 0.17),
        0 3px 10px rgba(14, 40, 85, 0.08);
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    height: 100vh;
    height: 100dvh;
    -webkit-text-size-adjust: 100%;
}

#root {
    width: 100%;
    height: 100%;
    min-height: 100%;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background:
        radial-gradient(circle at 85% 12%, #dbeaff 0%, transparent 29%),
        linear-gradient(135deg, #eef3f8, #f7f9fc);
    color: var(--text);
    overflow: hidden;
}

/* =========================================================
   CHAT WINDOW CONTAINER
========================================================= */

.xpert-chat {
    width: min(960px, calc(100vw - 40px));
    height: min(850px, calc(100vh - 40px));
    height: min(850px, calc(100dvh - 40px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(209, 220, 235, 0.95);
    border-radius: 22px;
    box-shadow: var(--shadow);
    position: relative;
    transition: width .2s ease, height .2s ease, transform .2s ease;
}

.xpert-chat.expanded {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    height: calc(100dvh - 20px);
}

.xpert-chat.minimized {
    height: 62px;
}

.xpert-chat.minimized .ai-intro,
.xpert-chat.minimized .chat-body,
.xpert-chat.minimized .composer-wrap,
.xpert-chat.minimized .disclaimer {
    display: none;
}

.xpert-chat.closed {
    display: none;
}

/* Iframe Host Adaptation */
body.in-iframe {
    display: block;
    background: transparent;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body.in-iframe #root {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.xpert-chat.in-iframe {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

.reopen-chat {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 13px 20px;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, #0757b9, #3c3bd6);
    color: #fff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(18, 65, 150, 0.28);
    z-index: 1000;
}

.reopen-chat.visible {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   HEADER
========================================================= */

.chat-header {
    position: relative;
    height: 62px;
    min-height: 62px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 82% 10%, rgba(66, 225, 255, 0.26), transparent 29%),
        radial-gradient(circle at 64% 125%, rgba(139, 86, 255, 0.34), transparent 45%),
        linear-gradient(112deg, #082f72 0%, #0757b9 53%, #3c3bd6 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    z-index: 10;
}

.chat-header::before {
    content: "✦";
    position: absolute;
    right: 140px;
    top: -27px;
    font-size: 82px;
    color: rgba(84, 226, 255, .08);
    transform: rotate(10deg);
    pointer-events: none;
}

.chat-header::after {
    content: "";
    position: absolute;
    width: 145px;
    height: 145px;
    right: -40px;
    top: -94px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .10);
    pointer-events: none;
}

.header-left {
    position: relative;
    z-index: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.xpert-ai-icon {
    position: relative;
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .99), rgba(215, 238, 255, .92));
    border: 1px solid rgba(255, 255, 255, .72);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .19), inset 0 0 9px rgba(255, 255, 255, .75);
}

.xpert-ai-icon svg {
    width: 31px;
    height: 31px;
    filter: drop-shadow(0 2px 2px rgba(9, 54, 125, .12));
}

.logo-sparkle {
    position: absolute;
    line-height: 1;
    color: var(--cyan);
    text-shadow: 0 0 8px rgba(67, 231, 255, .90);
}

.sparkle-one {
    font-size: 11px;
    top: -5px;
    right: -5px;
}

.sparkle-two {
    font-size: 6px;
    top: 5px;
    right: -9px;
    color: #bc83ff;
}

.header-info {
    min-width: 0;
}

.header-inline {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.brand-name {
    font-size: 17px;
    line-height: 1;
    font-weight: 760;
    letter-spacing: -.25px;
    color: white;
}

.brand-name span {
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(72, 228, 250, .28);
}

.header-divider {
    color: rgba(255, 255, 255, .36);
    font-size: 9px;
}

.header-subtitle {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .76);
}

.online-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, .94);
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(6px);
}

.online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #21df8d;
    box-shadow: 0 0 0 2px rgba(33, 223, 141, .14), 0 0 8px rgba(33, 223, 141, .55);
}

.header-actions {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}

.header-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, .90);
    font-family: inherit;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, .14);
}

.header-btn:active {
    transform: scale(.93);
}

.header-btn.close:hover {
    background: rgba(255, 86, 103, .25);
}

/* =========================================================
   AI CONTEXT STRIP
========================================================= */

.ai-intro {
    margin: 9px 12px 2px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid #e1e9f7;
    background: linear-gradient(120deg, #f5f8ff, #eff3ff);
}

.ai-intro-copy {
    min-width: 0;
    font-size: 11.5px;
    color: #405473;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-intro-copy strong {
    color: #1d5fca;
}

.ai-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 9px;
    border: 1px solid #cddcf8;
    background: #fff;
    color: #1d63d5;
    font-size: 9.5px;
    font-weight: 750;
}

/* =========================================================
   CHAT BODY & DOTTED PATTERN
========================================================= */

.chat-body {
    flex: 1;
    min-height: 0;
    padding: 16px 20px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background:
        linear-gradient(rgba(247, 249, 252, .965), rgba(247, 249, 252, .965)),
        radial-gradient(circle, #dbe3ed 1px, transparent 1.2px);
    background-size: auto, 19px 19px;
    position: relative;
}

.chat-body::-webkit-scrollbar {
    width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #ccd7e6;
    border-radius: 8px;
}

/* Date Separator Pill */
.date-separator {
    display: flex;
    justify-content: center;
    margin: 14px 0 8px 0;
    width: 100%;
    clear: both;
}

.date-pill {
    background: #ffffff;
    color: #556987;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(14, 40, 85, 0.06);
    border: 1px solid var(--border);
    letter-spacing: 0.2px;
}

/* History Loading Indicator */
.history-loader {
    display: none;
    text-align: center;
    padding: 6px 14px;
    font-size: 11px;
    color: var(--blue-600);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    width: fit-content;
    margin: 0 auto 10px auto;
    box-shadow: 0 2px 8px rgba(14, 40, 85, 0.08);
    border: 1px solid var(--border);
}

/* Floating Scroll Down Button */
.scroll-down-btn {
    position: absolute;
    right: 20px;
    bottom: 85px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--blue-600);
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(14, 40, 85, 0.15);
    cursor: pointer;
    display: none;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    z-index: 25;
    transition: all 0.2s ease;
}

.scroll-down-btn:hover {
    background: #ffffff;
    color: var(--blue-800);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(14, 40, 85, 0.22);
}

/* =========================================================
   MESSAGE ROWS & BUBBLES
========================================================= */

.message-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-row.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 14px;
    background-size: cover;
    background-position: center;
    margin-top: 2px;
}

.user-avatar {
    border: 2px solid #ffffff;
    /* background: linear-gradient(135deg, #1e40af, #3b82f6); */
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.22);
}

.ai-avatar {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 75% 20%, rgba(69, 229, 251, .45), transparent 32%),
        linear-gradient(140deg, #0877da, #1552cc 57%, #6636dc);
    box-shadow: 0 4px 14px rgba(35, 80, 185, .25);
    border: 2px solid #ffffff;
}

.ai-avatar::after {
    content: "✦";
    position: absolute;
    right: 3px;
    top: 1px;
    font-size: 7px;
    color: #89edff;
}

.agent-avatar {
    color: #fff;
    background: linear-gradient(140deg, #059669, #047857);
    box-shadow: 0 4px 14px rgba(5, 150, 105, .25);
    border: 2px solid #ffffff;
}

.message {
    max-width: 82%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.user .message {
    color: #ffffff;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.18);
}

.assistant .message,
.bot .message {
    max-width: 85%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    transition: box-shadow 0.2s ease;
}

.assistant .message:hover,
.bot .message:hover {
    box-shadow: 0 6px 24px -2px rgba(15, 23, 42, 0.09), 0 3px 8px -1px rgba(15, 23, 42, 0.04);
}

.agent .message {
    max-width: 85%;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-top-left-radius: 4px;
    box-shadow: 0 4px 20px -2px rgba(5, 150, 105, 0.08);
}

.message-meta {
    margin-top: 8px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 500;
}

.user .message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    text-align: right;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 6px;
}

.assistant-header {
    margin-bottom: 9px;
    padding-bottom: 7px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.assistant-name {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1e3a8a;
    font-size: 12.5px;
    font-weight: 700;
}

.agent .assistant-name {
    color: #047857;
}

.assistant-name .spark {
    color: var(--violet);
}

.source-chip {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 10.5px;
    font-weight: 500;
}

/* =========================================================
   RICH MESSAGE CONTENT
========================================================= */

.msg-body {
    line-height: 1.6;
    word-break: break-word;
    color: #1e293b;
}

.user .msg-body {
    color: #ffffff;
}

.msg-body p {
    margin: 0 0 10px 0;
}

.msg-body p:last-child {
    margin-bottom: 0;
}

.msg-ul {
    list-style: none;
    margin: 8px 0;
    padding: 0;
}

.msg-ul li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    line-height: 1.55;
}

.msg-ul li::before {
    content: "•";
    position: absolute;
    left: 2px;
    color: #2563eb;
    font-weight: 800;
    font-size: 15px;
}

.user .msg-ul li::before {
    color: #93c5fd;
}

.msg-ol {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    counter-reset: ol-counter;
}

.msg-ol li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 6px;
    line-height: 1.55;
    counter-increment: ol-counter;
}

.msg-ol li::before {
    content: counter(ol-counter) ".";
    position: absolute;
    left: 2px;
    color: #2563eb;
    font-weight: 700;
    font-size: 13px;
}

.user .msg-ol li::before {
    color: #93c5fd;
}

.msg-heading {
    font-size: 14px;
    font-weight: 750;
    color: #0f172a;
    margin: 12px 0 6px 0;
}

.user .msg-heading {
    color: #ffffff;
}

.msg-heading:first-child {
    margin-top: 0;
}

.msg-divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 10px 0;
}

.user .msg-divider {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.msg-bold {
    font-weight: 700;
    color: inherit;
}

.msg-italic {
    font-style: italic;
}

.msg-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 6px;
    color: #0f172a;
}

.button-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
}

.chip-btn {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chip-btn:hover {
    color: #1d4ed8;
    border-color: #93c5fd;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.14);
}

.chip-btn:active {
    transform: translateY(0);
}

/* =========================================================
   COMPOSER
========================================================= */

.composer-wrap {
    padding: 9px 12px 6px;
    background: #fff;
    border-top: 1px solid #e1e8f0;
    position: relative;
}

.composer {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 10px;
    border-radius: 14px;
    border: 1px solid #d6e3f1;
    background: #f8faff;
    transition: border .15s ease, box-shadow .15s ease;
}

.composer:focus-within {
    border-color: #8eb8f2;
    box-shadow: 0 0 0 3px rgba(23, 105, 232, .07);
}

.composer input[type="text"] {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #263e5e;
    font-family: inherit;
    font-size: 13.5px;
}

.composer input[type="text"]::placeholder {
    color: #8998aa;
}

.composer-btn {
    border: 0;
    display: grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s ease;
}

.attach-btn {
    width: 30px;
    height: 30px;
    background: transparent;
    color: #5b708c;
    font-size: 16px;
    border-radius: 8px;
}

.attach-btn:hover {
    background: rgba(23, 105, 232, .08);
    color: var(--blue-600);
}

.ai-mode-btn {
    width: 33px;
    height: 33px;
    border-radius: 9px;
    color: var(--blue-600);
    background: linear-gradient(145deg, #eef5ff, #edf1ff);
    font-size: 15px;
    border: 1px solid #e1e8fb;
}

.ai-mode-btn:hover {
    background: #e4efff;
}

.send-btn {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 0;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(140deg, #1878ed, #0754c8);
    box-shadow: 0 6px 14px rgba(16, 98, 216, .27);
    transition: transform .15s ease, box-shadow .15s ease;
}

.send-btn:hover:not(:disabled) {
    box-shadow: 0 7px 17px rgba(16, 98, 216, .34);
}

.send-btn:active:not(:disabled) {
    transform: scale(.95);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.disclaimer {
    padding: 4px 10px 8px;
    background: #fff;
    color: #7b899a;
    text-align: center;
    font-size: 10px;
}

.disclaimer span {
    color: #5177b7;
}

/* =========================================================
   MODAL GUEST INTAKE
========================================================= */

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(8, 46, 112, 0.4);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.intake-card {
    background: #ffffff;
    border: 1px solid rgba(209, 220, 235, 0.95);
    border-radius: 22px;
    padding: 32px 28px 24px 28px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.intake-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intake-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(112deg, #082f72 0%, #0757b9 53%, #3c3bd6 100%);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 5px 14px rgba(8, 47, 114, 0.25);
    margin-bottom: 12px;
}

.intake-logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    line-height: 1;
    margin-bottom: 6px;
    font-weight: 800;
    color: var(--blue-900);
}

.intake-header p {
    font-size: 13px;
    color: var(--text-soft);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
}

.styled-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.styled-input-group i {
    position: absolute;
    left: 14px;
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
}

.form-input-theme {
    width: 100%;
    background: #f8faff;
    border: 1px solid #d6e3f1;
    padding: 11px 14px 11px 38px;
    border-radius: 12px;
    color: var(--text);
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s ease;
}

.form-input-theme:focus {
    border-color: var(--blue-600);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(23, 105, 232, .10);
}

.submit-btn-theme {
    background: linear-gradient(140deg, #1878ed, #0754c8);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 98, 216, 0.25);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.submit-btn-theme:hover {
    box-shadow: 0 6px 16px rgba(16, 98, 216, 0.35);
    transform: translateY(-1px);
}

.theme-copyright {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

/* Emoji Picker Popup */
.emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 12px;
    background: #ffffff;
    border: 1px solid #dce4f0;
    border-radius: 16px;
    padding: 10px;
    width: 310px;
    max-width: calc(100vw - 32px);
    height: 210px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(14, 40, 85, 0.14);
    z-index: 100;
}

.emoji-picker::-webkit-scrollbar {
    width: 5px;
}

.emoji-picker::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
}

.emoji-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.emoji-item {
    cursor: pointer;
    font-size: 20px;
    padding: 3px;
    border-radius: 6px;
    transition: transform 0.1s;
    user-select: none;
}

.emoji-item:hover {
    transform: scale(1.22);
}

/* Quick Prompts Popup */
.ai-prompts-popup {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 14px;
    background: #ffffff;
    border: 1px solid #dce4f0;
    border-radius: 16px;
    padding: 10px;
    width: 290px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 10px 30px rgba(14, 40, 85, 0.16);
    z-index: 110;
}

.ai-prompts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--blue-700);
    padding: 4px 6px 8px;
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 6px;
}

.ai-prompt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 7px 9px;
    border-radius: 10px;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 12px;
    color: #27374d;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ai-prompt-item:hover {
    background: #f1f5f9;
    color: var(--blue-600);
}

/* =========================================================
   RESPONSIVE DESIGN
========================================================= */

@media (max-width: 768px) {

    html,
    body,
    #root {
        height: 100%;
        height: 100dvh;
        overflow: hidden;
    }

    body {
        background: #f7f9fc;
        display: block;
    }

    #root {
        display: block;
    }

    .xpert-chat {
        width: 100% !important;
        height: 100% !important;
        height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .chat-header {
        padding: 0 12px;
    }

    .header-subtitle,
    .header-divider {
        display: none;
    }

    .ai-intro {
        margin: 6px 8px 2px;
        padding: 7px 10px;
    }
}