.single-social-card-button {
    appearance: none;
    cursor: pointer;
}

.single-social-card-button .single-share-icon,
.single-social-card-button .single-share-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.single-social-card-button--with-label {
    width: auto;
    padding-inline: 12px;
    gap: 6px;
}

.single-social-card-button--with-label .single-share-label {
    display: inline;
    font-size: 12px;
    font-weight: 700;
}

html.dh-social-card-modal-open,
html.dh-social-card-modal-open body {
    overflow: hidden;
}

.dh-social-card-modal[hidden] {
    display: none !important;
}

.dh-social-card-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
}

.dh-social-card-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 14, .78);
    backdrop-filter: blur(5px);
}

.dh-social-card-modal__dialog {
    position: relative;
    width: min(94vw, 480px);
    max-height: calc(100dvh - 30px);
    overflow: auto;
    border-radius: 16px;
    background: #fff;
    color: #16191f;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

.dh-social-card-modal__dialog > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px 13px;
    border-bottom: 1px solid #e8ebef;
}

.dh-social-card-modal__dialog h2 {
    margin: 0;
    color: #17191e;
    font: 800 20px/1.2 system-ui, sans-serif;
}

.dh-social-card-modal__format {
    margin: 4px 0 0;
    color: #6a707b;
    font: 500 12px/1.35 system-ui, sans-serif;
}

.dh-social-card-modal__close {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    padding: 0;
    border: 1px solid #dce0e5;
    border-radius: 50%;
    background: #fff;
    color: #292d34;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.dh-social-card-modal__canvas-wrap {
    position: relative;
    display: grid;
    min-height: 220px;
    place-items: center;
    padding: 16px;
    background: #f0f2f5;
}

.dh-social-card-modal__canvas-wrap[hidden],
.dh-social-card-modal__dialog > footer[hidden],
.dh-social-card-modal__format-picker[hidden] {
    display: none !important;
}

.dh-social-card-modal__format-picker {
    padding: 18px;
    background: #f5f6f8;
}

.dh-social-card-modal__format-picker > p {
    margin: 0 0 12px;
    color: #17191e;
    font: 750 14px/1.35 system-ui, sans-serif;
}

.dh-social-card-modal__format-picker > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.dh-social-card-modal__format-picker button {
    min-height: 66px;
    padding: 10px 8px;
    border: 1px solid #d8dce2;
    border-radius: 10px;
    background: #fff;
    color: #242830;
    font: 700 12px/1.35 system-ui, sans-serif;
    cursor: pointer;
}

.dh-social-card-modal__format-picker button:hover,
.dh-social-card-modal__format-picker button:focus-visible {
    border-color: #760d07;
    outline: 2px solid rgba(118, 13, 7, .16);
}

.dh-social-card-modal canvas {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(62dvh, 610px);
    background: #760d07;
    box-shadow: 0 8px 24px rgba(16, 20, 28, .18);
}

.dh-social-card-modal__loader {
    position: absolute;
    display: none;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(118, 13, 7, .18);
    border-top-color: #760d07;
    border-radius: 50%;
    animation: dh-social-card-spin .7s linear infinite;
}

.dh-social-card-modal.is-loading .dh-social-card-modal__loader {
    display: block;
}

.dh-social-card-modal.is-loading canvas {
    opacity: .34;
}

.dh-social-card-modal__status {
    min-height: 18px;
    margin: 0;
    padding: 9px 18px 0;
    color: #5e6671;
    font: 600 12px/1.4 system-ui, sans-serif;
}

.dh-social-card-modal__dialog > footer {
    display: flex;
    gap: 10px;
    padding: 12px 18px 18px;
}

.dh-social-card-modal__action {
    flex: 1 1 0;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #760d07;
    border-radius: 9px;
    background: #760d07;
    color: #fff;
    font: 750 14px/1.2 system-ui, sans-serif;
    cursor: pointer;
}

.dh-social-card-modal__download {
    background: #fff;
    color: #760d07;
}

.dh-social-card-modal__action:disabled {
    cursor: wait;
    opacity: .55;
}

@keyframes dh-social-card-spin {
    to { transform: rotate(360deg); }
}

@media (min-width: 981px) {
    .single-social-card-button--mobile-only {
        display: none !important;
    }
}

@media (max-width: 540px) {
    .single-share.single-share-has-social-card {
        display: flex;
        width: 100%;
        max-width: 100%;
        gap: 3px;
        overflow-x: hidden;
    }

    .single-share.single-share-has-social-card > .single-share-link,
    .single-share.single-share-has-social-card > .single-reader-button,
    .single-share.single-share-has-social-card .single-reader-controls > .single-reader-button {
        flex: 1 1 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        min-height: 40px !important;
        height: 40px !important;
        padding-inline: 0;
    }

    .single-share.single-share-has-social-card > .single-reader-controls {
        display: flex;
        flex: 2 2 0 !important;
        width: 0 !important;
        min-width: 0;
        margin-inline-start: 0 !important;
        gap: 3px;
    }

    .single-share.single-share-has-social-card > :is(.single-share-preferred-source-visible-all, .single-share-preferred-source-visible-mobile) {
        flex: 1 1 0 !important;
        width: 0 !important;
        min-width: 0;
    }

    .single-share.single-share-has-social-card > :is(.single-share-preferred-source-visible-all, .single-share-preferred-source-visible-mobile) .single-share-link-preferred-source {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .single-share.single-share-has-social-card .single-share-preferred-source-note {
        display: none;
    }

    .single-share.single-share-has-social-card .single-share-icon,
    .single-share.single-share-has-social-card .single-share-icon svg {
        width: 15px;
        min-width: 15px;
        height: 15px;
    }

    .single-share.single-share-has-social-card .single-reader-button {
        overflow: hidden;
        font-size: 11px;
        white-space: nowrap;
    }

    .single-social-card-button--with-label .single-share-label {
        display: none;
    }

    .dh-social-card-modal {
        align-items: end;
        padding: 0;
    }

    .dh-social-card-modal__dialog {
        width: 100%;
        max-height: 96dvh;
        border-radius: 16px 16px 0 0;
    }

    .dh-social-card-modal__canvas-wrap {
        padding: 12px;
    }

    .dh-social-card-modal canvas {
        max-height: 64dvh;
    }

    .dh-social-card-modal__format-picker > div {
        grid-template-columns: 1fr;
    }

    .dh-social-card-modal__format-picker button {
        min-height: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dh-social-card-modal__loader {
        animation-duration: 1.4s;
    }
}
