.ec-share-dialog {
    width: min(100%, 560px);
    padding: 30px;
}

.ec-share-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.ec-share-heading {
    min-width: 0;
}

.ec-share-eyebrow {
    margin: 0 0 8px;
}

.ec-share-heading h2 {
    font-size: 28px;
}

.ec-share-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--ec-modal-line);
    border-radius: 10px;
    color: var(--ec-modal-muted);
    background: var(--ec-modal-surface);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.ec-share-close:hover {
    border-color: var(--ec-modal-line-strong);
    color: var(--ec-modal-text);
    background: var(--ec-modal-surface-strong);
}

.ec-share-description {
    margin: 14px 0 0;
    font-size: 14px;
}

.ec-share-scope {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 22px;
}

.ec-share-scope-option {
    min-height: 82px;
    padding: 15px 16px;
    border: 1px solid var(--ec-modal-line);
    border-radius: 13px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    color: var(--ec-modal-muted);
    background: var(--ec-modal-surface);
    text-align: left;
    cursor: pointer;
    transition:
        border-color 0.17s ease,
        background-color 0.17s ease,
        box-shadow 0.17s ease,
        transform 0.17s ease;
}

.ec-share-scope-option:hover {
    border-color: var(--ec-modal-line-strong);
    background: var(--ec-modal-surface-strong);
    transform: translateY(-1px);
}

.ec-share-scope-option.is-selected {
    border-color: rgba(42, 157, 93, 0.78);
    background: var(--ec-modal-accent-soft);
    box-shadow: inset 0 0 0 1px rgba(42, 157, 93, 0.16);
}

.ec-share-scope-option span {
    color: var(--ec-modal-muted);
    font-size: 11px;
    font-weight: 700;
}

.ec-share-scope-option strong {
    color: var(--ec-modal-text);
    font-size: 13px;
    line-height: 1.4;
}

.ec-share-scope-option.is-selected span {
    color: #8ec5a4;
}

.ec-share-url-box {
    position: relative;
    margin-top: 17px;
    padding: 14px;
    border: 1px solid var(--ec-modal-line);
    border-radius: 13px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    background: var(--ec-modal-surface);
}

.ec-share-url-box label {
    grid-column: 1 / -1;
    color: var(--ec-modal-muted);
    font-size: 10px;
    font-weight: 700;
}

.ec-share-url {
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--ec-modal-line);
    border-radius: 9px;
    outline: none;
    color: var(--ec-modal-copy);
    background: var(--ec-modal-field);
    font-size: 12px;
}

.ec-share-url:focus {
    border-color: rgba(42, 157, 93, 0.76);
    box-shadow: 0 0 0 3px rgba(42, 157, 93, 0.12);
}

.ec-share-copy-button {
    min-height: 42px;
    padding: 0 15px;
    white-space: nowrap;
}

.ec-share-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 11px;
}

.ec-share-actions.has-single-action {
    grid-template-columns: 1fr;
}

.ec-share-action-button {
    padding: 0 16px;
}

.ec-share-qr-panel {
    margin-top: 16px;
    padding: 17px;
    border: 1px solid var(--ec-modal-line);
    border-radius: 14px;
    background: var(--ec-modal-surface);
}

.ec-share-qr-panel[hidden] {
    display: none;
}

.ec-share-qr-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ec-share-qr-heading strong,
.ec-share-qr-heading span {
    display: block;
}

.ec-share-qr-heading strong {
    color: var(--ec-modal-text);
    font-size: 13px;
}

.ec-share-qr-heading span {
    margin-top: 5px;
    color: var(--ec-modal-muted);
    font-size: 11px;
}

.ec-share-qr-close {
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid var(--ec-modal-line);
    border-radius: 8px;
    color: var(--ec-modal-muted);
    background: transparent;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.ec-share-qr-close:hover {
    border-color: var(--ec-modal-line-strong);
    color: var(--ec-modal-text);
}

.ec-share-qr-canvas-wrap {
    width: min(100%, 300px);
    margin: 16px auto 0;
    padding: 10px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.ec-share-qr-canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.ec-share-qr-download {
    width: 100%;
    min-height: 42px;
    margin-top: 13px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.ec-share-status {
    min-height: 17px;
    margin: 12px 0 0;
    color: var(--ec-modal-muted);
    text-align: center;
    font-size: 10px;
    line-height: 1.5;
}

.ec-share-copy-helper {
    position: fixed !important;
    top: 0 !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

@media (max-width: 767px) {
    .ec-share-dialog {
        padding:
            13px
            max(18px, env(safe-area-inset-right))
            max(22px, calc(16px + env(safe-area-inset-bottom)))
            max(18px, env(safe-area-inset-left));
    }

    .ec-share-heading h2 {
        font-size: clamp(24px, 7vw, 28px);
    }

    .ec-share-description {
        font-size: 13px;
    }

    .ec-share-scope {
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 19px;
    }

    .ec-share-scope-option {
        min-height: 69px;
        padding: 13px 15px;
    }

    .ec-share-url-box {
        grid-template-columns: 1fr;
        margin-top: 14px;
    }

    .ec-share-copy-button,
    .ec-share-action-button {
        width: 100%;
    }

    .ec-share-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ec-share-qr-panel {
        padding: 15px;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .ec-share-dialog {
        width: min(100%, 700px);
        padding: 21px;
    }

    .ec-share-scope {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 14px;
    }

    .ec-share-scope-option {
        min-height: 66px;
    }

    .ec-share-url-box {
        grid-template-columns: 1fr auto;
        margin-top: 12px;
    }

    .ec-share-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
