:root {
    --le-chatdock-w: 420px;
    --le-chatdock-h: 80vh;
    --le-chatdock-min-h: 340px;
    --le-chatdock-min-w: 320px;
    --le-chatdock-sidebar-w: 220px;
    --le-chatdock-sidebar-w-full: 260px;
    --le-color-primary: var(--primary-color);
    --le-color-primary-dark: var(--secondary-color);
    --le-color-accent: var(--tertiary-color);
    --le-color-surface: var(--white-color);
    --le-color-surface-alt: rgba(var(--background-color-rgb), 0.85);
    --le-color-stroke: rgba(0, 0, 0, 0.06);
    --le-radius-xl: 22px;
    --le-blur: 22px;
    --le-shadow: 0 30px 45px rgba(15, 23, 42, 0.18);


    --chatdock-bg: var(--white-color);
    --chatdock-panel: var(--white-color);
    --chatdock-card: var(--white-color);


    --chat-border-soft: rgba(0, 0, 0, 0.06);
    --chat-border-strong: rgba(0, 0, 0, 0.12);
    --chat-shadow-soft: 0 16px 32px rgba(15, 23, 42, 0.12);
    --chat-shadow-subtle: 0 8px 20px rgba(15, 23, 42, 0.10);


    --chat-accent: var(--secondary-color);
    --chat-accent-soft: rgba(244, 68, 46, 0.06);

    --chatdock-muted: var(--primary-color);
    --chatdock-muted-strong: #000000;
}

.chat-full-body {
    background: var(--white-color);
    /* min-height: 100vh; */
    font-family: var(--font-family);
    color: var(--primary-color);
}

.chat-full-app {
    max-width: 1400px;
    margin: 0 auto;
    /* padding: 1.5rem; */
}

.bubble {
    a {
        color: var(--hyperlink-color)
    }
}

#fullRefreshConvos:active,
#toggleFullConversations:active {
    border-color: var(--white-color);
}

#cdApplyDates {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.chat-full-content {
    margin-top: .5rem;
    display: grid;
    direction: rtl;
    gap: .5rem;
    position: relative;
}

.chat-full-content>* {
    direction: ltr;
}

.chat-full-app .sidebar-collapsed {
    width: 0 !important;
    overflow: hidden;
}

.chat-full-sidebar {
    background: var(--chatdock-panel);
    border-radius: 8px;
    padding: .5rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--chat-border-soft);
    overflow-y: auto;
}

.chat-full-app.sidebar-collapsed .chat-full-sidebar {
    opacity: 0;
    pointer-events: none;
}

.chat-full-sidebar .sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: var(--chatdock-muted);
}

.chat-full-sidebar .sidebar-actions .btn-primary {
    border-radius: 18px;
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.18);
}

.chat-full-sidebar .input-group-text {
    background: var(--white-color);
    border: 1px solid var(--chat-border-soft);
    border-radius: 999px 0 0 999px;
    color: #000000;
}

.chat-full-sidebar .input-group .form-control {
    border: 1px solid var(--chat-border-soft);
    border-left: 0;
    border-radius: 0 999px 999px 0;
    background: transparent;
    color: var(--primary-color);
    box-shadow: none !important;
}

.chat-full-sidebar .input-group .form-control::placeholder {
    color: #000000;
}

#fullConvoList .item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.4rem;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    color: var(--primary-color);
    background-color: var(--white-color);
    border-bottom: 1px solid var(--chat-border-soft);
}

#fullConvoList .item:hover {
    border-color: var(--background-color);
    background: var(--background-color);
    border-bottom: 1px solid var(--chat-border-soft);
}

#fullConvoList .item.active {
    border-color: var(--chat-accent);
    border-left: 3px solid var(--chat-accent);
    background: var(--white-color);
}

#fullConvoList .item .flex-grow-1 {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

#fullConvoList .item .name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--font-size-p2);
    font-weight: 600;
}

