body.modal-open {
    overflow: hidden;
}

.published-card {
    min-height: 0;
}

.message-body {
    margin: 0 0 22px;
}

.message-modal {
    width: min(700px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
    color: var(--ink);
    box-shadow: 0 28px 90px rgba(26, 39, 34, .28);
}

.message-modal::backdrop {
    background: rgba(28, 39, 35, .66);
    backdrop-filter: blur(5px);
}

.message-modal[open] {
    animation: modal-in .2s ease-out;
}

.modal-shell {
    position: relative;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(145deg, #f5f8f5, #fffdfa);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d6ddd8;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: #edf2ef;
}

.message-modal .compose-intro {
    padding-right: 42px;
}

.message-modal .compose-intro h2 {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 28px;
    line-height: 1.2;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(14px) scale(.985); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
    .message-modal {
        width: min(100% - 16px, 700px);
        max-height: calc(100vh - 16px);
        border-radius: 19px;
    }

    .modal-shell {
        max-height: calc(100vh - 16px);
        padding: 25px 20px 22px;
        border-radius: 19px;
    }

    .message-modal .compose-intro {
        align-items: flex-start;
        padding-right: 34px;
    }

    .message-modal .compose-icon {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
    }

    .message-modal .compose-intro h2 {
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .message-modal[open] { animation: none; }
}
