.post-share-popup {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
}

.post-share-popup .post-share-dialog {
    position: relative;
    inset: auto;
    width: min(640px, 100%);
    max-height: none;
    flex: 0 0 auto;
    margin: 24px 0;
    overflow: visible;
    padding: 0;
    transform: none;
}

.post-share-popup .post-share-dialog[hidden] {
    display: none !important;
}

.post-share-dialog__close {
    position: absolute;
    inset-inline-end: 18px;
    inset-inline-start: auto;
    inset-block-start: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f5f8;
    color: #657184;
    font-size: 15px;
    cursor: pointer;
    z-index: 9;
}

.post-share-dialog__close > i {
    line-height: initial;
}

.post-share-dialog__content {
    padding: 22px;
}

.post-share-dialog__heading {
    padding-inline-end: 44px;
    margin-block-end: 18px;
}

.post-share-dialog__heading h2 {
    margin: 0;
    color: #24324a;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.5;
}

.post-share-dialog__box {
    display: grid;
    gap: 12px;
    padding: 0;
}

.post-share-dialog__form {
    display: contents;
}

.post-share-dialog__recipient-field,
.post-share-dialog__note {
    min-width: 0;
}

.post-share-dialog__recipient-field label,
.post-share-dialog__note label {
    display: block;
    margin: 0 0 8px;
    color: #4d5d76;
    font-size: 14px;
    font-weight: 600;
}

.post-share-dialog__combobox {
    position: relative;
}

.post-share-dialog__combobox input,
.post-share-dialog__note textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #dbe3ed;
    border-radius: 10px;
    background: #fbfcfe;
    color: #26344c;
    outline: 0;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.post-share-dialog__combobox input {
    padding: 10px 14px;
}

.post-share-dialog__note textarea {
    min-height: 92px;
    padding: 12px 14px;
    resize: vertical;
}

.post-share-dialog__combobox input:focus,
.post-share-dialog__note textarea:focus {
    border-color: #5a78f0;
    box-shadow: 0 0 0 3px rgb(90 120 240 / 14%);
}

.post-share-dialog__friend-results {
    position: absolute;
    inset-block-start: calc(100% + 6px);
    inset-inline: 0;
    z-index: 20;
    max-height: 240px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 36px rgb(34 47 74 / 16%);
    list-style: none;
}

.post-share-dialog__friend-results[hidden] {
    display: none;
}

.post-share-dialog__friend-results li {
    margin: 0;
}

.post-share-dialog__friend-result,
.post-share-dialog__friend-result-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #2e3c54;
    text-align: start;
}

.post-share-dialog__friend-result {
    cursor: pointer;
}

.post-share-dialog__friend-result:hover,
.post-share-dialog__friend-result:focus-visible {
    background: #f1f5ff;
    outline: 0;
}

.post-share-dialog__friend-result img,
.post-share-dialog__selected img {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.post-share-dialog__friend-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.post-share-dialog__friend-copy strong,
.post-share-dialog__friend-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-share-dialog__friend-copy span {
    color: #8792a5;
    font-size: 12px;
}

.post-share-dialog__selected {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    margin-block-start: 10px;
}

.post-share-dialog__selected:empty {
    display: none;
}

.post-share-dialog__selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 8px 4px 5px;
    border: 1px solid #dbe4ff;
    border-radius: 999px;
    background: #f3f6ff;
    color: #324a9b;
}

.post-share-dialog__selected-chip span {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-share-dialog__selected-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5a6b8f;
    cursor: pointer;
}

.post-share-dialog__preview-image {
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #eef2f7;
}

.post-share-dialog__preview-image img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 7;
    object-fit: cover;
}

.post-share-dialog__preview-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0;
}

.post-share-dialog__preview-meta > figure {
    flex: 0 0 auto;
    margin: 0;
}

.post-share-dialog__preview-meta > figure img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.post-share-dialog__preview-meta .friend-name {
    display: grid;
    min-width: 0;
    width: auto;
    margin: 0;
    gap: 3px;
}

.post-share-dialog__preview-meta strong,
.post-share-dialog__preview-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-share-dialog__preview-meta span {
    color: #78869b;
    font-size: 13px;
}

.post-share-dialog__socials {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    margin: 0;
}

.post-share-dialog__socials > span {
    width: auto;
    margin: 0;
}

.post-share-dialog__socials > ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.post-share-dialog__socials > ul li {
    margin: 0;
}

.post-share-dialog__socials button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f5f9;
    color: #5b6980;
    cursor: pointer;
}

.post-share-dialog__socials button:hover,
.post-share-dialog__socials button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgb(38 52 77 / 14%);
    outline: 0;
}

.post-share-dialog__actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.post-share-dialog__actions > button {
    float: none;
    margin: 0;
    border: 0;
    cursor: pointer;
}

.post-share-dialog__feedback {
    display: block;
    min-height: 20px;
    color: #65748a;
    font-size: 13px;
}

.post-share-dialog__feedback.is-error {
    color: #c24154;
}

@media (max-width: 576px) {
    .post-share-popup {
        padding: 12px;
    }

    .post-share-popup .post-share-dialog {
        max-height: none;
        margin-block: 12px;
        overflow: visible;
    }

    .post-share-dialog__content {
        padding: 22px 16px 18px;
    }

    .post-share-dialog__socials {
        align-items: flex-start;
        flex-direction: column;
    }
}
