.wrapper {
    display: inline;
    cursor: help;
}

.term {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: var(--color-text-muted);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* Portal-based popup — fixed to viewport, never clipped */
.popup {
    position: absolute;
    z-index: 10000;
    transform: translate(-50%, calc(-100% - 10px));
    width: max-content;
    max-width: 320px;
    padding: 8px 12px;
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    animation: tooltipFadeIn 120ms ease;

    /* Reset ALL inherited font styles so themes can't override */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 400;
    font-style: normal;
    line-height: 1.55;
    letter-spacing: normal;
    text-transform: none;
    text-align: left;
    white-space: normal;
    word-break: normal;
}

.popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-border);
}

.popupTitle {
    font-family: 'IBM Plex Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 3px;
}

.popupBody {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--color-text-secondary);
}

@keyframes tooltipFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
