/* Dedicated chat page: full-height blended embed + reader slide-over panel. */

/* ---- full-height chat layout ---- */
.nrag-chat-page {
    /* Header offset is themeable per site: set --nrag-header-offset on :root. */
    height: calc(100vh - var(--nrag-header-offset, 140px));
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

/* Make core's inline embed fill the frame instead of its fixed box. */
.nrag-chat-page [id^="mxchat-chatbot-wrapper"],
.nrag-chat-page [id^="chat-container"] {
    height: 100% !important;
    max-height: none !important;
    width: 100% !important;
    max-width: none !important;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    box-sizing: border-box;
}

.nrag-chat-page .chat-box {
    flex: 1 1 auto;
    overflow-y: auto;
}

/* ---- reader slide-over panel ---- */
.nrag-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(16, 29, 46, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 100000;
}

.nrag-panel-overlay.nrag-panel-open-state {
    opacity: 1;
    pointer-events: auto;
}

.nrag-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(600px, 94vw);
    background: #fff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.22s ease;
}

.nrag-panel-open-state .nrag-panel {
    transform: translateX(0);
}

.nrag-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #e3e6ea;
    background: #f7f8fa;
}

.nrag-panel-title {
    flex: 1 1 auto;
    font-weight: 600;
    font-size: 0.9em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nrag-panel-open {
    flex: 0 0 auto;
    font-size: 0.8em;
    font-weight: 700;
    text-decoration: none;
    color: #1e2337;
}

.nrag-panel-close {
    flex: 0 0 auto;
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    color: #555;
}

.nrag-panel-frame {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
}

.nrag-panel-lock,
.nrag-panel-lock body {
    overflow: hidden;
}
