/* dlg-hint.css — the marker showing that a field has an explanation.
 *
 * Markup comes from DlgHint (libs:view:admin):
 *   <label class="dlg-label">Label<span class="dlg-hint" title="…"><svg …/></span></label>
 *
 * Muted until it is wanted, so a form full of them still reads as labels rather
 * than a row of icons. The marker is decorative and not focusable: the tooltip
 * belongs to the label around it, so hovering anywhere on the label — including
 * the marker — brings it up, and the tab sequence stays on the inputs.
 */

/* The help cursor belongs to the whole label, not just the marker: the label
 * is what shows the tooltip, and two different cursors across one hover target
 * makes the icon read as a separate control. `cursor` inherits, so the marker
 * picks this up without a rule of its own. */
/* The help cursor belongs to the whole label, not just the marker: the label
 * is what shows the tooltip, and two different cursors across one hover target
 * makes the icon read as a separate control. `cursor` inherits, so the marker
 * picks this up without a rule of its own. */
.dlg-label:has(.dlg-hint),
label:has(> .dlg-hint) {
    cursor: help;
}

.dlg-hint {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    color: var(--app-text-secondary, #919191);
    opacity: 0.55;
    vertical-align: -2px;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.dlg-hint svg {
    width: 14px;
    height: 14px;
    display: block;
}

/*
 * The tooltip itself, drawn by dlg-hint.js in place of the browser's own so the
 * delay is ours to choose. Kept visible-but-transparent rather than
 * display:none so it can be measured before being positioned.
 */
.dlg-tip {
    position: fixed;
    z-index: 2000;
    max-width: 380px;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--app-text-primary, #212121);
    color: var(--app-bg-primary, #fff);
    font-size: 13px;
    line-height: 18px;
    /* Descriptions put their format example on its own line. */
    white-space: pre-line;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
}

.dlg-tip--on {
    opacity: 1;
    visibility: visible;
}

/* Lit by hovering the label, not just the marker itself — the label is the
 * tooltip's target, so the marker should react to the same gesture. */
.dlg-label:hover .dlg-hint,
label:hover > .dlg-hint {
    opacity: 1;
    color: var(--app-text-primary, #212121);
}
