:root {
    --sqsc-accent: #ff6900;
    --sqsc-solid-bg: #334150;
    --sqsc-text: #353535;
    --sqsc-border: #e6e6e6;
    --sqsc-surface: #ffffff;
}

.sqsc-selection-share {
    position: fixed;
    z-index: 2147483000;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: rgba(48, 48, 48, .88);
    color: #fff;
    font: 600 15px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sqsc-selection-share.sqsc-visible {
    display: inline-flex;
}

.sqsc-selection-share svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sqsc-modal[hidden] {
    display: none !important;
}

.sqsc-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483640;
    display: grid;
    place-items: center;
    padding: 14px;
    background: rgba(0, 0, 0, .56);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sqsc-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 20px;
    background: var(--sqsc-surface);
    color: var(--sqsc-text);
    box-shadow: 0 22px 70px rgba(0, 0, 0, .30);
}

.sqsc-header {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    padding: 0 22px;
    border-bottom: 1px solid var(--sqsc-border);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(8px);
}

.sqsc-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.sqsc-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-right: -5px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7d7d7d;
    cursor: pointer;
}

.sqsc-close:hover,
.sqsc-close:focus-visible {
    background: #f4f4f4;
    color: #333;
}

.sqsc-close svg {
    width: 23px;
    height: 23px;
    stroke: currentColor;
    stroke-width: 2;
}

.sqsc-body {
    display: grid;
    place-items: center;
    min-height: 0;
    padding: 22px 24px 18px;
}

.sqsc-card-shell {
    width: min(340px, 54vw);
}

.sqsc-card {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 10px;
    background: #797979;
    box-shadow: 0 2px 3px rgba(0, 0, 0, .18);
    isolation: isolate;
}

.sqsc-card::before {
    content: "";
    display: block;
    padding-top: var(--sqsc-ratio-padding, 125%);
}

.sqsc-card-bg,
.sqsc-card-tint,
.sqsc-card-content {
    position: absolute;
    inset: 0;
}

.sqsc-card-bg {
    z-index: 0;
    background-position: center;
    background-size: cover;
    filter: grayscale(1) blur(11px);
    transform: scale(1.08);
}

.sqsc-card-tint {
    z-index: 1;
    background: rgba(62, 62, 62, .55);
}

.sqsc-card-content {
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 18px 18px;
    color: #fff;
}

.sqsc-modal .sqsc-quote {
    all: unset;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    max-height: calc(1.48em * var(--sqsc-quote-lines, 7));
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(15px, 1.8vw, 19px);
    font-style: normal;
    font-weight: 400;
    line-height: 1.48;
    letter-spacing: -.015em;
    text-align: left;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: normal;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}

.sqsc-card[data-ratio="vertical"] {
    --sqsc-quote-lines: 10;
}

.sqsc-card[data-ratio="instagram"] {
    --sqsc-quote-lines: 7;
}

.sqsc-card[data-ratio="square"] {
    --sqsc-quote-lines: 6;
}

.sqsc-glass-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 20px 18px 17px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.19), rgba(255,255,255,.075) 56%, rgba(255,255,255,.12));
    box-shadow:
        0 18px 40px rgba(0, 0, 0, .16),
        inset 0 1px 0 rgba(255,255,255,.22),
        inset 0 -1px 0 rgba(255,255,255,.06);
    backdrop-filter: blur(18px) saturate(128%);
    -webkit-backdrop-filter: blur(18px) saturate(128%);
}

.sqsc-glass-panel::before,
.sqsc-glass-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(22px);
    opacity: .52;
}

.sqsc-glass-panel::before {
    width: 58%;
    height: 34%;
    top: -12%;
    left: -12%;
    background: radial-gradient(circle, rgba(255,255,255,.30), rgba(255,255,255,0) 70%);
}

.sqsc-glass-panel::after {
    width: 48%;
    height: 30%;
    right: -10%;
    bottom: 10%;
    background: radial-gradient(circle, rgba(255,255,255,.16), rgba(255,255,255,0) 72%);
}

.sqsc-glass-panel > * {
    position: relative;
    z-index: 1;
}


.sqsc-meta {
    color: inherit;
}

.sqsc-author {
    margin: 0 0 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.sqsc-post-title {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.45;
}

.sqsc-domain-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255, 255, 255, .38);
    font-size: 14px;
    font-weight: 700;
}

.sqsc-domain-row svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.sqsc-card[data-bg="slate"] .sqsc-card-bg,
.sqsc-card[data-bg="slate"] .sqsc-card-tint,
.sqsc-card[data-bg="white"] .sqsc-card-bg,
.sqsc-card[data-bg="white"] .sqsc-card-tint {
    display: none;
}