#fullConvoList .item .dropdown {
    flex-shrink: 0;
}

#fullConvoList {
    overflow-y: auto !important;
    overflow-x: hidden;
}

#fullConvoList .item .meta {
    font-size: .8rem;
    color: var(--primary-color);
}

.chat-full-main {
    background: var(--chatdock-panel);
    border-radius: 8px;
    padding: .5rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 200px) !important;
    height: auto !important;
}

.chat-full-main {
    h6{
        font-weight: 700;
    }
}

.chat-full-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--tertiary-color);
}

.chat-full-top-bar h5 {
    color: var(--primary-color);
}

.chat-full-messages {
    flex: 1;
    min-height: 0;
    background: var(--white-color);
}

.chat-full-footer {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    border-top: 1px solid var(--chat-border-soft);
    padding-top: .5rem;
}

#fullMessages::-webkit-scrollbar,
#fullConvoList::-webkit-scrollbar {
    width: 6px;
}

#fullMessages::-webkit-scrollbar-thumb,
#fullConvoList::-webkit-scrollbar-thumb {
    background: var(--background-color);
    border-radius: 999px;
}

#fullInput {
    flex: 1;
    min-height: 52px;
    border-radius: 999px;
    border: 1px solid var(--chat-border-soft);
    padding: 0.85rem 1.25rem;
    resize: none;
    color: var(--primary-color);
    background: var(--white-color);
    overflow-y: auto !important;
    scrollbar-width: none;
}

#fullInput::placeholder {
    color: #000000;
}

.chat-full-footer .btn {
    border: 1px solid var(--chat-border-soft);
}

.chat-full-footer .btn-primary {
    background: var(--secondary-color);
    color: var(--white-color);
}

.chat-full-footer .btn-secondary {
    background: var(--white-color);
    color: #000000;
}

/* .chat-full-unified {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-full-unified .dropdown-menu {
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--chat-border-soft);
    box-shadow: var(--chat-shadow-subtle);
} */

#fullConvoList-placeholder {
    margin-top: 1rem;
}

#fullConvoList-placeholder span {
    border-radius: 8px;
    height: 2rem;
}

#fullSearch::-webkit-input-placeholder {
    color: #bfbfbf !important;
}

#fullSearch:-ms-input-placeholder {
    color: #bfbfbf !important;
}

#fullSearch::-ms-input-placeholder {
    color: #bfbfbf !important;
}

#fullSearch::placeholder {
    color: #bfbfbf !important;
}

.js-full-new-chat,
#fullRefreshConvos {
    font-size: .8rem;
    color: var(--white-color);
    background: var(--primary-color);

    &:hover {
        background-color: var(--secondary-color);
        color: var(--white-color);
    }

}

#fullSend {
    color: var(--white-color);
    background: var(--primary-color);

    &:hover {
        background-color: var(--secondary-color);
        color: var(--white-color);
    }
}

#booleanQueryName {
    border: 1px solid var(--background-color);
    border-radius: 4px;
    border-bottom: 2px solid var(--tertiary-color) !important;
}

#booleanQueryFolderBtn {
    width: fit-content !important;
}

.help-message-heading {
    font-size: var(--font-size-p);
    font-weight: 600;
}

.chat-example-btn {
    font-size: var(--font-size-p2);
}

.domain-toggle label {
    font-size: var(--font-size-p2) !important;
    padding: 4px 8px !important;
}

