/* ─── Custom Tooltip ─────────────────────────────── */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: var(--text-muted);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 8px;
    position: relative;
}

.help-icon:hover {
    background-color: var(--primary-color);
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    width: 300px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: absolute;
    z-index: 1001;
    bottom: 125%;
    /* Position above */
    left: 50%;
    margin-left: -150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.2s;
    font-size: 0.85rem;
    line-height: 1.5;
    pointer-events: none;
    /* Prevent tooltip from blocking interaction if it lingers */
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.help-icon:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-title {
    font-weight: bold;
    margin-bottom: 4px;
    display: block;
    color: #fff;
    border-bottom: 1px solid #555;
    padding-bottom: 4px;
}

.tooltip-list {
    margin: 0;
    padding-left: 1.2rem;
}

.tooltip-list li {
    margin-bottom: 4px;
}

/* ─── Mobile Adjustment ─────────────────────────────── */
@media (max-width: 640px) {
    .tooltip-content {
        position: fixed;
        top: 50%;
        left: 50%;
        bottom: auto;
        transform: translate(-50%, -50%);
        margin-left: 0;
        width: 90% !important;
        max-width: 320px !important;
        white-space: normal;
        /* Ensure text wraps */
        z-index: 9999;
        /* Topmost */
    }

    .tooltip-content::after {
        display: none;
        /* Hide arrow on mobile */
    }
}