.sqsc-card[data-bg="slate"] {
    background: var(--sqsc-solid-bg);
}

.sqsc-card[data-bg="white"] {
    background: #fff;
    border-color: #dedede;
}

.sqsc-card[data-bg="white"] .sqsc-card-content {
    color: #2f2f2f;
}

.sqsc-card[data-bg="white"] .sqsc-domain-row {
    color: rgba(0, 0, 0, .32);
}

.sqsc-card[data-bg="white"] .sqsc-glass-panel {
    border-color: rgba(255, 255, 255, .85);
    background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.62));
    box-shadow: 0 16px 34px rgba(0, 0, 0, .10), inset 0 1px 0 rgba(255,255,255,.72);
}

.sqsc-card[data-bg="slate"] .sqsc-glass-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.09));
}

.sqsc-card[data-bg="image"] .sqsc-glass-panel {
    background: linear-gradient(180deg, rgba(255,255,255,.20), rgba(255,255,255,.10));
}

.sqsc-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: end;
    padding: 12px 22px 16px;
    border-bottom: 1px solid var(--sqsc-border);
}

.sqsc-control-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 500;
}

.sqsc-swatches,
.sqsc-ratios,
.sqsc-share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sqsc-swatch {
    position: relative;
    width: 40px;
    height: 40px;
    border: 1px solid #dedede;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.sqsc-swatch[data-value="image"] {
    background: #8c8c8c;
}

.sqsc-swatch[data-value="slate"] {
    background: var(--sqsc-solid-bg);
}

.sqsc-swatch[data-value="white"] {
    background: #fff;
}

.sqsc-swatch[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 10px;
    width: 12px;
    height: 7px;
    border-left: 3px solid #fff;
    border-bottom: 3px solid #fff;
    transform: rotate(-45deg);
}

.sqsc-swatch[data-value="white"][aria-pressed="true"]::after {
    border-color: #4c4c4c;
}

.sqsc-ratio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 11px;
    border: 0;
    border-radius: 10px;
    background: #efefef;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sqsc-ratio[aria-pressed="true"] {
    background: #1d1d1d;
    color: #fff;
}

.sqsc-ratio-icon {
    display: inline-block;
    width: 13px;
    height: 18px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.sqsc-ratio[data-value="square"] .sqsc-ratio-icon {
    width: 17px;
    height: 17px;
}

.sqsc-ratio[data-value="instagram"] .sqsc-ratio-icon {
    width: 13px;
    height: 20px;
}

.sqsc-footer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px 22px 16px;
}

.sqsc-main-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.sqsc-share-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    background: #fff;
    color: #333;
    cursor: pointer;
    text-decoration: none !important;
}

.sqsc-share-button:hover,
.sqsc-share-button:focus-visible {
    background: #f7f7f7;
}

.sqsc-share-button svg {
    width: 22px;
    height: 22px;
}

.sqsc-brand-glyph {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.sqsc-primary-share,
.sqsc-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.sqsc-primary-share {
    flex: 0 0 auto;
    padding: 0 14px;
    background: #1d1d1d;
    color: #fff;
}

.sqsc-download {
    width: 100%;
    flex: 1 1 auto;
    background: var(--sqsc-accent);
    color: #fff;
}

.sqsc-primary-share:hover,
.sqsc-primary-share:focus-visible,
.sqsc-download:hover,
.sqsc-download:focus-visible {
    filter: brightness(.96);
}

.sqsc-primary-share svg,
.sqsc-download svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sqsc-fallback-backdrop[hidden] {
    display: none !important;
}

.sqsc-fallback-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .34);
}

.sqsc-fallback-dialog {
    width: min(420px, calc(100vw - 40px));
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(0, 0, 0, .28);
    padding: 22px;
    color: #2f2f2f;
}

.sqsc-fallback-title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
}

.sqsc-fallback-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #535353;
}

