/* tooltip.css */
/* Definition trigger — "what does this mean?" */
.tooltip-trigger[data-type="def"] {
    border-bottom: 1px dotted #2563eb;
    color: inherit;
    cursor: help;
    text-decoration: none;
}

/* Reference trigger — "where does this go?" */
.tooltip-trigger[data-type="ref"] {
    border-bottom: 1px dashed #357d90;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}

#live-tooltip {
    position: absolute; 
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    z-index: 20000;
    display: none; 
    max-width: 60vw; /* Adjusted for better mobile fit */
    pointer-events: none;
    
    /* --- NEW COLORS --- */
    background: #e3f2fd;
    color: #1a237e; 
    border: 1px solid #90caf9; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#live-tooltip p {
    margin-bottom: 0;
    line-height: 1.4;
}

#live-tooltip.tooltip-def {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1a237e;
}

#live-tooltip.tooltip-ref {
    background-color: #f0fdf4;
    border-color: #86efac;
    color: #14532d;
}

@media screen and (max-width: 1200px) {
    #live-tooltip {
        /* Keep the width constraint so it fits the screen */
        max-width: calc(100vw - 40px) !important; 
        
        /* Ensure text wraps correctly */
        white-space: normal !important;
    }
}

@media screen and (max-width: 600px) {
    #live-tooltip {
        max-height: 250px;    /* Limits height so it doesn't cover the whole screen */
        overflow-y: auto;     /* Enables the scrollbar */
        -webkit-overflow-scrolling: touch; /* Smooth momentum scroll for iOS */
    }
}