:root {
    --orion-accent: #448EAD;
    --orion-dark: #0B2A4A;
    --widget-w: 320px;
    --widget-h: 350px;
    --widget-max-h: 500px;
    --z: 9999;
}

/* =========================
   Launcher button
   ========================= */
#orion-launcher {
    position: fixed;
    right: 4px;
    bottom: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    height: auto;
    background: var(--orion-accent);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    z-index: var(--z);
    box-shadow: 0 14px 28px rgba(0,0,0,.26);
}

    #orion-launcher img {
        display: none;
    }

    #orion-launcher:hover {
        background: #2F7E9E;
    }

/* =========================
   Chat container
   ========================= */
#orion-chat {
    position: fixed;
    right: 4px;
    bottom: 24px;
    width: var(--widget-w);
    height: var(--widget-h);
    max-height: var(--widget-max-h);
    background: #fff;
    border-radius: 16px;
    border: 1px solid #E6E6E6;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(0,0,0,.28);
    display: none;
    flex-direction: column;
    z-index: var(--z);
    transform-origin: bottom right;
    animation: popin .35s ease-out forwards;
}

@keyframes popin {
    0% {
        opacity: 0;
        transform: scale(.9)
    }

    70% {
        opacity: 1;
        transform: scale(1.03)
    }

    100% {
        opacity: 1;
        transform: scale(1)
    }
}

/* =========================
   Header
   ========================= */
#orion-header {
    height: 56px;
    background: var(--orion-dark);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 13px;
}

.orion-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.orion-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.orion-btn {
    background: rgba(255,255,255,.14);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

    .orion-btn:hover {
        background: rgba(255,255,255,.22);
    }

/* =========================
   WebChat host (wrapper)
   ========================= */
#webchat {
    height: calc(100% - 56px);
    display: flex;
    flex-direction: column;
    background: #f7f9fb;
    overflow: hidden;
}

/* WebChat renders into this */
#webchat-root {
    flex: 1 1 auto;
    min-height: 0; /* critical for transcript scrolling */
}

    /* Ensure WebChat fills the container */
    #webchat-root > * {
        height: 100%;
    }

/* =========================
   Loader
   ========================= */
#orion-loader {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f7f9fb;
}

.orion-spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 4px solid rgba(0,0,0,0.12);
    border-top-color: rgba(0,0,0,0.55);
    animation: orion-spin 0.9s linear infinite;
}

@keyframes orion-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.orion-loading-text {
    font-size: 14px;
    color: rgba(0,0,0,0.65);
    font-weight: 600;
}

/* =========================
   Mobile
   ========================= */
@media (max-width:520px) {
    #orion-chat {
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    #orion-launcher {
        right: 16px;
        bottom: 16px;
    }
}

/* =========================================================
   WebChat typography control
   ========================================================= */
#webchat,
#webchat * {
    font-family: Calibri, "Helvetica Neue", Arial, sans-serif !important;
}

    /* Main message text sizing */
    #webchat .webchat__text-content--is-plain,
    #webchat .webchat__text-content--is-plain *,
    #webchat .webchat__bubble__content,
    #webchat .webchat__bubble__content *,
    #webchat .ac-container,
    #webchat .ac-container * {
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

        /* Normal text weight */
        #webchat .webchat__text-content--is-plain,
        #webchat .webchat__bubble__content p,
        #webchat .webchat__bubble__content li,
        #webchat .webchat__bubble__content span,
        #webchat .webchat__bubble__content div,
        #webchat .ac-container p,
        #webchat .ac-container li,
        #webchat .ac-container span,
        #webchat .ac-container div {
            font-weight: 400 !important;
        }

        /* Keep bold/heading text bold (same size) */
        #webchat .webchat__bubble__content strong,
        #webchat .webchat__bubble__content b,
        #webchat .webchat__bubble__content [role="heading"],
        #webchat .webchat__bubble__content h1,
        #webchat .webchat__bubble__content h2,
        #webchat .webchat__bubble__content h3,
        #webchat .webchat__bubble__content h4,
        #webchat .webchat__bubble__content h5,
        #webchat .webchat__bubble__content h6,
        #webchat .ac-container strong,
        #webchat .ac-container b,
        #webchat .ac-container [role="heading"] {
            font-weight: 700 !important;
            font-size: 15px !important;
            line-height: 1.25 !important;
        }

/* Keep composer (textbox/button) normal */
#webchat-root input,
#webchat-root textarea,
#webchat-root button {
    font-size: 15px !important;
    line-height: 1.25 !important;
}

/* =========================================================
   Transcript logo (Option A injection)
   ========================================================= */
#orion-transcript-logo {
    display: flex;
    justify-content: center;
    padding: 6px 0 8px;
}

    #orion-transcript-logo img {
        height: 32px;
        width: auto;
        max-width: 150px;
        object-fit: contain;
        border-radius: 0;
    }

/* Slightly reduce top padding (safe) */
.webchat__basic-transcript__transcript {
    padding-top: 6px !important;
}

/* Push first message down to make logo feel closer to top */
#orion-transcript-logo + * {
    margin-top: 18px !important;
}

/* =========================================================
   Typing indicator (3 dots) smaller
   ========================================================= */
#webchat-root .webchat__typing-indicator,
#webchat-root .webchat__typing-indicator * {
    font-size: 10px !important;
    line-height: 1 !important;
}

    #webchat-root .webchat__typing-indicator svg {
        transform: scale(0.6);
        transform-origin: left center;
    }

#webchat-root .webchat__typing-indicator {
    margin-bottom: 4px !important;
}

/* =========================================================
   ROBUST TIMESTAMP + SPACING COMPRESSION (works across builds)
   ========================================================= */

/* Target timestamp text across different WebChat versions */
#webchat-root [aria-label="Timestamp"],
#webchat-root [aria-label="timestamp"],
#webchat-root time,
#webchat-root .webchat__timestamp,
#webchat-root .webchat__activity__timestamp,
#webchat-root [class*="timestamp"] {
    font-size: 10px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    display: inline-block !important;
    opacity: 0.6 !important;
}

/* Remove accidental giant vertical gaps between top-level transcript children */
/*#webchat-root .webchat__basic-transcript__transcript > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}*/

/* Reintroduce controlled spacing for real activities */
#webchat-root .webchat__basic-transcript__transcript .webchat__stacked-layout,
#webchat-root .webchat__basic-transcript__transcript .webchat__activity {
    margin: 6px 0 !important; /* adjust: 4px–8px */
}

/* ============================
   SAFE timestamp spacing fix
   (does NOT break bubble layout)
   ============================ */

/* Compress only the status row vertical space */
.webchat__stacked-layout__status {
    margin: 2px 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Keep the internal layout intact, just reduce its height */
.webchat__activity-status,
.webchat__activity-status__slotted,
.webchat__activity-status__slotted > * {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 10px !important;
    opacity: 0.6;
}

/* Do NOT collapse these — they control alignment */
.webchat__stacked-layout__avatar-gutter,
.webchat__stacked-layout__nub-pad,
.webchat__stacked-layout__alignment-pad {
    width: auto !important;
    margin: 0px !important;
    padding: 0 !important;
}
#webchat-root .webchat__basic-transcript__transcript {
    padding-left: 10px !important; /* try 8–14 */
    padding-right: 6px !important;
}

/* Reduce USER initials size (inside avatar circle) */
.webchat__initialsAvatar__initials {
    font-size: 11px !important; /* try 10–11 */
    font-weight: 600;
    line-height: 1;
}

#webchat-root details.webchat__link-definitions {
    display: none !important;
}