/* Frontend tooltip styling */
span.rsp-tooltip {
    position: relative;
    border-bottom: 1px dotted currentColor;
    cursor: help;
}

/* Tooltip bubble */
span.rsp-tooltip:hover::after,
span.rsp-tooltip:focus::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: 120%;
    transform: translateX(-50%);
    white-space: normal;
    min-width: 180px;
    max-width: 320px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.25;
    border-radius: 6px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

/* Tooltip arrow */
span.rsp-tooltip:hover::before,
span.rsp-tooltip:focus::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(120% - 6px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0,0,0,0.85);
    z-index: 9998;
}

/* Keep tooltip in viewport (simple approach) */
@media (max-width: 420px) {
    span.rsp-tooltip:hover::after,
    span.rsp-tooltip:focus::after {
        left: 0;
        transform: none;
    }
    span.rsp-tooltip:hover::before,
    span.rsp-tooltip:focus::before {
        left: 16px;
        transform: none;
    }
}