/* Typing Animation Styles */
.typing-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.3;
    animation: dotPulse 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.thinking-line {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 0.2;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Sidebar backdrop - hidden on desktop */
.sidebar-backdrop {
    display: none;
}

.chat-help-content {
    width: 75%;
}

/* =============================================
   MOBILE STYLES - Offcanvas Sidebar
   ============================================= */
@media (max-width: 992px) {
    .chat-full-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        width: min(320px, 85vw);
        height: 100%;
        z-index: 12;
        background: var(--white-color);
        border-radius: 0;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
        transform: translateX(0);
        transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out;
        opacity: 1 !important;
        pointer-events: auto !important;
        visibility: visible;
    }

    .chat-full-app.sidebar-collapsed .chat-full-sidebar {
        transform: translateX(-110%);
        visibility: hidden;
        pointer-events: none !important;
        box-shadow: none;
    }

    /* Ensure main content is below sidebar */
    .chat-full-main {
        position: relative;
        z-index: 1;
    }

    /* Backdrop hidden - using click-outside approach instead */
    .sidebar-backdrop {
        display: none;
    }

    #fullConvoList .item .name {
        max-width: 70vw;
    }
}

@media (max-width: 768px) {
    .chat-full-footer {
        flex-direction: column;
        align-items: flex-end;
    }

    .chat-full-footer>div {
        flex-direction: row-reverse;
    }

    .chat-help-content {
        width: 100%;
    }


}

/* Flow container */
.execution-flow {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

/* Stack steps vertically */
.execution-flow-list {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Each step wrapper */
.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Step box */
.flow-box {
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    text-align: center;
    min-width: 260px;
    max-width: 420px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Arrow */
.flow-arrow {
    font-size: 18px;
    color: #9ca3af;
    margin: 6px 0;
}

/* Hover for details */
/* .flow-step[title] {
  cursor: help;
} */

.flow-step:hover .flow-box {
    background: var(--white-color);
    /* border-color: #6366f1; */
}

/* Error step */
.flow-h-box-error {
    background: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
    font-weight: 600;
}

/* Arrow before error */
.flow-error .flow-h-arrow {
    color: #ef4444;
}

.btn-primary {
    background: var(--secondary-color);
    border: none;
    color: var(--white-color);
    box-shadow: 0 18px 32px rgba(15, 16, 18, 0.2);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active {
    background: var(--accent-color-1);
    color: var(--white-color);
}

.le-chatdock label,
.le-chatdock .form-label,
.le-chatdock small,
.le-chatdock .text-muted {
    color: var(--chatdock-muted);
}

.text-gradient {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--secondary-color);
}

.btn-ghost {
    background: transparent;
    border: 0;
    color: var(--primary-color);
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-icon-sm {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
}

.glassy {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(calc(var(--le-blur) * 0.4));
    border: 1px solid var(--accent-color-1);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.12);
    color: var(--primary-color) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.glassy:hover,
.glassy:focus {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.18);
}

.btn-chip {
    border-radius: 999px;
    background: var(--white-color);
    border: 1px solid var(--accent-color-1);
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.55rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-chip i {
    color: var(--tertiary-color);
}

.btn-chip:hover,
.btn-chip:focus {
    transform: translateY(-4px);
    background: var(--accent-color-1);
    color: var(--white-color);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
}

.btn-chip.active {
    background: var(--secondary-color);
    color: var(--white-color);
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.18);
    transform: translateY(-2px);
}

.btn-chip.active i {
    color: var(--white-color);
}

.le-chatdock-launcher {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 48px;
    height: 48px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--secondary-color);
    color: var(--white-color);
    display: grid;
    place-items: center;
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.2);
    backdrop-filter: blur(calc(var(--le-blur) * 0.4));
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    z-index: 15;
}

.le-chatdock-launcher:hover,
.le-chatdock-launcher:focus {
    transform: translateY(-4px);
    box-shadow: 0 30px 50px rgba(15, 23, 42, 0.3);
    color: var(--white-color);
}

.le-chatdock {
    z-index: 15;
    width: var(--le-chatdock-w);
    height: var(--le-chatdock-h);
    display: none;
    flex-direction: column;
    border-radius: 20px;
    background: var(--chatdock-bg);
    border: 1px solid var(--chat-border-soft);
    box-shadow: var(--chat-shadow-soft);
    overflow: hidden;
    color: var(--primary-color);
}

.le-chatdock.open {
    display: flex;
}

.le-chatdock.docked {
    position: fixed;
    right: 24px;
    bottom: 24px;
}

.le-chatdock.pagemode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    border-radius: 0;
    z-index: 1100;
}

