.chat-citation {
    color: var(--bs-primary);
    font-weight: 600;
    cursor: pointer;
    margin: 0 0.2rem;
    text-decoration: none;
}

.chat-citation:hover,
.chat-citation:focus {
    text-decoration: underline;
    outline: none;
}

.chat-citation-record {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.chat-tooltip {
    position: fixed;
    z-index: 1080;
    max-width: 360px;
    padding: 0.5rem 0.7rem;
    border-radius: 0.5rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.18);
    font-size: 0.9rem;
    line-height: 1.35;
    white-space: pre-wrap;
    display: none;
    pointer-events: auto;
    flex-direction: column;
    gap: 0.15rem;
}

.chat-tooltip.show {
    display: flex;
}

.chat-citation-snippet {
    color: #495057;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.chat-citation-chunk {
    color: #495057;
    line-height: 1.2;
    max-height: 10rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0.05rem 0.15rem 0.05rem 0;
    white-space: normal;
    scrollbar-gutter: stable;
}

.chat-citation-line + .chat-citation-line {
    margin-top: 0.18rem;
}

.chat-citation-anchor {
    font-weight: 700;
    color: var(--bs-body-color);
    background: rgba(255, 193, 7, 0.24);
    border-radius: 0.2rem;
    padding: 0 0.08rem;
}

.chat-citation-link {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.1rem;
}
