/* Shared @author / #article mention UI + inline refs — Win95 chrome (match editor dialogs) */

.content-ref-menu {
    position: fixed;
    z-index: 12000;
    min-width: 180px;
    max-width: min(320px, calc(100vw - 16px));
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    box-sizing: border-box;
    background: #f3f3f3;
    border: 1px solid #808080;
    border-radius: 0;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.18);
    font-family: 'MS Sans Serif', Arial, sans-serif;
}

.content-ref-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    width: 100%;
    margin: 0;
    padding: 5px 7px;
    border: 1px solid transparent;
    border-radius: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: 'MS Sans Serif', Arial, sans-serif;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
    color: #000;
}

.content-ref-menu-item:hover,
.content-ref-menu-item.is-active {
    background: #000080;
    border-color: #000080;
    color: #fff;
}

.content-ref-menu-item:hover .content-ref-menu-meta,
.content-ref-menu-item.is-active .content-ref-menu-meta {
    color: rgba(255, 255, 255, 0.78);
}

.content-ref-menu-primary {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.content-ref-menu-meta {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.55);
}

a.content-ref,
.content-ref {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.28);
    text-underline-offset: 2px;
    cursor: pointer;
}

a.content-ref:hover {
    text-decoration-color: rgba(0, 0, 0, 0.55);
}

a.content-ref-author {
    display: inline;
    font-weight: 600;
    white-space: nowrap;
}

a.content-ref-author .content-ref-author-avatar {
    display: inline-block;
    width: 1.05em;
    height: 1.05em;
    margin: 0 0.28em 0 0;
    padding: 0;
    vertical-align: -0.18em;
    object-fit: cover;
    object-position: center;
    border: 0;
    border-radius: 0;
    background: #e8e4dc;
}

/* TipTap editor: refs stay readable while editing */
.tiptap-editor a.content-ref {
    color: #1a1a1a;
}

.tiptap-editor a.content-ref-author .content-ref-author-avatar,
.tiptap-editor .ProseMirror img.content-ref-author-avatar {
    display: inline-block !important;
    width: 1.05em !important;
    height: 1.05em !important;
    max-width: 1.05em !important;
    max-height: 1.05em !important;
    margin: 0 0.28em 0 0 !important;
    vertical-align: -0.15em;
    object-fit: cover;
}