.le-chatdock .cd-header {
    height: 60px;
    background: var(--white-color);
    color: var(--primary-color);
    border-bottom: 1px solid var(--chat-border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    gap: 0.75rem;
    cursor: grab;
    user-select: none;
}

.le-chatdock .cd-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.cd-hamburger {
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--primary-color);
    background: var(--white-color);
    padding: 0.35rem 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cd-hamburger:hover,
.cd-hamburger:focus {
    border-color: var(--chat-border-soft);
    background: var(--chat-accent-soft);
}

.le-chatdock.dragging .cd-header {
    cursor: grabbing;
}

.le-chatdock .cd-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.le-chatdock .cd-title .name {
    font-weight: 600;
    font-size: var(--font-lg);
    letter-spacing: 0.01em;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.le-chatdock .cd-title i {
    font-size: 1.2rem;
}

.le-chatdock .cd-actions .btn {
    color: var(--primary-color);
    border-radius: 12px;
}

.le-chatdock .cd-actions .btn:hover {
    color: var(--primary-color);
    background: var(--chat-accent-soft);
}

.le-chatdock .cd-resizer {
    height: 5px;
    cursor: ns-resize;
    background: var(--accent-color-1);
}

.le-chatdock.pagemode .cd-resizer {
    display: none;
}

.cd-corner-resizer {
    position: absolute;
    width: 18px;
    height: 18px;
    bottom: 14px;
    right: 14px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.35);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18);
    cursor: nwse-resize;
    opacity: 0.85;
}

.cd-corner-resizer::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 3px;
    border-right: 2px solid rgba(99, 102, 241, 0.65);
    border-bottom: 2px solid rgba(99, 102, 241, 0.65);
}

.le-chatdock.pagemode .cd-corner-resizer {
    display: none;
}

.le-chatdock .cd-body {
    display: grid;
    grid-template-columns: var(--le-chatdock-sidebar-w) 1fr;
    transition: grid-template-columns 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.le-chatdock.sidebar-collapsed .cd-body {
    grid-template-columns: 0 1fr;
}

.le-chatdock .cd-sidebar {
    background: var(--chatdock-panel);
    border-right: 1px solid var(--chat-border-soft);
    padding: 1rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.le-chatdock.sidebar-collapsed .cd-sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.le-chatdock.pagemode .cd-sidebar {
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    width: var(--le-chatdock-sidebar-w-full);
}

.cd-sidebar .input-group {
    background: var(--white-color);
    border-radius: 999px;
    border: 1px solid var(--chat-border-soft);
    overflow: hidden;
    box-shadow: none;
}

.cd-sidebar .form-control {
    border: 0;
    background: transparent;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.cd-sidebar .input-group-text {
    border: 0;
    background: transparent;
    color: var(--primary-color);
}

.cd-convo-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.25rem;
    display: flex;
    flex-direction: column;
    /* gap: 0.25rem; */
}

.cd-convo-list .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    /* border-radius: 12px; */
    background: #f7f7f7;
    cursor: pointer;
}

.cd-convo-list .item .name {
    flex: 1;
    /* take remaining space */
    min-width: 0;
    /* CRITICAL for ellipsis */
    margin-right: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cd-convo-list .item .actions,
.cd-convo-list .item .dropdown {
    flex-shrink: 0;
}

.cd-convo-list .item .dropdown-toggle {
    padding: 8px;
}

.cd-convo-list .item:hover {
    border-color: var(--chat-border-soft);
    background: var(--chat-accent-soft);
}

.cd-convo-list .item.active {
    border-color: var(--chat-accent);
    border-left: 3px solid var(--chat-accent);
    background: #ffffff;
}

/* Prevent horizontal scrollbar in conversation list */
#cdConvoList {
    overflow-x: hidden !important;
}


.cd-convo-list .item .meta {
    font-size: 0.75rem;
    color: #000000;
}

.cd-chat {
    display: flex;
    flex-direction: column;
    background: var(--chatdock-panel);
    min-height: 0;
    position: relative;
    overflow: visible !important;
}

.cd-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.4rem 1.5rem;
    padding-top: calc(1.4rem + 60px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
    background: var(--white-color);
    min-height: 0;
    position: relative;
    z-index: 0;
}

.cd-sources-count,
.sources-label {
    cursor: pointer;
}

/* When messages container has content, it should be above welcome overlay */
/* .cd-messages:not(:empty) {
  z-index: 2;
} */

.cd-messages::-webkit-scrollbar {
    width: 6px;
}

.cd-messages::-webkit-scrollbar-thumb {
    background: var(--background-color);
    border-radius: 999px;
}

.le-msg {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    max-width: 100%;
}

.le-msg.user {
    margin-left: auto;
    justify-content: flex-end;
}

.le-msg .avatar {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: var(--primary-color);
    color: var(--white-color);
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    flex: 0 0 32px;
}

.le-msg.user .avatar {
    display: none;
}

.le-msg .bubble {
    padding: 0.5rem 1.05rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--chat-border-soft);
    /* box-shadow: var(--chat-shadow-subtle); */
    line-height: 1.5;
    font-size: 0.95rem;
    color: var(--primary-color) !important;
}

