:root {
    --dfnpanel-bg: #ddd;
    --dfnpanel-text: var(--text);
    --dfnpanel-target-bg: #ffc;
    --dfnpanel-target-outline: orange;
}
@media (prefers-color-scheme: dark) {
    :root {
        --dfnpanel-bg: #222;
        --dfnpanel-text: var(--text);
        --dfnpanel-target-bg: #333;
        --dfnpanel-target-outline: silver;
    }
}
.dfn-panel {
    position: absolute;
    z-index: 35;
    width: 20em;
    width: 300px;
    height: auto;
    max-height: 500px;
    overflow: auto;
    padding: 0.5em 0.75em;
    font: small Helvetica Neue, sans-serif, Droid Sans Fallback;
    background: var(--dfnpanel-bg);
    color: var(--dfnpanel-text);
    border: outset 0.2em;
    white-space: normal; /* in case it's moved into a pre */
}
.dfn-panel:not(.on) { display: none; }
.dfn-panel * { margin: 0; padding: 0; text-indent: 0; }
.dfn-panel > b { display: block; }
.dfn-panel a { color: var(--dfnpanel-text); }
.dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; }
.dfn-panel a:focus {
    outline: 5px auto Highlight;
    outline: 5px auto -webkit-focus-ring-color;
}
.dfn-panel > b + b { margin-top: 0.25em; }
.dfn-panel ul { padding: 0 0 0 1em; list-style: none; }
.dfn-panel li a {
    max-width: calc(300px - 1.5em - 1em);
    overflow: hidden;
    text-overflow: ellipsis;
}

.dfn-panel.activated {
    display: inline-block;
    position: fixed;
    left: 8px;
    bottom: 2em;
    margin: 0 auto;
    max-width: calc(100vw - 1.5em - .4em - .5em);
    max-height: 30vh;
    transition: left 1s ease-out, bottom 1s ease-out;
}

.dfn-panel .link-item:hover {
    text-decoration: underline;
}
.dfn-panel .link-item .copy-icon {
    opacity: 0;
}
.dfn-panel .link-item:hover .copy-icon,
.dfn-panel .link-item .copy-icon:focus {
    opacity: 1;
}

.dfn-panel .copy-icon {
    display: inline-block;
    margin-right: 0.5em;
    width: 0.85em;
    height: 1em;
    border-radius: 3px;
    background-color: #ccc;
    cursor: pointer;
}

.dfn-panel .copy-icon .icon {
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.dfn-panel .copy-icon .icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid black;
    background-color: #ccc;
    opacity: 0.25;
    transform: translate(3px, -3px);
}

.dfn-panel .copy-icon:active .icon::before {
    opacity: 1;
}

.dfn-paneled[role="button"] { cursor: help; }

.highlighted {
    animation: target-fade 3s;
}

@keyframes target-fade {
    from {
        background-color: var(--dfnpanel-target-bg);
        outline: 5px solid var(--dfnpanel-target-outline);
    }
    to {
        color: var(--a-normal-text);
        background-color: transparent;
        outline: transparent;
    }
}