body>& {
    max-height: 100%;
}

& {
    display: block;
    max-width: 100%;
    width: 360px;
    height: auto;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
    user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    border: 1px solid #0006;
    min-width: 160px;
    background: #fff;
}

&[draggable] {
    position: absolute;
}

>.body,
>[body] {
    padding: 6px;
    display: block;
    width: auto;
    height: 100%;
    overflow: hidden;
    overflow-y: scroll;
    position: relative;
    box-sizing: border-box;
    background-clip: padding-box;

    border-top: 6px solid #fff2;
    border-bottom: 6px solid #fff2;

    +.scrollbar {
        z-index: 3;
    }

    &:not(:nth-last-child(1)) {
        padding-bottom: 42px;
    }
}


>.head,
>[head] {
    top: 0;
    z-index: 3;
    background: inherit;
    position: relative;
    position: sticky;
    overflow: hidden;
    padding: 12px 16px 10px 16px;

    &:before {
        display: block;
        content: "";
        width: 20px;
        height: 20px;
        float: right;
    }

    &:not(:last-child) {
        margin: 0 0 -42px;
    }

    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, .16);

    >* {
        vertical-align: top;
    }

    .drop,
    .close {
        height: 42px;
        padding: 0 12px;
        line-height: 40px;
        color: #999;
        font-size: 24px;

        &:hover {
            color: #c26;
        }

        &:active {
            color: #823;
        }
    }
}

>.foot,
>[foot] {
    white-space: nowrap;
    overflow: auto;
}

>.foot,
>[foot] {
    z-index: 1;
    text-align: right;
    white-space: pre-wrap;
    padding: 6px 16px 0 16px;
    border-top: 1px solid rgba(0, 0, 0, .16);
    backdrop-filter: blur(20px);
    background: inherit;
    position: sticky;
    width: 100%;
    bottom: 0;
    margin-top: -42px;
}


>.foot,
>[foot] {
    .button {
        padding: 0 20px;
        margin-left: 10px;
        vertical-align: top;
        margin-bottom: 6px;
    }

    a.button {
        display: inline-block;
        padding: 0;
        margin-right: 6px;
    }
}