.sqsc-fallback-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.sqsc-fallback-button {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.sqsc-fallback-button[data-choice="link"] {
    background: #1d1d1d;
    color: #fff;
}

.sqsc-fallback-button[data-choice="download"] {
    background: var(--sqsc-accent);
    color: #fff;
}

.sqsc-fallback-button[data-choice="cancel"] {
    background: #f1f1f1;
    color: #333;
}

.sqsc-fallback-button:hover,
.sqsc-fallback-button:focus-visible {
    filter: brightness(.97);
}

.sqsc-toast {

    position: fixed;
    left: 50%;
    bottom: 30px;
    z-index: 2147483647;
    transform: translateX(-50%) translateY(10px);
    padding: 10px 15px;
    border-radius: 8px;
    background: #202020;
    color: #fff;
    font: 600 14px/1.2 system-ui, sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
}

.sqsc-toast.sqsc-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

body.sqsc-modal-open {
    overflow: hidden !important;
}

@media (max-width: 760px) {
    .sqsc-modal {
        padding: 10px;
        place-items: center;
    }

    .sqsc-dialog {
        width: min(520px, calc(100vw - 20px));
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }

    .sqsc-header {
        min-height: 52px;
        padding: 0 14px;
    }

    .sqsc-title {
        font-size: 18px;
    }

    .sqsc-close {
        width: 34px;
        height: 34px;
    }

    .sqsc-body {
        min-height: 0;
        padding: 12px 12px 10px;
    }

    .sqsc-card-shell {
        width: min(280px, 68vw);
    }

    .sqsc-card-content {
        padding: 14px 12px 12px;
    }

    .sqsc-glass-panel {
        padding: 14px 12px 12px;
        border-radius: 16px;
    }

    .sqsc-modal .sqsc-quote {
        font-size: clamp(13px, 3.5vw, 17px);
        line-height: 1.4;
        max-height: calc(1.4em * var(--sqsc-quote-lines, 7));
    }

    .sqsc-author,
    .sqsc-post-title {
        font-size: 12px;
    }

    .sqsc-post-title {
        margin-bottom: 12px;
    }

    .sqsc-domain-row {
        font-size: 10px;
    }

    .sqsc-domain-row svg {
        width: 16px;
        height: 16px;
    }

    .sqsc-controls {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px 12px 12px;
    }

    .sqsc-control-title {
        margin-bottom: 6px;
        font-size: 13px;
    }

    .sqsc-swatches,
    .sqsc-ratios,
    .sqsc-share-buttons {
        gap: 7px;
    }

    .sqsc-swatch {
        width: 34px;
        height: 34px;
    }

    .sqsc-swatch[aria-pressed="true"]::after {
        left: 10px;
        top: 8px;
        width: 10px;
        height: 6px;
        border-left-width: 2px;
        border-bottom-width: 2px;
    }

    .sqsc-ratios {
        flex-wrap: nowrap;
    }

    .sqsc-ratio {
        flex: 1 1 0;
        justify-content: center;
        min-width: 0;
        min-height: 36px;
        gap: 6px;
        padding: 0 7px;
        font-size: 12px;
    }

    .sqsc-ratio-icon {
        width: 11px;
        height: 16px;
        border-width: 1.5px;
    }

    .sqsc-ratio[data-value="square"] .sqsc-ratio-icon {
        width: 15px;
        height: 15px;
    }

    .sqsc-ratio[data-value="instagram"] .sqsc-ratio-icon {
        width: 11px;
        height: 17px;
    }

    .sqsc-footer {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
        padding: 10px 12px 12px;
    }

    .sqsc-share-buttons {
        gap: 6px;
    }

    .sqsc-share-button {
        width: 38px;
        height: 38px;
    }

    .sqsc-share-button svg {
        width: 19px;
        height: 19px;
    }

    .sqsc-brand-glyph {
        font-size: 18px;
    }

    .sqsc-main-actions {
        flex-direction: row;
        gap: 7px;
    }

    .sqsc-primary-share,
    .sqsc-download {
        width: auto;
        min-height: 38px;
        gap: 6px;
        padding: 0 10px;
        font-size: 12px;
    }

    .sqsc-download {
        flex: 1 1 auto;
    }

    .sqsc-primary-share svg,
    .sqsc-download svg {
        width: 17px;
        height: 17px;
    }

    .sqsc-fallback-dialog {
        width: min(340px, calc(100vw - 32px));
        padding: 16px;
        border-radius: 14px;
    }

    .sqsc-fallback-title {
        font-size: 18px;
    }

    .sqsc-fallback-text {
        font-size: 13px;
    }

    .sqsc-fallback-actions {
        gap: 8px;
        margin-top: 14px;
    }

    .sqsc-fallback-button {
        min-height: 42px;
        font-size: 14px;
    }
}

@media (max-width: 430px) {
    .sqsc-dialog {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 16px);
    }

    .sqsc-card-shell {
        width: min(248px, 64vw);
    }

    .sqsc-footer {
        grid-template-columns: 1fr;
    }

    .sqsc-share-buttons {
        justify-content: center;
    }

    .sqsc-main-actions {
        width: 100%;
    }

    .sqsc-primary-share,
    .sqsc-download {
        flex: 1 1 0;
    }
}

/* Keep the selection control visible even when a theme has aggressive global button rules. */
button.sqsc-selection-share {
    position: fixed !important;
    z-index: 2147483000 !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

button.sqsc-selection-share.sqsc-visible {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
