.yfm-term {
    &_title {
        color: var(--yfm-color-term-title, var(--yfm-color-term-title-private));
        cursor: pointer;

        border-bottom: 1px dotted;

        font-size: inherit;
        line-height: inherit;
        font-style: normal;

        &:hover {
            color: var(--yfm-color-term-title-hover, var(--yfm-color-term-title-hover-private));
        }
    }

    &_dfn {
        position: absolute;
        z-index: 100;

        visibility: hidden;
        opacity: 0;

        // Keep the closed definition off-screen so its (still laid-out) box
        // does not extend the page's scrollable area. Inline top/left set by
        // setDefinitionPosition() are cleared in closeDefinition() to restore
        // these values. Negative-direction overflow does not create a
        // scrollable region, while the box stays measurable for positioning.
        top: -9999px;
        left: -9999px;

        padding: 10px;

        background-color: var(
            --yfm-color-term-dfn-background,
            var(--yfm-color-term-dfn-background-private)
        );

        font-size: inherit;
        line-height: inherit;
        font-style: normal;

        border-radius: 4px;

        box-shadow: 0 8px 20px
            var(--yfm-color-term-dfn-shadow, var(--yfm-color-term-dfn-shadow-private));
        outline: none;

        width: fit-content;
        max-width: 450px;

        @media screen and (max-width: 600px) {
            & {
                max-width: 80%;
            }
        }

        &::before {
            content: '';
            position: absolute;
            z-index: -1;
            inset: 0;

            border-radius: inherit;
            box-shadow: 0 0 0 1px
                var(
                    --yfm-color-term-dfn-pseudo-shadow,
                    var(--yfm-color-term-dfn-pseudo-shadow-private)
                );
        }

        &.open {
            visibility: visible;

            animation-name: popup;
            animation-duration: 0.1s;
            animation-timing-function: ease-out;
            animation-fill-mode: forwards;

            @keyframes popup {
                0% {
                    opacity: 0;
                    transform: translateY(10px);
                }
                100% {
                    opacity: 1;
                    transform: translateY(0);
                }
            }
        }
    }
}