.le-msg.user .bubble {
    color: var(--primary-color) !important;
    background: var(--background-color);
    color: #fff;
    border: 0;
    /* box-shadow: var(--chat-shadow-subtle); */
}

.le-msg.assistant .bubble {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--chat-border-soft);
    color: var(--primary-color);
}

.le-msg .time {
    font-size: 0.75rem;
    color: #000000;
    margin-top: 0.35rem;
}

.cd-footer {
    border-top: 1px solid var(--chat-border-soft);
    background: var(--white-color);
    padding: 0.85rem 1.2rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.65rem;
    align-items: center;
}

.cd-footer textarea {
    resize: none;
    max-height: 120px;
    border-radius: 18px;
    border: 1px solid var(--chat-border-soft);
    padding: 0.85rem 1.25rem;
    font-size: var(--font-md);
    background: var(--white-color);
    color: var(--primary-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cd-footer textarea::placeholder {
    font-size: 0.85rem;
    color: var(--accent-color-1);
}

.cd-footer textarea:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 1px rgba(244, 68, 46, 0.25);
}

.cd-date-input {
    background: var(--white-color);
    border: 1px solid var(--chat-border-soft);
    color: var(--primary-color);
}

.cd-date-input::placeholder {
    color: #000000;
}

#cdModeDropdown {
    display: flex;
    align-items: center;
}

.btn-send {
    border-radius: 16px;
    padding: 0 1.15rem;
    display: grid;
    place-items: center;
    background: var(--secondary-color);
    color: var(--white-color);
    box-shadow: var(--chat-shadow-subtle);
}

.btn-send i {
    font-size: 1rem;
}

/* .btn-mode {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--chat-border-soft);
  background: var(--white-color);
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--primary-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
} */

/* .btn-mode i {
  font-size: 0.75rem;
  color: #000000;
} */

/* .btn-mode:hover,
.btn-mode:focus {
  border-color: rgba(47, 49, 54, 0.4);
  box-shadow: 0 12px 24px rgba(47, 49, 84, 0.12);
  color: var(--primary-color);
} */

/* Fix z-index of mode dropdown */
#cdModeDropdown .dropdown-menu {
    top: auto !important;
    bottom: 42px !important;
    /* position above button */
    transform: none !important;
    z-index: 999999 !important;
}

#cdConvoList .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

