.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

.post-card {
    direction: rtl;
    text-align: right;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.22);
}

.post-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.post-card-body {
    padding: 18px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
}

.post-card-body p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.62);
}

.post-card-date,
.post-detail-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}

.post-detail {
    direction: rtl;
    text-align: right;
    max-width: 820px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    overflow: hidden;
}

.post-detail img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.post-detail-inner {
    padding: 28px 30px 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-detail-inner h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
}

.post-detail-text {
    font-size: 0.95rem;
    line-height: 2;
    color: rgba(255, 255, 255, 0.82);
    word-break: break-word;
}

.post-back-btn {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 9px 20px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.post-back-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.msg-login-link {
    margin-top: 16px;
}

.msg-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    direction: rtl;
}

.msg-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.75);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.msg-tab.is-active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.msg-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
    direction: rtl;
    min-height: 460px;
}

.msg-layout-single {
    grid-template-columns: 1fr;
}

.msg-list,
.msg-thread {
    background: rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
}

.msg-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 640px;
}

.msg-list-row {
    text-align: right;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    color: #ffffff;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.msg-list-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.msg-list-row.is-active {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.25);
}

.msg-list-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.msg-list-top b {
    font-size: 0.88rem;
}

.msg-pill {
    font-size: 0.68rem;
    padding: 3px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.75);
}

.msg-pill.open {
    color: #7dd3a0;
    border-color: rgba(125, 211, 160, 0.4);
}

.msg-new-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e94560;
    flex-shrink: 0;
}

.msg-list-row small {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
}

.msg-thread {
    display: flex;
    flex-direction: column;
    min-height: 460px;
    max-height: 640px;
}

.msg-hint {
    margin: auto;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.9rem;
}

.msg-thread-head {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-weight: 700;
    font-size: 0.95rem;
}

.msg-thread-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.7;
    word-break: break-word;
}

.msg-bubble time {
    display: block;
    margin-top: 4px;
    font-size: 0.68rem;
    opacity: 0.55;
}

.msg-bubble.from-user {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.12);
}

.msg-bubble.from-admin {
    align-self: flex-end;
    background: rgba(233, 69, 96, 0.18);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.msg-reply-bar {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.msg-reply-bar input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 11px 18px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
}

.msg-reply-bar input:focus {
    border-color: rgba(255, 255, 255, 0.4);
}

.msg-reply-bar button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    cursor: pointer;
}

.msg-reply-bar button:hover {
    background: rgba(255, 255, 255, 0.16);
}

@media (max-width: 820px) {
    .msg-layout {
        grid-template-columns: 1fr;
    }
    .msg-list {
        max-height: 240px;
    }
}