.cd-convo-list .dropdown-item {
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* .cd-convo-list .dropdown-item:hover,
.cd-convo-list .dropdown-item:focus {
  background: var(--chat-accent-soft);
  color: var(--primary-color);
} */

/* .cd-convo-list .dropdown-item.text-danger {
  color: var(--secondary-color);
}

.cd-convo-list .dropdown-item.text-danger:hover,
.cd-convo-list .dropdown-item.text-danger:focus {
  background: rgba(244, 68, 46, 0.06);
  color: var(--secondary-color);
} */
/* Disable hover styling on chat items when dropdown is open or hovered */
/* #cdConvoList .item.dropdown-open,
#cdConvoList .item:hover .dropdown-menu:hover,
#cdConvoList .item:hover .dropdown-menu.show {
    background-color: inherit !important;
} */

.cd-empty-state,
.cd-welcome-state {
    /* position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
}

.cd-empty-state.d-none,
.cd-welcome-state.d-none {
    display: none;
}

#cdEmptyMsg {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.45);
    letter-spacing: 0.01em;
    animation: floatUp 6s ease-in-out infinite;
    pointer-events: none;
}

#cdWelcomeOptions {
    display: flex;
    justify-content: center;
    /* align-items: flex-start; */
    padding: 1.5rem;
    width: 100%;
    pointer-events: auto;
    overflow-y: auto;
    padding-top: 2rem;
    position: relative;
    z-index: 11;
}

#cdWelcomeOptions * {
    pointer-events: auto;
}

.cd-welcome-card {
    width: 100%;
    max-width: 500px;
    border-radius: 26px;
    padding: 1.75rem 2rem;
    background: var(--white-color);
    border: 1px solid var(--chat-border-soft);
    box-shadow: var(--chat-shadow-subtle);
    text-align: left;
}

.cd-welcome-title {
    font-size: 1.65rem;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.cd-source-chips {
    margin-top: 1rem;
    margin-bottom: .1rem;
}

.cd-sources-count {
    font-size: 0.75rem;
    color: var(--tertiary-color);
}

.cd-assistant-msg {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cd-assistant-msg .cd-sources-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cd-assistant-msg .btn {
    border-radius: 12px;
}

#cdCollapsedBtns {
    display: none;
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--white-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.le-chatdock.sidebar-collapsed #cdCollapsedBtns {
    display: flex;
}

#cdCollapsedBtns .btn {
    pointer-events: auto;
    min-width: auto;
    height: 40px;
    border-radius: 16px;
    flex-shrink: 0;
}

.btn-ghost.glassy {
    background: var(--accent-color-1) !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #ffffff !important;
    box-shadow: 0 16px 26px rgba(15, 23, 42, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-ghost.glassy .label {
    font-size: 0.72rem;
    text-transform: uppercase;
}

.btn-ghost.glassy:hover,
.btn-ghost.glassy:focus {
    background: var(--secondary-color) !important;
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 20px 32px rgba(15, 23, 42, 0.2);
    color: #ffffff !important;
}

.le-chatdock.pagemode .cd-body {
    grid-template-columns: var(--le-chatdock-sidebar-w-full) 1fr;
}

.le-chatdock.pagemode.sidebar-collapsed .cd-body {
    grid-template-columns: 0 1fr !important;
}

.le-chatdock.pagemode .cd-footer {
    width: 100%;
    border-radius: 0 0 28px 28px;
}

#cdInput {
    overflow-y: auto !important;
    /* allow scroll */
    scrollbar-width: none;
    /* Firefox hide scrollbar */
}

#cdInput::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari hide scrollbar */
}

/* Date dropdown toggles */
.le-date-dropdown .toggle-date.active {
    background-color: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.le-date-dropdown .toggle-date {
    min-width: 64px;
}

/* Hide / show helper */
.le-date-dropdown .datepicker-container input.d-none {
    display: none !important;
}

.cd-title {
    overflow: visible !important;
}

/* Toggle button styles removed - date picker now shows both inputs simultaneously */

/* Unified Control Styles */
.le-unified-control {
    position: static;
    /* Allow dropdown to position relative to viewport */
}

#btnUnifiedControl {
    font-size: .8rem;
    color: var(--white-color);
    background: var(--primary-color);
}

/* .le-unified-control > #btnUnifiedControl {
  border-radius: 999px;
  border: 1px solid var(--chat-border-soft);
  background: var(--white-color);
  color: var(--primary-color);
  padding-inline: 0.75rem;
  font-weight: 500;
} */

/* .le-unified-control > #btnUnifiedControl i {
  color: var(--chat-accent);
}

.le-unified-control > #btnUnifiedControl:hover,
.le-unified-control > #btnUnifiedControl:focus {
  border-color: var(--chat-accent);
  background: var(--chat-accent-soft);
} */

/* .le-unified-control .dropdown-menu,
.le-unified-dropdown-detached {
    min-width: 320px;
    max-width: min(90vw, 400px);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1055 !important;
    border-radius: 18px;
    border: 1px solid var(--chat-border-soft);
    box-shadow: var(--chat-shadow-subtle);
} */

/* .le-unified-dropdown-detached {
    position: fixed !important; */
    /* When detached and moved to body */
/* } */

@keyframes floatUp {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@media (max-width: 768px) {
    :root {
        --le-chatdock-w: calc(100vw - 24px);
    }

    .le-chatdock.docked {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 100px;
    }

    .le-chatdock-launcher {
        right: 16px;
        bottom: 78px;
        width: 56px;
        height: 56px;
        border-radius: 18px;
    }

    .cd-welcome-card {
        padding: 1.5rem;
    }

    .cd-messages {
        flex: 0;
    }
}

/* Ensure Bootstrap modals appear above the chatdock */
.modal-body .form-label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

/* .modal {
    z-index: 140000 !important;
} */

/* .modal-backdrop {
    z-index: 139999 !important;
} */

/* Defensive: if chat uses huge z-index or creates stacking context, lower it while modal open */
/* .lechat-modal-open {
    z-index: 1000 !important;
} */

/* Make sure modal dialogs themselves appear on top of everything */
/* .modal.show {
    z-index: 140001 !important;
} */

/* Danger button for delete modal */
#deleteConvoConfirm {
    background: var(--secondary-color);
    border: none;
    color: #ffffff;
    font-weight: 600;
    /* padding: 0.5rem 1.25rem; */
    /* border-radius: 12px; */
    transition: all 0.2s ease;
}

#deleteConvoConfirm:hover {
    opacity: .8;
}

/* Share modal specific styles */
#shareConvoLink {
    font-family: monospace;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.8);
}

#shareConvoCopyBtn,
#shareConvoExportBtn {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

#shareConvoCopyBtn:hover,
#shareConvoExportBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.cd-chart-wrapper {
    padding: 10px;
    border-radius: 8px;
    background: var(--white-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

td,
th {
    border: 1px solid var(--primary-color);
    padding: 6px;
}

th {
    background: var(--bottom-bar-bg);
    color: var(--primary-color);
}

/* 2 per row grid container */
#sourcesPreviewBody {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
    padding: 4px;
}

/* Card style */
.source-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 12px;
    background: var(--chat-surface);
    border: 1px solid var(--chat-border-soft);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all .2s ease;
}

.source-card:hover {
    transform: translateY(-3px);
    background: #fff;
}

/* Profile + Mediatype inline */
.source-top {
    display: flex;
    width: 100%;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: #444;
}

/* Title */
.source-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111;
}

/* Summary */
.source-summary {
    color: #333;
    font-size: 0.82rem;
    line-height: 1.25rem;
}

/* Date */
.source-meta {
    font-size: 0.75rem;
    opacity: 0.7;
}